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  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:	Mon, 5 Oct 2015 16:23:01 +0800
From:	Hui Zhu <>
To:	<>, <>, <>,
CC:	<>, Hui Zhu <>
Subject: [PATCH] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

In function obj_malloc:
	if (!class->huge)
		/* record handle in the header of allocated chunk */
		link->handle = handle;
		/* record handle in first_page->private */
		set_page_private(first_page, handle);
The huge's page save handle to private directly.

But in obj_to_head:
	if (class->huge) {
		return page_private(page);
	} else
		return *(unsigned long *)obj;
It is used as a pointer.

So change obj_to_head use page_private(page) as value but not pointer
in obj_to_head.

Signed-off-by: Hui Zhu <>
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index f135b1b..e881d4f 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -824,7 +824,7 @@ static unsigned long obj_to_head(struct size_class *class, struct page *page,
 	if (class->huge) {
-		return *(unsigned long *)page_private(page);
+		return page_private(page);
 	} else
 		return *(unsigned long *)obj;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists