From: Al Viro <viro@zeniv.linux.org.uk>
To: Andy Lutomirski <luto@kernel.org>
Cc: syzbot <syzbot+ea3a78a71705faf41d77@syzkaller.appspotmail.com>,
Aleksa Sarai <cyphar@cyphar.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
syzkaller-bugs@googlegroups.com,
Thomas Gleixner <tglx@linutronix.de>, X86 ML <x86@kernel.org>
Subject: Re: WARNING in ex_handler_uaccess
Date: Sat, 19 Sep 2020 01:17:14 +0100 [thread overview]
Message-ID: <20200919001714.GC3421308@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CALCETrVi=quLyPXzt-0ou-FF_OYMa7pE5N8_NchRaWtwLg3kNg@mail.gmail.com>
On Fri, Sep 18, 2020 at 05:07:43PM -0700, Andy Lutomirski wrote:
> On Fri, Sep 18, 2020 at 4:55 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > On Fri, Sep 18, 2020 at 04:31:33PM -0700, Andy Lutomirski wrote:
> >
> > > check_zeroed_user() looks buggy. It does:
> > >
> > > if (!user_access_begin(from, size))
> > > return -EFAULT;
> > >
> > > unsafe_get_user(val, (unsigned long __user *) from, err_fault);
> > >
> > > This is wrong if size < sizeof(unsigned long) -- you read outside the
> > > area you verified using user_access_begin().
> >
> > Read the code immediately prior to that. from will be word-aligned,
> > and size will be extended accordingly. If the area acceptable for
> > user_access_begin() ends *NOT* on a word boundary, you have a problem
> > and I would strongly recommend to seek professional help.
> >
> > All reads in that thing are word-aligned and word-sized. So I very
> > much doubt that your analysis is correct.
>
> Maybe -ETOOTIRED, but I seriously question the math in here. Suppose
> from == (unsigned long *)1 and size == 1. Then align is 1, and we do:
>
> from -= align;
> size += align;
>
> So now from = 0 and size = 2. Now we do user_access_begin(0, 2) and
> then immediately read 4 or 8 bytes. No good.
Could you explain what kind of insane hardware manages to do #PF-related
checks (including SMAP, whatever) with *sub*WORD* granularity?
If it's OK with 16bit read from word-aligned address, but barfs on 64bit
one... I want to know what the hell had its authors been smoking.
next prev parent reply other threads:[~2020-09-19 0:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 21:01 WARNING in ex_handler_uaccess syzbot
2020-09-18 23:31 ` Andy Lutomirski
2020-09-18 23:55 ` Al Viro
2020-09-19 0:07 ` Andy Lutomirski
2020-09-19 0:17 ` Al Viro [this message]
2020-09-19 15:37 ` David Laight
2020-09-21 10:22 ` Rasmus Villemoes
2020-09-21 10:33 ` David Laight
2020-09-23 4:26 ` 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=20200919001714.GC3421308@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=bp@alien8.de \
--cc=cyphar@cyphar.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=syzbot+ea3a78a71705faf41d77@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=x86@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.