Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1924579lqp; Tue, 16 Apr 2024 01:47:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDCYo7rMuJQryuJwL2Wb1Gqn6rv/KGxcUgKl3K/PJXFm+OYp3cFloE0NwkGaAHdNioHZrlTT70vL8U5vsJdD8H6frbCMl5H+8oSu8PKw== X-Google-Smtp-Source: AGHT+IGatyuUzK0VbJpxfuIBOIZOyShDcyfrI5JTtXWCUAwuV7/YJxUnC1Ak9voT1pghyjPARy6v X-Received: by 2002:a50:d7d8:0:b0:56b:ec47:a846 with SMTP id m24-20020a50d7d8000000b0056bec47a846mr7537871edj.25.1713257262562; Tue, 16 Apr 2024 01:47:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713257262; cv=pass; d=google.com; s=arc-20160816; b=ExMvBqtBmhXW9FJ7Ay4Wgu5VfDvDtOnnlm9MgBHOkpTaYtvRch/u6uGCb1oTY4Nt5n 9ygXuL2YKrjwwJx9NeLNaNozo8OPJpGMUAzEX5OMTXzkf9KcziiQqHU6yFU5MKXkaunR GtpjRb3LJL0aZaabnDGO1Nisl0Ed7Bov2bblq+Se2ZT8OP8Q1RI7ogxiv2saA2nG6gyh uVz7Lmva04xkoocFKDVVIlD3nB/M+dRAkZCpphZzMAf81gSK14an8T9jqPFUkD7Gw3DR YV6PKTcSVV3QxiBUeBDZ/V2fODykVB+g5fv+HeA3cSMXJDzU7Ht6DkTeqFBsal0secJF dCaQ== 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=cdFARpeJLKEG6lkXysYKLQ1MgRKXAzEEOOq2GHR99oo=; fh=V938ft3gZS+5dtNdYkqe8D7b3+AFA1iPv3DK7YDF0IU=; b=Z8KHvPKiXQWpt0Lp06H/u3tKUIMtAKPmNC4MvPi7qyKK/+ws2EQhafNhWasCp0k+IV reCI8rR/CkuELS4alz6Axco7jGtxR5I22SrAarxjQZDEg88EaANnCtmnOoNiBejwDEmO kST1PWggyRu9qJ4r4q8ei5yGDDSNR97YWKjVNiN/r8HT9Uq6S7t7YM9bfiZuZYgqX1t5 EDM+QUh3sQzHZ57iQ3mYqCowvsaka3AMGb9HHx6IzRWaG7iUe2FPtKeZa/bvHTRt3oal 9Kr237SbYFb5ANOoXZsRaUY/Rq5AL+s9IDawBbvFxd4YfhmVYBcjGwnMfH9UC7E+uaMO FvTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=C4jlf6u4; 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-146511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 y12-20020a056402270c00b0056bfe9ba67asi5492352edd.287.2024.04.16.01.47.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 01:47:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146511-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=@google.com header.s=20230601 header.b=C4jlf6u4; 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-146511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146511-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1C67E1F22A32 for ; Tue, 16 Apr 2024 08:46:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12EA283CD2; Tue, 16 Apr 2024 08:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="C4jlf6u4" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 699A0629 for ; Tue, 16 Apr 2024 08:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713257193; cv=none; b=KEFHe1ubcU2vV953BrHtfcjyN8df1EZ/9lIMJraVSCQkvcwDQ64s9ovymjaL++NjZP09qedANgzhfiBdlRV4wEHuAzI03onQ2AX2ZcOj9CrFOI0nZsYFFWnFB57kdSjr09dbXjsh34+ySheubrRN7i9YfnUr6iaMLg0IZW7txlA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713257193; c=relaxed/simple; bh=wvlbCfxHSZpaqmi0913qTIrGU+Bv5x+PhfrqBSY9p8c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tYPx0rXv8Vr/AVaEF43r4oMx5HY2UIRoekqZahx250GciOJgUn6hiOTntkfCG6Gi8N4zLyjEt1tF6707qd3fI/VRDGAagFBd/3FRtnnBg9X0K6vk5SWcJcVjQVlD8jkGKe4lUFsIoFed9BoMtOKdIH6rVEyl8smClh3mD8CBgME= 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=C4jlf6u4; arc=none smtp.client-ip=209.85.214.173 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-pl1-f173.google.com with SMTP id d9443c01a7336-1e44f82ff9cso92355ad.1 for ; Tue, 16 Apr 2024 01:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713257190; x=1713861990; 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=cdFARpeJLKEG6lkXysYKLQ1MgRKXAzEEOOq2GHR99oo=; b=C4jlf6u4BkMKAlXkp6H0vBHquDHwX3WsR4yryseN2YfQhSDvPR56UdRl7OWUpZIdbd oZg2JfuFLfN0ZIZGK1gwsUvqhLQeGJG+ZLRrQP7fuxzxDRmS4lHKzemRs66CailrCL4S UxUIj6dIUPf6SzBJc5HnR47Bx5veES1rc8xg86lDS/XumfsnCVuvcSh0TBRX8qJQCcAF DEjQiWpRz5BC2YexRviZU7CzdQVFa/HvJR0xtV1TcdxydkPYLGGc8OJmbIuKSjpy/plM XYdIZtMJAWjqwcyeXZJtJbC4XpRxFAaF64yp95Fte/iBJgLjuyWcmvXdMlI360AK9egK MYvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713257190; x=1713861990; 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=cdFARpeJLKEG6lkXysYKLQ1MgRKXAzEEOOq2GHR99oo=; b=YLxHYyFt+R2ERYjahtlt5d5ljhr0B8cvx7KOGnPHpbfafHGZoNjQqWNMRY9SnxJFqG Z6qjAe9raJdIniogdvcdvrMvO0rrcErzbXGvNFB9tqS8JMbvcFqiqxompVMZdsp7s1+D bTw1eDMvB+1XxqTHTidWMS/92RNMzhPAHenevSJVzxQRgpP0ZdXx+rBoD5cjGomfslXJ HBnIFtqgyOEvDA5hb2+D7Q4ti0v63vQNLNolIT3W+Qlm4hBB5GovrsR65NVwKhabvl4A gR0wh/CC9RBK7dEeUMz1+A3cK7fzFOUMy1EkgsUq803O+cvAHgvi0WlSWej7l86R6M9P h4Cg== X-Forwarded-Encrypted: i=1; AJvYcCVWdmzMn0uXoMLI2hUX1X4BvL/ES74ChDiSZ2FYcChJ/PTfWkxNua16BPqGmtYTP1v5ZjM8gJjWRY+XQhj3XvTN/z/CoXcOg7jXo+Je X-Gm-Message-State: AOJu0YxaNCZtxHkvYb6XkXYa92EFfiVs7DeYCQY4LId2uDnM4a8gjkUp IM7rfgrtWPDIiISv8wc/cx3LcSuNIYKfANwm9sCvApDZVNMdfB4kHo8vahAsoNlNzQmBq/dtl0D u/nOdv4lxyZnQ/dLivQ2NP+/vGr/khm2WODus X-Received: by 2002:a17:902:f548:b0:1e5:1138:e29d with SMTP id h8-20020a170902f54800b001e51138e29dmr143673plf.29.1713257189512; Tue, 16 Apr 2024 01:46:29 -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: Aleksandr Nogikh Date: Tue, 16 Apr 2024 10:46:16 +0200 Message-ID: Subject: Re: [syzbot] [mm?] KMSAN: kernel-infoleak in bpf_probe_write_user To: Alexei Starovoitov , Alexander Potapenko Cc: Andrew Morton , syzbot , LKML , linux-mm , syzkaller-bugs , bpf , Dmitry Vyukov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable (+Alexander Potapenko) Hi Alexei, Thanks for bringing this up! I guess some annotations in the kernel code need to be adjusted. Syzbot stress-tests the kernel, but in the end it's the kernel itself that detects problems and prints error reports. --=20 Aleksandr 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". > > 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.