Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2428927pxa; Mon, 24 Aug 2020 14:03:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOCOIhETr1uY5F6UPONsKbZuJvXYjK9YMg8DAY6OuTJOek7fDj7qUfYE4jtZNyJwquxQZX X-Received: by 2002:a17:906:2a0d:: with SMTP id j13mr7706525eje.474.1598303016460; Mon, 24 Aug 2020 14:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598303016; cv=none; d=google.com; s=arc-20160816; b=XwU+Emsj4WwmK4GOE1MMV5vSFzjat11E5+cKx8CvhZFt16w5ikQLFjGrM18nMAP1rL FQVvavnhSS8R4couQDDygknMl3VD3+Fvf9VNRJfTQOch2US5kyJtfVBwidiTu/jdRYmL oq63DTKaFcQo0pIp7MHxe4S4U2zP0XkCl41cgkIucli2Rq2OjKkgj9NT20F+Em5t+HoD HvupiHXMTQz3WPKh7R35pscoXt5Z3TmYRGQYAlslmLfYbSyOYbzdoQOy3oXFzCynVjes aqCmOs11WymrwFdL6Ve+0TBWK+rZxcqDu7gz7vDiZnMoEjls5tpsg24nNxX5u0G+6i9i aP+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dArBMjBu6Yjd06FGK20jndZ6EdlklVUmvStH3WB7sTA=; b=w33t3r3s7VjSGn/If4THVtLbRsUQD8zV25I/vN6SXjh7rjVnA1pfqGDUV8CtIaJOiq c4BIa76q067Myi8aY0ReVGjVc+tBtHPIKT999BfuWAThswaohIQdi6aOl8tXp7zjGU89 2mrT/8WEjpzUMl3Rb2Wo8xEoyF2i8vJb/9vfRNOCLp63mhp8D5IoVXSBy4kUXY0xTuuW IxSCEUJXFZEBPT6oBmnVtaI5SbRG6yHAJZaIPVOLnBcbcltNymVXrxzkRFRlUxjnwxWh +5sDQDngJ3jR5+1PKWJZq4KVanIKwW8MpO3i4dDbnkeGvdhNRw03G31NeZZoYl7D4jJ5 Ml+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VkxC5aDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si7329431edq.596.2020.08.24.14.03.12; Mon, 24 Aug 2020 14:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VkxC5aDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbgHXVA0 (ORCPT + 99 others); Mon, 24 Aug 2020 17:00:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:40450 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726365AbgHXVAV (ORCPT ); Mon, 24 Aug 2020 17:00:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598302819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dArBMjBu6Yjd06FGK20jndZ6EdlklVUmvStH3WB7sTA=; b=VkxC5aDG5QbqOjX1g7DlDCudiZ1qwdBeFesdRBdwrOExIvXIltOZ5b2p9gL/Iwi56Fp4FL xIYwSbOkMkuWs8cQ4UqykgaUTAuRdZwKrZ0WAEXOoZCQ/lZM7JWYBqVsSzL9mCQtWUdEPR sEt6DZ7Uak+wGfdjhFqC3L5/VHBXH/A= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-FP2fRMm_OI-atoC6kP-lmg-1; Mon, 24 Aug 2020 17:00:14 -0400 X-MC-Unique: FP2fRMm_OI-atoC6kP-lmg-1 Received: by mail-lf1-f69.google.com with SMTP id w24so1203788lfl.6 for ; Mon, 24 Aug 2020 14:00:14 -0700 (PDT) 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=dArBMjBu6Yjd06FGK20jndZ6EdlklVUmvStH3WB7sTA=; b=HYso5knZxK8O1MvT5mS+k++ujtFbcci9Mg+MDg37v72CpF1T54RBaFJ1tSM/YIkJOK ZX3zBjvCg3SI1/X1ttlo5/ASXv6DCEqeWai8w55p5rpMxeX0PDwjxer9bQR+s35cWC2T lakm8cXHOB6vC/UGFi31hWyiRSygDxSn6Lq6RIK1jS56wlfjxRGxbaxozXb3JMBIOqXp w0p1xPmsPGRsV1StQJhrp0k/+/dad5ZZx+1j9EnoAWaOKb5o+pllEmfzWFxPXUaqKECX 7U6PM5Ot4hghTKarN9S0LhJdXt/AG1h9Xqf7cQkXbGBnIc9SLwHbYAi76xxbThsshc4p rhww== X-Gm-Message-State: AOAM532m6Cpf/ahPuDQMSTYPnHQ5ntxizwQxi0Tk1F1ABxHH8BPhywyj Z1lbYHv8Kt8gL4ug4nUxl9OGTyApItf0rNSlGBEZEgkzf3QmxdnliRo0qSeZVOqqNq3Zi+xctVY 5PyK19pNL38AcDluTawtc/EmmgiBDdPY+pHJvO/qL X-Received: by 2002:ac2:568b:: with SMTP id 11mr3362061lfr.87.1598302811957; Mon, 24 Aug 2020 14:00:11 -0700 (PDT) X-Received: by 2002:ac2:568b:: with SMTP id 11mr3362038lfr.87.1598302811601; Mon, 24 Aug 2020 14:00:11 -0700 (PDT) MIME-Version: 1.0 References: <0000000000008caae305ab9a5318@google.com> <000000000000a726a405ada4b6cf@google.com> In-Reply-To: <000000000000a726a405ada4b6cf@google.com> From: Ondrej Mosnacek Date: Mon, 24 Aug 2020 23:00:00 +0200 Message-ID: Subject: Re: general protection fault in security_inode_getattr To: syzbot Cc: andriin@fb.com, Alexei Starovoitov , bpf , Daniel Borkmann , James Morris , john.fastabend@gmail.com, kafai@fb.com, KP Singh , Linux kernel mailing list , Linux Security Module list , network dev , "Serge E. Hallyn" , songliubraving@fb.com, syzkaller-bugs@googlegroups.com, yhs@fb.com, linux-fsdevel@vger.kernel.org, Miklos Szeredi , linux-unionfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 24, 2020 at 9:37 PM syzbot wrote: > syzbot has found a reproducer for the following issue on: Looping in fsdevel and OverlayFS maintainers, as this seems to be FS/OverlayFS related... See also original report against 5.8-rc7: https://lore.kernel.org/linux-security-module/0000000000008caae305ab9a5318@google.com/T/ > > HEAD commit: d012a719 Linux 5.9-rc2 > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=14aa130e900000 > kernel config: https://syzkaller.appspot.com/x/.config?x=891ca5711a9f1650 > dashboard link: https://syzkaller.appspot.com/bug?extid=f07cc9be8d1d226947ed > compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=104a650e900000 > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+f07cc9be8d1d226947ed@syzkaller.appspotmail.com > > general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN > KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] > CPU: 1 PID: 32288 Comm: syz-executor.3 Not tainted 5.9.0-rc2-syzkaller #0 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > RIP: 0010:d_backing_inode include/linux/dcache.h:549 [inline] > RIP: 0010:security_inode_getattr+0x42/0x140 security/security.c:1276 > Code: 1b fe 49 8d 5e 08 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 bc b4 5b fe 48 8b 1b 48 83 c3 68 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 9f b4 5b fe 48 8b 1b 48 83 c3 0c > RSP: 0018:ffffc9000a017750 EFLAGS: 00010202 > RAX: 000000000000000d RBX: 0000000000000068 RCX: ffff888093ec6180 > RDX: 0000000000000000 RSI: ffffc9000a017860 RDI: ffffc9000a017850 > RBP: ffffc9000a017850 R08: dffffc0000000000 R09: ffffc9000a017850 > R10: fffff52001402f0c R11: 0000000000000000 R12: ffffc9000a017860 > R13: 0000000000008401 R14: ffffc9000a017850 R15: dffffc0000000000 > FS: 00007f292d4ef700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 0000001b30920074 CR3: 00000000937fd000 CR4: 00000000001506e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > Call Trace: > vfs_getattr+0x21/0x60 fs/stat.c:121 > ovl_copy_up_one fs/overlayfs/copy_up.c:850 [inline] > ovl_copy_up_flags+0x2ef/0x2a00 fs/overlayfs/copy_up.c:931 > ovl_maybe_copy_up+0x154/0x180 fs/overlayfs/copy_up.c:963 > ovl_open+0xa2/0x200 fs/overlayfs/file.c:147 > do_dentry_open+0x7c8/0x1010 fs/open.c:817 > do_open fs/namei.c:3251 [inline] > path_openat+0x2794/0x3840 fs/namei.c:3368 > do_filp_open+0x191/0x3a0 fs/namei.c:3395 > file_open_name+0x321/0x430 fs/open.c:1113 > acct_on kernel/acct.c:207 [inline] > __do_sys_acct kernel/acct.c:286 [inline] > __se_sys_acct+0x122/0x6f0 kernel/acct.c:273 > do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > RIP: 0033:0x45d579 > Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 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 0f 83 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007f292d4eec78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a3 > RAX: ffffffffffffffda RBX: 0000000000000700 RCX: 000000000045d579 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000040 > RBP: 000000000118cf70 R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c > R13: 00007ffc8e04bc4f R14: 00007f292d4ef9c0 R15: 000000000118cf4c > Modules linked in: > ---[ end trace 7e4f1041b188e411 ]--- > RIP: 0010:d_backing_inode include/linux/dcache.h:549 [inline] > RIP: 0010:security_inode_getattr+0x42/0x140 security/security.c:1276 > Code: 1b fe 49 8d 5e 08 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 bc b4 5b fe 48 8b 1b 48 83 c3 68 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 9f b4 5b fe 48 8b 1b 48 83 c3 0c > RSP: 0018:ffffc9000a017750 EFLAGS: 00010202 > RAX: 000000000000000d RBX: 0000000000000068 RCX: ffff888093ec6180 > RDX: 0000000000000000 RSI: ffffc9000a017860 RDI: ffffc9000a017850 > RBP: ffffc9000a017850 R08: dffffc0000000000 R09: ffffc9000a017850 > R10: fffff52001402f0c R11: 0000000000000000 R12: ffffc9000a017860 > R13: 0000000000008401 R14: ffffc9000a017850 R15: dffffc0000000000 > FS: 00007f292d4ef700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 00007fef820e7000 CR3: 00000000937fd000 CR4: 00000000001506e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > -- Ondrej Mosnacek Software Engineer, Platform Security - SELinux kernel Red Hat, Inc.