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] [day] [month] [year] [list]
Message-ID: <20220208154931.4371-1-xiezhipeng1@huawei.com>
Date:   Tue, 8 Feb 2022 10:49:31 -0500
From:   Zhipeng Xie <xiezhipeng1@...wei.com>
To:     <peterz@...radead.org>
CC:     <acme@...nel.org>, <alexander.shishkin@...ux.intel.com>,
        <jolsa@...hat.com>, <linux-kernel@...r.kernel.org>,
        <linux-perf-users@...r.kernel.org>, <mark.rutland@....com>,
        <mingo@...hat.com>, <namhyung@...nel.org>,
        <xiezhipeng1@...wei.com>, <xiexiuqi@...wei.com>,
        <fanwentao@...wei.com>
Subject: Re: [PATCH] Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled

On Mon, February 7, 2022 10:12 PM, Peter Zijlstra wrote:
> Your $Subject needs a subsystem prefix.

Thanks for your comments, I will adjust the patch Subject and resend the
patch according to your suggestions.

> On Mon, Feb 07, 2022 at 12:02:59PM -0500, Zhipeng Xie wrote:
> > when CONFIG_PERF_USE_VMALLOC is enabled, rb->nr_pages is always
> > equal to 1 in rb_alloc, causing perf_mmap return -EINVAL when mmap.
> > Fix this problem using data_page_nr.
> 
> How can this be? This would mean that any arch that selects that hasn't
> worked for forever ?! That seems unlikely.

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/...
I have this problem when using sysdig -B(using ebpf)[1] on an aarch64 kernel
with CONFIG_PERF_USE_VMALLOC enabled. sysdig -B works fine after rebuilding
the kernel with the CONFIG_PERF_USE_VMALLOC disabled. I tracked it down to the
if condition event->rb->nr_pages != nr_pages in perf_mmap is true where
event->rb->nr_pages = 1 and nr_pages = 2048 resulting perf_mmap to return
-EINVAL.

[1] https://github.com/draios/sysdig

> > Signed-off-by: Zhipeng Xie <xiezhipeng1@...wei.com>
> 
> If this is correct; this is also missing a Fixes: tag.

Sorry, I don't know when this problem was introduced, so
I have no idea which commit my patch fixes.from the git log,
this problem seems to have existed for a long time, even before
the ebpf feature was introduced.

Powered by blists - more mailing lists