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: <Ylg6tU5d9JA/2anr@hirez.programming.kicks-ass.net>
Date:   Thu, 14 Apr 2022 17:16:05 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Zhipeng Xie <xiezhipeng1@...wei.com>
Cc:     mingo@...hat.com, acme@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org, xiexiuqi@...wei.com,
        fanwentao@...wei.com
Subject: Re: [PATCH v2] perf/core: Fix perf_mmap fail when
 CONFIG_PERF_USE_VMALLOC enabled

On Wed, Feb 09, 2022 at 09:54:17AM -0500, Zhipeng Xie wrote:
> This problem can be reproduced with CONFIG_PERF_USE_VMALLOC enabled on both
> x86_64 and aarch64 arch when using sysdig -B(using ebpf)[1].
> sysdig -B works fine after rebuilding the kernel with CONFIG_PERF_USE_VMALLOC
> disabled.
> 
> I tracked it down to the if condition event->rb->nr_pages != nr_pages in
> perf_mmap is true when CONFIG_PERF_USE_VMALLOC is enabled where
> event->rb->nr_pages = 1 and nr_pages = 2048 resulting perf_mmap to return
> -EINVAL.This is because when CONFIG_PERF_USE_VMALLOC is enabled, rb->nr_pages
> is always equal to 1.
> 
> Arch with CONFIG_PERF_USE_VMALLOC enabled by default:
> 	arc/arm/csky/mips/sh/sparc/xtensa
> Arch with CONFIG_PERF_USE_VMALLOC disabled by default:
> 	x86_64/aarch64/...
> 
> Fix this problem by using data_page_nr.
> 
> [1] https://github.com/draios/sysdig
> 
> Signed-off-by: Zhipeng Xie <xiezhipeng1@...wei.com>

Right; sorry for being tardy. Fix looks ok, but I tihnk it needs:

Fixes: 906010b2134e ("perf_event: Provide vmalloc() based mmap() backing")

Will go queue.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ