Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5406087imm; Tue, 19 Jun 2018 09:52:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJxK5r9kBOjRPStTbIc6EhTRrT+exo1UtXiPy3d6BuOrAR8RDzjWiy4CaTSsKsf0imRgtbI X-Received: by 2002:a63:b147:: with SMTP id g7-v6mr15303009pgp.379.1529427163719; Tue, 19 Jun 2018 09:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529427163; cv=none; d=google.com; s=arc-20160816; b=eZGcysFBaOCNsQeIIPLxbf/qM60zq/PcxZPIfFE0A3N/J9OLOrO0wcF1dBUF2sQSrV NKL/JH6JyULKud7QsLXPVt1ywdb9AkNd4rY2CmExexHZh3Dow0RRiB3RaUxq4mviJfd2 qyfLVMjAFSOsYksTurpcevtVqGtsj0wn4DhbRqBjCw7rY1vDRyCR6mQUHccVhpivvlYj j8JNcAqhabpOJqLRyQRBhCYa9b3xSeheqfP59RP2UtuD3DYrqihHTpW47uqCPV3eZ4mY 4kkz22oUzjpWq9Guy3SxvEallEgim3mfPAo8/uVnbeu+lZWiHMhdsKXZqqq5Vr0jtX7q T/vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=CCMVS6vFaHSeMIrX6/Y8Jh4v2fb44VZE5kGIiUIwvRo=; b=Ba7HAj8k22IFNWFpVfLMWiC1kOkTqs2sDWBKGsD5hfE0i9GlGqGkH9pCiGiyGeRuyn SoWIOHKw+/D+EmcbYR4pEGZHcivqdsqEgkfddsIfz8/DQIbQAy0KJYAF74tiRPm5qK2r KsKosXYk6B5T/GcNzL2+Ip3mZ4qJDEI91XiWGc+kSsQeayA22ierFy471/z3/GqJypFW BKFueWBIW6WkC9MawM6QAGD4HiDbcL0nCXbiAPIfpVt+++/kRYLSWWTKC/8K0MElrHsA O9YE/TnKRxYIffGY7brVDeBR6U4zP1BFOg69UDT2xPVxJjegpHB3CDDk6e+m7RbPAkKg Dzpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=If4gxVUj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24-v6si55927plr.302.2018.06.19.09.52.29; Tue, 19 Jun 2018 09:52:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=If4gxVUj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967022AbeFSQvc (ORCPT + 99 others); Tue, 19 Jun 2018 12:51:32 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35373 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966267AbeFSQva (ORCPT ); Tue, 19 Jun 2018 12:51:30 -0400 Received: by mail-lf0-f67.google.com with SMTP id i15-v6so554694lfc.2 for ; Tue, 19 Jun 2018 09:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CCMVS6vFaHSeMIrX6/Y8Jh4v2fb44VZE5kGIiUIwvRo=; b=If4gxVUjOGICSpHKKPa5D3Bv3d1rg7raSQKzwhhU7qNleSGiX6kGlBfe441+Z2FqUb MILmV2gqt4X1gboMZU0xoqhZU6d1zbWX4dOuri04OVurgIx9tdvR5Lqp+JD0VC3T9r9O pTvdA/El33wF9q3KDDqH/d3hM2uQ1GfIl1G8DkMl++tWAWRtMFnwxZbZ9cNPM+RF7Lwj cGvvYyG3nG3ywD7FE80NbjP+z79sdprMlQ/vn3ijuy5gI0sJ8gNXrW96tVLlSe/lHxSF XUn+OPUXWJ8j6DKu7gN9hT4/pyP+SQE2lpEdb0XQJFY4wzi3z5qG9I1Ah0vUzLobnMPU b5DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CCMVS6vFaHSeMIrX6/Y8Jh4v2fb44VZE5kGIiUIwvRo=; b=HFLjYzMafasAxXusdVkRFQu+JWRPsZ983sRTI0029ooXLXLc4sNQz3ARZXcKJ14bgK lJFkTV7QNOoUbKlsau+8WytIhB8iAw55Co32N8q+cDOcetEoUhzDqzJSfvpSB89BSpPc Z5bS/3weLdI6hsA1Mzp3RQtbu+YU2b+Nlr6wyNcT4JHXzkilNHKn9XdUzu8krXSNj961 37wqPU+SohJ8RIf5wN4KPBQaEHiU5PM37aXXPkWeSipZYkUGkwgCiRqDohvcxj+mFQ7/ UZY7aS6+TuwI3axjKVaXfXjlNNBDckhuVsv/yHrFltSfiOdxUDaxcjqLMvzBokBJZvmb kDKA== X-Gm-Message-State: APt69E2OcFixnKaCvIKqibrqEKUCtzSqhKmt6ts3GY0diUwRFKDowsWP 7ikxP0mZjNNXXpICExdn1pfNe4aRUA4+LwgZ1X6W X-Received: by 2002:a19:a892:: with SMTP id r140-v6mr10459671lfe.39.1529427089267; Tue, 19 Jun 2018 09:51:29 -0700 (PDT) MIME-Version: 1.0 References: <20180612080912.7827-1-peter.enderborg@sony.com> <20180612080912.7827-4-peter.enderborg@sony.com> In-Reply-To: From: Paul Moore Date: Tue, 19 Jun 2018 12:51:18 -0400 Message-ID: Subject: Re: [PATCH 03/13] selinux: Cleanup printk logging in policydb To: joe@perches.com Cc: peter.enderborg@sony.com, Stephen Smalley , Eric Paris , James Morris , danielj@mellanox.com, dledford@redhat.com, selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, serge@hallyn.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 12:45 PM Joe Perches wrote: > > On Tue, 2018-06-19 at 12:41 -0400, Paul Moore wrote: > > On Tue, Jun 12, 2018 at 4:09 AM Peter Enderborg > > wrote: > > > > > > Replace printk with pr_* to avoid checkpatch warnings and > > > replace KERN_CONT with 2 longer prints. > > > > > > Signed-off-by: Peter Enderborg > > > --- > > > security/selinux/ss/policydb.c | 91 +++++++++++++++++++++--------------------- > > > 1 file changed, 46 insertions(+), 45 deletions(-) > > > > Merged, thank you. While removing the separate KERN_CONT message > > introduces some duplication, I think that's the right thing to do. > > > > > diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c > [] > > > @@ -504,7 +504,7 @@ static void hash_eval(struct hashtab *h, const char *hash_name) > > > struct hashtab_info info; > > > > > > hashtab_stat(h, &info); > > > - printk(KERN_DEBUG "SELinux: %s: %d entries and %d/%d buckets used, " > > > + pr_debug("SELinux: %s: %d entries and %d/%d buckets used, " > > > "longest chain length %d\n", hash_name, h->nel, > > > info.slots_used, h->size, info.max_chain_len); > > > } > > > @@ -533,15 +533,17 @@ static int policydb_index(struct policydb *p) > > > { > > > int i, rc; > > > > > > - printk(KERN_DEBUG "SELinux: %d users, %d roles, %d types, %d bools", > > > - p->p_users.nprim, p->p_roles.nprim, p->p_types.nprim, p->p_bools.nprim); > > > if (p->mls_enabled) > > > - printk(KERN_CONT ", %d sens, %d cats", p->p_levels.nprim, > > > - p->p_cats.nprim); > > > - printk(KERN_CONT "\n"); > > > + pr_debug("SELinux: %d users, %d roles, %d types, %d bools, %d sens, %d cats", > > > + p->p_users.nprim, p->p_roles.nprim, p->p_types.nprim, > > > + p->p_bools.nprim, p->p_levels.nprim, p->p_cats.nprim); > > > + else > > > + pr_debug("SELinux: %d users, %d roles, %d types, %d bools", > > > + p->p_users.nprim, p->p_roles.nprim, p->p_types.nprim, > > > + p->p_bools.nprim); > > This lost the terminating newline on each pr_debug Good catch. I haven't pushed to selinux/next yet, and this is pretty minor, so I'll just fix that up in the merge. -- paul moore www.paul-moore.com