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: <175551260332.1420.6289156509216446637.tip-bot2@tip-bot2>
Date: Mon, 18 Aug 2025 10:23:23 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: perf/core] perf: Remove redundant condition for AUX buffer size

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     e8c4f6ee8eeed8e02800bed6afb9aa22fc3476a1
Gitweb:        https://git.kernel.org/tip/e8c4f6ee8eeed8e02800bed6afb9aa22fc3476a1
Author:        Thomas Gleixner <tglx@...utronix.de>
AuthorDate:    Tue, 12 Aug 2025 12:38:59 +02:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Fri, 15 Aug 2025 13:12:58 +02:00

perf: Remove redundant condition for AUX buffer size

It is already checked whether the VMA size is the same as
nr_pages * PAGE_SIZE, so later checking both:

      aux_size == vma_size && aux_size == nr_pages * PAGE_SIZE

is redundant. Remove the vma_size check as nr_pages is what is actually
used in the allocation function. That prepares for splitting out the buffer
allocation into separate functions, so that only nr_pages needs to be
handed in.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Link: https://lore.kernel.org/r/20250812104018.424519320@infradead.org
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 8060c28..eea3a7d 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7043,7 +7043,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
 		if (rb_has_aux(rb) && rb->aux_pgoff != vma->vm_pgoff)
 			goto aux_unlock;
 
-		if (aux_size != vma_size || aux_size != nr_pages * PAGE_SIZE)
+		if (aux_size != nr_pages * PAGE_SIZE)
 			goto aux_unlock;
 
 		/* already mapped with a different size */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ