netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] core: Don't attempt to load the "" driver.
@ 2014-09-02 13:48 David Laight
  2014-09-02 18:25 ` Cong Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: David Laight @ 2014-09-02 13:48 UTC (permalink / raw)
  To: Linux Netdev List, David Miller

Requests like 'ifconfig ""' cause dev_load(net, "") be called, since
request_module("") return 0 (success) this generates the error message:
"Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead."

Since dev_load() doesn't have to work, just ignore such names.
---

If you search for the above error message, you'll find a lot of complaints.
While the applications shouldn't be calling an SIOCxxx ioctl with ifr_name[0] == 0
the kernel shouldn't be tracing the error either.

Due to the complaints from users, this might be a backport candidate.

 net/core/dev_ioctl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index cf999e0..84edf16 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -358,6 +358,9 @@ void dev_load(struct net *net, const char *name)
 	struct net_device *dev;
 	int no_module;
 
+	if (!name[0])
+		return;
+
 	rcu_read_lock();
 	dev = dev_get_by_name_rcu(net, name);
 	rcu_read_unlock();
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-09-10 20:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 13:48 [PATCH net] core: Don't attempt to load the "" driver David Laight
2014-09-02 18:25 ` Cong Wang
2014-09-03  9:02   ` David Laight
2014-09-03 17:02     ` Cong Wang
2014-09-03 18:18       ` Stephen Hemminger
2014-09-02 21:03 ` David Miller
2014-09-03  8:55 ` [PATCH V2 " David Laight
2014-09-05 21:32   ` David Miller
2014-09-08 13:23     ` David Laight
2014-09-10  0:24       ` David Miller
2014-09-10  8:50         ` David Laight
2014-09-10 20:06           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).