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=1796379823; b=gSrhXbSAdJWdz/86O+oXLiM4o2+LRIzl1ZHbi+RvVQQqt9yv+E55TW765ZUjUnoQFAZD OGIrANKqRDVNUuV2CRkN1StwooqzDeDZ5FOzTHx/mZEbd1SfdiC3aIaJMCPGW/IIun5XH cujTdd/1bb5LjYDc0O7fDCvPJfB3q2gMRkEiUfNc0KVd2GN6kfq+G90C1RD66MgUtGqwI nMc0xy6/5MNi/jDeszsLQxxLWYpi3KQcZF4HKfLi/vo9LIrIiGnu/bb1P2br8e7Lf7Krm 3x9Qym7P6zhKd7E9v98pXl6dRzyCyOf8E7JdyIg8uhWqynuF5EQZwMAkd89PxhUBr/Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379823; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=l28dwjv0/lhW9rkehDayxJznph1Hv25s/QGhyAFnqFY=; b=CSyoVzQHnayJCYOW4YR8EJlVUCrDRdl/jCv9tmrM3JJJb0XOcUfYuLvkX6tC+KKfPlrX 8sauPf7GXPBGn6kLqQHM5Xsx2SQro0PF9mj1ynLB6ruw6ClORRdy1UNPTUVrsOKamQR+z YylGKYcwmTPW/khefqaEEIvtlWztOg+YAk6dfG/vrFfl2ZPPWH8ZbGBWDsawFvP2SS46q AcDyUZ+goR3+U4mKPZugWp9GOIDDGvZAcIeUFnjdvazsxmJV1HTvyjgXptFIUyOBjINc8 uqoYrfUst2ze1axRXnAN9tjFaRpuM0Wt86Uq8q8f4SXTX4ICAvfq7BgqYJS2ssMotrA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=C0KdDZ5X; 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 5BA7D606A322; Fri, 4 Dec 2026 10:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=C0KdDZ5X Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC1091F000CE; Fri, 4 Dec 2026 10:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379823; bh=l28dwjv0/lhW9rkehDayxJznph1Hv25s/QGhyAFnqFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C0KdDZ5X6Q14IoYSQo/zCrm+j77FDGiYRMBUz5N0xpmGQCwD6KcpwG9VQy2E4JfJC sidYYuZodA+ZQXK1K0yZnaFszxtM/DD9fb3+mQH/fzvms7ifd+YPLS/FcKDDh4ihrO bUKacUzef5e1oA/IKRds636l3aVzfnXNoV6xb3HA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Leon Hwang , Kumar Kartikeya Dwivedi , Sasha Levin Subject: [PATCH 6.12 040/555] bpf: Disallow interpreter fallback for arena-related insns Date: Fri, 4 Dec 2026 19:01:23 +0900 Message-ID: <20261204100607.463535211@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Leon Hwang [ Upstream commit 34746b5a84ec37c0ea2bf6808c65c5ed8790eb51 ] Since the interpreter does not support the arena-related insns, interpreter fallback should not be allowed for these insns in core.c::__bpf_prog_select_runtime(). Currently, when the interpreter executes the arena ST/LDX/STX insns, it would hit the BUG_ON() in ___bpf_prog_run() at run time. [ 2.579196] BPF interpreter: unknown opcode a2 (imm: 0x0) [ 2.579998] ------------[ cut here ]------------ [ 2.580652] kernel BUG at kernel/bpf/core.c:2349! [ 2.581314] Oops: invalid opcode: 0000 [#1] SMP PTI Set jit_required as true when arena map is used in the prog to disallow interpreter fallback for arena-related insns. Fixes: 6082b6c328b5 ("bpf: Recognize addr_space_cast instruction in the verifier.") Signed-off-by: Leon Hwang Link: https://lore.kernel.org/bpf/20260715141122.15783-2-leon.hwang@linux.dev Signed-off-by: Kumar Kartikeya Dwivedi [edit] Apply the check_map_prog_compatibility() change in resolve_pseudo_ldimm64(), where this branch handles arena maps. Signed-off-by: Leon Hwang Signed-off-by: Sasha Levin --- kernel/bpf/verifier.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 4b1d89ec02a8f..bcfc23ff3c57a 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -19841,6 +19841,7 @@ static int resolve_pseudo_ldimm64(struct bpf_verifier_env *env) return -EOPNOTSUPP; } env->prog->aux->arena = (void *)map; + env->prog->jit_required = true; if (!bpf_arena_get_user_vm_start(env->prog->aux->arena)) { verbose(env, "arena's user address must be set via map_extra or mmap()\n"); return -EINVAL; -- 2.53.0