All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] vfs: constify arguments to utime family of system calls
Date: Thu, 31 Mar 2016 21:24:57 -0500	[thread overview]
Message-ID: <20160401022457.GC1323@zzz> (raw)
In-Reply-To: <20160401020524.GA17997@ZenIV.linux.org.uk>

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.

  reply	other threads:[~2016-04-01  2:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01  1:51 [PATCH v2] vfs: constify arguments to utime family of system calls Eric Biggers
2016-04-01  2:05 ` Al Viro
2016-04-01  2:24   ` Eric Biggers [this message]
2016-04-01  3:30     ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160401022457.GC1323@zzz \
    --to=ebiggers3@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.