[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMrEMU86jmds8LMmbdVk=54h+ziY=6MHwyzHxVRXy5dLGFTmGA@mail.gmail.com>
Date: Mon, 10 Feb 2020 18:36:42 -0800
From: Justin Capella <justincapella@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
youling257 <youling257@...il.com>, Pavel Machek <pavel@....cz>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scripts/kallsyms: fix memory corruption caused by write over-run
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);
>
Powered by blists - more mailing lists