Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp282740lqo; Wed, 15 May 2024 14:31:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVv96gfa1YzuiNP2VuPhuqr4mGl196eVzcUsnIhXTPtFKSmyxWxS+mCL5AFKK+suxr/pXiSr0P1p8JYZPQ5m5ktxWMAk5kALTj4vQik8Q== X-Google-Smtp-Source: AGHT+IFnmJAOJkthK+2N7EpYIYt+qtcjbIoS3Jy8Y7MAFsod/XeFphEP/OAUHj/5QS2ueAFwozw2 X-Received: by 2002:a17:906:4098:b0:a5a:8c59:d6d with SMTP id a640c23a62f3a-a5a8c590f06mr341553466b.17.1715808660519; Wed, 15 May 2024 14:31:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715808660; cv=pass; d=google.com; s=arc-20160816; b=P44rm8NIdYwqVbQdpRctCpkKqQ79bF+itYQucXd6T9cqyLQxz4zZ6KwVwB5Cz5Ylxl hdMA9DiA8heblKMxl3n5DS1lQitms8ogu1K8aVUrVSc9stMA8PiQGpo4Yr2Fg7uVrXmy REY1sdJjQRB+vCMva8SMSm56Nk8QAwFL9kM214aHouMa43RQF5d1eSHmcB62RVI5L2iO P+ZwW3kccSpvV0faWGNNIlqxfohNM9EmEhJy3MWOyJ03dh6n8UktTG32GwtIbU+N+Pmr II+MT/ta+nda3GSIpOwI1Dhmb/o0Huk0Bpn2asi7ueBgQsDVI5KF6u/nAg2DViiJoxRi 14Dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=V/Y5GE40yPs/wmhH+w0R59Hsxc6Sy/7klwSUObGVbGA=; fh=wMW/9CFu+3L6MydvYYxkrzA7EVM/vON1qDcShXvGrw8=; b=sspDoBNkPCb83q94oURTkk4oais6ZTnp/L+wwR8T11hQuPWu/iGcOJTbeXvXqRhZ21 4Ua3SjCeALpwmikWr47HvqFf67eVC/3Oh9XZSZjQMr/mfTG9O9xD3nf2PppsG3c5+gT5 nBpst8CBdn7N8Ce/ELdrkyI2d6nmJfcVryiaPts2VJvSZWwKb+9IUAYIhAt0AScYctVL 6/7X6BhpdG+9RhE0tsf7TdzLr484AWhz7AebIxWtvoW7CLxvVFGD7S/bkanY0wxSaxmt F7dPLuYHwV02nQmerhMuNGQgNlAkCG7Vi+VzuSyyLJlfzjSi9CWvOLI/4WBkJDQA5y0h 91Gw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YQZGNlvo; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a3f85f377si569539466b.743.2024.05.15.14.31.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 14:31:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YQZGNlvo; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1C3B11F2148A for ; Wed, 15 May 2024 21:31:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAA2915B546; Wed, 15 May 2024 21:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YQZGNlvo" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 6DEFD1FC4; Wed, 15 May 2024 21:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715808653; cv=none; b=aQtkn3YR9MyMbEJE38eP57v99tgU/o4w2fMFJ4bgt0C5YNw+Ci50y7xtS9gKdMnCmmPO5DZW2Cf8HRcDD80Rb5J48eAIgXQep9zVG59eWl1T6tjdjc5Bwz/61jahHzuyYSwcN8qKMQNZsQwvk9CCLNWAejKU5NrMwsNOa9PNtek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715808653; c=relaxed/simple; bh=cSegm8zca06bh3VxwG/1nohgKIpy1sLC+CwU8trRmDs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nmOHF6qg6Bm7gT9w4E8fm5moIEKYJqAuIqzogToT017XjSknp9/RUjTdH//7cOSOQCzVOkkJtjRbfDb+9oCLWXdiEpBwethzY+7LvY9S4vOL9pmTueQ7ENmRzIkG1uDPr57pRelP+vyd267W6SvEEHYahDsgsU6yAHuaYvVGmRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YQZGNlvo; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-350513d2c6aso4245784f8f.2; Wed, 15 May 2024 14:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715808650; x=1716413450; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=V/Y5GE40yPs/wmhH+w0R59Hsxc6Sy/7klwSUObGVbGA=; b=YQZGNlvo/rqPfMziRaeIyqEpHjwsXni8BJYvRzkPBDqEzG4on+0pa2PsUiQp1V136F TpHWKTATmbF0bBRKAR/EHndSkJ/WNnMTrY1AdlGRGYju2qikej67c01yrDb6rR8ekdQc Ks1H2sQVHkXuNN4ItoFNrN61rgjgIcmJWhDLg4TsuU4+bNCGcQJCZuVRduGyZ8uiNdg3 pm3CDyaNwTmLy0IQ7rh+E405OtTDQaL1ZDUDgBGgXlO0MsDMKdjZhCDWbxM1bVei3js8 4UhQVWzEfr2Q+IZJX8zLyVf3azniENoHDWdUev4mVknSZtJEz5RaYiQZfPr2YaQz0frD tyyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715808650; x=1716413450; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V/Y5GE40yPs/wmhH+w0R59Hsxc6Sy/7klwSUObGVbGA=; b=vnDoEVBCkthFGW5eXspcUvNHtJEoeE+32QMsUcJwl+FN/FkPZrHmmMAUK5BrE0YB9A 18+zdoRW442NVZ3jk6ds/461va9r8+Z4jBOwgWhKfRd6P3MiMuxOIgPEuc3ZOjWqlCpJ 17Wz2jDJSlRx2GHqjoeoHhJ+T9ndPme7UPz72Y1hqO2TK9aV2jpwv7MZfSle+c+Xa6n1 UHuBSEn1580XfEAIOIGSEk2QmctFALKbiK505l81znKtRu+j8lXX7vZrHTVENAOZa4Fn sBtwhsa629M7LuxzkTiYvR10Rghk7aysaG81cHKIdjf6bboR5FSSvskjOppISU2wAIne Q/Fw== X-Forwarded-Encrypted: i=1; AJvYcCWv6IbD5rdY9MHilHF5D82mTvdrLKmWmjEV63bu54SDvKH13w6gV/Rypx6x61VtwnVlKG9K3ejrZW23bnXSmrW70sn6gVcAiYcANOMl X-Gm-Message-State: AOJu0YwB7zuxIUjBz7VOQMxIjH5J2gjA9Qtg9V4BTZQJYKybKdwcJo41 RApPS2yhIjQZvoSuAo+d4g/rojGIeIxmyZ9z8Tt7LQznaVm5re/JMON3KyK3TdvtptKUta2p88B m7pFUUBaFGLtJ+2Ir+hpkLRjqVXLf8w== X-Received: by 2002:adf:e851:0:b0:34d:9fc2:4a81 with SMTP id ffacd0b85a97d-3504a61c5c6mr11922947f8f.5.1715808649395; Wed, 15 May 2024 14:30:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Alexei Starovoitov Date: Wed, 15 May 2024 14:30:37 -0700 Message-ID: Subject: Re: WARNING: kmalloc bug in bpf_uprobe_multi_link_attach To: Ubisectech Sirius , Jiri Olsa Cc: linux-trace-kernel , linux-kernel , ast , daniel , andrii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2024 at 12:33=E2=80=AFAM Ubisectech Sirius wrote: > > Hello. > We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec.= Recently, our team has discovered a issue in Linux kernel 6.7. Attached t= o the email were a PoC file of the issue. Jiri, please take a look. > Stack dump: > > loop3: detected capacity change from 0 to 8 > MTD: Attempt to mount non-MTD device "/dev/loop3" > ------------[ cut here ]------------ > WARNING: CPU: 1 PID: 10075 at mm/util.c:632 kvmalloc_node+0x199/0x1b0 mm/= util.c:632 > Modules linked in: > CPU: 1 PID: 10075 Comm: syz-executor.3 Not tainted 6.7.0 #2 > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/0= 1/2014 > RIP: 0010:kvmalloc_node+0x199/0x1b0 mm/util.c:632 > Code: 02 1d 00 eb aa e8 a7 49 c6 ff 41 81 e5 00 20 00 00 31 ff 44 89 ee e= 8 36 45 c6 ff 45 85 ed 0f 85 1b ff ff ff e8 88 49 c6 ff 90 <0f> 0b 90 e9 dd= fe ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 > RSP: 0018:ffffc90002007b60 EFLAGS: 00010212 > RAX: 00000000000023e4 RBX: 0000000000000400 RCX: ffffc90003aaa000 > RDX: 0000000000040000 RSI: ffffffff81c3acc8 RDI: 0000000000000005 > RBP: 00000037ffffcec8 R08: 0000000000000005 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 > R13: 0000000000000000 R14: 00000000ffffffff R15: ffff88805ff6e1b8 > FS: 00007fc62205f640(0000) GS:ffff88807ec00000(0000) knlGS:0000000000000= 000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 0000001b2e026000 CR3: 000000005f338000 CR4: 0000000000750ef0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > PKRU: 55555554 > Call Trace: > > kvmalloc include/linux/slab.h:738 [inline] > kvmalloc_array include/linux/slab.h:756 [inline] > kvcalloc include/linux/slab.h:761 [inline] > bpf_uprobe_multi_link_attach+0x3fe/0xf60 kernel/trace/bpf_trace.c:3239 > link_create kernel/bpf/syscall.c:5012 [inline] > __sys_bpf+0x2e85/0x4e00 kernel/bpf/syscall.c:5453 > __do_sys_bpf kernel/bpf/syscall.c:5487 [inline] > __se_sys_bpf kernel/bpf/syscall.c:5485 [inline] > __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5485 > do_syscall_x64 arch/x86/entry/common.c:52 [inline] > do_syscall_64+0x43/0x120 arch/x86/entry/common.c:83 > entry_SYSCALL_64_after_hwframe+0x6f/0x77 > RIP: 0033:0x7fc62128fd6d > Code: c3 e8 97 2b 00 00 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f= 7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff= ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 > RSP: 002b:00007fc62205f028 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 > RAX: ffffffffffffffda RBX: 00007fc6213cbf80 RCX: 00007fc62128fd6d > RDX: 0000000000000040 RSI: 00000000200001c0 RDI: 000000000000001c > RBP: 00007fc6212f14cd R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 > R13: 000000000000000b R14: 00007fc6213cbf80 R15: 00007fc62203f000 > > > Thank you for taking the time to read this email and we look forward to w= orking with you further. > > >