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]
Message-Id: <20220122094827.684542-1-dzm91@hust.edu.cn>
Date:   Sat, 22 Jan 2022 17:48:26 +0800
From:   Dongliang Mu <dzm91@...t.edu.cn>
To:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Salah Triki <salah.triki@...il.com>
Cc:     Dongliang Mu <mudongliangabcd@...il.com>,
        syzkaller <syzkaller@...glegroups.com>,
        Jiri Kosina <jkosina@...e.cz>, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] hid: elo: fix memory leak in elo_probe

From: Dongliang Mu <mudongliangabcd@...il.com>

When hid_parse in elo_probe fails, it forgets to call usb_put_dev to
decrease the refcount.

Fix this by adding usb_put_dev in the error handling code of elo_probe

Fixes: fbf42729d0e9 ("HID: elo: update the reference count of the usb device structure")
Reported-by: syzkaller <syzkaller@...glegroups.com>
Signed-off-by: Dongliang Mu <mudongliangabcd@...il.com>
---
 drivers/hid/hid-elo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c
index 8e960d7b233b..9b42b0cdeef0 100644
--- a/drivers/hid/hid-elo.c
+++ b/drivers/hid/hid-elo.c
@@ -262,6 +262,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
 
 	return 0;
 err_free:
+	usb_put_dev(udev);
 	kfree(priv);
 	return ret;
 }
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ