Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp837552rwl; Thu, 5 Jan 2023 05:23:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXvut3lkTHDyzP3Pg5TtYm6Me7RyIcvKLWeFZ83eGYDifI5NoQmSgP0EQLpO8duL5AhO2B/6 X-Received: by 2002:a17:906:1c59:b0:7e5:856d:6365 with SMTP id l25-20020a1709061c5900b007e5856d6365mr43215115ejg.50.1672924994659; Thu, 05 Jan 2023 05:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672924994; cv=none; d=google.com; s=arc-20160816; b=tSIOJy6+e2vToUECwRBlm0Bvpxxo+zoWzNVDfwHZ66AdMgY0NhxOmKySgqSH2OExOF 25i2XgzKtcs7A6WcaS8FIhMfM0If8U70ArbbgLL4zY/EMTLnEcj/TwrsD47lDHj2IPgL kxsCdmSY+HzZ9vwP4Kkr73b/gv5mmF5NXDm2E6yTXe4XWnSD65Pk2h1YdIFxF1fL5i3l vJudtjsy00fmQ8LRkyimR28XPQ/2zMd1C2eR8LA0ZRDNYUL4qdOXCMNSrnXEq+/hbVx3 2NDpRX5eHyJOFAETxwaAs00s/uezK4kbnmhap1pKm9GwSfzix41XeUL1BKIB3f7rmQ1f pB2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=8WGVyRhEAn0+TtSP18cnfFmSDtI8CvwxbXiFAMb3+l8=; b=x4pS3zqSw8ShwocYdDDFKWV+42T3Na1UYOanGQ/rp8FSwyvxiU3uyoNSQ7H7mm16ZP u409SLodOg16sdOZrOuhRYHuO3Dt3s4xGVGF8Zf16IBwMDxslS6kLz7cXEgcsc+S0nD8 koOnYDhjbMLoi/P/MOpCQHfoGZ+CRL/a1TiHv/kYmcQ/euA7KnqMvxFa6ZZ6W2rCP0yR Dk4RDu89VY7AxC1d51Hvy3TzmVuOAtkhf3gtxG6CU2mqjMlpnBf0Y+20rrqLBhVXQGH/ WtIA6Qw3cDq4jgfqvDQFevjil+6O1hMCzxIMVfgydeNs7ZEs1I8HQa24J8Hz/Q1g3XpW 9XvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=fO+NpLNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be5-20020a1709070a4500b007c1727f7c6fsi31594632ejc.261.2023.01.05.05.23.01; Thu, 05 Jan 2023 05:23:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=fO+NpLNK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbjAENPz (ORCPT + 56 others); Thu, 5 Jan 2023 08:15:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232153AbjAENPv (ORCPT ); Thu, 5 Jan 2023 08:15:51 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931931C3 for ; Thu, 5 Jan 2023 05:15:48 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id vm8so83051868ejc.2 for ; Thu, 05 Jan 2023 05:15:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=8WGVyRhEAn0+TtSP18cnfFmSDtI8CvwxbXiFAMb3+l8=; b=fO+NpLNKOGf6gW+JdDIhspBquPZyqThb+mhLqEmYRP1Mcx5skuDb1IQV9ap8g1UXD6 vTJJmRIn9JOWxf+mZqGIH1WdstfoBtN5lVc5IrBdfOXLM1gg7UoZen+sIMiL6BMF0BOd zc2c3QyjVCEbzv4b9KPPcTyXjNLcf+GIZsmbY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8WGVyRhEAn0+TtSP18cnfFmSDtI8CvwxbXiFAMb3+l8=; b=aUc3kJTpHWxnJpU1+gkT9cIkghqeFCxrCOO507ElL5MlVrd6nCXbntp+QBOA3w//Eh rJVqUhLI3W4Qj+mSjrdHYgQIgJToLwSt8BplbQnF7NfoJjEk6nAVAPDhbJZa9X/WcWxC oIBKACUPvIbjbmRyrHHbjfI0nqZTscZliRLIIJv3LJlCORZ+QOgvE1aNWMhcARNUgkra u0xjbL+VLASjsIEc8VcRoFKE+pbkpkOYN+NFxw6htape0tIkU0y58dGjRu6jVETyNNij n2GqBEKOB6a+E8NRgZJRL5gAizob9hLfs858GhT9ghfM9jPW/DlkNInSWBT3toagAFcF J91A== X-Gm-Message-State: AFqh2kq6mB88/XLsiuznUvOpiPgU16oxgmGu7RmUFvC8pMgex/0EJ9Ge 5l9NkRiETgDCad1oK9Eb8T6dmw== X-Received: by 2002:a17:907:c242:b0:7c4:fc02:46a3 with SMTP id tj2-20020a170907c24200b007c4fc0246a3mr51359635ejc.30.1672924547140; Thu, 05 Jan 2023 05:15:47 -0800 (PST) Received: from cloudflare.com (79.184.146.66.ipv4.supernova.orange.pl. [79.184.146.66]) by smtp.gmail.com with ESMTPSA id gf26-20020a170906e21a00b007c0b9500129sm16438182ejb.68.2023.01.05.05.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 05:15:45 -0800 (PST) References: <00000000000073b14905ef2e7401@google.com> <639034dda7f92_bb36208f5@john.notmuch> <6391a95864c5e_1ec2b208a@john.notmuch> User-agent: mu4e 1.6.10; emacs 27.2 From: Jakub Sitnicki To: John Fastabend , Eric Dumazet Cc: syzbot , bpf@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] BUG: stack guard page was hit in inet6_release Date: Thu, 05 Jan 2023 14:07:11 +0100 In-reply-to: <6391a95864c5e_1ec2b208a@john.notmuch> Message-ID: <87k021m8an.fsf@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 08, 2022 at 01:07 AM -08, John Fastabend wrote: > Eric Dumazet wrote: >> On Wed, Dec 7, 2022 at 7:38 AM John Fastabend wrote: >> > >> > syzbot wrote: >> > > Hello, >> > > >> > > syzbot found the following issue on: >> > > >> > > HEAD commit: 6a30d3e3491d selftests: net: Use "grep -E" instead of "egr.. >> > > git tree: net >> > > console+strace: https://syzkaller.appspot.com/x/log.txt?x=1576b11d880000 >> > > kernel config: https://syzkaller.appspot.com/x/.config?x=cc4b2e0a8e8a8366 >> > > dashboard link: https://syzkaller.appspot.com/bug?extid=04c21ed96d861dccc5cd >> > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for >> > > Debian) 2.35.2 >> > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14e1656b880000 >> > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1077da23880000 >> > > >> > > Downloadable assets: >> > > disk image: >> > > https://storage.googleapis.com/syzbot-assets/bbee3d5fc908/disk-6a30d3e3.raw.xz >> > > vmlinux: https://storage.googleapis.com/syzbot-assets/bf9e258de70e/vmlinux-6a30d3e3.xz >> > > kernel image: >> > > https://storage.googleapis.com/syzbot-assets/afaa6696b9e0/bzImage-6a30d3e3.xz >> > > >> > > IMPORTANT: if you fix the issue, please add the following tag to the commit: >> > > Reported-by: syzbot+04c21ed96d861dccc5cd@syzkaller.appspotmail.com >> > > >> > > BUG: TASK stack guard page was hit at ffffc90003cd7fa8 (stack is >> > > ffffc90003cd8000..ffffc90003ce0000) >> > > stack guard page: 0000 [#1] PREEMPT SMP KASAN >> > > CPU: 0 PID: 3636 Comm: syz-executor238 Not tainted >> > > 6.1.0-rc7-syzkaller-00135-g6a30d3e3491d #0 >> > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS >> > > Google 10/26/2022 >> > > RIP: 0010:mark_lock.part.0+0x26/0x1910 kernel/locking/lockdep.c:4593 >> > > Code: 00 00 00 00 41 57 41 56 41 55 41 89 d5 48 ba 00 00 00 00 00 fc ff df >> > > 41 54 49 89 f4 55 53 48 81 ec 38 01 00 00 48 8d 5c 24 38 <48> 89 3c 24 48 >> > > c7 44 24 38 b3 8a b5 41 48 c1 eb 03 48 c7 44 24 40 >> > > RSP: 0018:ffffc90003cd7fb8 EFLAGS: 00010096 >> > > RAX: 0000000000000004 RBX: ffffc90003cd7ff0 RCX: ffffffff8162a7bf >> > > RDX: dffffc0000000000 RSI: ffff88801f65e238 RDI: ffff88801f65d7c0 >> > > RBP: ffff88801f65e25a R08: 0000000000000000 R09: ffffffff910f4aff >> > > R10: fffffbfff221e95f R11: 0000000000000000 R12: ffff88801f65e238 >> > > R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000040000 >> > > FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 >> > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >> > > CR2: ffffc90003cd7fa8 CR3: 000000000c28e000 CR4: 00000000003506f0 >> > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 >> > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 >> > > Call Trace: >> > > >> > > mark_lock kernel/locking/lockdep.c:4598 [inline] >> > > mark_usage kernel/locking/lockdep.c:4543 [inline] >> > > __lock_acquire+0x847/0x56d0 kernel/locking/lockdep.c:5009 >> > > lock_acquire kernel/locking/lockdep.c:5668 [inline] >> > > lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 >> > > lock_sock_nested+0x3a/0xf0 net/core/sock.c:3447 >> > > lock_sock include/net/sock.h:1721 [inline] >> > > sock_map_close+0x75/0x7b0 net/core/sock_map.c:1610 >> > >> > I'll take a look likely something recent. >> >> Fact that sock_map_close can call itself seems risky. >> We might issue a one time warning and keep the host alive. > > Agree seems better to check the condition than loop on close. > I still need to figure out the bug that got into this state > though. Thanks. I know what is happening. We're not restoring sk_prot in the child socket on clone. tcp_bpf_clone() callback currently restores sk_prot only if the listener->sk_prot is &tcp_bpf_prots[*][TCP_BASE]. It should also check for TCP_BPF_RX/TXRX. It's a regression that slipped through with c5d2177a72a1 ("bpf, sockmap: Fix race in ingress receive verdict with redirect to self"). And we're clearly missing selftest coverage for this scenario. I can fix that.