From: David Miller <davem@davemloft.net>
To: viro@ZenIV.linux.org.uk
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] get_compat_msghdr(): get rid of field-by-field copyin
Date: Thu, 13 Jul 2017 19:36:02 -0700 (PDT) [thread overview]
Message-ID: <20170713.193602.14448503583172802.davem@davemloft.net> (raw)
In-Reply-To: <20170714013750.GC13102@ZenIV.linux.org.uk>
From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Fri, 14 Jul 2017 02:37:50 +0100
> On Tue, Jul 11, 2017 at 08:25:14PM -0700, David Miller wrote:
>
>> looks harmless, or if there is a bug in there I can't see it.
>>
>> But whatever it is, that same problem could be hiding in some of these
>> other transformations as well.
>>
>> I think the bug might be that we are corrupting the user's stack
>> somehow. But the two user copies in that commit look perfectly fine
>> to my eyes.
>>
>> There shouldn't be any padding in that compat_rlimit structure, so
>> it's not like we're copying extra bytes. Well, we'd be exposing
>> kernel stack memory if that were the case.
>
> There isn't any padding in compat_rlimit; unfortunately, it was
> mistakenly declared as struct rlimit instead. Which, of course,
> has different member sizes - otherwise we wouldn't have needed
> a compat syscall there in the first place.
>
> It was harder to spot since I combined move and a transformation
> into one commit. Shouldn't have done so... Had those been two
> separate commits, the bug would've stood out immediately. Shouldn't
> be the case here...
Ok, I'll ack these patches then:
Acked-by: David S. Miller <davem@davemloft.net>
next prev parent reply other threads:[~2017-07-14 2:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-08 18:21 [RFC] get_compat_msghdr(): get rid of field-by-field copyin Al Viro
2017-07-08 18:22 ` [RFC] copy_msghdr_from_user(): " Al Viro
2017-07-08 18:22 ` [RFC] get_compat_bpf_fprog(): don't copyin field-by-field Al Viro
2017-07-10 19:04 ` Daniel Borkmann
2017-07-12 3:25 ` [RFC] get_compat_msghdr(): get rid of field-by-field copyin David Miller
2017-07-14 1:37 ` Al Viro
2017-07-14 2:36 ` David Miller [this message]
2017-07-14 2:50 ` [git pull] vfs.git network field-by-field copyin patches 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=20170713.193602.14448503583172802.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).