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]
Date:   Thu,  8 Sep 2022 14:17:30 -0700
From:   "Yichun Zhang (agentzh)" <yichun@...nresty.com>
To:     linux-fsdevel@...r.kernel.org
Cc:     "Yichun Zhang (agentzh)" <yichun@...nresty.com>,
        Colin Ian King <colin.i.king@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org
Subject: [PATCH] relay: replay_file_open(): NULL ptr deref in CPU hotplugs

CPU hotplug may introduce race conditions. We reproduced kernel panics
due to this NULL ptr deref error when doing frequent random CPU hotplugs
in a KVM guest.

Signed-off-by: Yichun Zhang (agentzh) <yichun@...nresty.com>
---
 kernel/relay.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/relay.c b/kernel/relay.c
index 6a611e779e95..2db69fd527d1 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -816,6 +816,9 @@ EXPORT_SYMBOL_GPL(relay_flush);
 static int relay_file_open(struct inode *inode, struct file *filp)
 {
 	struct rchan_buf *buf = inode->i_private;
+	if (unlikely(buf == NULL))
+		return -ENOENT;
+
 	kref_get(&buf->kref);
 	filp->private_data = buf;
 
-- 
2.17.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ