From: Alexey Dobriyan <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Subject: buffer overflow in io_sq_thread()
Date: Wed, 31 Mar 2021 23:24:56 +0300 [thread overview]
Message-ID: <[email protected]> (raw)
The code below will overflow because TASK_COMM_LEN is 16 but PID can be
as large as 1 billion which is 10 digit number.
Currently not even Fedora ships pid_max that large but still...
Alexey
static int io_sq_thread(void *data)
{
struct io_sq_data *sqd = data;
struct io_ring_ctx *ctx;
unsigned long timeout = 0;
char buf[TASK_COMM_LEN];
DEFINE_WAIT(wait);
sprintf(buf, "iou-sqp-%d", sqd->task_pid);
next reply other threads:[~2021-03-31 20:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 20:24 Alexey Dobriyan [this message]
2021-04-01 8:51 ` buffer overflow in io_sq_thread() Pavel Begunkov
2021-04-01 15:09 ` Stefan Metzmacher
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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