public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Amy Griffis <amy.griffis@hp.com>
To: linux-audit@redhat.com
Subject: [PATCH git] make selinux_audit_rule_update() remove safely
Date: Tue, 25 Apr 2006 14:57:08 -0400	[thread overview]
Message-ID: <20060425185708.GA24662@zk3.dec.com> (raw)

(Al, this is a fix for the -mm patch
audit-support-for-context-based-audit-filtering-2.patch.  Please fold
in with lspp.b7 3811b185122022cd5e59b1ca85342b820e3b3e22 on next
rebase.)

Use list_for_each_entry_safe() in selinux_audit_rule_update() to
protect against call_rcu() on list entries while traversing.

Signed-off-by: Amy Griffis <amy.griffis@hp.com>

---

 kernel/auditfilter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

71476af7bf618dee43c9ac86b0227882df412152
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 7b91a1e..f1151a2 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -1397,7 +1397,7 @@ static inline int audit_rule_has_selinux
  * updated rule. */
 int selinux_audit_rule_update(void)
 {
-	struct audit_entry *entry, *nentry;
+	struct audit_entry *entry, *n, *nentry;
 	struct audit_watch *watch;
 	int i, err = 0;
 
@@ -1405,7 +1405,7 @@ int selinux_audit_rule_update(void)
 	mutex_lock(&audit_filter_mutex);
 
 	for (i = 0; i < AUDIT_NR_FILTERS; i++) {
-		list_for_each_entry(entry, &audit_filter_list[i], list) {
+		list_for_each_entry_safe(entry, n, &audit_filter_list[i], list) {
 			if (!audit_rule_has_selinux(&entry->rule))
 				continue;
 
-- 
1.3.0

                 reply	other threads:[~2006-04-25 18:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060425185708.GA24662@zk3.dec.com \
    --to=amy.griffis@hp.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox