From patchwork Wed Apr 10 16:54:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Micah Morton X-Patchwork-Id: 10894415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A2B417E6 for ; Wed, 10 Apr 2019 16:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5042C28A2A for ; Wed, 10 Apr 2019 16:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E17928A32; Wed, 10 Apr 2019 16:54:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDCEA28A2A for ; Wed, 10 Apr 2019 16:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730417AbfDJQyn (ORCPT ); Wed, 10 Apr 2019 12:54:43 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34152 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730324AbfDJQyn (ORCPT ); Wed, 10 Apr 2019 12:54:43 -0400 Received: by mail-pg1-f196.google.com with SMTP id v12so1920415pgq.1 for ; Wed, 10 Apr 2019 09:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TrcHL0kMBw/SvjlhZQb5Lz2YkuzTjIC+UsSx0C/4214=; b=RqN+sxxUNazXMPmh1vqpGzL0oHUJpijlK2g8/8klMYjd+UBcv562haiJjgovGLO15g y+UHZ3A7Ebu4H9ZRyjmaEZVfn126Rgv7RYeyF2SMlp/IL64kfqnC7dKQI8cMlNlVTjt8 ieJQFeRIgd1QaumLJw5xbvPtQhsyu8VmN7r+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TrcHL0kMBw/SvjlhZQb5Lz2YkuzTjIC+UsSx0C/4214=; b=e7r8j2PVHie0gXtChoLCGiNP/oZu/VqlCH3aIu8lYLK/ha3qzF/gBN5Sa5LrQWsmfR JmMSQzl69QMBXRsLb5PXojmyZSsOfRO8hSi0eaB2aqOfsEyqDW7IbkBMp7GWdVvXCJhr 6wm92wKsipyhQ+Hp/v3Uzyh5xslvKrVvgdKLD066WRs7W5pFP7dgCrypOh5nk5h22l/o jWPDqUa3BzWd2B9h/sVQNu0qHLJ+7uCoTS40d2ftJh0QEToK/9wwbQIGtmN4uo1byIOQ +DKMMpAPwfnh1z7Tyox/SkOwjGFGDUbOVL3VDMSf/9DWXzrATnHTbRjXIdZa2iIZNWAI EPZw== X-Gm-Message-State: APjAAAVupCfYSI29hYcwSOZIGUXSR6I07BXf3OqrXg3dZWqwk9SKrhUH LMBWHP+5VsmajU2m0mX8JcKvLg== X-Google-Smtp-Source: APXvYqxmrI89ehpm68s5ZXHOF6SE4j7Julbv7LyNMhlWUzRwcFYPPnI1VbsST/V+oEdG1wo2L52VQg== X-Received: by 2002:a62:415d:: with SMTP id o90mr44476618pfa.236.1554915282625; Wed, 10 Apr 2019 09:54:42 -0700 (PDT) Received: from localhost ([2620:15c:202:201:9e10:971c:f11c:a814]) by smtp.gmail.com with ESMTPSA id a3sm3439841pgj.89.2019.04.10.09.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 09:54:41 -0700 (PDT) From: Micah Morton X-Google-Original-From: Micah Morton To: jmorris@namei.org, keescook@chromium.org, casey@schaufler-ca.com, linux-security-module@vger.kernel.org Cc: Jann Horn , Micah Morton Subject: [PATCH 01/10] LSM: SafeSetID: fix pr_warn() to include newline Date: Wed, 10 Apr 2019 09:54:34 -0700 Message-Id: <20190410165434.206579-1-mortonm@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Jann Horn 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 Signed-off-by: Micah Morton Reviewed-by: Kees Cook --- 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)); /*