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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151001075530.GL3982@pengutronix.de>
Date:	Thu, 1 Oct 2015 09:55:30 +0200
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	Bastian Stender <bst@...gutronix.de>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	James Morris <jmorris@...ei.org>,
	Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org,
	trivial@...nel.org, kernel@...gutronix.de,
	Joe Perches <joe@...ches.com>
Subject: Re: [PATCH] net ipv4: use preferred log methods

Hello Basti,

Cc += Joe Perches

On Wed, Sep 30, 2015 at 05:00:31PM +0200, Bastian Stender wrote:
> Replace printk calls with preferred unconditional log method calls to keep
> kernel messages clean.
> 
> Signed-off-by: Bastian Stender <bst@...gutronix.de>
> ---
>  net/ipv4/ipconfig.c                            |  77 +++++-------
>  net/ipv4/netfilter/arp_tables.c                | 165 +++++++++++--------------
>  net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |   2 +-
>  net/ipv4/netfilter/nf_nat_snmp_basic.c         |  31 +++--
>  4 files changed, 122 insertions(+), 153 deletions(-)
> 
> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
> index ed4ef09..50ec7c6 100644
> --- a/net/ipv4/ipconfig.c
> +++ b/net/ipv4/ipconfig.c
> [...]
> @@ -857,12 +848,12 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
>  	if (dev_hard_header(skb, dev, ntohs(skb->protocol),
>  			    dev->broadcast, dev->dev_addr, skb->len) < 0) {
>  		kfree_skb(skb);
> -		printk("E");
> +		pr_alert("E\n");
>  		return;
>  	}
>  
>  	if (dev_queue_xmit(skb) < 0)
> -		printk("E");
> +		pr_alert("E\n");

I'm not sure about this change. If after

	printk("E");
	printk("E");

both E are on the same line I'd say switching to pr_alert and adding \n
is bad. I don't know off-hand if that's the case, maybe Joe does?

> [...]
> diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
> index 7c67667..78f63f5 100644
> --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
> +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
> @@ -915,8 +915,7 @@ static inline void mangle_address(unsigned char *begin,
>  		}
>  
>  		if (debug)
> -			printk(KERN_DEBUG "bsalg: mapped %pI4 to %pI4\n",
> -			       &old, addr);
> +			pr_debug("bsalg: mapped %pI4 to %pI4\n", &old, addr);

This is also a change in behaviour. The removed line results in the
message making it into the kernel log buffer unconditionally (though
probably not on the console). The newly added line is a noop however
unless DEBUG is defined. This doesn't mean the change is bad, but at
least it's not in the scope for a trivial cleanup patch that just
converts existing code to the modern way with no intend to change
behaviour.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ