Messages in this thread | | | Date | Thu, 24 Nov 2022 12:26:41 +0100 | Subject | Re: [PATCH 01/12] mm, slab: ignore hardened usercopy parameters when disabled | From | Vlastimil Babka <> |
| |
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.
| |