From mboxrd@z Thu Jan 1 00:00:00 1970 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 A63CA36BCE3 for ; Tue, 24 Feb 2026 09:29:18 +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=1771925360; cv=none; b=JghCNsMGrj3QJRO0PIgxiT/Rk4Fl1UIiNrlGMYSyLdpeTADuJzkaFQ6iwNTEsMWZwuv8OjPVgVTPNduZfl9Ai8yq7iJipYa9MSqo5M3JhPa21xCUsVCGvy1FcaKyVzKbuHiiccOqTnBcHbrVjh8LhqGcw5mV7N1hdvpQPGifIHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771925360; c=relaxed/simple; bh=hrd0NlY9pBKuduf76fdmrPBnyckvVI6lRHdi9c3/5Sg=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=IP4YtdWXKn2xf5cSoJ+F3fZgdSufrtxOcSUtdBc/n7Rt7HU64+SO53dTtaHo3g185q92knHzSqXDZdJ+OTI03IOjciSPp5xGqKafrE/LKYt6TvHQ/diw60pT44Fuhgwh9S+Fg6zP8rPwQOfeF7hNm0IOVkcMm/cQMAe5nztyHr0= 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=ToZNpNBU; 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="ToZNpNBU" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-483101623e9so46262665e9.3 for ; Tue, 24 Feb 2026 01:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771925357; x=1772530157; 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=ToZNpNBUa7ULlHFexOnmI/c0h6jdjDxvckF46bfE0/ypJ4VIPVNVhQw/GfRsUsuhxS 05FGbcZtUWFMT/2mSEFBSCbOFbK2ga15yN9b1nFt08L/NhZBEHXndLDXNoiLy+DiCQND UBR9a4wfDOyjDNRJzP5SJxuH4//WnDDt05M858ZDGQLXlEdZD30SNlm8DmwWotlI1uWI I8K99SORg6nNIxGUqpKEPCfOpWBaflwVsiS2LstkNgeQDpzNBZufNDedbz5Lq4aElHS3 J8ZKiX+igIRhKUJaHCGZZpKmVna+F6bURE7S7qjU72f5SFcb/1u2AzQ8lX2wZQhYAz1S hhiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771925357; x=1772530157; 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=IWYnH1U4tCMyNTGNnRqRbToi8jqiQqabog2E/ambl9Cc8kB3ml3FfuvjgcrB5i4I2S 7oqVjiAVjCwrosuIz3AYuRuncUFstUOLvb4spSsDmGCaRZ9mcCIMAmQo8hlzpRcdNEDU CJOVaPL0cmwB1tPRZTxOa7cd9/lPy8jt7PJCcJg0kiZmXFaAvyhdxQXZfmKZPduWnd25 hWvESOqnqlseGnATwD4D9zMRLZ7KaEJz7gNL+mcTyxPIx1b95UhU9HMSnQMX8NnLdL7z LpPF+j2WFaDJnUhysl9EO4MuiYwl4ucvIsEtk874W3oCgqZ/X/0/gpvbZnW4E4P2fVmf RW1Q== X-Forwarded-Encrypted: i=1; AJvYcCUwzgkX3WexNnOTa9XSRLiXxCE8Qoj4mQjE3gjnd1kb1hE6DArptEeolmv0UeP+pWoU1tdROTEbzs2Q5BU=@vger.kernel.org X-Gm-Message-State: AOJu0YyhzIA80UZS8K5YD+A/RjA7cd2F4QVnV4Zqi6iUIjPY0QKeSUFo KULdQygDgVAafhBBTuRFWjGCdMeQyjanU4gi7Dm+n2oZlO+bzrfOSLycWoQOgqUBRZ+6ywlxkjV GTw== X-Received: from wmbju22.prod.google.com ([2002:a05:600c:56d6:b0:47e:e4a5:c5f2]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:6298:b0:477:5c58:3d42 with SMTP id 5b1f17b1804b1-483a95fb23amr187555705e9.10.1771925356794; Tue, 24 Feb 2026 01:29:16 -0800 (PST) Date: Tue, 24 Feb 2026 09:29:15 +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: <20260224092915.1925488-1-tabba@google.com> Subject: [PATCH] arm64: bpf: Fix UBSAN misaligned access in BPF JIT From: Fuad Tabba To: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: tabba@google.com 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 --- 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 = round_up(prog_size + PLT_TARGET_SIZE, extable_align); image_size = extable_offset + extable_size; ro_header = 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 = orig_prog; -- 2.53.0.371.g1d285c8824-goog