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: Sun, 18 Feb 2024 14:57:50 +0800
From: liqiang <liqiang64@...wei.com>
To: <akpm@...ux-foundation.org>, <ying.huang@...el.com>,
	<paulmck@...ux.vnet.ibm.com>, <neilb@...e.de>, <chuck.lever@...cle.com>
CC: <linux-kernel@...r.kernel.org>
Subject: [RESEND PATCH] llist: Make llist_del_first return only the first node

Set the next of the returned node of llist_del_first
to NULL, which can prevent subsequent nodes in llist
from being exposed, and is more consistent with the
logic of this interface.

Signed-off-by: liqiang <liqiang64@...wei.com>
---
 lib/llist.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/llist.c b/lib/llist.c
index f21d0cf..c33fff5 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -61,6 +61,7 @@ struct llist_node *llist_del_first(struct llist_head *head)
 		next = READ_ONCE(entry->next);
 	} while (!try_cmpxchg(&head->first, &entry, next));
 
+	entry->next = NULL;
 	return entry;
 }
 EXPORT_SYMBOL_GPL(llist_del_first);
-- 
2.23.0.windows.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ