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: <20231130034017.1210429-1-suhui@nfschina.com>
Date:   Thu, 30 Nov 2023 11:40:18 +0800
From:   Su Hui <suhui@...china.com>
To:     nathan@...nel.org, ndesaulniers@...gle.com, trix@...hat.com
Cc:     Su Hui <suhui@...china.com>, akpm@...ux-foundation.org,
        willy@...radead.org, fmdefrancesco@...il.com, ira.weiny@...el.com,
        tony.luck@...el.com, jiaqiyan@...gle.com, pcc@...gle.com,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        kernel-janitors@...r.kernel.org
Subject: [PATCH] highmem: fix a memory copy problem in memcpy_from_folio

Clang static checker complains that value stored to 'from' is never read.
And memcpy_from_folio() only copy the last chunk memory from folio to
destination.
Using 'to += chunk' to replace 'from += chunk' to fix this typo problem.

Fixes: b23d03ef7af5 ("highmem: add memcpy_to_folio() and memcpy_from_folio()")
Signed-off-by: Su Hui <suhui@...china.com>
---
 include/linux/highmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 4cacc0e43b51..be20cff4ba73 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -454,7 +454,7 @@ static inline void memcpy_from_folio(char *to, struct folio *folio,
 		memcpy(to, from, chunk);
 		kunmap_local(from);
 
-		from += chunk;
+		to += chunk;
 		offset += chunk;
 		len -= chunk;
 	} while (len > 0);
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ