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 4882DC4332D for ; Sun, 14 Mar 2021 10:13:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E095064EED for ; Sun, 14 Mar 2021 10:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235147AbhCNKCS (ORCPT ); Sun, 14 Mar 2021 06:02:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235100AbhCNKBx (ORCPT ); Sun, 14 Mar 2021 06:01:53 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA756C061574 for ; Sun, 14 Mar 2021 03:01:51 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id t5so6428398qvs.5 for ; Sun, 14 Mar 2021 03:01:51 -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=V9sT2+1xGWWst4bttpxK8qQ+hu8YuKQN51ohN8OT3c8=; b=V0E9YrVrqNrmHyaGGS2inR5EG2jdyBufEWpDo1J7GHy2CDxubNlpcs2qDjK8muao68 vJ/fBpCplKi9jzNcEsBT+NeZ5ZcU6wbjacQMfVTiCoXeodLZFL+3j9O+EmwgDRcgyqku WnLMo7j7BOPADrmvQn5Hf7D/mz9sCpNVKfglfFUsK+aYPBorVNl99DLBSw7mATQJKrm1 FViIjGdN5yZe1/RNfm4H6Kd592Q1I6cgrIYSYtiRMbY8NbsZtK6RCbnL1ew3GpJ16idM 8X9VNTXyQeyfLwUac+y1LdoA+rZ/Py48RhmKQL2E/tgLxh7LzN5p/sqB/6qs8KEMFfwp vhHw== 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=V9sT2+1xGWWst4bttpxK8qQ+hu8YuKQN51ohN8OT3c8=; b=dzRZOBH9j5TV36w7SDGnj8ZUmS5xG2nuhEg3t6wcDf8+NDEeKgDMSc/J+ZTrSDDJ4D k7ZHztDt9hJTLmnrK+H3RLDY3odcbGYR9S7XJ0fDNjMLzS+5JA/ffdF+fOtlC2Vq+VfV B+pQRownLS1xtQrwlHy+jnzC5XQLab/+j9ah51DODXgxdDTkduLelNdH/IsOuWkwzZ/2 EvbM5sIaetWWW1Ev0aQhIdTcefiqlTh/Bvh8SGYrog6hzsnak9BkGekapZEv62nUdt2x waLtNfVLCVNcuLE6vuO3QTykjEfD8f2/8EtSjIJY9GBMfFgp5tpl9kyw89fB/8CopBaG W/Pg== X-Gm-Message-State: AOAM533sAxlE6EoupjDtjANHjyOK8fyVmQ6N9d7OejgOODq7mMjUH3Yv O6oHOXHk7/mdJLI6D06VD0/79VR+TEi9FsEnBaikJQ== X-Google-Smtp-Source: ABdhPJy+VvF0EiHA6nUvKNqWlrBetdvLNPW+AK/wZIPRYlo9k7aSKbqQa7OoPlVK+wlWobmQl0SijN7Ooh4s/FNr5eA= X-Received: by 2002:a05:6214:326:: with SMTP id j6mr5856707qvu.13.1615716110661; Sun, 14 Mar 2021 03:01:50 -0700 (PDT) MIME-Version: 1.0 References: <00000000000096cdaa05bd32d46f@google.com> In-Reply-To: From: Dmitry Vyukov Date: Sun, 14 Mar 2021 11:01:39 +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 Wed, Mar 10, 2021 at 7:53 PM 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? > > 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.