On 13/06/06, Pekka J Enberg <[email protected]> wrote:
> As far as I understood, Ingo is worried about: > > struct s { /* some fields */; char *buf; }; > > struct s *p = kmalloc(sizeof(struct s) + BUF_SIZE); > p->buf = p + sizeof(struct s); > > Which could lead to false negative due to p->buf pointing to p. However, > for us to even _find_ p->buf, we would need an incoming pointer _to_ p > which makes me think this is not a problem in practice. Hmm?
On 6/13/06, Catalin Marinas <[email protected]> wrote:
Not exactly. In the above case, Ingo (and me) is worried about having a incoming pointer (from other block) equal to p->buf and therefore inside the block allocated with kmalloc.
Ah, right, I overlooked that case. But, is it really a leak? That is, even though we currently don't have a pointer to the beginning fo the block, we don't know for sure it was a leak. You're now allowed to do: p = kmalloc(...); p = p + HDR_SIZE; /* ... */ kfree(p - HDR_SIZE); Do you think we should ban the above? Pekka - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: "Catalin Marinas" <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- References:
- [PATCH 2.6.17-rc6 0/9] Kernel memory leak detector 0.7
- From: Catalin Marinas <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: "Catalin Marinas" <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: Pekka J Enberg <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: Ingo Molnar <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: "Catalin Marinas" <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: Ingo Molnar <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: Pekka J Enberg <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: "Catalin Marinas" <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: Pekka J Enberg <[email protected]>
- Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- From: "Catalin Marinas" <[email protected]>
- [PATCH 2.6.17-rc6 0/9] Kernel memory leak detector 0.7
- Prev by Date: Re: [RFC] ATA host-protected area (HPA) device mapper?
- Next by Date: Re: [SPARSEMEM] confusing uses of SPARSEM_EXTREME (try #2)
- Previous by thread: Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- Next by thread: Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
- Index(es):