From: Jonathan Nieder <jrnieder@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Szymon Janc <szymon@janc.net.pl>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] binfmt_misc: Fix compilation error in parse_command()
Date: Sat, 19 May 2012 15:14:18 -0500 [thread overview]
Message-ID: <20120519201418.GA5780@burratino> (raw)
In-Reply-To: <20120121191806.GD23916@ZenIV.linux.org.uk>
Al Viro wrote:
> On Sat, Jan 21, 2012 at 08:02:37PM +0100, Szymon Janc wrote:
>> --- a/fs/binfmt_misc.c
>> +++ b/fs/binfmt_misc.c
>> @@ -418,7 +418,7 @@ static int parse_command(const char __user *buffer, size_t count)
>> return 0;
>> if (count > 3)
>> return -EINVAL;
>> - if (copy_from_user(s, buffer, count))
>> + if (copy_from_user(s, buffer, min(count, sizeof(s))))
>
> File a report in gcc bugzilla. Note that
> * count is size_t and thus unsigned
> * sizeof(s) is 4
> IOW, min(count, sizeof(s)) should do no better (or worse) than count here.
> If gcc is unable to prove that, it really needs to be fixed...
Looks like this is <http://gcc.gnu.org/PR52798>.
Thanks,
Jonathan
prev parent reply other threads:[~2012-05-19 20:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-21 19:02 [PATCH] binfmt_misc: Fix compilation error in parse_command() Szymon Janc
2012-01-21 19:18 ` Al Viro
2012-05-19 20:14 ` Jonathan Nieder [this message]
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=20120519201418.GA5780@burratino \
--to=jrnieder@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=szymon@janc.net.pl \
--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.