Re: [PATCH 01/12] mm, slab: ignore hardened usercopy parameters when disabled

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

 



On 11/24/22 12:16, Hyeonggon Yoo wrote:
>>  	/* Fail closed on bad usersize of useroffset values. */
>> -	if (WARN_ON(!usersize && useroffset) ||
>> +	if (!IS_ENABLED(CONFIG_HARDENED_USERCOPY) ||
>> +	    WARN_ON(!usersize && useroffset) ||
>>  	    WARN_ON(size < usersize || size - usersize < useroffset))
>>  		usersize = useroffset = 0;
> 
> I think this change is no longer needed as slab_unmergeable()
> now does not check usersize when CONFIG_HARDENED_USERCOPY=n?

True, but the code here still follows by

if (!usersize)
    s = __kmem_cache_alias(name, size, align, flags, ctor);

So it seemed simplest just to leave it like that.






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux