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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 8 Jul 2010 18:24:20 +0400
From:	Kulikov Vasiliy <segooon@...il.com>
To:	dkirjanov@...nel.org
Cc:	Kernel Janitors <kernel-janitors@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	John Linn <john.linn@...inx.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Jiri Pirko <jpirko@...hat.com>,
	Brian Hill <brian.hill@...inx.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 3/4] ll_temac: free everything on error path

> I just sent a patch that fixes this.
Hey, you forgot to CC me/kernel-janitors in your patch.

Anyway,
> /**
>+ *  * temac_dma_bd_release - Release buffer descriptor rings
>+ */
>+static void temac_dma_bd_release(struct net_device *ndev)
>+{
>+   struct temac_local *lp = netdev_priv(ndev);
>+   int i;
>+
>+   for (i = 0; i < RX_BD_NUM; i++) {
>+       if (lp->rx_skb[i]) {
            ^^^^^^^^^^
This can be NULL if kzalloc() failed.
>+           dma_unmap_single(ndev->dev.parent, lp->rx_bd_v[i].phys,
>+                   XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
>+           dev_kfree_skb(lp->rx_skb[i]);
>+       }
>+   }
>+   dma_free_coherent(ndev->dev.parent, sizeof(*lp->rx_bd_v) * RX_BD_NUM,
>+           lp->rx_bd_v, lp->rx_bd_p);
>+   dma_free_coherent(ndev->dev.parent, sizeof(*lp->tx_bd_v) * TX_BD_NUM,
>+           lp->tx_bd_v, lp->tx_bd_p);

These two DMA's can be unallocated if dma_alloc_coherent() failed.

I wanted to introduce many labels to divide these error cases because of it.

>+   kfree(lp->rx_skb);
>+}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ