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  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, 29 Mar 2014 13:16:36 +0100
From:	Elias Vanderstuyft <>
Cc:	Elias Vanderstuyft <>,
	Anssi Hannula <>,
	Michal Malý <>,,
Subject: [PATCH v2 1/1] Input: don't modify the id of ioctl-provided ff effect on upload failure

If a new (id == -1) ff effect was uploaded from userspace,
ff-core.c::input_ff_upload() will have assigned
a positive number to the new effect id.
Currently, evdev.c::evdev_do_ioctl() will save this new id to userspace,
regardless of whether the upload succeeded or not.

On upload failure, this can be confusing because the dev->ff->effects[] array
will not contain an element at the index of that new effect id.

This patch fixes this by leaving the id unchanged after upload fails.

Note: Unfortunately applications should still expect changed effect id for
quite some time.

This has been discussed on:
("ff-core effect id handling in case of a failed effect upload")

Suggested-by: Dmitry Torokhov <>
Signed-off-by: Elias Vanderstuyft <>
Cc: Anssi Hannula <>
Cc: Michal Malý <>
  Only added one line to the commit message to say
  what this patch actually does,
  instead of only stating the reason why it's submitted.

 drivers/input/evdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index a06e125..ce953d8 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -954,11 +954,13 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
 			return -EFAULT;
 		error = input_ff_upload(dev, &effect, file);
+		if (error)
+			return error;
 		if (put_user(, &(((struct ff_effect __user *)p)->id)))
 			return -EFAULT;
-		return error;
+		return 0;
 	/* Multi-number variable-length handlers */

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists