netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.31-rc5] can: fix oops caused by wrong rtnl newlink usage
@ 2009-08-11 12:41 Oliver Hartkopp
  2009-08-13 23:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hartkopp @ 2009-08-11 12:41 UTC (permalink / raw)
  To: David Miller
  Cc: Patrick McHardy, Wolfgang Grandegger, Linux Netdev List,
	Dmitry Eremin-Solenikov

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

For 'real' hardware CAN devices the netlink interface is used to set CAN
specific communication parameters. Real CAN hardware can not be created with
the ip tool ...

The invocation of 'ip link add type can' lead to an oops as the standard rtnl
newlink function was called:

http://bugzilla.kernel.org/show_bug.cgi?id=13954

This patch adds a private newlink function for the CAN device driver interface
that unconditionally returns -EOPNOTSUPP.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
CC: Wolfgang Grandegger <wg@grandegger.com>

---

[-- Attachment #2: can_newlink_oops_fix.patch --]
[-- Type: text/x-patch, Size: 616 bytes --]

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 9e4283a..e1a4f82 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -611,11 +611,18 @@ nla_put_failure:
 	return -EMSGSIZE;
 }
 
+static int can_newlink(struct net_device *dev,
+		       struct nlattr *tb[], struct nlattr *data[])
+{
+	return -EOPNOTSUPP;
+}
+
 static struct rtnl_link_ops can_link_ops __read_mostly = {
 	.kind		= "can",
 	.maxtype	= IFLA_CAN_MAX,
 	.policy		= can_policy,
 	.setup		= can_setup,
+	.newlink	= can_newlink,
 	.changelink	= can_changelink,
 	.fill_info	= can_fill_info,
 	.fill_xstats	= can_fill_xstats,

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

* Re: [PATCH 2.6.31-rc5] can: fix oops caused by wrong rtnl newlink usage
  2009-08-11 12:41 [PATCH 2.6.31-rc5] can: fix oops caused by wrong rtnl newlink usage Oliver Hartkopp
@ 2009-08-13 23:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-08-13 23:33 UTC (permalink / raw)
  To: oliver; +Cc: kaber, wg, netdev, dbaryshkov

From: Oliver Hartkopp <oliver@hartkopp.net>
Date: Tue, 11 Aug 2009 14:41:24 +0200

> For 'real' hardware CAN devices the netlink interface is used to set CAN
> specific communication parameters. Real CAN hardware can not be created with
> the ip tool ...
> 
> The invocation of 'ip link add type can' lead to an oops as the standard rtnl
> newlink function was called:
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=13954
> 
> This patch adds a private newlink function for the CAN device driver interface
> that unconditionally returns -EOPNOTSUPP.
> 
> Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
> Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

Applied to net-2.6

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

end of thread, other threads:[~2009-08-13 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 12:41 [PATCH 2.6.31-rc5] can: fix oops caused by wrong rtnl newlink usage Oliver Hartkopp
2009-08-13 23:33 ` 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).