Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1931071lqp; Tue, 16 Apr 2024 02:04:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe1xBbopLVWfQijnY95zDANeNlp4AIlpbEZ5pjaQxgXkyGnvO/BYkzFs4gZrLDOFtYRpTwYXGrBvRucvfMlv6mKQo8mY4DG4jsm3YBHg== X-Google-Smtp-Source: AGHT+IFhLujkxdG2c2GilyU5PEd28EV8J475leaKRHMQ1BTgq2Sx6b8iR2+k04P908qaAyW6h4A7 X-Received: by 2002:a05:6a00:1486:b0:6ec:ff5e:7e66 with SMTP id v6-20020a056a00148600b006ecff5e7e66mr16242627pfu.1.1713258290277; Tue, 16 Apr 2024 02:04:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713258290; cv=pass; d=google.com; s=arc-20160816; b=ZAANebCx7PPAcXhqtE6izhPyi7MB2RoNW9kKaWO5h+TbIUvjrhEWS1orm8BXHTvVpL kBMeyzDsiwUhX5uhKmE++wAXyPADfp2J8fdi9N+JtfXLeMKJaHc3SeyWZSjrylcKh7Dw cCGPofhZ9m4RKZTGTTpd+BOJ3rt4jcuekySEzOVpVrigVe9WXmvGF2UEU8YpsKDLlpZo EvjmuYIQT0OzMr5jtT0OXUDynETOAl2HIbmwwPNZBVF+XFKTRPba9Vap13mmjY1BTq9d /FFDCwDuAI78AuS9VlfaYld3ZjSlKYTaD6RibBGZ5PkCtC9McOEb1RrV0E+2Oj7m8Obi TNxg== 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=hPVk/nT4EhdKCio3Wn9r/Arl5MCpgxnJeUxrDI8MyIE=; fh=Jppr4Cq/+5tN6eiHrs9zQQocMSQpHBhABw6pvacL7AA=; b=JUh3fiD0XV0bGvcAyx2I0H4iJoew3tbIs9Oh8W9EBhvaW6l4h5aJ9CArYpwHo7hnGv yoC3qjcrM0TdcVFokcG/btKuZLWd6REDq4DSTEaqZil9JpHFZn7A22ztJy66JooNnirn AKTnrK0K5XsKRFtj/XgCQ/aQYPXRw9bYK9K+1jdGutlQhMoci31YJSYsXzXVvhr0WzMQ QMt7S//lqfznnGIkRaPUjE44EuodmDY4tKVlbhSvaIa55ZRaLYxrQVmCXhUwuDxJmdiJ 4Epiku5ndzGfGhOB7pIQsiatyskPlTb3k9EQpTM0K0i4QmsNJ5OF4Yk8eG81EYuA27+I Opgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rQTCc1DG; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-146518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h9-20020a056a00170900b006ea93dd9239si9831387pfc.144.2024.04.16.02.04.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 02:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rQTCc1DG; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-146518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2D516B216E1 for ; Tue, 16 Apr 2024 08:53:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20C9684A3E; Tue, 16 Apr 2024 08:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rQTCc1DG" Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 734BB71B50 for ; Tue, 16 Apr 2024 08:52:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713257577; cv=none; b=f2slnv6vjbCpxtJ/hQBrpxn1xtp1lqnIticzz5sNyejLmHBxQqGdDzJcmywbqNUDKs3ObgadYSgHEsX4zPCoy/qrEHniHF4tL8M2aQRezR1Fmdt29idcdeodV5kPzxXA65QJ/n5+fRivVu5b8jOPEMgdzxa+OBDcCJUBCHjDYko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713257577; c=relaxed/simple; bh=FdtQyAHvdiOXO6ti4ShXTouSZM7Z22hhscY+ZntVPlM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=oMgcrrRIX+icPpdb/V2j92Z0Pn+Gty3UKwNYxKZAqnMcPMo7pKgHATRZ+E5CV124m1zFn0FnqVsfhjrGjp6tYQQe4jbWcFYShVLw6EZTgpSsqh65cGv+i2FDBTFfoHSTO5KQjMjEF7sdHBPlTgcm4DaO/p7v3zBLBdR/qRwccV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=rQTCc1DG; arc=none smtp.client-ip=209.85.222.180 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=google.com Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-78d743f3654so390039385a.0 for ; Tue, 16 Apr 2024 01:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713257574; x=1713862374; 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=hPVk/nT4EhdKCio3Wn9r/Arl5MCpgxnJeUxrDI8MyIE=; b=rQTCc1DGz3frrxpKbhy/9ejG+WfVduUruCugxkAc5sFgADXwdcpj9zCZyUgziljJFi ctU904t/17GeCTCltvetKp2HQ/9uH09h342nj+MfpObZ57wpPqrIuE1D/sCSXSRFue51 zMpaLbTculKnw2XZaTKJWNGNpRly48LZHif+ZGMJIFmRA+DTNt1RDFCvRXMFnshEKqPf o7jxFMYdhIYE2M8gF0HtpBigUurWFU/hOinYcHbyzUcSLXYTnZO5IiNudXtFDHs2Jyla EQr52YF4rilEFO2AiobMhUdOiBmV8fuMgJecc3q6v0OX+UZIeaAdVlsmKOPk3+KVob6D i3pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713257574; x=1713862374; 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=hPVk/nT4EhdKCio3Wn9r/Arl5MCpgxnJeUxrDI8MyIE=; b=xNHKNvw5ehf8raGA7x/NRl0zzpi/Iw/0tFj17VzXfCPbuT45Q+POQd9Tr9vmTI8Pm/ zbzqzFIcjkERTB74HlaFgNcxC9ijTOY2OK/UiLZZEDl5KWy53xl6h/Vdqg/tLAHJkQPG ghXfCTWHmMA4YYRvYWbEz9dXI0xi8AfEQp03uWqL+q+Tv/OznT52dQeuGpJOiq5gJF9r w/Ndx+YJK5At7xRFFQ9uA9hqmG7mRmsKjRMvMBu09Q1DFp4fQ2dIxMcDn2vFR7R0nJfF uAh0r8vxx8CITxYPbKmY72KeTLuyc86M8MINUNTL7Zbro7p41Td37bZLY4Ea4CBSdpxH 3bXQ== X-Forwarded-Encrypted: i=1; AJvYcCWdbpVWO0uMarghsN9ds0tjWp8GHO82TI6cf+na/Uk02UCZLFQYbltACsikAvf3A8eIkjqbCp4Wft4YgsLLDgrDEYN08lX9WpvJeoXT X-Gm-Message-State: AOJu0YwcUayTmVoh31aAKs7DNbcO4k9jRgG5ldMIQsd/WXKNDqfPvS/E esQy0fsSHEQBOcfQdgRfjB5rwO5iPzpAIFlMzsUoi/hweJWbyGG1k0CMHCeJfL74EVr4UlX4Xrr +L25T1Knsc9G5sf5c3/g/I9QDaeRWhX46MVep X-Received: by 2002:ad4:4ba2:0:b0:69b:7145:b2ee with SMTP id i2-20020ad44ba2000000b0069b7145b2eemr6105996qvw.4.1713257574178; Tue, 16 Apr 2024 01:52:54 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <000000000000fe696d0615f120bb@google.com> <20240415131837.411c6e05eb7b0af077d6424a@linux-foundation.org> In-Reply-To: From: Alexander Potapenko Date: Tue, 16 Apr 2024 10:52:12 +0200 Message-ID: Subject: Re: [syzbot] [mm?] KMSAN: kernel-infoleak in bpf_probe_write_user To: Alexei Starovoitov Cc: Andrew Morton , syzbot , LKML , linux-mm , syzkaller-bugs , bpf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2024 at 11:06=E2=80=AFPM Alexei Starovoitov wrote: > > Hi, > > syzbot folks, please disable such "bug" reporting. > The whole point of bpf is to pass such info to userspace. > probe_write_user, various ring buffers, bpf_*_printk-s, bpf maps > all serve this purpose of "infoleak". > Hi Alexei, From KMSAN's perspective it is fine to pass information to the userspace, unless it is marked as uninitialized. It could be that we are missing some initialization in kernel/bpf/core.c th= ough. Do you know which part of the code is supposed to initialize the stack in PROG_NAME? > On Mon, Apr 15, 2024 at 1:18=E2=80=AFPM Andrew Morton wrote: > > > > (cc bpf@) > > > > On Fri, 12 Apr 2024 19:27:25 -0700 syzbot wrote: > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit: fec50db7033e Linux 6.9-rc3 > > > git tree: upstream > > > console+strace: https://syzkaller.appspot.com/x/log.txt?x=3D16509ba11= 80000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=3D13e7da432= 565d94c > > > dashboard link: https://syzkaller.appspot.com/bug?extid=3D79102ed905e= 5b2dc0fc3 > > > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for= Debian) 2.40 > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=3D10a4af9= d180000 > > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=3D12980f9d1= 80000 > > > > > > Downloadable assets: > > > disk image: https://storage.googleapis.com/syzbot-assets/901017b36ccc= /disk-fec50db7.raw.xz > > > vmlinux: https://storage.googleapis.com/syzbot-assets/16bfcf5618d3/vm= linux-fec50db7.xz > > > kernel image: https://storage.googleapis.com/syzbot-assets/dc9c5a1e7d= 02/bzImage-fec50db7.xz > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the = commit: > > > Reported-by: syzbot+79102ed905e5b2dc0fc3@syzkaller.appspotmail.com > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/= instrumented.h:114 [inline] > > > BUG: KMSAN: kernel-infoleak in __copy_to_user_inatomic include/linux/= uaccess.h:125 [inline] > > > BUG: KMSAN: kernel-infoleak in copy_to_user_nofault+0x129/0x1f0 mm/ma= ccess.c:149 > > > instrument_copy_to_user include/linux/instrumented.h:114 [inline] > > > __copy_to_user_inatomic include/linux/uaccess.h:125 [inline] > > > copy_to_user_nofault+0x129/0x1f0 mm/maccess.c:149 > > > ____bpf_probe_write_user kernel/trace/bpf_trace.c:349 [inline] > > > bpf_probe_write_user+0x104/0x180 kernel/trace/bpf_trace.c:327 > > > ___bpf_prog_run+0x13fe/0xe0f0 kernel/bpf/core.c:1997 > > > __bpf_prog_run64+0xb5/0xe0 kernel/bpf/core.c:2236 > > > bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] > > > __bpf_prog_run include/linux/filter.h:657 [inline] > > > bpf_prog_run include/linux/filter.h:664 [inline] > > > __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] > > > bpf_trace_run2+0x116/0x300 kernel/trace/bpf_trace.c:2420 > > > __bpf_trace_kfree+0x29/0x40 include/trace/events/kmem.h:94 > > > trace_kfree include/trace/events/kmem.h:94 [inline] > > > kfree+0x6a5/0xa30 mm/slub.c:4377 > > > vfs_writev+0x12bf/0x1450 fs/read_write.c:978 > > > do_writev+0x251/0x5c0 fs/read_write.c:1018 > > > __do_sys_writev fs/read_write.c:1091 [inline] > > > __se_sys_writev fs/read_write.c:1088 [inline] > > > __x64_sys_writev+0x98/0xe0 fs/read_write.c:1088 > > > do_syscall_64+0xd5/0x1f0 > > > entry_SYSCALL_64_after_hwframe+0x72/0x7a > > > > > > Local variable stack created at: > > > __bpf_prog_run64+0x45/0xe0 kernel/bpf/core.c:2236 > > > bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] > > > __bpf_prog_run include/linux/filter.h:657 [inline] > > > bpf_prog_run include/linux/filter.h:664 [inline] > > > __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] > > > bpf_trace_run2+0x116/0x300 kernel/trace/bpf_trace.c:2420 > > > > > > Bytes 0-7 of 8 are uninitialized > > > Memory access of size 8 starts at ffff888121ec7ae8 > > > Data copied to user address 00000000ffffffff > > > > > > CPU: 1 PID: 4779 Comm: dhcpcd Not tainted 6.9.0-rc3-syzkaller #0 > > > Hardware name: Google Google Compute Engine/Google Compute Engine, BI= OS Google 03/27/2024 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > > > > > > > --- > > > This report is generated by a bot. It may contain errors. > > > See https://goo.gl/tpsmEJ for more information about syzbot. > > > syzbot engineers can be reached at syzkaller@googlegroups.com. > > > > > > syzbot will keep track of this issue. See: > > > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > > > > > If the report is already addressed, let syzbot know by replying with: > > > #syz fix: exact-commit-title > > > > > > If you want syzbot to run the reproducer, reply with: > > > #syz test: git://repo/address.git branch-or-commit-hash > > > If you attach or paste a git patch, syzbot will apply it before testi= ng. > > > > > > If you want to overwrite report's subsystems, reply with: > > > #syz set subsystems: new-subsystem > > > (See the list of subsystem names on the web dashboard) > > > > > > If the report is a duplicate of another one, reply with: > > > #syz dup: exact-subject-of-another-report > > > > > > If you want to undo deduplication, reply with: > > > #syz undup > > > > -- > You received this message because you are subscribed to the Google Groups= "syzkaller-bugs" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to syzkaller-bugs+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgi= d/syzkaller-bugs/CAADnVQ%2BE%3Dj1Z4MOuk2f-U33oqvUmmrRcvWvsDrmLXvD8FhUmsQ%40= mail.gmail.com. -- Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Liana Sebastian Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg