Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1039140AbdDUMO7 (ORCPT ); Fri, 21 Apr 2017 08:14:59 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35254 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1039027AbdDUMOz (ORCPT ); Fri, 21 Apr 2017 08:14:55 -0400 Cc: mtk.manpages@gmail.com, lkml , linux-fsdevel , hch@infradead.org To: David Howells From: "Michael Kerrisk (man-pages)" Subject: Unchecked flags in statx(2) [Should be fixed before 4.11-final?] Message-ID: Date: Fri, 21 Apr 2017 14:14:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 938 Lines: 30 Hello David, 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. 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? The failure to do these sorts of checks has been the source of grief in the past with other system calls. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/