From nobody Sat Feb 7 23:23:06 2026 Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) (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 2CF29309EE9 for ; Tue, 6 Jan 2026 05:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767676795; cv=none; b=cC0s2gGoS1Oc0c6br41qMZ7kjIuI+qWorw+3zWofL4Rzde+J9LhScgjTYQe5TC/XQS7KWnpJnDJY780eLroUcGMWETYTbPhBwSI7HfEhF0u/luWDi0J396CBpWShJH8ib0HgY0tYNrYBPxvtWt3GYN+hC/dwb1ryzJ853aCTYm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767676795; c=relaxed/simple; bh=HTt6fQg4uYumGL3rUFbOchJ3HRbnpZ+HEQNvGJhUVA0=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=aG3fGOjL3ytjiPpbJArG+pH2BcNyky8vHI7hmrKMWQsNK2JB0kYazATzfJGb9HdhhN5T5EFE/bz0DEngWdLGWEtleMatX7okkKs/EAYurH0YJBZNlP9CDjmr3X/BxhmLWiEPwI+sQFc18MQko5o7yUCxTNCPU+NkvBJhEYlIdVg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.160.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-3ff48fbeadfso762227fac.1 for ; Mon, 05 Jan 2026 21:19:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767676793; x=1768281593; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hqwGxEHcZV1F+J1Am/BqyIlsPSFr6Mm36ysaeL76K90=; b=rHlqRj44j59IdCmRgTONC+Bu3wdLQRB2jcVDveLLrCHpv32Xn+BwPVeyl2bkS6jUXK LgHrzeBk+Ia7jkuhsykadfBY/iGEJ8blVd7YC6c8905fn5ozco+0tFs80EdddR6RIkGO iTuJ9N0w+c80Ka6tzaq3XEW7TYMZYt9e1d6vwUKi+Bfpz4Akf5f2xlzbPx13SASUdjJ2 mEFG6+Q0HA0mZiOzHYgxIMAro3Ar2JNaEGkrLi67Nmhzzkd9zcyckdbq2gN3MtGoGYhq EPc5Jir4ykFl51wRJ/XgqvK+aKjSxX5tXdrZoi+7y5ZorQMEWSNcKdlThKZAW0x2CAlc rbHA== X-Gm-Message-State: AOJu0Yw+HcrNPnUmFB09Qzu1R59PyiSKCLT6xic+OZIBrFI9WLpj3P6P OZIDtW3gKo/WCnaLxdgkz+wG3X+L0LoCudYQe24cac3pQNdLYcCnZlIdj118eyzAHFA/VsgJAzq pruSMFtg/GoZYs25IFrQGaM5S4enPH7ky/sUR/dqIOi66wY04sGvDZN3Bu8Y= X-Google-Smtp-Source: AGHT+IFckw7r/KNPeDkYY7YaKHqmGgqZHaPbI+LuwqGUHgDJgipU3T6Zzn4CnUH6d5b9zjCeBo3Iouot35E2okjfaKEGhQ21bQh/ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:8408:b0:65b:35d7:bb8d with SMTP id 006d021491bc7-65f47a1a6acmr635924eaf.50.1767676793083; Mon, 05 Jan 2026 21:19:53 -0800 (PST) Date: Mon, 05 Jan 2026 21:19:53 -0800 In-Reply-To: <695bc686.050a0220.1c677c.032f.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <695c9b79.050a0220.1c677c.0338.GAE@google.com> Subject: Forwarded: [PATCH] bpf: Fix double offset in insn_array_map_direct_value_addr() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] bpf: Fix double offset in insn_array_map_direct_value_addr= () Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git master insn_array_map_direct_value_addr() adds the offset to the returned address, but callers of map_direct_value_addr() expect the base address and add the offset themselves. This is inconsistent with other implementations like array_map_direct_value_addr() and arena_map_direct_value_addr() which return only the base address. This causes a double offset when check_reg_const_str() validates ARG_PTR_TO_CONST_STR arguments, leading to an out-of-bounds read in strnchr() when bpf_snprintf() is called with a format string from an insn_array map. Remove the offset addition to match the expected behavior. Reported-by: syzbot+2c29addf92581b410079@syzkaller.appspotmail.com Signed-off-by: Deepanshu Kartikey --- kernel/bpf/bpf_insn_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/bpf_insn_array.c b/kernel/bpf/bpf_insn_array.c index c96630cb75bf..37b43102953e 100644 --- a/kernel/bpf/bpf_insn_array.c +++ b/kernel/bpf/bpf_insn_array.c @@ -126,7 +126,7 @@ static int insn_array_map_direct_value_addr(const struc= t bpf_map *map, u64 *imm, return -EINVAL; =20 /* from BPF's point of view, this map is a jump table */ - *imm =3D (unsigned long)insn_array->ips + off; + *imm =3D (unsigned long)insn_array->ips; =20 return 0; } --=20 2.43.0