[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Which types of locking should I use?
> I don't remember, but I thought kmalloc() with less than 32 bytes
> doesn't return NULL. I called kmalloc() with 6 bytes
> ("const char *" + "unsigned short int") and (I thought) succeeded.
If you ask for <32 bytes, it still allocates 32 bytes. And you should be
extra careful here since that buffer overflow (<32 bytes) will not trigger
a panic (but may at some later time if things change :(
Muthu.
> Max size I could allocate with kmalloc() is 128 * 1024 bytes,
> which is equals to PAGE_SIZE << 5.
> # I have no linux PC here to verify now.
>
>
> Thank you.
>
> --
> Tetsuo (a5497108 _at_ anet.ne.jp)
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/