lkml.org 
[lkml]   [2011]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] slub: slub_def.h: needs additional check for "index"
On Fri, 6 May 2011, Maxin John wrote:

> In slub_def.h file, the kmalloc_index() may return -1 for some special cases.
> If that negative return value gets assigned to "index", it might lead to issues
> later as the variable "index" is used as index to array "kmalloc_caches" in :


The value passed to kmalloc_slab is tested before the result is used.
kmalloc_slab() only returns -1 for values > 4MB.

The size of the object is checked against SLUB_MAX size which is
significantly smaller than 4MB. 8kb by default.

So kmalloc_slab() cannot return -1 if the parameter is checked first.


\
 
 \ /
  Last update: 2011-05-06 20:59    [W:0.052 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site