Re: buffer overflow in io_sq_thread()

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

 



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/1213a929-30f2-592d-86a2-ddcf84139940@xxxxxxxxx/T/#m9a9707c76e0ca73b54676b5d0fe198587b36c1b4

As there's no urgent problem in 5.12 I'll repost them for 5.13...

metze




[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