From: Petr Mladek <pmladek@suse.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] printk: ringbuffer: Wrong data pointer when appending small string
Date: Thu, 15 Oct 2020 14:22:46 +0200 [thread overview]
Message-ID: <20201015122246.GD8871@alley> (raw)
In-Reply-To: <20201014175051.GC13775@alley>
On Wed 2020-10-14 19:50:54, Petr Mladek wrote:
> data_realloc() returns wrong data pointer when the block is wrapped and
> the size is not increased. It might happen when pr_cont() wants to
> add only few characters and there is already a space for them because
> of alignment.
>
> It might cause writing outsite the buffer. It has been detected by LTP
> tests with KASAN enabled:
>
> Link: https://lore.kernel.org/r/CA+G9fYt46oC7-BKryNDaaXPJ9GztvS2cs_7GjYRjanRi4+ryCQ@mail.gmail.com
> Fixes: 4cfc7258f876a7feba673ac ("printk: ringbuffer: add finalization/extension support")
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
The patch is committed into printk/linux.git, branch for-5.10-fixup.
I am going to send a pull request with it tomorrow unless something
happens in the meantime.
Best Regards,
Petr
prev parent reply other threads:[~2020-10-15 12:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 10:49 [LTP] BUG: KASAN: global-out-of-bounds in vprintk_store on x86_64 Naresh Kamboju
2020-10-14 12:47 ` Sergey Senozhatsky
2020-10-14 14:05 ` Petr Mladek
2020-10-14 15:13 ` Petr Mladek
2020-10-14 17:50 ` [LTP] [PATCH] printk: ringbuffer: Wrong data pointer when appending small string Petr Mladek
2020-10-15 6:31 ` Sergey Senozhatsky
2020-10-15 9:59 ` John Ogness
2020-10-15 12:22 ` Petr Mladek [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=20201015122246.GD8871@alley \
--to=pmladek@suse.com \
--cc=ltp@lists.linux.it \
/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