From: Stefan Metzmacher <[email protected]>
To: Pavel Begunkov <[email protected]>,
Alexey Dobriyan <[email protected]>,
[email protected]
Cc: [email protected]
Subject: Re: buffer overflow in io_sq_thread()
Date: Thu, 1 Apr 2021 17:09:11 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Am 01.04.21 um 10:51 schrieb Pavel Begunkov:
> On 31/03/2021 21:24, Alexey Dobriyan wrote:
>> 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...
>
> And is safer limited in any case. Thanks
>
>>
>> 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);
I have patches for this see
https://lore.kernel.org/io-uring/[email protected]/T/#m9a9707c76e0ca73b54676b5d0fe198587b36c1b4
As there's no urgent problem in 5.12 I'll repost them for 5.13...
metze
prev parent reply other threads:[~2021-04-01 18:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 20:24 buffer overflow in io_sq_thread() Alexey Dobriyan
2021-04-01 8:51 ` Pavel Begunkov
2021-04-01 15:09 ` Stefan Metzmacher [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 \
[email protected] \
[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