[Devel] [PATCH rh7] fib_rules: mark default fib reles as BLACK

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Mon Nov 23 04:47:12 PST 2015


This patch fixed flase positive, reported by KASan.

https://jira.sw.ru/browse/PSBM-41453

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 net/core/fib_rules.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 0e91311..bc69cef 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -36,6 +36,10 @@ int fib_default_rule_add(struct fib_rules_ops *ops,
 	/* The lock is not required here, the list in unreacheable
 	 * at the moment this function is called */
 	list_add_tail(&r->list, &ops->rules_list);
+
+	/* This object is not referenced by any user and will be removed on net
+	 * ns stop in fib_rules_cleanup_ops */
+	kmemleak_ignore(r);
 	return 0;
 }
 EXPORT_SYMBOL(fib_default_rule_add);



More information about the Devel mailing list