public inbox for [email protected]
 help / color / mirror / Atom feed
* buffer overflow in io_sq_thread()
@ 2021-03-31 20:24 Alexey Dobriyan
  2021-04-01  8:51 ` Pavel Begunkov
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2021-03-31 20:24 UTC (permalink / raw)
  To: axboe; +Cc: asml.silence, io-uring

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-01 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox