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]
Message-Id: <20241112095449.461196-1-colin.i.king@gmail.com>
Date: Tue, 12 Nov 2024 09:54:49 +0000
From: Colin Ian King <colin.i.king@...il.com>
To: Hugh Dickins <hughd@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Gabriel Krisman Bertazi <gabriel@...sman.be>,
	Christian Brauner <brauner@...nel.org>,
	André Almeida <andrealmeid@...lia.com>,
	linux-mm@...ck.org
Cc: kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH][next] mm: shmem: Fix error checking on utf8_parse_version failures

Currently the error check on the call to utf8_parse_version is always
false because version is an unsigned int and this can never be less
than zero. Because version is required to be an unsigned int, fix the
issue by casting it to int just for the error check.

Fixes: 58e55efd6c72 ("tmpfs: Add casefold lookup support")
Signed-off-by: Colin Ian King <colin.i.king@...il.com>
---
 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 7987deb2be9b..b69e1d8816fa 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4377,7 +4377,7 @@ static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *
 				       "in the format: utf8-<version number>");
 
 		version = utf8_parse_version(version_str);
-		if (version < 0)
+		if ((int)version < 0)
 			return invalfc(fc, "Invalid UTF-8 version: %s", version_str);
 	}
 
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ