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, 21 Dec 2017 16:54:17 +0100
From:   Vasyl Gomonovych <gomonovych@...il.com>
To:     viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
        gomonovych@...il.com
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] epoll: fix dereferenced before check pt

This patch fixes the warning reported by smatch:

fs/eventpoll.c:889 ep_item_poll() warn: variable dereferenced before check 'pt'

Signed-off-by: Vasyl Gomonovych <gomonovych@...il.com>
---
 fs/eventpoll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index afd548ebc328..fc772a1f1396 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -879,7 +879,8 @@ static unsigned int ep_item_poll(struct epitem *epi, poll_table *pt, int depth)
 	struct eventpoll *ep;
 	bool locked;
 
-	pt->_key = epi->event.events;
+	if (pt)
+		pt->_key = epi->event.events;
 	if (!is_file_epoll(epi->ffd.file))
 		return epi->ffd.file->f_op->poll(epi->ffd.file, pt) &
 		       epi->event.events;
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ