From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9F2E3159C9B for ; Fri, 9 Aug 2024 10:06:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 272EB2BC0A1; Fri, 9 Aug 2024 10:06:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0BFE22BC0A1 for ; Fri, 9 Aug 2024 10:06:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 207793430BC for ; Fri, 9 Aug 2024 10:06:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AD89F1E9C for ; Fri, 9 Aug 2024 10:06:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1723197976.599d8c41b144596764b33d87d09f80948652ed92.sam@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: dumpelf.c X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 599d8c41b144596764b33d87d09f80948652ed92 X-VCS-Branch: master Date: Fri, 9 Aug 2024 10:06:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6103d4a8-e6df-4994-a574-09999d92f3d3 X-Archives-Hash: f44896faf0505e4934092a7bfe0bbbc7 commit: 599d8c41b144596764b33d87d09f80948652ed92 Author: Mike Frysinger gentoo org> AuthorDate: Fri Jan 26 03:57:24 2024 +0000 Commit: Sam James gentoo org> CommitDate: Fri Aug 9 10:06:16 2024 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=599d8c41 dumpelf: improve note memory check Make sure the entire structure fits within the bounds of memory, not just the start of it. Bug: https://bugs.gentoo.org/922906 Signed-off-by: Mike Frysinger gentoo.org> (cherry picked from commit a5298c41c27a35a5c2dcca0723c808029d241953) Signed-off-by: Sam James gentoo.org> dumpelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumpelf.c b/dumpelf.c index 6ce8403..b88be0c 100644 --- a/dumpelf.c +++ b/dumpelf.c @@ -232,7 +232,7 @@ static void dump_notes(const elfobj *elf, size_t B, const void *memory, const vo } printf("\n\t/%c note section dump:\n", '*'); - for (i = 0; ndata < memory_end && !corrupt; ++i) { + for (i = 0; ndata < memory_end - sizeof(*note) && !corrupt; ++i) { note = ndata; namesz = EGET(note->n_namesz); descsz = EGET(note->n_descsz);