From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:59645 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757840AbcDACF0 (ORCPT ); Thu, 31 Mar 2016 22:05:26 -0400 Date: Fri, 1 Apr 2016 03:05:24 +0100 From: Al Viro To: Eric Biggers Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] vfs: constify arguments to utime family of system calls Message-ID: <20160401020524.GA17997@ZenIV.linux.org.uk> References: <1459475472-13104-1-git-send-email-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1459475472-13104-1-git-send-email-ebiggers3@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Mar 31, 2016 at 08:51:12PM -0500, Eric Biggers wrote: > The system calls to set file times: utime(), utimes(), futimesat(), and > utimensat(), all take in pointers to a filename and time information, > neither of which is modified. Mark the pointed-to data as 'const' to > better reflect the semantics. I'm not sure if there's any point, to be honest. Anything doing direct dereferencing of those pointers is completely broken and reads are no better than writes in that respect. OTOH... put_user() and friends will produce an error when you give them const void __user * on most of the architectures, so it's not entirely useles... What's the situation with other syscalls? It doesn't make much sense to do it piece-by-piece...