lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhRPeSjtWE_HNhRQGZedtOsHKfPN0d=_yC9-n=HhAtkMrg@mail.gmail.com>
Date:   Tue, 19 Jun 2018 12:51:18 -0400
From:   Paul Moore <paul@...l-moore.com>
To:     joe@...ches.com
Cc:     peter.enderborg@...y.com, Stephen Smalley <sds@...ho.nsa.gov>,
        Eric Paris <eparis@...isplace.org>,
        James Morris <jmorris@...ei.org>, danielj@...lanox.com,
        dledford@...hat.com, selinux@...ho.nsa.gov,
        linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org, serge@...lyn.com
Subject: Re: [PATCH 03/13] selinux: Cleanup printk logging in policydb

On Tue, Jun 19, 2018 at 12:45 PM Joe Perches <joe@...ches.com> wrote:
>
> On Tue, 2018-06-19 at 12:41 -0400, Paul Moore wrote:
> > On Tue, Jun 12, 2018 at 4:09 AM Peter Enderborg
> > <peter.enderborg@...y.com> wrote:
> > >
> > > Replace printk with pr_* to avoid checkpatch warnings and
> > > replace KERN_CONT with 2 longer prints.
> > >
> > > Signed-off-by: Peter Enderborg <peter.enderborg@...y.com>
> > > ---
> > >  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ