Re: commit 7b025f3f85ed causes NULL pointer dereference

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

 



On Wed, Apr 09 2025 at 08:49, James Bottomley wrote:
> On Tue, 2025-04-08 at 22:46 +0200, Thomas Gleixner wrote:
> [...]
>> -	retain_ptr(dev);
>>  	msix_update_entries(dev, entries);
>> +	retain_ptr(dev);
>>  	return 0;
>
> Heh, well, that scores -6 on the Rusty scale "the name tells you how
> not to use it" because retain_ptr would commonly be read to mean the
> pointer retains its value.  It would be nice if KASAN had compile time
> markers that would cause a use after free build failure for this, but,
> apparently, it doesn't.  The cleanup annotations don't let us remove
> the scope free function, which would otherwise let us match the use to
> the name, so I think the name might have to change to something like
> retain_and_null_ptr().

Yeah. When I saw it I immediately rumaged for a brown paperbag :)





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux