From: Paul Moore <pmoore@redhat.com>
To: Richard Guy Briggs <rgb@redhat.com>
Cc: selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org,
trinity@vger.kernel.org, sds@tycho.nsa.gov,
vlee@twopensource.com, eparis@parisplace.org,
james.l.morris@oracle.com, serge@hallyn.com
Subject: Re: [PATCH] selinux: convert WARN_ONCE() to printk_once() in selinux_nlmsg_perm()
Date: Wed, 12 Nov 2014 16:21:46 -0500 [thread overview]
Message-ID: <2504561.J229oUfjhi@sifl> (raw)
In-Reply-To: <49c549f887cd1a0284f79251765606eccacd11e3.1415818605.git.rgb@redhat.com>
On Wednesday, November 12, 2014 02:01:34 PM Richard Guy Briggs wrote:
> Convert WARN_ONCE() to printk_once() in selinux_nlmsg_perm().
>
> After conversion from audit_log() in commit e173fb26, WARN_ONCE() was deemed
> too alarmist, so switch it to printk_once(). If this gets buried in the
> noise, it may be converted to a rate-limited call in the future.
>
> Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> ---
> security/selinux/hooks.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index e663141..17d0066 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -4725,9 +4725,9 @@ 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_once("selinux_nlmsg_perm: 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;
> }
My apologies, I should have noticed this sooner, but printk_once() is probably
not a good choice here as only the first invalid netlink message will be
displayed. This is fine if all the invalid netlink messages happen the same,
but that isn't likely to be the case.
Richard, any objections if I convert the printk_once() to a printk(WARN) and
update the patch description accordingly?
--
paul moore
security and virtualization @ redhat
next prev parent reply other threads:[~2014-11-12 21:21 UTC|newest]
Thread overview: 12+ 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:51 ` Stephen Smalley
2014-11-05 21:57 ` Paul Moore
2014-11-05 22:25 ` Richard Guy Briggs
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 21:21 ` Paul Moore [this message]
2014-11-12 21:25 ` Richard Guy Briggs
2014-11-12 21:30 ` Paul Moore
2014-11-12 21:35 ` Richard Guy Briggs
2014-11-12 21:44 ` Paul Moore
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=2504561.J229oUfjhi@sifl \
--to=pmoore@redhat.com \
--cc=eparis@parisplace.org \
--cc=james.l.morris@oracle.com \
--cc=linux-security-module@vger.kernel.org \
--cc=rgb@redhat.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=serge@hallyn.com \
--cc=trinity@vger.kernel.org \
--cc=vlee@twopensource.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