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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 19 Sep 2015 10:39:20 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	cpaul@...hat.com
Cc:	David Herrmann <dh.herrmann@...il.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
	Linux API <linux-api@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Arnd Bergmann <arnd@...db.de>, Joe Perches <joe@...ches.com>,
	Jiri Slaby <jslaby@...e.com>,
	Vishnu Patekar <vishnupatekar0510@...il.com>,
	Sebastian Ott <sebott@...ux.vnet.ibm.com>,
	Benjamin Tissoires <benjamin.tissoires@...hat.com>,
	Hans de Goede <hdegoede@...hat.com>,
	linux-doc@...r.kernel.org
Subject: Re: [PATCH v5] Input: Add userio module

Hi Stephen,

On Thu, Sep 17, 2015 at 07:00:10PM -0400, cpaul@...hat.com wrote:
> 				   Responses
> * Re: if (!userio) in userio_device_write(): it happens if we close the file
>   descriptor while the input driver is trying to talk to the device, since we
>   can't immediately bring down the driver. Removing the condition breaks the
>   driver

...

> +/**
> + * userio_device_write - Write data from serio to a userio device in userspace
> + * @id: The serio port for the userio device
> + * @val: The data to write to the device
> + */
> +static int userio_device_write(struct serio *id, unsigned char val)
> +{
> +	struct userio_device *userio = id->port_data;
> +
> +	if (!userio)
> +		return -1;

1. I do not see where we reset port data.
2. I do not see what prevents object to which you now have a pointer to
from disappearing at any moment past your check.

> +
> +	mutex_lock(&userio->lock);

serio_write() must allow to be called from interrupt context, so you
can't use mutex here.

Thanks.

-- 
Dmitry
--
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