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>] [day] [month] [year] [list]
Date:	Sat, 14 May 2011 22:58:08 +0200
From:	Oliver Neukum <oliver@...kum.org>
To:	linux-usb@...r.kernel.org, netdev@...r.kernel.org,
	Alexey Orishko <alexey.orishko@...ricsson.com>
Subject: strange code in cdc-ncm

Hi,

I was looking at this code:

static void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf)
{
	struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
	struct usb_driver *driver;

	if (ctx == NULL)
		return;		/* no setup */

	driver = driver_of(intf);

	usb_set_intfdata(ctx->data, NULL);
	usb_set_intfdata(ctx->control, NULL);
	usb_set_intfdata(ctx->intf, NULL);

	/* release interfaces, if any */
	if (ctx->data_claimed) {
		usb_driver_release_interface(driver, ctx->data);
		ctx->data_claimed = 0;
	}

	if (ctx->control_claimed) {
		usb_driver_release_interface(driver, ctx->control);
		ctx->control_claimed = 0;
	}

It seems a bit strange to me. If you may or may not have claimed an interface,
how can you unconditionally zero out intfdata?

	Regards
		Oliver
--
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