Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp939557pxp; Wed, 16 Mar 2022 22:01:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynHFrWNsrfw0g6Nd8QV/ReiAeRwc269x+N1tXA9pW5fvJtpCa59aU6L8K3PnQZbzQzOBLz X-Received: by 2002:a63:c144:0:b0:373:d6e7:e78f with SMTP id p4-20020a63c144000000b00373d6e7e78fmr2218394pgi.571.1647493284340; Wed, 16 Mar 2022 22:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647493284; cv=none; d=google.com; s=arc-20160816; b=pVo9ngninSNY3I3tcCyz/2MfmGeR2SQ+veualSJ/1f1BzMlDtEY71rALxYYVsbiOI7 6dpw4hVFLlykuLAckWfQj8vPzHO/qyR1wdWrbQgKxfl5Pn9fKCvg3zt3x9uTRpd1t3GB OvxnafnW+FaNZ7H7FJ1OEAt3ntQ1+I4B1b+r/hcJy8JlahcHZbwNOfdpFxShfEk4KLOr /j8btTEci5wuWucLshbkKfuGjGdeiS/aIxTB5AfN40CMBQ1d3tn/C35bzhmKzRgutAeb fecLWmgi8i/Y0LSFYhn+ng5koLRhbn+gUo9awJNWyYiVpgKRpsNjGUBzak9SByyBNZ67 kvtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=bivPo3+wAVTQRldbFZu6B3qFC4oZ8xMuiisWGmykGhI=; b=it5Yf0+Lxq6c7x4pvNEv2h8Zq5UGwlK7mwLAmu+8NGKf8C83e5FvwHXJs3XIRBgAF0 /W1AVcIKAhu/2Lth+4BhSe0NgXoV826NhNjyBf/OYQsXdn97ZVs8TAh7m1pUsV6eEKL8 dOmFC8xJwiRI0wzazEEHiXflyejjcrdj14ujVH8W66zHNLrR2BZ9e/G1foeeTyG9Qu4r DOOM0dmDvoPC5vJ9FqdQVU5Cq6djrs+5jl/OoucI6LX98saUUYrp7WSZfptFhjiS1Yru XL+X93T1bxdw6hVCOFccLNMeb+Hb9AqfaJMf3u2LdqErfZMDSABiDqGvVVQI5wpcDINR WBZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m13-20020a638c0d000000b003816043efbdsi977074pgd.434.2022.03.16.22.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:01:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE2C91925AA; Wed, 16 Mar 2022 21:15:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343792AbiCOAAK (ORCPT + 99 others); Mon, 14 Mar 2022 20:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234318AbiCOAAJ (ORCPT ); Mon, 14 Mar 2022 20:00:09 -0400 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68DA7DFCC; Mon, 14 Mar 2022 16:58:58 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:44796) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nTuaW-002q7m-4N; Mon, 14 Mar 2022 17:58:56 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:37744 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nTuaU-005KY7-2l; Mon, 14 Mar 2022 17:58:55 -0600 From: "Eric W. Biederman" To: Pavel Begunkov Cc: Olivier Langlois , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Alexander Viro , Jens Axboe , Oleg Nesterov , Linus Torvalds References: <192c9697e379bf084636a8213108be6c3b948d0b.camel@trillion01.com> <9692dbb420eef43a9775f425cb8f6f33c9ba2db9.camel@trillion01.com> <87h7i694ij.fsf_-_@disp2133> <1b519092-2ebf-3800-306d-c354c24a9ad1@gmail.com> <13250a8d-1a59-4b7b-92e4-1231d73cbdda@gmail.com> <878rw9u6fb.fsf@email.froward.int.ebiederm.org> <303f7772-eb31-5beb-2bd0-4278566591b0@gmail.com> Date: Mon, 14 Mar 2022 18:58:28 -0500 In-Reply-To: <303f7772-eb31-5beb-2bd0-4278566591b0@gmail.com> (Pavel Begunkov's message of "Tue, 28 Dec 2021 11:24:56 +0000") Message-ID: <87ilsg13yz.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nTuaU-005KY7-2l;;;mid=<87ilsg13yz.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/LDPq3+2z3H5H31TkqwIyz8Jul6I65E2g= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Pavel Begunkov X-Spam-Relay-Country: X-Spam-Timing: total 1454 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 11 (0.8%), b_tie_ro: 10 (0.7%), parse: 1.07 (0.1%), extract_message_metadata: 13 (0.9%), get_uri_detail_list: 2.2 (0.1%), tests_pri_-1000: 6 (0.4%), tests_pri_-950: 1.37 (0.1%), tests_pri_-900: 1.09 (0.1%), tests_pri_-90: 61 (4.2%), check_bayes: 59 (4.1%), b_tokenize: 8 (0.6%), b_tok_get_all: 10 (0.7%), b_comp_prob: 2.9 (0.2%), b_tok_touch_all: 35 (2.4%), b_finish: 0.84 (0.1%), tests_pri_0: 1343 (92.4%), check_dkim_signature: 0.63 (0.0%), check_dkim_adsp: 2.4 (0.2%), poll_dns_idle: 0.45 (0.0%), tests_pri_10: 2.3 (0.2%), tests_pri_500: 11 (0.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC] coredump: Do not interrupt dump for TIF_NOTIFY_SIGNAL X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pavel Begunkov writes: > On 12/24/21 19:52, Eric W. Biederman wrote: >> Pavel Begunkov writes: > [...] >>> FWIW, I worked it around in io_uring back then by breaking the >>> dependency. >> I am in the middle of untangling the dependencies between ptrace, >> coredump, signal handling and maybe a few related things. > > Sounds great > >> Do folks have a reproducer I can look at? Pavel especially if you have >> something that reproduces on the current kernels. > > A syz reproducer was triggering it reliably, I'd try to revert the > commit below and test: > https://syzkaller.appspot.com/text?tag=ReproC&x=15d3600cb00000 > > It should hung a task. Syzbot report for reference: > https://syzkaller.appspot.com/bug?extid=27d62ee6f256b186883e > > > commit 1d5f5ea7cb7d15b9fb1cc82673ebb054f02cd7d2 > Author: Pavel Begunkov > Date: Fri Oct 29 13:11:33 2021 +0100 > > io-wq: remove worker to owner tw dependency > > INFO: task iou-wrk-6609:6612 blocked for more than 143 seconds. > Not tainted 5.15.0-rc5-syzkaller #0 > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > task:iou-wrk-6609 state:D stack:27944 pid: 6612 ppid: 6526 flags:0x00004006 > Call Trace: > context_switch kernel/sched/core.c:4940 [inline] > __schedule+0xb44/0x5960 kernel/sched/core.c:6287 > schedule+0xd3/0x270 kernel/sched/core.c:6366 > schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1857 > do_wait_for_common kernel/sched/completion.c:85 [inline] > __wait_for_common kernel/sched/completion.c:106 [inline] > wait_for_common kernel/sched/completion.c:117 [inline] > wait_for_completion+0x176/0x280 kernel/sched/completion.c:138 > io_worker_exit fs/io-wq.c:183 [inline] > io_wqe_worker+0x66d/0xc40 fs/io-wq.c:597 > ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 > ... Thank you very much for this. There were some bugs elsewhere I had to deal with so I am slower looking at this part of the code than I was expecting. I have now reproduced this with the commit reverted on current kernels and the repro.c from the syzcaller report. I am starting to look into how this interacts with my planned code changes in this area. In combination with my other planned changes I think all that needs to happen in do_coredump is to clear TIF_NOTIFY_SIGNAL along with TIF_SIGPENDING to prevent io_uring interaction problems. But we will see. The deadlock you demonstrate here shows that it is definitely not enough to clear TIF_NOTIFY_SIGNAL (without other changes) so that signal_pending returns false, which I was hoping was be the case. Eric