linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Capella <justincapella@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	youling257 <youling257@gmail.com>, Pavel Machek <pavel@ucw.cz>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scripts/kallsyms: fix memory corruption caused by write over-run
Date: Mon, 10 Feb 2020 18:36:42 -0800	[thread overview]
Message-ID: <CAMrEMU86jmds8LMmbdVk=54h+ziY=6MHwyzHxVRXy5dLGFTmGA@mail.gmail.com> (raw)
In-Reply-To: <20200210161852.842-1-masahiroy@kernel.org>

Looks like len is already +1, maybe it shouldn't be?

>         len = strlen(name) + 1;
>
> -       sym = malloc(sizeof(*sym) + len);
> +       sym = malloc(sizeof(*sym) + len + 1);


Maybe strlcpy or if len wasn't incremented?

>
> -       memcpy(sym_name(sym), name, len);
> +       strcpy(sym_name(sym), name);
>

  parent reply	other threads:[~2020-02-11  2:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 16:18 [PATCH] scripts/kallsyms: fix memory corruption caused by write over-run Masahiro Yamada
2020-02-10 18:58 ` Pavel Machek
2020-02-11  2:36 ` Justin Capella [this message]
2020-02-11 14:46   ` Masahiro Yamada
2020-02-12  9:20 ` Masahiro Yamada

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='CAMrEMU86jmds8LMmbdVk=54h+ziY=6MHwyzHxVRXy5dLGFTmGA@mail.gmail.com' \
    --to=justincapella@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=youling257@gmail.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 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).