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: <856564cf-fba4-4473-bfa9-e9b03115abd1@oracle.com>
Date: Wed, 28 Feb 2024 12:04:02 +0000
From: Alan Maguire <alan.maguire@...cle.com>
To: Jiri Olsa <olsajiri@...il.com>, John Hubbard <jhubbard@...dia.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>,
        Alexei Starovoitov <ast@...nel.org>, bpf@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>, dwarves@...r.kernel.org
Subject: Re: [PATCH] fix linux kernel BTF builds: increase max percpu
 variables by 10x

On 28/02/2024 09:20, Jiri Olsa wrote:
> On Tue, Feb 27, 2024 at 07:21:42PM -0800, John Hubbard wrote:
>> When building the Linux kernel with a distro .config, most or even all
>> possible kernel modules are built. This adds up to 4500+ modules, and
>> based on my testing, this causes the pahole utility to run out of space,
>> which shows up like this (CONFIG_DEBUG_INFO_BTF=y is required in order
>> to reproduce this):
>>
>>   LD      .tmp_vmlinux.btf
>>   BTF     .btf.vmlinux.bin.o
>> Reached the limit of per-CPU variables: 4096
>> ...repeated many times...
>> Reached the limit of per-CPU variables: 4096
>>   LD      .tmp_vmlinux.kallsyms1
>>   NM      .tmp_vmlinux.kallsyms1.syms
>>   KSYMS   .tmp_vmlinux.kallsyms1.S
>>   AS      .tmp_vmlinux.kallsyms1.S
>>   LD      .tmp_vmlinux.kallsyms2
>>   NM      .tmp_vmlinux.kallsyms2.syms
>>   KSYMS   .tmp_vmlinux.kallsyms2.S
>>   AS      .tmp_vmlinux.kallsyms2.S
>>   LD      vmlinux
>>   BTFIDS  vmlinux
>> libbpf: failed to find '.BTF' ELF section in vmlinux
>> FAILED: load BTF from vmlinux: No data available
>> make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 255
>> make[2]: *** Deleting file 'vmlinux'
>> make[1]: *** [/kernel_work/linux-people/Makefile:1162: vmlinux] Error 2
>> make: *** [Makefile:240: __sub-make] Error 2
>>
>> Increasing MAX_PERCPU_VAR_CNT by 10x avoids running out of space, and
>> allows the build to succeed.
> 
> do you have an actual count of percpu variables for your config?
> 10x seems a lot to me
> 
> this might be a workaround, but we should make encoder->percpu.vars
> dynamically allocated like we do for functions
> 
> jirka
>

Good idea Jiri; John would you mind trying the attached patch? Thanks!

Alan
View attachment "0001-btf_encoder-dynamically-allocate-the-vars-array-for-.patch" of type "text/x-patch" (3501 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ