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]
Message-ID: <20241123094729.1099378-2-mjguzik@gmail.com>
Date: Sat, 23 Nov 2024 10:47:28 +0100
From: Mateusz Guzik <mjguzik@...il.com>
To: tglx@...utronix.de,
	bp@...en8.de,
	andy@...nel.org,
	akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org,
	x86@...nel.org,
	Mateusz Guzik <mjguzik@...il.com>
Subject: [PATCH 1/2] x86/callthunks: s/bcmp/memcmp/

bcmp() is implemented as a call to memcmp() and callthunks is the only
consumer.

Use memcmp() directly so that bcmp() can get retired.

Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
---
 arch/x86/kernel/callthunks.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c
index 465647456753..dda60b91944f 100644
--- a/arch/x86/kernel/callthunks.c
+++ b/arch/x86/kernel/callthunks.c
@@ -188,11 +188,11 @@ static void *patch_dest(void *dest, bool direct)
 	apply_relocation(insn_buff, pad, tsize, skl_call_thunk_template, tsize);
 
 	/* Already patched? */
-	if (!bcmp(pad, insn_buff, tsize))
+	if (!memcmp(pad, insn_buff, tsize))
 		return pad;
 
 	/* Ensure there are nops */
-	if (bcmp(pad, nops, tsize)) {
+	if (memcmp(pad, nops, tsize)) {
 		pr_warn_once("Invalid padding area for %pS\n", dest);
 		return NULL;
 	}
@@ -309,7 +309,7 @@ static bool is_callthunk(void *addr)
 	memcpy(insn_buff, skl_call_thunk_template, tmpl_size);
 	apply_relocation(insn_buff, pad, tmpl_size, skl_call_thunk_template, tmpl_size);
 
-	return !bcmp(pad, insn_buff, tmpl_size);
+	return !memcmp(pad, insn_buff, tmpl_size);
 }
 
 int x86_call_depth_emit_accounting(u8 **pprog, void *func, void *ip)
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ