[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191217140804.27364-3-sergey.dyasli@citrix.com>
Date: Tue, 17 Dec 2019 14:08:03 +0000
From: Sergey Dyasli <sergey.dyasli@...rix.com>
To: <xen-devel@...ts.xen.org>, <kasan-dev@...glegroups.com>,
<linux-kernel@...r.kernel.org>
CC: Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>,
"Stefano Stabellini" <sstabellini@...nel.org>,
George Dunlap <george.dunlap@...rix.com>,
Ross Lagerwall <ross.lagerwall@...rix.com>,
Sergey Dyasli <sergey.dyasli@...rix.com>
Subject: [RFC PATCH 2/3] xen: teach KASAN about grant tables
From: Ross Lagerwall <ross.lagerwall@...rix.com>
Otherwise it produces lots of false positives.
Signed-off-by: Ross Lagerwall <ross.lagerwall@...rix.com>
Signed-off-by: Sergey Dyasli <sergey.dyasli@...rix.com>
---
drivers/xen/grant-table.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 49b381e104ef..0f844c14d5b9 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1049,6 +1049,7 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
foreign = xen_page_foreign(pages[i]);
foreign->domid = map_ops[i].dom;
foreign->gref = map_ops[i].ref;
+ kasan_alloc_pages(pages[i], 0);
break;
}
@@ -1085,8 +1086,10 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
if (ret)
return ret;
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++) {
ClearPageForeign(pages[i]);
+ kasan_free_pages(pages[i], 0);
+ }
return clear_foreign_p2m_mapping(unmap_ops, kunmap_ops, pages, count);
}
--
2.17.1
Powered by blists - more mailing lists