From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796490886; b=KD4tL/ZJ7GHdM0kw4GV6XnJcZ331dqjgAGQxRHCQL4VfUW1of8eX5faBX05YWAUxrR3L 4wC28NfhcyWP0mzI1bURu0zL5Dga4yCgMghwGt3R2OVhZVq02/Cij4aXEqog7xJtb4b9r sQJeAy96Kjh+vNikVukRdlGzOg43jHWT901MN7SVLonUIpiTrc+Vs+dzeKvHUeZL5VjUo HpqkMv6Qi52laYNPqpaQGFGcr84e4lYXZpNgnFc3/jRP/wVNwdUeAyYL9S1ZyTXyBdNCi TRd+h9rQaYrPBhtiPaQWfapDWfs2gHiWiAvbDLPn+W4cJiBiCpyr4Jn13RLzT98Z4Xg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796490886; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=UlFcqX1EBSv12U3ZOOxZeZGwUCPeoj21tjBjg0tHe4w=; b=u/6cF+7DDaxfdpX+NxMrBnJTF4ZWEoxb3TVlmy8yNs3MCQh8ThlUKLULpu4a0vxrpE4q Vah3oY1CL9dxO1yhW3oJ84su78AmgwU/q6xc3I0ooHQ+/HIcPTHzmjCAZ/GWZ9RdOJMhV hU1e/D2FXXOSF5Vhz27SIhuXSLDti1z1bILEXbxVPb1c0plM2EXWSoh/ffmWL8JOXXTII U4NP6wfjOfL5QfOqH3Jm3X+N6FR8QinNOjSosYGJGe3riGxzYIw04V3RbY4amg161QouZ dyG1lFljyC34Ma8m0LV3QrPk+XKMvhMLVs1hAH7i7puSdI7lHzLYQzRd5nufmqtjRqA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MS0HwkOE; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 371A4606A31F; Sat, 5 Dec 2026 17:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MS0HwkOE Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE5701F0092B; Sat, 5 Dec 2026 17:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796490886; bh=UlFcqX1EBSv12U3ZOOxZeZGwUCPeoj21tjBjg0tHe4w=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=MS0HwkOEa24UvESHX7/dCEU1uFKLgtyRQC8k1vUbWm9tVZXE/9s5jd88exGR/nLLS fsRFbcMq6/PNENYg0V3MgkiM5HOKfEepGhiVffktYLLDPGmx23rzWvYfyZaPKLnFeO InXqu02WuahoZH+1e4Y7pw6wusKtDrS1sAqoD/PJr07SgkisD1HDH6ZQn8efgRrjOu DNS4icJh1UMNCw+ZLSG7fmdsHMd+GhF3Li692tPcCE3do0OEZ1o7tfiIcD3EVCzvgb sxlw6kgkmTYRJSiz+zi9T4Vgto95pOTlUnoLfW546voZ1sRGlgDzvHSaLXO72m/K25 N8qtpmviUoHDw== Date: Sat, 5 Dec 2026 18:14:39 +0100 From: Thorsten Blum To: Alexei Starovoitov Cc: Andrew Morton , Song Liu , Jiri Olsa , Ihor Solodrai , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Yonghong Song , Emil Tsalapatis , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH bpf-next v2] lib/buildid: Avoid wraparound when aligning ELF note sizes Message-ID: References: <20261205131119.105160-2-blum@kernel.org> X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Dec 05, 2026 at 04:34:44PM +0000, Alexei Starovoitov wrote: > On Sat, Dec 05, 2026 at 05:11 AM Thorsten Blum wrote: > > For u32 note sizes, ALIGN() wraps the values 0xfffffffd through > > 0xffffffff to 0 before check_add_overflow() runs. Parsing can then > > continue as if the affected size were 0. > > > > Use u64 for name_sz and desc_sz to avoid alignment wraparound, allowing > > check_add_overflow() to reject these malformed notes early. > > The code is the same as in v1. Only the log changed. > The reason for rejection is the same as before: nothing is broken. > It doesn't harden anything either. The owner of the file writes 0 > instead of 0xffffffff and gets the same walk. Size 0 is valid. > I don't think we need this patch. OK, I misunderstood your first feedback then.