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>] [day] [month] [year] [list]
Message-ID: <17d0ecdc-9dbc-4f9f-9da1-eb37199060f5@web.de>
Date: Thu, 30 Oct 2025 19:56:54 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-arm-kernel@...ts.infradead.org, Russell King <linux@...linux.org.uk>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Miaoqian Lin <linmq006@...il.com>
Subject: [PATCH] ARM: ecard: Use pointers from memcpy() calls for assignments
 in ecard_init_pgtables()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 30 Oct 2025 19:50:08 +0100

Pointers were assigned to a variable. The same pointer was used for
the destination parameter of two memcpy() calls.
This function is documented in the way that the same value is returned.
Thus convert separate statements into direct variable assignments for
the return values from memory copy actions.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/arm/mach-rpc/ecard.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index 2cde4c83b7f9..879c201b754e 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -229,14 +229,12 @@ static void ecard_init_pgtables(struct mm_struct *mm)
 	pgd_t *src_pgd, *dst_pgd;
 
 	src_pgd = pgd_offset(mm, (unsigned long)IO_BASE);
-	dst_pgd = pgd_offset(mm, IO_START);
-
-	memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE));
+	dst_pgd = memcpy(pgd_offset(mm, IO_START), src_pgd,
+			 sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE));
 
 	src_pgd = pgd_offset(mm, (unsigned long)EASI_BASE);
-	dst_pgd = pgd_offset(mm, EASI_START);
-
-	memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE));
+	dst_pgd = memcpy(pgd_offset(mm, EASI_START), src_pgd,
+			 sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE));
 
 	flush_tlb_range(&vma, IO_START, IO_START + IO_SIZE);
 	flush_tlb_range(&vma, EASI_START, EASI_START + EASI_SIZE);
-- 
2.51.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ