From: Richard Weinberger <richard.weinberger@gmail.com>
To: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>,
linux-um <linux-um@lists.infradead.org>,
Richard Weinberger <richard@nod.at>,
Jeff Dike <jdike@addtoit.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] um: vector: Avoid NULL ptr deference if transport is unset
Date: Sun, 29 Mar 2020 23:55:47 +0200 [thread overview]
Message-ID: <CAFLxGvzuDJs7B7w6eF+dC634pVrK6BJPyfUOvXoACL7toYwoPg@mail.gmail.com> (raw)
In-Reply-To: <74c04f11-4b67-d1a7-7d05-197a229b245c@cambridgegreys.com>
On Mon, Feb 17, 2020 at 8:54 AM Anton Ivanov
<anton.ivanov@cambridgegreys.com> wrote:
>
> On 16/02/2020 21:36, Sjoerd Simons wrote:
> > When the transport option of a vec isn't set strncmp ends up being
> > called on a NULL pointer. Better not do that.
> >
> > Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> >
> > ---
> >
> > arch/um/drivers/vector_kern.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
> > index 0ff86391f77d..ca90666c0b61 100644
> > --- a/arch/um/drivers/vector_kern.c
> > +++ b/arch/um/drivers/vector_kern.c
> > @@ -198,6 +198,9 @@ static int get_transport_options(struct arglist *def)
> > long parsed;
> > int result = 0;
> >
> > + if (transport == NULL)
> > + return -EINVAL;
> > +
> > if (vector != NULL) {
> > if (kstrtoul(vector, 10, &parsed) == 0) {
> > if (parsed == 0) {
> >
> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Applied, thanks!
--
Thanks,
//richard
prev parent reply other threads:[~2020-03-29 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-16 21:36 [PATCH] um: vector: Avoid NULL ptr deference if transport is unset Sjoerd Simons
2020-02-17 7:53 ` Anton Ivanov
2020-03-29 21:55 ` Richard Weinberger [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=CAFLxGvzuDJs7B7w6eF+dC634pVrK6BJPyfUOvXoACL7toYwoPg@mail.gmail.com \
--to=richard.weinberger@gmail.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=richard@nod.at \
--cc=sjoerd.simons@collabora.co.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).