File 0001-logind-fix-sd_eviocrevoke-ioctl-call.patch of Package systemd.1472

Based on Message-ID: <20150122053054.GF18247@in.waw.pl>
From: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date: Thu, 22 Jan 2015 06:30:54 +0100
Subject: [HEADS-UP] [PATCH] logind: fix sd_eviocrevoke ioctl call

On Thu, Jan 22, 2015 at 11:36:02AM +1000, Peter Hutterer wrote:
> If the third argument is non-null, the kernel will always error out with
> EINVAL and devices won't get revoked.
>
> Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> ---
> Figured I send this to you guys directly instead of the list in case you
> want to label this as security bug and do the happy CVE dance and whatnot.
> If not, feel free to push directly.
No, life is too short. We should push it directly, though not today.
I'll give a heads-up to distribution people. I'll rebuild the Fedora
package tomorrow.

Looking at the kernel code, the bug seems obvious. I guess that not
that many people are using this, since otherwise there would be more
reports.

[BTW: If someone is rebuilding a package, they might want to also take
http://cgit.freedesktop.org/systemd/systemd/commit/?id=524daa8c3e .]

Zbyszek

---
 src/login/logind-session-device.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- src/login/logind-session-device.c
+++ src/login/logind-session-device.c	2015-01-22 11:56:35.662018482 +0000
@@ -107,7 +107,7 @@ static int sd_eviocrevoke(int fd) {
 
         assert(fd >= 0);
 
-        r = ioctl(fd, EVIOCREVOKE, 1);
+        r = ioctl(fd, EVIOCREVOKE, NULL);
         if (r < 0) {
                 r = -errno;
                 if (r == -EINVAL && !warned) {
openSUSE Build Service is sponsored by