Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: [Full-Disclosure] Re: Linux Kernel sctp_setsockopt() Integer Overflow |
|---|---|
| Date: | Sat, 15 May 2004 23:07:00 +0200 (CEST) |
On Sat, 15 May 2004, Michael Tokarev wrote:
But kmalloc(0) will return NULL, and the whole setsockopt
will finish with errno set to ENOMEM.
From 2.4 mm/slab.c:
void * kmalloc (size_t size, int flags)
{
cache_sizes_t *csizep = cache_sizes;
for (; csizep->cs_size; csizep++) {
if (size > csizep->cs_size)
continue;
return __kmem_cache_alloc(flags & GFP_DMA ?
csizep->cs_dmacachep : csizep->cs_cachep, flags);
}
return NULL;
}
How did you come from the above snippet of the code to the idea that kmalloc(0) returns NULL? It allocates the number of bytes equal to the closest larger value of cache_sizes->cs_size entries ... so on typical system this would be something like 32 or 64 bytes, depending on the page size (see include/linux/kmalloc_sizes.h) ... and of course returns pointer to this data, which is definitely not NULL. -- JiKos.
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [Full-Disclosure] Worm of the worm?, Bruce Ediger |
|---|---|
| Next by Date: | [Full-Disclosure] Vuln. MacOSX/Safari: Remote help-call, execute scripts, Troels Bay |
| Previous by Thread: | [Full-Disclosure] Re: Linux Kernel sctp_setsockopt() Integer Overflow, Michael Tokarev |
| Next by Thread: | Re: [Full-Disclosure] Re: Linux Kernel sctp_setsockopt() Integer Overflow, Stefan Esser |
| Indexes: | [Date] [Thread] [Top] [All Lists] |