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>] [day] [month] [year] [list]
Date:   Thu, 12 Nov 2020 09:03:54 -0500
From:   Zhang Xiaoxu <zhangxiaoxu5@...wei.com>
To:     <zhangxiaoxu5@...wei.com>, <dhowells@...hat.com>,
        <jarkko@...nel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] watch_queue: Fix wrong return value of watch_queue_set_size()

If memory allocate failed, we should return -ENOMEM rather than 0.

Fixes: c73be61cede5 ("pipe: Add general notification queue support")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@...wei.com>
---
 kernel/watch_queue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
index 0ef8f65bd2d7..3084060a52d2 100644
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -247,6 +247,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
 	if (ret < 0)
 		goto error;
 
+	ret = -ENOMEM;
 	pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL);
 	if (!pages)
 		goto error;
-- 
2.25.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ