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: <1393280598.11020.77.camel@joe-AO722>
Date:	Mon, 24 Feb 2014 14:23:18 -0800
From:	Joe Perches <joe@...ches.com>
To:	Casey Schaufler <casey@...aufler-ca.com>
Cc:	linux-kernel@...r.kernel.org,
	James Morris <james.l.morris@...cle.com>,
	linux-security-module@...r.kernel.org
Subject: Re: [PATCH 6/8] security: smack: Use a more current logging style

On Mon, 2014-02-24 at 14:16 -0800, Casey Schaufler wrote:
> On 2/24/2014 1:59 PM, Joe Perches wrote:
> > Convert printks to pr_<level>
> > Add pr_fmt.

> > diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
[]
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > +
> 
> What is pr_fmt() for?

Prefixing "smack: " to the pr_<level> uses.

> > @@ -2106,8 +2108,7 @@ static int smack_inode_setsecurity(struct inode *inode, const char *name,
> >  		if (sock->sk->sk_family == PF_INET) {
> >  			rc = smack_netlabel(sock->sk, SMACK_CIPSO_SOCKET);
> >  			if (rc != 0)
> > -				printk(KERN_WARNING
> > -					"Smack: \"%s\" netlbl error %d.\n",
> > +				pr_warn("\"%s\" netlbl error %d\n",
> >  					__func__, -rc);

This will be now be emitted as

<4>smack: "smack_inode_setsecurity" netlbl error -<d>

instead of

<4>Smack: "smack_inode_setsecurity" netlbl error -<d>

Though it'd be a lot more common to use:

					pr_warn("%s: netlbl error: %d\n",
						__func__, -rc);

so the output would be:

<4>smack: smack_inode_setsecurity: netlbl error: -<d>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ