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]
Message-ID: <20201008165859.2e96ef7c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Thu, 8 Oct 2020 16:58:59 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Allen Pais <allen.lkml@...il.com>
Cc:     davem@...emloft.net, m.grzeschik@...gutronix.de, paulus@...ba.org,
        oliver@...kum.org, woojung.huh@...rochip.com,
        UNGLinuxDriver@...rochip.com, petkan@...leusys.com,
        netdev@...r.kernel.org, Allen Pais <apais@...ux.microsoft.com>,
        Romain Perier <romain.perier@...il.com>
Subject: Re: [next-next v3 05/10] net: cdc_ncm: convert tasklets to use new
 tasklet_setup() API

On Tue,  6 Oct 2020 11:41:54 +0530 Allen Pais wrote:
> From: Allen Pais <apais@...ux.microsoft.com>
> 
> In preparation for unconditionally passing the
> struct tasklet_struct pointer to all tasklet
> callbacks, switch to using the new tasklet_setup()
> and from_tasklet() to pass the tasklet pointer explicitly.

> @@ -815,7 +815,7 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
>  
>  	hrtimer_init(&ctx->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>  	ctx->tx_timer.function = &cdc_ncm_tx_timer_cb;
> -	tasklet_init(&ctx->bh, cdc_ncm_txpath_bh, (unsigned long)dev);
> +	tasklet_setup(&ctx->bh, cdc_ncm_txpath_bh);
>  	atomic_set(&ctx->stop, 0);
>  	spin_lock_init(&ctx->mtx);
>  
> @@ -1468,9 +1468,9 @@ static enum hrtimer_restart cdc_ncm_tx_timer_cb(struct hrtimer *timer)
>  	return HRTIMER_NORESTART;
>  }
>  
> -static void cdc_ncm_txpath_bh(unsigned long param)
> +static void cdc_ncm_txpath_bh(struct tasklet_struct *t)
>  {
> -	struct usbnet *dev = (struct usbnet *)param;
> +	struct usbnet *dev = from_tasklet(dev, t, bh);
>  	struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
>  
>  	spin_lock_bh(&ctx->mtx);

This one is wrong.

ctx is struct cdc_ncm_ctx, but you from_tasklet() struct usbdev.
They both happen to have a tasklet called bh in 'em.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ