From nobody Fri Apr 17 01:43:54 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 037CE369220 for ; Tue, 24 Feb 2026 09:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771925493; cv=none; b=UVkXvhIWZ7ev37Xegt/k1Hq8lNqHlCcuAEbtWM/4f9V4UPiSnyvANRsGZeAacSOu1HPBXIcnuSam8NDb4sHbd5e7aVl4YC52L7dWRRhMDKeY0SUI3vNUAb6e/2J/4a3b6AC79MCfAhX7ZR6rmXLzdnwnK5bjuA81sd0K4zmihOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771925493; c=relaxed/simple; bh=hrd0NlY9pBKuduf76fdmrPBnyckvVI6lRHdi9c3/5Sg=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=mEaOXQewng4ILsLrFIr6P03nTngqaaGyiWJdfmJk2h0iFVRHgA9Qr1NribiRBsA/qlryXCRHWD9vAL88E+V1OWzH5zu9Y4PGWgJXNsOnB8hyGEE2JuQbMBw/CwGr346ejuxL4N2++EWyGI4BZHpahAspvGFUIb4RHLySxN8589o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tabba.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vAJ9whtp; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--tabba.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vAJ9whtp" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4836ff58111so64116965e9.1 for ; Tue, 24 Feb 2026 01:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771925489; x=1772530289; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=srSVsiV2b/ln5UzP/d6flconP4PG3Pc7vryxNaoWscY=; b=vAJ9whtptRWJB+waUZnd2mi57nrf/xMqy7huGNLpB6bd59SbC86qxMsnHZiizGEgyw 9cOcvDFA5Uxkxmtgl3M2wfS1PV+gZQeX2/8955gyu9IBKtr07OUtGxHIEPADING+Snid yI862+L7evmpx5Sl08MeLlclssgiITuy1zlEASRSJQgd5RH61B3HkmlO9qZEYw6DjIyB E/tD/ZukxlaYUK/vqfI0p0rs0l3ZatTgG93gW4BNAWh2BIMl1GxqP26gwB0JJE49u5qQ fmE+xs1UE3BavYR2dQz1vBzqy03SWPDvnQyytjcwichz+3V+ft0QAttvzBoXP6AVlmYg O1qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771925489; x=1772530289; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=srSVsiV2b/ln5UzP/d6flconP4PG3Pc7vryxNaoWscY=; b=GlTHLARGhvoMziJOOHlnVBmN/P5OwoYllWrFlf/sGcuRUiCXvSWxVgZ0cH+U8/L4fc vPn074JHWCUdH1aIuTMjTCL0RfItNBrq+BS1In6jxQJQRtNtUGZ5vdX4tLmwy91KjQyu 1dqqhSngkXk8/dPdhob+9ijcH1URQHnUSsL6RNmaUCmgpS15IrNiXQLwdVHx/ufQ/icz Rs3HSKdFVjCcRNRXduUV8m+5Y68Mbp5qG6zNb22xw35cTbIKSp1p3PySixMp5BS6HQ1u 25pDDUZci6iBHHdjojLbS5Z1SjTF+D/1oJDwcLjms7b4S2iuWPNWvfrFy2J5PjMDJXIi BfhQ== X-Forwarded-Encrypted: i=1; AJvYcCUsTRJPYbCgWPIDvK0ZgaS4QxjZw0P13ZfpOEjZlXuHbncrL2kgC2rMP3P4UzTlwlz9tjPOF/v0K86CtSI=@vger.kernel.org X-Gm-Message-State: AOJu0YxBJFY8xfIkbuWOp0o99o/vU9TbKMHfvNyfKVYtoidTMWRTqGSu VQRSpw/Wr6u1Jxa6VGHLoFcxoLrpcV3U6MbAOlKT/8n69H5qL6ZG3LPEJpApjJdzDaWwwDDaL7D H1A== X-Received: from wmdq4.prod.google.com ([2002:a05:600c:304:b0:483:2ac4:5da6]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1e1d:b0:483:456a:514b with SMTP id 5b1f17b1804b1-483a95befe5mr191351835e9.12.1771925489179; Tue, 24 Feb 2026 01:31:29 -0800 (PST) Date: Tue, 24 Feb 2026 09:31:28 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.53.0.371.g1d285c8824-goog Message-ID: <20260224093128.1926610-1-tabba@google.com> Subject: [PATCH] arm64: bpf: Fix UBSAN misaligned access in BPF JIT From: Fuad Tabba To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Puranjay Mohan , Catalin Marinas , Will Deacon , bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Xu Kuohai , Jakub Sitnicki , Jean-Philippe Brucker , tabba@google.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct bpf_plt contains a u64 'target' field. The BPF JIT allocator was using an alignment of 4 bytes (sizeof(u32)), which could lead to the 'target' field being misaligned in the JIT buffer. Increase the alignment requirement to 8 bytes (sizeof(u64)) in bpf_jit_binary_pack_alloc() to guarantee proper alignment for struct bpf_plt. Fixes: b2ad54e1533e9 ("bpf, arm64: Implement bpf_arch_text_poke() for arm64= ") Signed-off-by: Fuad Tabba Acked-by: Xu Kuohai --- arch/arm64/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 356d33c7a4ae..adf84962d579 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -2119,7 +2119,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog = *prog) extable_offset =3D round_up(prog_size + PLT_TARGET_SIZE, extable_align); image_size =3D extable_offset + extable_size; ro_header =3D bpf_jit_binary_pack_alloc(image_size, &ro_image_ptr, - sizeof(u32), &header, &image_ptr, + sizeof(u64), &header, &image_ptr, jit_fill_hole); if (!ro_header) { prog =3D orig_prog; --=20 2.53.0.371.g1d285c8824-goog