All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: linux-serial@vger.kernel.org,
	syzbot+4c7f1a69dfe24c6b3aeb@syzkaller.appspotmail.com,
	syzbot+92f32d4e21fb246d31a2@syzkaller.appspotmail.com,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	Peter Hurley <peter@hurleysoftware.com>,
	Caleb Connolly <caleb@connolly.tech>
Subject: Re: [PATCH] serial: 8250: fix NULL pointer dereference in serial8250_do_startup()
Date: Thu, 13 May 2021 16:24:12 +0200	[thread overview]
Message-ID: <YJ02jIEDHduLbQ3f@kroah.com> (raw)
In-Reply-To: <e3617587-7ff1-720c-00ab-434608705652@oracle.com>

On Mon, Apr 26, 2021 at 06:33:01PM +0200, Vegard Nossum wrote:
> On 2021-04-26 18:17, Greg Kroah-Hartman wrote:
> > On Mon, Apr 26, 2021 at 06:14:33PM +0200, Vegard Nossum wrote:
> > >   static void set_io_from_upio(struct uart_port *p)
> > >   {
> > >   	struct uart_8250_port *up = up_to_u8250p(p);
> > > @@ -2151,6 +2178,11 @@ int serial8250_do_startup(struct uart_port *port)
> > >   	unsigned char lsr, iir;
> > >   	int retval;
> > > +	if (WARN_ON_ONCE(needs_membase(port->iotype) && !port->membase))
> > > +		return -ENODEV;
> > > +	if (WARN_ON_ONCE(needs_iobase(port->iotype) && !port->iobase))
> > > +		return -ENODEV;
> > 
> > These WARN_ON() will still trigger syzbot.  Are you sure you tested this
> > and had syzbot verify it?
> 
> I tested it locally and the WARN_ON()s don't trigger -- presumably
> because serial8250_verify_port() is called from uart_set_info() before
> we get to serial8250_do_startup():
> 
>         /*
>          * Ask the low level driver to verify the settings.
>          */
>         if (uport->ops->verify_port)
>                 retval = uport->ops->verify_port(uport, new_info);
> 
> [...]
> 
>                 retval = uart_startup(tty, state, 1);
> 
> At least, this was my intention. Although now that I look at it again,
> it looks like this check may be skipped in some cases; is that what
> you're referring to?
> 
> I didn't have syzbot verify it -- I thought it would do that when
> submitting my patch. Looks like I need to push somewhere and ask syzbot
> to test it using this?
> 
> #syz test: git://repo/address.git commit-hash
> 
> (I assume I can send this privately as long as I use the right
> syzbot+...@ To-address?)
> 

Dropping this now until you get this tested properly...

thanks,

greg k-h

      parent reply	other threads:[~2021-05-13 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 19:35 BUG: unable to handle kernel NULL pointer dereference in mem16_serial_out syzbot
2019-12-10  1:38 ` syzbot
2019-12-12 10:57   ` Greg KH
2019-12-13  9:05     ` Dmitry Vyukov
2021-04-26 16:14 ` [PATCH] serial: 8250: fix NULL pointer dereference in serial8250_do_startup() Vegard Nossum
2021-04-26 16:17   ` Greg Kroah-Hartman
2021-04-26 16:33     ` Vegard Nossum
2021-04-28  6:36       ` BUG: unable to handle kernel NULL pointer dereference in mem16_serial_out syzbot
2021-05-13 14:24       ` Greg Kroah-Hartman [this message]

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=YJ02jIEDHduLbQ3f@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=caleb@connolly.tech \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=syzbot+4c7f1a69dfe24c6b3aeb@syzkaller.appspotmail.com \
    --cc=syzbot+92f32d4e21fb246d31a2@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vegard.nossum@oracle.com \
    /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.