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: <4FBB469B.50801@suse.cz>
Date:	Tue, 22 May 2012 09:56:11 +0200
From:	Jiri Slaby <jslaby@...e.cz>
To:	Hans de Goede <hdegoede@...hat.com>
CC:	Jiri Kosina <jkosina@...e.cz>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb-hid-core: Set intfdata to NULL if probe fails

On 05/21/2012 09:39 PM, Hans de Goede wrote:
> other drivers which rely on frameworks which only call dev_set_drvdata
> on the interface's device if no drvdata has been set

This looks very broken as it relies on an undocumented behavior. If they
want to do that they should:
* set intfdata to NULL
* call some hook that may set intfdata
* set intfdata to whatever they want if it is still NULL

Right?

What are those frameworks?

> Signed-off-by: Hans de Goede <hdegoede@...hat.com>
> ---
>  drivers/hid/usbhid/hid-core.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 5bf91db..70d760f 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -1296,6 +1296,7 @@ err_free:
>  	kfree(usbhid);
>  err:
>  	hid_destroy_device(hid);
> +	usb_set_intfdata(intf, NULL);
>  	return ret;
>  }
>  
> 
-- 
js
suse labs

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ