public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Alexey Dobriyan <[email protected]>, [email protected]
Cc: [email protected]
Subject: Re: buffer overflow in io_sq_thread()
Date: Thu, 1 Apr 2021 09:51:56 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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);
> 

-- 
Pavel Begunkov

  reply	other threads:[~2021-04-01  8:56 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 [this message]
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