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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Jan 2018 19:41:18 -0800
From:   Nick Desaulniers <nick.desaulniers@...il.com>
To:     akpm@...ux-foundation.org
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>,
        Matthew Wilcox <willy@...radead.org>,
        Nick Desaulniers <nick.desaulniers@...il.com>,
        Minchan Kim <minchan@...nel.org>,
        Nitin Gupta <ngupta@...are.org>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] zsmalloc: use U suffix for negative literals being shifted

Fixes warnings about shifting unsigned literals being undefined
behavior.

Suggested-by: Minchan Kim <minchan@...nel.org>
Signed-off-by: Nick Desaulniers <nick.desaulniers@...il.com>
---
Changes since v1:
* Use L suffix in addition to U, as suggested (link->next is unsigned long).

 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 683c065..b9040bd 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1057,7 +1057,7 @@ static void init_zspage(struct size_class *class, struct zspage *zspage)
 			 * Reset OBJ_TAG_BITS bit to last link to tell
 			 * whether it's allocated object or not.
 			 */
-			link->next = -1 << OBJ_TAG_BITS;
+			link->next = -1UL << OBJ_TAG_BITS;
 		}
 		kunmap_atomic(vaddr);
 		page = next_page;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ