From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>,
Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: Re: [PATCH] can: ems_usb: fix a leak in ems_usb_start_xmit()
Date: Fri, 06 Dec 2013 23:28:12 +0100 [thread overview]
Message-ID: <6e046a57-0383-41ae-bc8c-8eaaa4709a4c@email.android.com> (raw)
In-Reply-To: <1386363082-15144-1-git-send-email-khoroshilov@ispras.ru>
Alexey Khoroshilov <khoroshilov@ispras.ru> schrieb:
>There is spare code with obvious misprint in ems_usb_start_xmit():
>usb_free_urb() should be used to deallocate urb instead of
>usb_unanchor_urb().
>
>Found by Linux Driver Verification project (linuxtesting.org).
>
>Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>---
> drivers/net/can/usb/ems_usb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/can/usb/ems_usb.c
>b/drivers/net/can/usb/ems_usb.c
>index 5f9a7ad9b964..beae1ec255f4 100644
>--- a/drivers/net/can/usb/ems_usb.c
>+++ b/drivers/net/can/usb/ems_usb.c
>@@ -798,7 +798,7 @@ static netdev_tx_t ems_usb_start_xmit(struct
>sk_buff *skb, struct net_device *ne
> * allowed (MAX_TX_URBS).
> */
> if (!context) {
>- usb_unanchor_urb(urb);
>+ usb_free_urb(urb);
> usb_free_coherent(dev->udev, size, buf, urb->transfer_dma);
>
looks like you are introducing a new use after free problem here ...
> netdev_warn(netdev, "couldn't find free context\n");
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
next prev parent reply other threads:[~2013-12-06 22:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 20:51 Alexey Khoroshilov
2013-12-06 22:28 ` Oliver Hartkopp [this message]
2013-12-06 22:57 ` Alexey Khoroshilov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e046a57-0383-41ae-bc8c-8eaaa4709a4c@email.android.com \
--to=socketcan@hartkopp.net \
--cc=khoroshilov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®