All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Amber Thrall <amber@thrall.me>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/1] fs: strncmp() for user space buffers
Date: Sun, 28 Feb 2016 23:10:40 +0000	[thread overview]
Message-ID: <20160228231040.GR17997@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20160228230303.GQ17997@ZenIV.linux.org.uk>

On Sun, Feb 28, 2016 at 11:03:03PM +0000, Al Viro wrote:
> On Sun, Feb 28, 2016 at 02:50:22PM -0800, Amber Thrall wrote:
> > The simple_strncmp_to_buffer() function provides an easier method for
> > developers to compare a kernel space buffer against user space data. This
> > process is done in a few drivers and may be simplified to a single function.
> 
> *blink*
> 
> The name is rather confusing and I would say that semantics is unexpected
> as well.  I would like to see proposed users of that primitive...

BTW, such calling conventions are going to breed bugs - it's "0 if equal,
something positive if greater, something negative if less, except when
returned negative happens to be -EFAULT or -ENOMEM, in which cases it's
an error".  It would be _very_ easy to get wrong in callers.

  reply	other threads:[~2016-02-28 23:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 22:50 [PATCH 1/1] fs: strncmp() for user space buffers Amber Thrall
2016-02-28 23:03 ` Al Viro
2016-02-28 23:10   ` Al Viro [this message]
2016-02-28 23:39   ` Amber Thrall
2016-02-29  2:10     ` Al Viro
2016-02-29 15:41       ` Amber Thrall

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=20160228231040.GR17997@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=amber@thrall.me \
    --cc=linux-fsdevel@vger.kernel.org \
    /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.