Re: [PATCH] devtmpfs: don't use vfs_getattr_nosec to query i_mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On April 25, 2025 6:32:59 AM PDT, Christoph Hellwig <hch@xxxxxx> wrote:
>On Fri, Apr 25, 2025 at 12:12:36PM +0200, Christian Brauner wrote:
>> > That is: if dev_mynode(dev, inode) is not true some random value will be returned.
>> 
>> Don't bother resending, Christoph.
>> I've already fixed this with int err = 0 in the tree.
>
>Thanks!  Let me use this as a platform to rant about our option
>defaults and/or gcc error handling.  It seems like ever since we started
>zeroing on-stack variables by default gcc stopped warnings about using
>uninitialized on-stack variables, leading to tons of these case where
>we don't catch uninitialized variables.  Now in this and in many cases
>the code works fine because it assumed zero initialization, but there are
>also cases where it didn't, leading to new bugs.

This isn't the case: the feature was explicitly designed in both GCC and Clang to not disrupt -Wuninitialized. But -Wuninitialized has been so flakey for so long that it is almost useless (there was even -Wmaybe-uninitialized added to try to cover some of the missed diagnostics). And it's one of the many reasons stack variable zeroing is so important, since so much goes undiagnosed. :(

>Can we fix this somehow?

Fixing -Wuninitialized would be lovely, but it seems no one has been able to for years now. 😭

-- 
Kees Cook





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux