Messages in this thread | | | Date | Tue, 26 Apr 2022 16:18:03 +0300 | From | Andy Shevchenko <> | Subject | Re: [PATCH v2] hex2bin: fix access beyond string end |
| |
On Tue, Apr 26, 2022 at 08:07:44AM -0400, Mikulas Patocka wrote: > On Tue, 26 Apr 2022, Andy Shevchenko wrote: > > On Sun, Apr 24, 2022 at 10:48 PM Mikulas Patocka <mpatocka@redhat.com> wrote: > > > > > > If we pass too short string to "hex2bin" (and the string size without the > > > terminating NUL character is even), "hex2bin" reads one byte after the > > > terminating NUL character. This patch fixes it. > > > > > > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> > > > Cc: stable@vger.kernel.org > > > > You need to provide a Fixes tag. > > OK. Here I resend it with the "Fixes" tag. > > > And on top of that it would be nice to understand if we need to > > support half-bytes, but in any case it's not a scope of the patch > > right now. > > Do you think that there are any users who need this?
If my memory doesn't do any tricks with me, I have seen the patterns like hex2bin() + hex_to_bin() in some places in the kernel.
-- With Best Regards, Andy Shevchenko
| |