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:	Sat, 28 Apr 2012 22:18:32 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	tom.leiming@...il.com
Cc:	gregkh@...uxfoundation.org, netdev@...r.kernel.org,
	linux-usb@...r.kernel.org, huajun.li.lee@...il.com,
	oneukum@...e.de, stable@...nel.org
Subject: Re: [PATCH] usbnet: fix skb traversing races during unlink

From: Ming Lei <tom.leiming@...il.com>
Date: Fri, 27 Apr 2012 18:21:35 +0800

> +/*The caller must hold list->lock*/

Please put spaces in your comments, like this:

/* The caller must hold list->lock */

> +
> +		/*speedup unlink by blocking resubmit*/

Same here.
>  
> -		entry = (struct skb_data *) skb->cb;
> +		skb_queue_walk(q, skb) {
> +			entry = (struct skb_data *) skb->cb;
> +			if (entry->state != unlink_start)
> +				break;
> +		}
> +		if (skb == (struct sk_buff *)q)
> +			break;

Please do not expose the internal details of SKB lists
with a test like this.  Eventually this will all be
converted to struct list_head and this kind of test
will cause unnecessary pain for such a conversion.

Instead, code it like this, as you would for a loop
using list_for_each*() or similar:

	skb_queue_walk(q, skb) {
		if (condition)
			goto found;
	}
	/* No matching entry. */
	break;
found:

Thanks.
--
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