Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1368963

Re: [PATCH v2] vfs: constify arguments to utime family of system calls

From Eric Biggers <ebiggers3@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] vfs: constify arguments to utime family of system calls
Date 2016-04-01 04:30 +0200
Message-ID <riX0t-65Z-3@gated-at.bofh.it> (permalink)
References <riWxs-5uU-11@gated-at.bofh.it> <riWH9-5RD-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Apr 01, 2016 at 03:05:24AM +0100, Al Viro wrote:
> 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...

I feel it's a small improvement as it reduces the chance of bugs.  However, if
you look at all the system calls, they are, in general, inconsistent about using
'const'.  So may be right that changing just a few isn't worthwhile.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] vfs: constify arguments to utime family of system calls Eric Biggers <ebiggers3@gmail.com> - 2016-04-01 04:00 +0200
  Re: [PATCH v2] vfs: constify arguments to utime family of system  calls Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-01 04:10 +0200
    Re: [PATCH v2] vfs: constify arguments to utime family of system  calls Eric Biggers <ebiggers3@gmail.com> - 2016-04-01 04:30 +0200
      Re: [PATCH v2] vfs: constify arguments to utime family of system  calls Al Viro <viro@ZenIV.linux.org.uk> - 2016-04-01 05:40 +0200

csiph-web