Re: [PATCH] mm/slub.c: add parameter length checking for alloc_loc_track()

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

 



On 07/15/2013 11:16 PM, Christoph Lameter wrote:
> On Mon, 15 Jul 2013, Chen Gang wrote:
> 
>> > On 07/12/2013 09:49 PM, Christoph Lameter wrote:
>>> > > On Fri, 12 Jul 2013, Chen Gang wrote:
>>> > >
>>>> > >> Since alloc_loc_track() will alloc additional space, and already knows
>>>> > >> about 'max', so need be sure of 'max' must be larger than 't->count'.
>>> > >
>>> > > alloc_loc_track is only called if t->count > max from add_location:
>>> > >
>> >
>> > For add_location(), if "t->count > t->max", it calls alloc_loc_track()
>> > with "max == 2 * t->max".
>> >
>> > In this case we need be sure that "t->count < 2 * t->max".
> We are sure about that since t->count is always incremented by one and
> then checked against t->max. The location database is build up from a
> single hardware thread without any concurrency.
> 
> So we do not really need this patch.
> 
> 
> 

Hmm... what you says above is reasonable.

In this case, since alloc_loc_track() is a static function, it will
depend on the related maintainers' willing and opinions to decide
whether add the related check or not (just like add 'BUG_ON' or not).

I need respect the original related maintainers' willing and opinions.


Thanks.
-- 
Chen Gang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




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