linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Micah Morton <mortonm@chromium.org>
To: jmorris@namei.org, keescook@chromium.org, casey@schaufler-ca.com,
	linux-security-module@vger.kernel.org
Cc: Jann Horn <jannh@google.com>, Micah Morton <mortonm@chromium.org>
Subject: [PATCH 01/10] LSM: SafeSetID: fix pr_warn() to include newline
Date: Wed, 10 Apr 2019 09:54:34 -0700	[thread overview]
Message-ID: <20190410165434.206579-1-mortonm@chromium.org> (raw)

From: Jann Horn <jannh@google.com>

Fix the pr_warn() calls in the SafeSetID LSM to have newlines at the end.
Without this, denial messages will be buffered as incomplete lines in
log_output(), and will then only show up once something else prints into
dmesg.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Micah Morton <mortonm@chromium.org>
---
 security/safesetid/lsm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/safesetid/lsm.c b/security/safesetid/lsm.c
index cecd38e2ac80..2daecab3a4c0 100644
--- a/security/safesetid/lsm.c
+++ b/security/safesetid/lsm.c
@@ -91,7 +91,7 @@ static int safesetid_security_capable(const struct cred *cred,
 			 * to functionality other than calling set*uid() (e.g.
 			 * allowing user to set up userns uid mappings).
 			 */
-			pr_warn("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions",
+			pr_warn("Operation requires CAP_SETUID, which is not available to UID %u for operations besides approved set*uid transitions\n",
 				__kuid_val(cred->uid));
 			return -1;
 		}
@@ -103,7 +103,7 @@ static int check_uid_transition(kuid_t parent, kuid_t child)
 {
 	if (check_setuid_policy_hashtable_key_value(parent, child))
 		return 0;
-	pr_warn("UID transition (%d -> %d) blocked",
+	pr_warn("UID transition (%d -> %d) blocked\n",
 		__kuid_val(parent),
 		__kuid_val(child));
 	/*
-- 
2.21.0.392.gf8f6787159e-goog


             reply	other threads:[~2019-04-10 16:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 16:54 Micah Morton [this message]
2019-04-10 17:09 ` [PATCH 01/10] LSM: SafeSetID: fix pr_warn() to include newline Kees Cook
2019-05-06 15:53   ` Micah Morton
2019-05-06 23:39     ` James Morris
2019-05-07 15:01       ` Micah Morton

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=20190410165434.206579-1-mortonm@chromium.org \
    --to=mortonm@chromium.org \
    --cc=casey@schaufler-ca.com \
    --cc=jannh@google.com \
    --cc=jmorris@namei.org \
    --cc=keescook@chromium.org \
    --cc=linux-security-module@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).