Linux-Modules Archive on lore.kernel.org
 help / color / Atom feed
From: Jorge Lucangeli Obes <jorgelo@google.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: linux-modules <linux-modules@vger.kernel.org>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH] libkmod: reset was_space on second pass
Date: Tue, 28 Jan 2020 10:03:28 -0500
Message-ID: <CAKYuF5QuxP1S3ZQGdQDnzj2jmKp2Knr4GyYBaEKjg0efXVgreA@mail.gmail.com> (raw)
In-Reply-To: <CAKi4VAJjA_G5KZ2Z6uAMKcp-38mF3PfAsfM1MvLQcKuDO7vWsA@mail.gmail.com>

Thanks!

On Mon, Jan 27, 2020 at 8:46 AM Lucas De Marchi
<lucas.de.marchi@gmail.com> wrote:
>
> On Mon, Jan 20, 2020 at 4:22 PM Lucas De Marchi
> <lucas.de.marchi@gmail.com> wrote:
> >
> > From: Lucas De Marchi <lucas.demarchi@intel.com>
> >
> > The softdep config parser uses a 2-pass approach to use a single
> > allocation for all the softdep struct. However "was_space" variable
> > isn't reset between them. This can lead to a buffer overflow.
> >
> > Reported-by: Jorge Lucangeli Obes <jorgelo@google.com>
> > Link: https://lore.kernel.org/linux-modules/CAKYuF5QhGCPCazHQjN-=kFc5kHs7Ok8WqmmGLo31CiOEN8TYdA@mail.gmail.com
> > ---
>
> Applied,
>
> Lucas De Marchi
>
> >  libkmod/libkmod-config.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
> > index aaac0a1..7b62367 100644
> > --- a/libkmod/libkmod-config.c
> > +++ b/libkmod/libkmod-config.c
> > @@ -335,6 +335,7 @@ static int kmod_config_add_softdep(struct kmod_config *config,
> >         n_pre = 0;
> >         n_post = 0;
> >         mode = S_NONE;
> > +       was_space = false;
> >         for (p = s = line; ; s++) {
> >                 size_t plen;
> >
> > --
> > 2.24.1
> >
>
>
> --
> Lucas De Marchi

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 19:22 Lucas De Marchi
2020-01-27 13:46 ` Lucas De Marchi
2020-01-28 15:03   ` Jorge Lucangeli Obes [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=CAKYuF5QuxP1S3ZQGdQDnzj2jmKp2Knr4GyYBaEKjg0efXVgreA@mail.gmail.com \
    --to=jorgelo@google.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=lucas.demarchi@intel.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

Linux-Modules Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-modules/0 linux-modules/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-modules linux-modules/ https://lore.kernel.org/linux-modules \
		linux-modules@vger.kernel.org
	public-inbox-index linux-modules

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-modules


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git