Re: [PATCH 2/2] add f_flags to struct statfs(64)

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

 



On Wed, Jul 07, 2010 at 07:33:11PM +0200, Christoph Hellwig wrote:
> On Wed, Jul 07, 2010 at 10:31:37AM -0700, Linus Torvalds wrote:
> > On Wed, Jul 7, 2010 at 10:11 AM, Ulrich Drepper <drepper@xxxxxxxxxx> wrote:
> > >
> > > How does this work with old kernels which didn't initialize f_spare?
> > 
> > Some of the compat layers (and older kernels) don't copy the f_spare
> > values, so user space should clear the field before doing the system
> > call, and you should be ok.
> > 
> > There should be no actual _uninitialized_ values copied from the
> > kernel. IOW, either the kernel writes zero, or it doesn't write
> > anything at all. Anything else would be a security issue anyway (ie
> > kernel stack data leak). Afaik, no kernel does that.
> 
> Sometime before 2.4.0 (I posted the exact release in the previous
> thread) the kernel initalized unused fields to 0xff.  So if we want to
> support these kernels it is an issue.

glibc could just set 2.4.0 as the oldest version to test ST_VALID
against. I think most distros compile it to support no older than
2.6.something kernels anyway.

Should we not allow glibc to assume the mapping is 1:1 except ST_VALID?
If other spare fields may be used in future, this could be the best
place to do versioning or otherwise make use of some bits. Possibly a
couple of bits could be used for version number.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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