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:   Wed, 09 Sep 2020 11:09:56 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     allen.lkml@...il.com
Cc:     jes@...ined-monkey.org, kuba@...nel.org, dougmill@...ux.ibm.com,
        cooldavid@...ldavid.org, mlindner@...vell.com,
        stephen@...workplumber.org, borisp@...lanox.com,
        netdev@...r.kernel.org, romain.perier@...il.com
Subject: Re: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new
 tasklet_setup() API

From: Allen Pais <allen.lkml@...il.com>
Date: Wed,  9 Sep 2020 14:14:51 +0530

> @@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue)
>  }
>  
>  
> -static void ace_tasklet(unsigned long arg)
> +static void ace_tasklet(struct tasklet_struct *t)
>  {
> -	struct net_device *dev = (struct net_device *) arg;
> -	struct ace_private *ap = netdev_priv(dev);
> +	struct ace_private *ap = from_tasklet(ap, t, ace_tasklet);
> +	struct net_device *dev = (struct net_device *)((char *)ap -
> +				ALIGN(sizeof(struct net_device), NETDEV_ALIGN));
>  	int cur_size;
>  

I don't see this is as an improvement.  The 'dev' assignment looks so
incredibly fragile and exposes so many internal details about netdev
object allocation, alignment, and layout.

Who is going to find and fix this if someone changes how netdev object
allocation works?

I don't want to apply this, it sets a very bad precedent.  The existing
code is so much cleaner and easier to understand and audit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ