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: <ad42871b-22a6-4819-b5db-835e7044b3f1@web.de>
Date: Thu, 30 Oct 2025 21:51:00 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linuxppc-dev@...ts.ozlabs.org, kvm@...r.kernel.org,
 Alexander Graf <agraf@...e.de>,
 Christophe Leroy <christophe.leroy@...roup.eu>,
 Madhavan Srinivasan <maddy@...ux.ibm.com>,
 Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Miaoqian Lin <linmq006@...il.com>
Subject: [PATCH] KVM: PPC: Use pointer from memcpy() call for assignment in
 kvmppc_kvm_pv()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 30 Oct 2025 21:43:20 +0100
Subject: [PATCH] KVM: PPC: Use pointer from memcpy() call for assignment in kvmppc_kvm_pv()

A pointer was assigned to a variable. The same pointer was used for
the destination parameter of a memcpy() call.
This function is documented in the way that the same value is returned.
Thus convert two separate statements into a direct variable assignment for
the return value from a memory copy action.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/powerpc/kvm/powerpc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 2ba057171ebe..ae28447b3e04 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -216,8 +216,7 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
 
 			shared &= PAGE_MASK;
 			shared |= vcpu->arch.magic_page_pa & 0xf000;
-			new_shared = (void*)shared;
-			memcpy(new_shared, old_shared, 0x1000);
+			new_shared = memcpy(shared, old_shared, 0x1000);
 			vcpu->arch.shared = new_shared;
 		}
 #endif
-- 
2.51.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ