lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <96852.1615854639@turing-police>
Date:   Mon, 15 Mar 2021 20:30:39 -0400
From:   "Valdis Klētnieks" <valdis.kletnieks@...edu>
To:     Christoph Hellwig <hch@...radead.org>
cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: arm64: kernel/sys.c - silence initialization warnings.

On Mon, 15 Mar 2021 19:23:00 -0000, Christoph Hellwig said:
> On Mon, Mar 15, 2021 at 11:14:34AM +0000, Catalin Marinas wrote:
> > We do similar initialisation in arch/arm64/kernel/sys32.c and
> > arch/arm64/kernel/traps.c for example. It's a pretty common pattern
> > throughout the kernel.
> > 
> > So we either treat W=1 output as diff against the vanilla kernel when
> > checking new patches or we remove override-init altogether from W=1.
> > Mark Rutland pointed me to an older thread:
>
> Please just remove the override-init warning, it is not helpful at all.

The tl;dr: Christoph is *probably* correct that it's not flagging any actual
bugs. And since *my* interest is "get the kernel tree to a point where W=1
or sparse throwing a warning is something worth looking at",  I'm not opposed
to a patch to remove it from W=1 tree-wide if it has essentially zero chance of
flagging an actual bug.

The longer version:

So I did a quick analysis...

For an x86_64 allmodconfig, there's not that many left:

     16 drivers/ata/ahci.h
      1 drivers/ata/pata_atiixp.c
      1 drivers/ata/pata_cs5520.c
      1 drivers/ata/pata_cs5530.c
      1 drivers/ata/pata_sc1200.c
      1 drivers/ata/pata_serverworks.c
      1 drivers/ata/sata_mv.c
      4 drivers/ata/sata_nv.c
      1 drivers/ata/sata_sil24.c
      1 drivers/block/drbd/drbd_main.c
      6 drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_d.h
      2 drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_sh_mask.h
      1 drivers/input/serio/i8042-x86ia64io.h
      1 include/linux/blkdev.h
      1 kernel/bpf/btf.c
      4 kernel/time/hrtimer.c
      1 lib/errname.c

The drivers/ata *.c warnings all appear to be the same type of thing:

static struct scsi_host_template serverworks_osb4_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
        .sg_tablesize   = LIBATA_DUMB_MAX_PRD,
};

The preprocessor macro defining the struct contents, and then
overriding one predefined value. So that's half of x64_64 done right there.

There's a few corners still need looking at, like why drivers/ata/ahci.h
throws 16 warnings on x64, but 30 on arm and 28 on arm64, and why
there's 4 warnings on include/linux/stddef.h on arm64 but not arm or x86.

But the number is certainly small enough that it's only a day or two's work
at most to check every single one.  If I go through the rest of x86 and arm
and they're all legit, I'll send a patch to nuke it kernel-wide rather than piecemeal.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ