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]
Date:	Thu, 17 Jul 2014 17:24:18 +0200
From:	Veaceslav Falico <vfalico@...il.com>
To:	David Laight <David.Laight@...LAB.COM>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"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>,
	Tom Gundersen <teg@...m.no>
Subject: Re: [PATCH v2 net-next 0/2] net: print net_device name/state more
 often

On Thu, Jul 17, 2014 at 02:48:17PM +0000, David Laight wrote:
>From: Veaceslav Falico
>> 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.
>
>While you've got this code out on the operating table what about:

I don't think these ideas fit into the current patchset, as it's somehow
unrelated to the "lets give the real name/state when possible".

However, I like them, see below.

>1) Tracing the renames into the kernel message buffer.

I think you can enable it already. dev_change_name() (net's function to
change net_device name) calls device_rename(), which handles the device
renaming, and it has:

1805         dev_dbg(dev, "renaming to %s\n", new_name);

It can be easily enabled if you have dynamic debug compiled in.

However, indeed, it might be a good info to watch for, and a pretty simple
patch, which might be useful.

diff --git a/net/core/dev.c b/net/core/dev.c
index 239722a..d14ebf0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1113,6 +1113,9 @@ int dev_change_name(struct net_device *dev, const char *newname)
 		return err;
 	}
 
+	if (oldname[0] && !strchr(oldname, '%'))
+		netdev_info(dev, "renamed from %s\n", oldname);
+
 	old_assign_type = dev->name_assign_type;
 	dev->name_assign_type = NET_NAME_RENAMED;
 

>2) Including the original name in some of the kernel traces.

The only possible use-case of that, from what I can see (with the patch
from 1) ) - is in the renaming functions themselves, which have already
quite a few output sources and, tbh, it's a really rare situation to
implenment tracking of renames in-kernel.

>
>I've been trying to diagnose some issues on a system that renames
>its interfaces, and it can get tricky working out which interface
>messages refer to.
>
>	David
>
>
>
--
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