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: <CAADnVQJcmyMmxPfSaKgqMiCDZP=Pe8-Jf7NnEdfgxejvZr+44g@mail.gmail.com>
Date: Thu, 23 Jan 2025 21:14:04 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
Cc: bpf <bpf@...r.kernel.org>, Network Development <netdev@...r.kernel.org>, 
	"open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>, 
	Alexei Starovoitov <ast@...nel.org>, Hari Bathini <hbathini@...ux.ibm.com>, 
	Andrii Nakryiko <andrii@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Jesper Dangaard Brouer <hawk@...nel.org>, Martin KaFai Lau <martin.lau@...ux.dev>, Eddy Z <eddyz87@...il.com>, 
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>, 
	John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>
Subject: Re: [PATCH] bpf: Fix mix-up of 4096 and page size.

On Wed, Jan 22, 2025 at 10:38 AM Saket Kumar Bhaskar
<skb99@...ux.ibm.com> wrote:
>
> For platforms on powerpc architecture with a default page size greater
> than 4096, there was an inconsistency in fragment size calculation.
> This caused the BPF selftest xdp_adjust_tail/xdp_adjust_frags_tail_grow
> to fail on powerpc.
>
> The issue occurred because the fragment buffer size in
> bpf_prog_test_run_xdp() was set to 4096, while the actual data size in
> the fragment within the shared skb was checked against PAGE_SIZE
> (65536 on powerpc) in min_t, causing it to exceed 4096 and be set
> accordingly. This discrepancy led to an overflow when
> bpf_xdp_frags_increase_tail() checked for tailroom, as skb_frag_size(frag)
> could be greater than rxq->frag_size (when PAGE_SIZE > 4096).
>
> This commit updates the page size references to 4096 to ensure consistency
> and prevent overflow issues in fragment size calculations.

This isn't right. Please fix the selftest instead.

pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ