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:	Mon, 31 Mar 2008 23:02:46 +0200
From:	Johannes Berg <johannes@...solutions.net>
To:	Björn Steinbrink <B.Steinbrink@....de>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Arjan van de Ven <arjan@...ux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Jiri Kosina <jkosina@...e.cz>
Subject: Re: [PATCH] evdev: Release eventual input device grabs when
	getting disconnected


> --- a/drivers/input/evdev.c
> +++ b/drivers/input/evdev.c
> @@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev)
>  	evdev_hangup(evdev);
>  	evdev_remove_chrdev(evdev);
>  
> +	if (evdev->grab)
> +		evdev_ungrab(evdev, evdev->grab);
> +

You might want to insert a comment about why this is safe and doesn't
race since it's not entirely trivial to see because everything else that
manipulates the grab needs to take the mutex. In fact, I'm not entirely
sure it's race-free but at least it can't race against the ioctl handler
because by this time ->exist will be 0.

johannes

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ