Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161159AbdDUMlu (ORCPT ); Fri, 21 Apr 2017 08:41:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57446 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161105AbdDUMlq (ORCPT ); Fri, 21 Apr 2017 08:41:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B831168403 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dhowells@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B831168403 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: To: "Michael Kerrisk (man-pages)" Cc: dhowells@redhat.com, lkml , linux-fsdevel , hch@infradead.org Subject: Re: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18424.1492778504.1@warthog.procyon.org.uk> Date: Fri, 21 Apr 2017 13:41:44 +0100 Message-ID: <18425.1492778504@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 21 Apr 2017 12:41:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 971 Lines: 28 Michael Kerrisk (man-pages) wrote: > I was reading your statx(2) man page, and noticed this text: > > Do not simply set mask to UINT_MAX as one or more bits may, in the > future, be used to specify an extension to the buffer. > > (Here' 'mask' is the fourth argument to statx()) > > What is going on here? Why is there not a check in the code to > give EINVAL if any flag other than those in STATX_ALL (0x00000fffU) > is specified? (There is a check that gives EINVAL flags in > STATX__RESERVED (0x80000000U), but STATX_ALL != ~STATX__RESERVED. Yeah, I need to update that. I sent you the manpage to have a look at before the patch that added the reservation got merged - possibly before I even wrote that patch. > Similarly, there appears to be no check for invalid flags in the > 'flags' argument of statx(). Why is there also not such a check > there? Like this? if (mask & STATX__RESERVED) return -EINVAL; David