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: <20190718080903.22622-1-daniel.vetter@ffwll.ch>
Date:   Thu, 18 Jul 2019 10:09:03 +0200
From:   Daniel Vetter <daniel.vetter@...ll.ch>
To:     Intel Graphics Development <intel-gfx@...ts.freedesktop.org>
Cc:     Daniel Vetter <daniel.vetter@...ll.ch>,
        Jens Remus <jremus@...ux.ibm.com>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-fbdev@...r.kernel.org, linux-s390@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Nicolas Pitre <nicolas.pitre@...aro.org>,
        Martin Hostettler <textshell@...uujin.de>,
        Adam Borowski <kilobyte@...band.pl>,
        Mikulas Patocka <mpatocka@...hat.com>,
        Daniel Vetter <daniel.vetter@...el.com>,
        Sam Ravnborg <sam@...nborg.org>
Subject: [PATCH] vt: Grab console_lock around con_is_bound in show_bind

Not really harmful not to, but also not harm in grabbing the lock. And
this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt:
More locking checks").

Reported-by: Jens Remus <jremus@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org
Cc: linux-fbdev@...r.kernel.org
Cc: linux-s390@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Nicolas Pitre <nicolas.pitre@...aro.org>
Cc: Martin Hostettler <textshell@...uujin.de>
Cc: Adam Borowski <kilobyte@...band.pl>
Cc: Mikulas Patocka <mpatocka@...hat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@...el.com>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: Sam Ravnborg <sam@...nborg.org>
---
 drivers/tty/vt/vt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index ec92f36ab5c4..34aa39d1aed9 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr,
 			 char *buf)
 {
 	struct con_driver *con = dev_get_drvdata(dev);
-	int bind = con_is_bound(con->con);
+	int bind;
+
+	console_lock();
+	bind = con_is_bound(con->con);
+	console_unlock();
 
 	return snprintf(buf, PAGE_SIZE, "%i\n", bind);
 }
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ