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-next>] [day] [month] [year] [list]
Message-Id: <1405596491-5881-1-git-send-email-vfalico@gmail.com>
Date:	Thu, 17 Jul 2014 13:28:09 +0200
From:	Veaceslav Falico <vfalico@...il.com>
To:	netdev@...r.kernel.org
Cc:	"David S. Miller" <davem@...emloft.net>,
	Jason Baron <jbaron@...mai.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Vlad Yasevich <vyasevic@...hat.com>,
	stephen hemminger <stephen@...workplumber.org>,
	Jerry Chu <hkchu@...gle.com>,
	Ben Hutchings <bhutchings@...arflare.com>,
	Veaceslav Falico <vfalico@...il.com>
Subject: [PATCH net-next 0/2] net: print net_device name/state more often

Hi,

Currently we use net_device->name only if it's the NETREG_REGISTERED
reg_state, otherwise we return "(unregistered device)".

However, we always populate net_device->name on creation, so it's always
available to us for use. The only caveat is that we might have a name like
"eth%d", in which case we cannot use it as it might change in the future.

Also, the net_device might not be NETREG_UNREGISTERED when the function is
called (_UNINITIALIZED, _UNREGISTERING, _RELEASED, _DUMMY), so it's
misleading.

So, a better way would be to always return the dev->name in netdev_name(),
unless it's in the form of "eth%d", then return "unnamed net_device". This
way we'll always return the name in NETREG_REGISTERED reg_state, and also
return it in other states, when possible.

Also, to be more verbose on non-NETREG_REGISTERED states, add a function
netdev_reg_state(), which returns a string describing the state, and use it
in netdev_printk()-related functions. If the dev is in NETREG_REGISTERED
state then a void string is regurned and, thus, nothing changes.

After these two patches we'll have the same behaviour in the usual cases,
and more verbose in non-standardad/buggy ones.

CC: "David S. Miller" <davem@...emloft.net>
CC: Jason Baron <jbaron@...mai.com>
CC: Eric Dumazet <edumazet@...gle.com>
CC: Vlad Yasevich <vyasevic@...hat.com>
CC: stephen hemminger <stephen@...workplumber.org>
CC: Jerry Chu <hkchu@...gle.com>
CC: Ben Hutchings <bhutchings@...arflare.com>
Signed-off-by: Veaceslav Falico <vfalico@...il.com>

---
 include/linux/netdevice.h | 21 ++++++++++++++++++---
 lib/dynamic_debug.c       |  8 +++++---
 net/core/dev.c            |  8 +++++---
 3 files changed, 28 insertions(+), 9 deletions(-)
--
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