All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] iommu/amd: make kmemleak ignore the 'irq_remap_table' object
@ 2015-11-20 11:09 Michael Wang
  2015-11-20 11:33 ` [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak Michael Wang
  0 siblings, 1 reply; 45+ messages in thread
From: Michael Wang @ 2015-11-20 11:09 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel

The kmemleak testing on 3.18.24 show:

unreferenced object 0xffff880233ff9010 (size 16):
  comm "swapper/0", pid 1, jiffies 4294937440 (age 2010.490s)
  hex dump (first 16 bytes):
    0a 0a 00 00 20 00 00 00 00 44 fb 33 02 88 ff ff  .... ....D.3....
  backtrace:
    [<ffffffff8118192d>] create_object+0x10d/0x2d0
    [<ffffffff815c2d4b>] kmemleak_alloc+0x5b/0xc0
    [<ffffffff8116dd19>] kmem_cache_alloc_trace+0xb9/0x160
    [<ffffffff814ffe51>] get_irq_table+0x151/0x380

This is caused by the 'irq_lookup_table' was allocated with
__get_free_pages() which won't create kmemleak object, thus it's
pointers won't be count as referencing in kmemleak scanning.

The 'irq_remap_table' allocated won't be freed after initialized,
doesn't make sense to let kmemleak scan it.

This patch mark the 'irq_remap_table' object as 'ignored' to
stop the 'false positives' report.

Signed-off-by: Michael Wang <yun.wang@profitbricks.com>
---
 drivers/iommu/amd_iommu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8b2be1e..87a1a88 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3603,6 +3603,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic)
 	}
 
 	irq_lookup_table[devid] = table;
+	kmemleak_ignore(table);
 	set_dte_irq_entry(devid, table);
 	iommu_flush_dte(iommu, devid);
 	if (devid != alias) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2015-12-03  8:47 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20 11:09 [RFC PATCH] iommu/amd: make kmemleak ignore the 'irq_remap_table' object Michael Wang
2015-11-20 11:33 ` [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak Michael Wang
2015-11-20 12:31   ` Michael Wang
     [not found]   ` <564F051E.9010703-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-11-25 11:14     ` Michael Wang
2015-11-25 11:14       ` Michael Wang
2015-11-25 15:08   ` Joerg Roedel
     [not found]     ` <20151125150806.GG2064-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-25 15:14       ` Michael Wang
2015-11-25 15:14         ` Michael Wang
2015-12-02 10:37         ` Michael Wang
2015-12-02 10:52           ` Catalin Marinas
     [not found]             ` <CAHkRjk5QNQiNeJTcjKFQzpac_4us_3Ts1w4+uRw6TY16LbgsJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 10:56               ` Michael Wang
2015-12-02 10:56                 ` Michael Wang
2015-12-02 11:31                 ` Catalin Marinas
     [not found]                   ` <CAHkRjk5WzPT1gRaa=3qyrp1gcee9ZQKF_rU42FAu0C6ep8JPug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 11:38                     ` Michael Wang
2015-12-02 11:38                       ` Michael Wang
     [not found]                       ` <565ED81B.3020606-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 11:51                         ` Joerg Roedel
2015-12-02 11:51                           ` Joerg Roedel
     [not found]                           ` <20151202115142.GD18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-12-02 12:31                             ` Michael Wang
2015-12-02 12:31                               ` Michael Wang
2015-12-02 12:53                               ` Borislav Petkov
     [not found]                                 ` <20151202125315.GB3910-fF5Pk5pvG8Y@public.gmane.org>
2015-12-02 13:01                                   ` Michael Wang
2015-12-02 13:01                                     ` Michael Wang
     [not found]                                     ` <565EEBC3.5050807-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 13:13                                       ` Borislav Petkov
2015-12-02 13:13                                         ` Borislav Petkov
2015-12-02 13:18                                         ` Michael Wang
2015-12-02 13:40                                           ` Borislav Petkov
2015-12-02 13:48                                             ` Michael Wang
2015-12-02 13:59                                               ` Borislav Petkov
     [not found]                                                 ` <20151202135931.GF3783-fF5Pk5pvG8Y@public.gmane.org>
2015-12-02 14:09                                                   ` Michael Wang
2015-12-02 14:09                                                     ` Michael Wang
     [not found]                                                     ` <565EFB8E.4020600-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 14:13                                                       ` Borislav Petkov
2015-12-02 14:13                                                         ` Borislav Petkov
     [not found]                                                         ` <20151202141309.GG3783-fF5Pk5pvG8Y@public.gmane.org>
2015-12-02 14:21                                                           ` Michael Wang
2015-12-02 14:21                                                             ` Michael Wang
2015-12-02 17:36                                                   ` Catalin Marinas
2015-12-02 17:36                                                     ` Catalin Marinas
     [not found]                                                     ` <CAHkRjk4DdRE6=tN7VZu67Bsdty_4uT2GSbUff5MwP_nSJ+uj4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 18:40                                                       ` Borislav Petkov
2015-12-02 18:40                                                         ` Borislav Petkov
2015-12-03  8:47                                                     ` Michael Wang
     [not found]                               ` <565EE4AA.4070309-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 12:56                                 ` Joerg Roedel
2015-12-02 12:56                                   ` Joerg Roedel
     [not found]                                   ` <20151202125636.GE18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-12-02 13:07                                     ` Michael Wang
2015-12-02 13:07                                       ` Michael Wang
2015-12-02 11:17               ` Joerg Roedel
2015-12-02 11:17                 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.