linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: Jiri Slaby <jslaby@suse.com>
Cc: Nicolas Pitre <nico@fluxnic.net>,
	Or Cohen <orcohen@paloaltonetworks.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	textshell@uchuujin.de, Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sam Ravnborg <sam@ravnborg.org>,
	mpatocka@redhat.com, ghalat@redhat.com,
	LKML <linux-kernel@vger.kernel.org>,
	jwilk@jwilk.net, Nadav Markus <nmarkus@paloaltonetworks.com>,
	syzkaller <syzkaller@googlegroups.com>
Subject: Re: Bug report - slab-out-of-bounds in vcs_scr_readw
Date: Tue, 5 Nov 2019 11:53:18 +0100	[thread overview]
Message-ID: <CACT4Y+bw_fuhC0q2Wb0K=+z9p_E+apZr9h7_+HWOhAe6_g7KgQ@mail.gmail.com> (raw)
In-Reply-To: <fb1744cd-2680-1459-16de-8d6a4afd666d@suse.com>

On Tue, Nov 5, 2019 at 11:29 AM Jiri Slaby <jslaby@suse.com> wrote:
>
> On 05. 11. 19, 10:33, Nicolas Pitre wrote:
> > Subject: [PATCH] vcs: prevent write access to vcsu devices
> >
> > Commit d21b0be246bf ("vt: introduce unicode mode for /dev/vcs") guarded
> > against using devices containing attributes as this is not yet
> > implemented. It however failed to guard against writes to any devices
> > as this is also unimplemented.
> >
> > Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
> > Cc: <stable@vger.kernel.org> # v4.19+
> >
> > diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
> > index fa07d79027..ef19b95b73 100644
> > --- a/drivers/tty/vt/vc_screen.c
> > +++ b/drivers/tty/vt/vc_screen.c
> > @@ -456,6 +456,9 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
> >       size_t ret;
> >       char *con_buf;
> >
> > +     if (use_unicode(inode))
> > +             return -EOPNOTSUPP;
>
> Looks good to me. I am also thinking about a ban directly in open:
>
> if (use_unicode(inode) && (filp->f_flags & O_ACCMODE) != O_RDONLY)
>   return -EOPNOTSUPP;
>
> Would that break the unicode users?


On a related note, syzbot seems to get very similar bug reports on
some downstream kernels (4.15):
KASAN: use-after-free Read in vcs_scr_readw
KASAN: use-after-free Write in vcs_scr_writew

but not on upstream. I wonder why. And if we are missing some good
config in upstream kernel or something. This all fuzzing is somewhat
random, so it might have just happened without particular reasons
(maybe it will discover it later). But wanted to check if there are
some low hanging fruits. Anything obviously missing in:
https://github.com/google/syzkaller/blob/master/dashboard/config/upstream-kasan.config
?

  reply	other threads:[~2019-11-05 10:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAM6JnLeEnvjjQPyLeh+8dt5wGNud_vks5k_eXJZy2T1H7ao=hQ@mail.gmail.com>
2019-11-04 15:24 ` Bug report - slab-out-of-bounds in vcs_scr_readw Greg KH
2019-11-04 15:50   ` Nicolas Pitre
2019-11-04 16:15     ` Or Cohen
2019-11-04 18:33       ` Nicolas Pitre
2019-11-05  6:54         ` Jiri Slaby
2019-11-05  9:03           ` Or Cohen
2019-11-05  9:14             ` Jiri Slaby
2019-11-05  9:33               ` Nicolas Pitre
2019-11-05 10:29                 ` Jiri Slaby
2019-11-05 10:53                   ` Dmitry Vyukov [this message]
2019-11-05 13:44                   ` Nicolas Pitre
2019-11-06 17:01                     ` Or Cohen
2019-11-26 21:55                 ` Nicolas Pitre
2019-11-27  6:45                   ` Greg KH
2019-11-27 16:24                     ` Nicolas Pitre
2019-11-27 16:30                       ` Greg KH

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='CACT4Y+bw_fuhC0q2Wb0K=+z9p_E+apZr9h7_+HWOhAe6_g7KgQ@mail.gmail.com' \
    --to=dvyukov@google.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=ghalat@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=jwilk@jwilk.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=nico@fluxnic.net \
    --cc=nmarkus@paloaltonetworks.com \
    --cc=orcohen@paloaltonetworks.com \
    --cc=sam@ravnborg.org \
    --cc=syzkaller@googlegroups.com \
    --cc=textshell@uchuujin.de \
    /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).