Messages in this thread | | | From | Sven Schnelle <> | Subject | Re: [PATCH] printk: fix buffer overflow potential for print_text() | Date | Sun, 24 Jan 2021 09:59:21 +0100 |
| |
John Ogness <john.ogness@linutronix.de> writes:
> Hi Sven, > > Thanks for the outstanding analysis! > > On 2021-01-23, Sven Schnelle <svens@linux.ibm.com> wrote: >>> 1401 if (buf_size > 0) >>> 1402 text[len] = 0; >> >> I don't think i have really understood how all the printk magic works, >> but using r->text_buf[len] seems to be the correct place to put the >> zero byte in that case? > > Yes, you are correct! @text is pointing to the beginning of the > currently processed line, not the beginning of the buffer. > > I will submit a patch to fix our recent fix (unless you would like to do > that).
Please go ahead, thank you!
| |