From: Vaishali Thakkar <vaishali.thakkar@oracle.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Kees Cook <keescook@chromium.org>,
"kernel-hardening@lists.openwall.com"
<kernel-hardening@lists.openwall.com>,
Al Viro <viro@zeniv.linux.org.uk>,
David Windsor <dwindsor@gmail.com>
Subject: Re: [kernel-hardening] [RFC PATCH] lib: Harden csum_partial_copy_from_user
Date: Fri, 4 Nov 2016 15:33:11 +0530 [thread overview]
Message-ID: <581C5CDF.1080608@oracle.com> (raw)
In-Reply-To: <20161103180524.GA27785@remoulade>
On Thursday 03 November 2016 11:35 PM, Mark Rutland wrote:
> On Thu, Nov 03, 2016 at 10:26:41AM +0530, Vaishali Thakkar wrote:
>> On Thursday 03 November 2016 09:53 AM, Mark Rutland wrote:
>>> On Thu, Nov 03, 2016 at 07:44:35AM +0530, Vaishali Thakkar wrote:
>>>> On Thursday 03 November 2016 03:29 AM, Kees Cook wrote:
>>>>> On Wed, Nov 2, 2016 at 2:44 PM, Mark Rutland <mark.rutland@arm.com> wrote:
>>>>>> I know that both arm64 and x86 have a check_object_size() call in their
>>>>>> __copy_from_user() implementations.
>>>
>>>>>> Is that missing on some architectures?
>
>>> Looking again, a grep shows many (even those with MMUs) don't do anything at
>>> all in v4.9-rc2:
>>>
>>> [mark@remoulade:~/src/linux]% for ARCH in arch/*; do
>>> printf "%d %s\n" $(git grep check_object_size -- "${ARCH}" | wc -l) ${ARCH};
>>> done | sort -n
>
>> Hmm, should we go for sending patches for them? [atleast for the ones with MMUs
>> and then may be maintainers/developers can check the change]
>
> If Al's uaccess unification work is arriving shortly, sending patches for those
> in parallel is just going to make matters more painful.
>
> So it really depends on when that's likely to appear.
Makes sense.
>> Also, I think same goes for the the kasan_check. We have only arm64 and x86
>> with these checks.
>
> Yes. I'd hoped to collect all of those behind a common helper, something like:
>
> static inline void check_uaccess_read(void *kaddr, const void __user *uaddr, unsigned long n)
> {
> kasan_check_write(kaddr, n);
> check_object_size(kaddr, n, false);
> any_uaddr_sanity_check(uaddr, n);
> }
Ok, sounds reasonable.
Thanks.
> Thanks,
> Mark.
>
--
Vaishali
next prev parent reply other threads:[~2016-11-04 10:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-02 17:02 [kernel-hardening] [RFC PATCH] lib: Harden csum_partial_copy_from_user Vaishali Thakkar
2016-11-02 20:44 ` Mark Rutland
2016-11-02 21:59 ` Kees Cook
2016-11-03 2:14 ` Vaishali Thakkar
2016-11-03 4:23 ` Mark Rutland
2016-11-03 4:56 ` Vaishali Thakkar
2016-11-03 18:05 ` Mark Rutland
2016-11-04 10:03 ` Vaishali Thakkar [this message]
2016-11-03 5:03 ` 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=581C5CDF.1080608@oracle.com \
--to=vaishali.thakkar@oracle.com \
--cc=dwindsor@gmail.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=mark.rutland@arm.com \
--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.