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, 6 Sep 2012 22:46:00 +0200
From:	Fabio Baltieri <fabio.baltieri@...il.com>
To:	Oliver Hartkopp <socketcan@...tkopp.net>
Cc:	Kurt Van Dijck <kurt.van.dijck@....be>,
	Marc Kleine-Budde <mkl@...gutronix.de>,
	Wolfgang Grandegger <wg@...ndegger.com>,
	linux-kernel@...r.kernel.org, linux-can@...r.kernel.org
Subject: Re: [PATCH] can: rename LED trigger name on netdev renames

On Thu, Sep 06, 2012 at 09:31:07PM +0200, Oliver Hartkopp wrote:
> >> +
> >> +/*
> >> + * NETDEV rename notifier to rename the associated led triggers too
> >> + */
> >> +static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
> >> +			void *data)
> >> +{
> >> +	struct net_device *netdev = (struct net_device *)data;
> >> +	struct can_priv *priv = netdev_priv(netdev);
> >> +	int busy = 0;
> >> +
> >> +	if (!net_eq(dev_net(netdev), &init_net))
> >> +		return NOTIFY_DONE;
> >> +
> >> +	if (netdev->type != ARPHRD_CAN)
> >> +		return NOTIFY_DONE;
> >> +
> >> +	if (msg != NETDEV_CHANGENAME)
> >> +		return NOTIFY_DONE;
> > 
> > That's the main problem, which I also got stuck into when I did my first
> > can-led implementation.  As LED structures are in netdev's private data,
> > you can only use it if your driver is based on the can-dev API, and
> > there are no way to be sure of that if you get outside driver's code
> > itself.
> > 
> > This would give problems with vcan, slcan, and probabily other
> > non-mainlined drivers.
> 
> 
> Do you think, this is really a problem?
> 
> If a driver decides not to use the can-dev framework it has to implement own
> solutions or just adopt can-dev.

Agreed, but this still means that we can't assume that
netdev_priv(netdev) to a netdev where netdev->type == ARPHRD_CAN points
to a struct can_priv, right?

Fabio
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ