On Mon, 24 Sep 2007 08:59:56 EDT, Kyle Moffett said: > Proper fix is to give __kmalloc a "void *caller" parameter and have > all of the various wrapper functions pass in the value of > __builtin_return_address() appropriately. I believe that even works > properly for inline functions which may or may not be inlined. I think I looked at that, and it wasn't as easy as it looked, because there were ugly corner cases for what __builtin_return_address() returned depending on exactly what did or didn't get inlined. Basically, it's ugly stuff - if you try to use __builtin_retur_address inside kcalloc to pass to __kmalloc, and then kcalloc gets inlined, you end up passing not the routine you wanted (the caller of kcalloc), but the *parent* of that...
Attachment:
pgpTrJzplL8sd.pgp
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] Uninline kcalloc()
- From: Christoph Lameter <[email protected]>
- Re: [PATCH] Uninline kcalloc()
- References:
- [PATCH] Uninline kcalloc()
- From: Alexey Dobriyan <[email protected]>
- Re: [PATCH] Uninline kcalloc()
- From: [email protected]
- Re: [PATCH] Uninline kcalloc()
- From: Kyle Moffett <[email protected]>
- [PATCH] Uninline kcalloc()
- Prev by Date: Re: [patch 1/2] VFS: new fgetattr() file operation
- Next by Date: [PATCH rc7-mm1] fix BUG at mm/swap.c:405!
- Previous by thread: Re: [PATCH] Uninline kcalloc()
- Next by thread: Re: [PATCH] Uninline kcalloc()
- Index(es):