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-next>] [day] [month] [year] [list]
Date:	Sat, 12 May 2007 11:18:45 +0800
From:	"Yin,Fengwei" <yfw.kernel@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: Is this a preempt issue in drivers/input/evdev.c

Hi,
When open/close evdev, the code is as following to handle multi-client
operation:
static int evdev_release(...)
{
	...
	if (!--evdev->open) {
		<------------preempted
		if (evdev->exist)
			input_close_device(...);
		else
			evdev_free(evdev);
	}
	return 0;
}

static int evdev_open(...)
{
	...
	if (!evdev->open++ && evdev->exist){
		errror = input_open_device(...);
		if (error) {
			...
		}
	}
	...
	return 0;
}

So if the evdev_release() is preempted at the point marked by another
process which will open the evdev, which will make operation sequence
like:

   --evdev->open in evdev_release()
         -----> preempted
	                            evdev->open++ and input_open_devie()
	 <----- reschedule 
	input_close_device()

Should we introduce a mutex here? Or do I miss something? Thanks.

Regards
Yin, Fengwei


	



-
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