From: Alexei Starovoitov <ast@plumgrid.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Andrew Morton <akpm@linux-foundation.org>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] mm/maccess.c: actually return -EFAULT from strncpy_from_unsafe
Date: Sat, 17 Oct 2015 13:33:48 -0700 [thread overview]
Message-ID: <5622B0AC.1050307@plumgrid.com> (raw)
In-Reply-To: <1445113206-27980-1-git-send-email-linux@rasmusvillemoes.dk>
On 10/17/15 1:20 PM, Rasmus Villemoes wrote:
> As far as I can tell, strncpy_from_unsafe never returns -EFAULT. ret
> is the result of a __copy_from_user_inatomic(), which is 0 for success
> and positive (in this case necessarily 1) for access error - it is
> never negative. So we were always returning the length of the,
> possibly truncated, destination string.
>
> Signed-off-by: Rasmus Villemoes<linux@rasmusvillemoes.dk>
> ---
> Probably not -stable-worthy. I can only find two callers, one of which
> ignores the return value.
good catch.
Acked-by: Alexei Starovoitov <ast@kernel.org>
cc-ing original authors where I copy pasted that part from.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Alexei Starovoitov <ast@plumgrid.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Andrew Morton <akpm@linux-foundation.org>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] mm/maccess.c: actually return -EFAULT from strncpy_from_unsafe
Date: Sat, 17 Oct 2015 13:33:48 -0700 [thread overview]
Message-ID: <5622B0AC.1050307@plumgrid.com> (raw)
In-Reply-To: <1445113206-27980-1-git-send-email-linux@rasmusvillemoes.dk>
On 10/17/15 1:20 PM, Rasmus Villemoes wrote:
> As far as I can tell, strncpy_from_unsafe never returns -EFAULT. ret
> is the result of a __copy_from_user_inatomic(), which is 0 for success
> and positive (in this case necessarily 1) for access error - it is
> never negative. So we were always returning the length of the,
> possibly truncated, destination string.
>
> Signed-off-by: Rasmus Villemoes<linux@rasmusvillemoes.dk>
> ---
> Probably not -stable-worthy. I can only find two callers, one of which
> ignores the return value.
good catch.
Acked-by: Alexei Starovoitov <ast@kernel.org>
cc-ing original authors where I copy pasted that part from.
next prev parent reply other threads:[~2015-10-17 20:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-17 20:20 [PATCH] mm/maccess.c: actually return -EFAULT from strncpy_from_unsafe Rasmus Villemoes
2015-10-17 20:20 ` Rasmus Villemoes
2015-10-17 20:33 ` Alexei Starovoitov [this message]
2015-10-17 20:33 ` Alexei Starovoitov
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=5622B0AC.1050307@plumgrid.com \
--to=ast@plumgrid.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung@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.