All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: rgb@redhat.com, selinux@tycho.nsa.gov
Subject: [PATCH] selinux: convert WARN_ONCE() to printk() in selinux_nlmsg_perm()
Date: Wed, 12 Nov 2014 16:36:13 -0500	[thread overview]
Message-ID: <20141112213613.7528.34729.stgit@localhost> (raw)
In-Reply-To: <20141112212515.GF28076@madcap2.tricolour.ca>

From: Richard Guy Briggs <rgb@redhat.com>

Convert WARN_ONCE() to printk() in selinux_nlmsg_perm().

After conversion from audit_log() in commit e173fb26, WARN_ONCE() was
deemed too alarmist, so switch it to printk().

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
[PM: Changed to printk(WARNING) so we can all of the different invalid
 netlink messages.  In Richard's defense, he brought this point up
 earlier, but I didn't understand his point at the time.]
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 security/selinux/hooks.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 2478976..654f071 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4727,9 +4727,10 @@ static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb)
 	err = selinux_nlmsg_lookup(sksec->sclass, nlh->nlmsg_type, &perm);
 	if (err) {
 		if (err == -EINVAL) {
-			WARN_ONCE(1, "selinux_nlmsg_perm: unrecognized netlink message:"
-				  " protocol=%hu nlmsg_type=%hu sclass=%hu\n",
-				  sk->sk_protocol, nlh->nlmsg_type, sksec->sclass);
+			printk(KERN_WARNING
+			       "SELinux: unrecognized netlink message:"
+			       " protocol=%hu nlmsg_type=%hu sclass=%hu\n",
+			       sk->sk_protocol, nlh->nlmsg_type, sksec->sclass);
 			if (!selinux_enforcing || security_get_allow_unknown())
 				err = 0;
 		}

      parent reply	other threads:[~2014-11-12 21:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 20:12 "selinux_nlmsg_perm: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=30" warning on Linux 3.18-rc3 Vinson Lee
2014-11-05 20:48 ` Paul Moore
2014-11-05 20:48   ` Paul Moore
2014-11-05 20:51   ` Stephen Smalley
2014-11-05 20:51     ` Stephen Smalley
2014-11-05 21:57     ` Paul Moore
2014-11-05 21:57       ` Paul Moore
2014-11-05 22:25       ` Richard Guy Briggs
2014-11-05 22:25         ` Richard Guy Briggs
2014-11-10 20:41         ` Paul Moore
2014-11-10 20:41           ` Paul Moore
2014-11-12 19:01           ` [PATCH] selinux: convert WARN_ONCE() to printk_once() in selinux_nlmsg_perm() Richard Guy Briggs
2014-11-12 19:01             ` Richard Guy Briggs
2014-11-12 21:21             ` Paul Moore
2014-11-12 21:21               ` Paul Moore
2014-11-12 21:25               ` Richard Guy Briggs
2014-11-12 21:25                 ` Richard Guy Briggs
2014-11-12 21:30                 ` Paul Moore
2014-11-12 21:30                   ` Paul Moore
2014-11-12 21:35                   ` Richard Guy Briggs
2014-11-12 21:35                     ` Richard Guy Briggs
2014-11-12 21:44                     ` Paul Moore
2014-11-12 21:44                       ` Paul Moore
2014-11-12 21:36                 ` Paul Moore [this message]

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=20141112213613.7528.34729.stgit@localhost \
    --to=pmoore@redhat.com \
    --cc=rgb@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /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 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.