From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [PATCH 2/2] add f_flags to struct statfs(64) Date: Thu, 8 Jul 2010 04:16:31 +1000 Message-ID: <20100707181631.GF9263@laptop> References: <20100707165325.GB12557@lst.de> <4C34B53A.6060408@redhat.com> <20100707173311.GA14608@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Ulrich Drepper , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from cantor2.suse.de ([195.135.220.15]:32907 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756792Ab0GGSQg (ORCPT ); Wed, 7 Jul 2010 14:16:36 -0400 Content-Disposition: inline In-Reply-To: <20100707173311.GA14608@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 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.