lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed,  8 Aug 2012 16:27:08 +0530
From:	Jenny TC <jenny.tc@...el.com>
To:	paul.gortmaker@...driver.com, linux-kernel@...r.kernel.org
Cc:	jenny.tc@...el.com
Subject: [PATCH] kernel_notifier: register conditional raw notifier

Introduce a new API raw_notifier_chain_cond_register to
add a notifier to a raw notifier chain, only if notifier
not already present in the chain.

Signed-off-by: Jenny TC <jenny.tc@...el.com>
---
 kernel/notifier.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/kernel/notifier.c b/kernel/notifier.c
index 2d5cc4c..267e26f 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -349,6 +349,24 @@ int raw_notifier_chain_register(struct raw_notifier_head *nh,
 EXPORT_SYMBOL_GPL(raw_notifier_chain_register);
 
 /**
+ *	raw_notifier_chain_cond_register - Cond add notifier to a raw notifier chain
+ *	@nh: Pointer to head of the raw notifier chain
+ *	@n: New entry in notifier chain
+ *
+ *	Adds a notifier to a raw notifier chain, only if not already
+ *	present in the chain.
+ *	All locking must be provided by the caller.
+ *
+ *	Currently always returns zero.
+ */
+int raw_notifier_chain_cond_register(struct raw_notifier_head *nh,
+		struct notifier_block *n)
+{
+	return notifier_chain_cond_register(&nh->head, n);
+}
+EXPORT_SYMBOL_GPL(raw_notifier_chain_cond_register);
+
+/**
  *	raw_notifier_chain_unregister - Remove notifier from a raw notifier chain
  *	@nh: Pointer to head of the raw notifier chain
  *	@n: Entry to remove from notifier chain
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ