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]
Message-ID: <lsq.1575813165.786382069@decadent.org.uk>
Date:   Sun, 08 Dec 2019 13:53:50 +0000
From:   Ben Hutchings <ben@...adent.org.uk>
To:     linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC:     akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
        "Hillf Danton" <hdanton@...a.com>,
        "syzbot" <syzbot+62a1e04fd3ec2abf099e@...kaller.appspotmail.com>,
        "Andrey Konovalov" <andreyknvl@...gle.com>,
        "Jiri Kosina" <jkosina@...e.cz>
Subject: [PATCH 3.16 66/72] HID: hiddev: do cleanup in failure of opening
 a device

3.16.79-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Hillf Danton <hdanton@...a.com>

commit 6d4472d7bec39917b54e4e80245784ea5d60ce49 upstream.

Undo what we did for opening before releasing the memory slice.

Reported-by: syzbot <syzbot+62a1e04fd3ec2abf099e@...kaller.appspotmail.com>
Cc: Andrey Konovalov <andreyknvl@...gle.com>
Signed-off-by: Hillf Danton <hdanton@...a.com>
Signed-off-by: Jiri Kosina <jkosina@...e.cz>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
 drivers/hid/usbhid/hiddev.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -322,6 +322,10 @@ static int hiddev_open(struct inode *ino
 	return 0;
 bail_unlock:
 	mutex_unlock(&hiddev->existancelock);
+
+	spin_lock_irq(&list->hiddev->list_lock);
+	list_del(&list->node);
+	spin_unlock_irq(&list->hiddev->list_lock);
 bail:
 	file->private_data = NULL;
 	vfree(list);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ