Re: buffer overflow in io_sq_thread()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux