From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5B4BC433DB for ; Sun, 14 Mar 2021 11:04:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1A7764EC0 for ; Sun, 14 Mar 2021 11:04:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235204AbhCNLD4 (ORCPT ); Sun, 14 Mar 2021 07:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234904AbhCNLD4 (ORCPT ); Sun, 14 Mar 2021 07:03:56 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFE31C061574 for ; Sun, 14 Mar 2021 04:03:55 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id d20so29011763qkc.2 for ; Sun, 14 Mar 2021 04:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZLrP4l4H65pb8M2x3DmR+dro99lUOubfCFMxCcIwSs8=; b=aqFQ0r0ajDoxAzsNxpA6vK0Zdj3ovoLhw+/jMkUZTnXEBFuxuFhCDIVChyina/YdNL TiaChHRMrS2bq6ra3/XwlhKAi448hL+T1ODNfJ9v536uUtYf6IVUoVavpUIjrXILA0aQ EXE5As5UjV1qrO0Du4u9rcqqtisZ5WumTKmyt4G85Y7rU3m2iEuTiPwyno8gVaViFGW1 ohQO7ehjYfrWMXVZwOiQfcUyiy56ZWJ+BV0GlxiMD7RFjQFo0jjnzjra3WZ0yO3WmyCP wjcshkgQEmEb2OyJmoUhnxUvF48KQt/9Xg5P6UtdJIksT1m727NGOrsTKH6u9a5ucfWx 9WDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZLrP4l4H65pb8M2x3DmR+dro99lUOubfCFMxCcIwSs8=; b=c6x4UWAIJVudBROGpq3L0f3D1OopChRmxbkjC6HfZwfe81J5wHb5MepuSI2srVRMCq eLDbFC8/R7VA9EOp8UXscu0oMdjk5SMgnGD7XN0am9DXmMqmG8WTZBFYV0TJFTWUK6mx p03QhqyhA4Ob7yVAjlYmDuaEShHDBo7ZWpbh97sJv/p1SYVbWHi7ybwy1sJ2LYZ28eYh sT63APDLQTfVlkSyroTUz4uWZRyQT4Sp7zQkC5J6sBYrKVcJsT3wa2R3RnoyRc0m4c/D jnIk25DH1b+v07x1cwXE+zZjGtevF2Tlu9gSnd1b4hCruaE/kIupYrrgaa3zqIZf4EfT je9Q== X-Gm-Message-State: AOAM533HbL5y0RNnujJKQCDvbR5MFkicr+3BVXXolaEUmnJiPfXiieS7 d9aHVVsQdDtp15J2YscCLrpzKOS/UJ4dr8GilrlNrQ== X-Google-Smtp-Source: ABdhPJwEegFcOLhpznys7nGUJ8jy4+601fJsOcZDpPR+EdJcnLdnSVL+p2u/yEUr6V/fvF+FJ96hAtYrDtqWf6oc7wU= X-Received: by 2002:a37:4743:: with SMTP id u64mr20614742qka.350.1615719834825; Sun, 14 Mar 2021 04:03:54 -0700 (PDT) MIME-Version: 1.0 References: <00000000000096cdaa05bd32d46f@google.com> In-Reply-To: From: Dmitry Vyukov Date: Sun, 14 Mar 2021 12:03:43 +0100 Message-ID: Subject: Re: [syzbot] BUG: unable to handle kernel access to user memory in sock_ioctl To: syzbot , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv Cc: andrii@kernel.org, Alexei Starovoitov , bpf , Daniel Borkmann , David Miller , John Fastabend , Martin KaFai Lau , kpsingh@kernel.org, Jakub Kicinski , LKML , netdev , Song Liu , syzkaller-bugs , Yonghong Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Sun, Mar 14, 2021 at 11:01 AM Dmitry Vyukov wrote: > > On Wed, Mar 10, 2021 at 7:28 PM syzbot > > wrote: > > > > > > Hello, > > > > > > syzbot found the following issue on: > > > > > > HEAD commit: 0d7588ab riscv: process: Fix no prototype for arch_dup_tas.. > > > git tree: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes > > > console output: https://syzkaller.appspot.com/x/log.txt?x=122c343ad00000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=e3c595255fb2d136 > > > dashboard link: https://syzkaller.appspot.com/bug?extid=c23c5421600e9b454849 > > > userspace arch: riscv64 > > > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > Reported-by: syzbot+c23c5421600e9b454849@syzkaller.appspotmail.com > > > > +riscv maintainers > > > > Another case of put_user crashing. > > There are 58 crashes in sock_ioctl already. Somehow there is a very > significant skew towards crashing with this "user memory without > uaccess routines" in schedule_tail and sock_ioctl of all places in the > kernel that use put_user... This looks very strange... Any ideas > what's special about these 2 locations? I could imagine if such a crash happens after a previous stack overflow and now task data structures are corrupted. But f_getown does not look like a function that consumes way more than other kernel syscalls... > > > Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000020000300 > > > Oops [#1] > > > Modules linked in: > > > CPU: 1 PID: 4488 Comm: syz-executor.0 Not tainted 5.12.0-rc2-syzkaller-00467-g0d7588ab9ef9 #0 > > > Hardware name: riscv-virtio,qemu (DT) > > > epc : sock_ioctl+0x424/0x6ac net/socket.c:1124 > > > ra : sock_ioctl+0x424/0x6ac net/socket.c:1124 > > > epc : ffffffe002aeeb3e ra : ffffffe002aeeb3e sp : ffffffe023867da0 > > > gp : ffffffe005d25378 tp : ffffffe007e116c0 t0 : 0000000000000000 > > > t1 : 0000000000000001 t2 : 0000003fb8035e44 s0 : ffffffe023867e30 > > > s1 : 0000000000040000 a0 : 0000000000000000 a1 : 0000000000000007 > > > a2 : 1ffffffc00fc22d8 a3 : ffffffe003bc1d02 a4 : 0000000000000000 > > > a5 : 0000000000000000 a6 : 0000000000f00000 a7 : ffffffe000082eba > > > s2 : 0000000000000000 s3 : 0000000000008902 s4 : 0000000020000300 > > > s5 : ffffffe005d2b0d0 s6 : ffffffe010facfc0 s7 : ffffffe008e00000 > > > s8 : 0000000000008903 s9 : ffffffe010fad080 s10: 0000000000000000 > > > s11: 0000000000020000 t3 : 982de389919f6300 t4 : ffffffc401175688 > > > t5 : ffffffc401175691 t6 : 0000000000000007 > > > status: 0000000000000120 badaddr: 0000000020000300 cause: 000000000000000f > > > Call Trace: > > > [] sock_ioctl+0x424/0x6ac net/socket.c:1124 > > > [] vfs_ioctl fs/ioctl.c:48 [inline] > > > [] __do_sys_ioctl fs/ioctl.c:753 [inline] > > > [] sys_ioctl+0x5c2/0xd56 fs/ioctl.c:739 > > > [] ret_from_syscall+0x0/0x2 > > > Dumping ftrace buffer: > > > (ftrace buffer empty) > > > ---[ end trace a5f91e70f37b907b ]--- > > > > > > > > > --- > > > 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.