Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3737335ybv; Tue, 25 Feb 2020 06:29:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwLZpXAfa/hA1EMVs94inaCqcrWgUsu7l8Lc5YnmyehxCq6lhJm2t2Az3Dm6M0Yb6rgtg1q X-Received: by 2002:a9d:6443:: with SMTP id m3mr43631339otl.20.1582640989978; Tue, 25 Feb 2020 06:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582640989; cv=none; d=google.com; s=arc-20160816; b=n/jYuJ1CUqKFia0zEdgVoHWOuoK7Dq8YEqb01msBGoymQhd2vhGSwk/LBx172Zl8B5 S0qkeUIqHXUT/SiOQjy0PYVHyk8WKP+JKiz7shp1fu2quORTDUd6BJOPezueh5BfO3YJ uPmtfwniDJh5xjBWuV5fB5UB1ZEswoYQe6j8EJa0teI6/o3DMKgIa1tgvVQwFNb/hsF6 1lfW6T3qnwJTPK+DA/0Wvgfb/Qp74R2fBPbraW+V8iqwL83TiG7FE5kg0D+KaKi/ILFW pau4QCaaQXkjWAv/SiXYL3pZAu2MDAW7PmTFtjhZ2feSOqtfdpj2ZE+c59kSFIQlVPRy WERQ== 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=WvYGv8xN+w/SUBCWE+CoNscUIV7+ScpQFYEooaj8Z1c=; b=t+B0tRMnjwNsS1wJlh4u1xVtbi8WOMJq2cAqx2zOatSC6ysdVjwftch+4K0xDNap0w 3+ZfVaGdQ3F3C4fFYdri9exLyLVZqH9MAy1WqBrcdzl1xgPoX6nCrVhX37PEC0ko1Bk7 YF+OUifivPj4FZVFkwEiLUtHIndLB4mpquOsU6PpnxNb/Gtp9na7nXa2llH38t5U1MsB ztqOoYmeGSr/SjDVGA6oJDohCxU0WzSAgmBF/u8yve9BTSxYZFRAVwrlt+28Spux2qeS Ky1sVkVNR+YxvC8UZUJNU6us4XyDwQvPztSrtBYm8ccIlKkDj6SYhjAqXBeGIFCkLEvz DG9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LPWCNZ3Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23si7985274oti.65.2020.02.25.06.29.33; Tue, 25 Feb 2020 06:29:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LPWCNZ3Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730781AbgBYO2F (ORCPT + 99 others); Tue, 25 Feb 2020 09:28:05 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:45031 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730757AbgBYO2E (ORCPT ); Tue, 25 Feb 2020 09:28:04 -0500 Received: by mail-qt1-f195.google.com with SMTP id j23so9124290qtr.11 for ; Tue, 25 Feb 2020 06:28:03 -0800 (PST) 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=WvYGv8xN+w/SUBCWE+CoNscUIV7+ScpQFYEooaj8Z1c=; b=LPWCNZ3YxMHTL7Q7dPalvXEujGlkQ8tRXyBT/5BjWctRPf0/PYnf5M/hZdsrz9/lWU 3gMKqV3GYdS8Z0CYfte8BOCVSBngbSW1BdXnB0WILNLv3kVsoJvaTWxPXvNdhsBn3qQ9 F+Ifwv67cH/ryZeK1cf4lxS2ZN5JSju4kx3hi/Lhm1jmf0BMvSxpt2GS2HYsMzzr7Lum mla+JC8oqknzqPLa+J4SuC39w8lVzVkpxD3R6gLgbmpuhH2zlDhv8efipV23iVfEmW6B ruY/etXZqSHeTJ3Xh+pZNwmiWa6ymzlA8PAtA6PPRbJk7BWYvQ9c814wTCE/Fxk0b9eQ vxfw== 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=WvYGv8xN+w/SUBCWE+CoNscUIV7+ScpQFYEooaj8Z1c=; b=X++GLWi0JHpzLrX4ILri3uSwPVAtrRSJMyH4R/ytDAKJsOHb8ds7n0Z1hRTk0xXvpj tvt+cJ14v2sIzp3EZ+5tNZmaK0FVjh7SwqrARFXgxJRem2fbtNO4pPX3eVDiRiQSah38 ZY5ASMXYFENNCXyqj9TVoSq+w24YxG8StAtLnh4I4eTc8EHBHXhvdzHfCFDIkURohix4 tmjZULmQ/d/LYiFoQ1fu/yITo7RhFXTb6ZF4wHQkNEFnl1H9rmVMTurifL8Becxwamly Q3brcqlxAzEwuMbl+c2FRX4Bzy09rGUHncsYdNQpnqmTaoRDUkI3RdZS3VKPoYv7QTU2 5LhA== X-Gm-Message-State: APjAAAU5T/7Y9Wedubf1cfxtFyOAyYgp+cJQgWyB+++JLNYQrn7hghkx YBQNHDIR1RdiZ2hYvgpCQU1tReQjsWPL6Cig8lC0Rw== X-Received: by 2002:ac8:7159:: with SMTP id h25mr53587846qtp.380.1582640882721; Tue, 25 Feb 2020 06:28:02 -0800 (PST) MIME-Version: 1.0 References: <000000000000a719a9059f62246e@google.com> In-Reply-To: From: Dmitry Vyukov Date: Tue, 25 Feb 2020 15:27:51 +0100 Message-ID: Subject: Re: BUG: unable to handle kernel NULL pointer dereference in cipso_v4_sock_setattr To: Paul Moore , Paolo Abeni Cc: syzbot , cpaasch@apple.com, David Miller , Davide Caratti , Florian Westphal , kuba@kernel.org, Alexey Kuznetsov , LKML , linux-security-module , matthieu.baerts@tessares.net, netdev , peter.krystad@linux.intel.com, syzkaller-bugs , Hideaki YOSHIFUJI 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 Tue, Feb 25, 2020 at 3:20 PM Paul Moore wrote: > > On Tue, Feb 25, 2020 at 3:19 AM syzbot > wrote: > > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit: ca7e1fd1 Merge tag 'linux-kselftest-5.6-rc3' of git://git... > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=179f0931e00000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=a61f2164c515c07f > > dashboard link: https://syzkaller.appspot.com/bug?extid=f4dfece964792d80b139 > > compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14fdfdede00000 > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17667de9e00000 > > > > The bug was bisected to: > > > > commit 2303f994b3e187091fd08148066688b08f837efc > > Author: Peter Krystad > > Date: Wed Jan 22 00:56:17 2020 +0000 > > > > mptcp: Associate MPTCP context with TCP socket > > > > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14fbec81e00000 > > final crash: https://syzkaller.appspot.com/x/report.txt?x=16fbec81e00000 > > console output: https://syzkaller.appspot.com/x/log.txt?x=12fbec81e00000 > > > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > > Reported-by: syzbot+f4dfece964792d80b139@syzkaller.appspotmail.com > > Fixes: 2303f994b3e1 ("mptcp: Associate MPTCP context with TCP socket") > > > > BUG: kernel NULL pointer dereference, address: 0000000000000000 > > #PF: supervisor instruction fetch in kernel mode > > #PF: error_code(0x0010) - not-present page > > PGD 8e171067 P4D 8e171067 PUD 93fa2067 PMD 0 > > Oops: 0010 [#1] PREEMPT SMP KASAN > > CPU: 0 PID: 8984 Comm: syz-executor066 Not tainted 5.6.0-rc2-syzkaller #0 > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > > RIP: 0010:0x0 > > Code: Bad RIP value. > > RSP: 0018:ffffc900020b7b80 EFLAGS: 00010246 > > RAX: 1ffff110124ba600 RBX: 0000000000000000 RCX: ffff88809fefa600 > > RDX: ffff8880994cdb18 RSI: 0000000000000000 RDI: ffff8880925d3140 > > RBP: ffffc900020b7bd8 R08: ffffffff870225be R09: fffffbfff140652a > > R10: fffffbfff140652a R11: 0000000000000000 R12: ffff8880925d35d0 > > R13: ffff8880925d3140 R14: dffffc0000000000 R15: 1ffff110124ba6ba > > FS: 0000000001a0b880(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000 > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > CR2: ffffffffffffffd6 CR3: 00000000a6d6f000 CR4: 00000000001406f0 > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > Call Trace: > > cipso_v4_sock_setattr+0x34b/0x470 net/ipv4/cipso_ipv4.c:1888 > > netlbl_sock_setattr+0x2a7/0x310 net/netlabel/netlabel_kapi.c:989 > > smack_netlabel security/smack/smack_lsm.c:2425 [inline] > > smack_inode_setsecurity+0x3da/0x4a0 security/smack/smack_lsm.c:2716 > > security_inode_setsecurity+0xb2/0x140 security/security.c:1364 > > __vfs_setxattr_noperm+0x16f/0x3e0 fs/xattr.c:197 > > vfs_setxattr fs/xattr.c:224 [inline] > > setxattr+0x335/0x430 fs/xattr.c:451 > > __do_sys_fsetxattr fs/xattr.c:506 [inline] > > __se_sys_fsetxattr+0x130/0x1b0 fs/xattr.c:495 > > __x64_sys_fsetxattr+0xbf/0xd0 fs/xattr.c:495 > > do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 > > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > Netdev folks, I'm not very familiar with the multipath TCP code so I > was wondering if you might help me out a bit with this report. Based > on the stack trace above it looks like for a given AF_INET sock "sk", > inet_sk(sk)->is_icsk is true but inet_csk(sk) is NULL; should this be > possible under normal conditions or is there an issue somewhere? Paolo has submitted some patch for testing for this bug, not sure if you have seen it, just in case: https://groups.google.com/forum/#!msg/syzkaller-bugs/dqwnTBh-MQw/LhgSZYGsBgAJ