Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3900263pxv; Mon, 19 Jul 2021 11:29:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTaxGlIxIxGUYXT7QDBsJGmc1B67jbrfjk4EgZL+Np3mGjVFKpD/JBNlrJbbVu6u2kmWBL X-Received: by 2002:a17:906:c29a:: with SMTP id r26mr29236718ejz.235.1626719370690; Mon, 19 Jul 2021 11:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626719370; cv=none; d=google.com; s=arc-20160816; b=UYeHyFazX2XNLvqYEEYzYhVF8uOQazzUl2qTQjhATF8gAVIDaUaMkmC6llfDNGGWBR wr74vXUbFoXxUwOxrV3sNMY2/n1CkXoV048WFL4YmW0lhfJQmqPK7VpamwoTBArX1i16 IygmLqN59KbomLJJL2C6gQejgIk3MrPOSyNjjJ/IOMMbGH49qGikyqiNfdnLOr+vAbeX WRrBHPfEnOYZLdLiD4y7PyQiSXL/QEEOym7b6y+tnEI7nEUomtVXdos72WmrhKmMM8hE C1TspkhOiLl+rUZA/D4/FYgtlfbjShm0FUc5tOnHg9Dlf/pRCJy46a+Lq+9UyGvsDzbx fqUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=bC4MxiMR6/WdBb2kDanGoPVgU3HczlOrNCuENL6GncA=; b=imLMz7Iui1EjG8yeEMUywmzpWni5EGa4u450Ol+ms+e9GPol5Q8tShiTbDRVksNe4r fAZsRRHMpNW+IW6Vl9XHGFZg3H0ZvXJlBp4Vh/44AVuBGmrN2quDoFd7sdBTNLAci6BY e+53fAXoN+tXuNUA4NBvKa39LsJa4Yce+ThsB+cJhlX74bhJ8BoKY8xvht/rJbN0Z1me kO6yp3E7XqVWHVbb1l0hvzbnSZDxtoNmtgP633Ud0WJipNCNf3XGAUcDXIDTM5iSBy8U VP3VoI+atKxLCoHOnZCKEDoyYGqJzw8gZ+nGqU2fKr+WtbhZaxbZ6bvhj2jus/2lVKeo dpdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=hmXqMxM2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb9si20567791edb.385.2021.07.19.11.29.07; Mon, 19 Jul 2021 11:29:30 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=hmXqMxM2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354579AbhGSRlp (ORCPT + 99 others); Mon, 19 Jul 2021 13:41:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351744AbhGSQnG (ORCPT ); Mon, 19 Jul 2021 12:43:06 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 858CBC04DF10 for ; Mon, 19 Jul 2021 09:53:59 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id g4-20020a17090ace84b029017554809f35so14465063pju.5 for ; Mon, 19 Jul 2021 10:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=bC4MxiMR6/WdBb2kDanGoPVgU3HczlOrNCuENL6GncA=; b=hmXqMxM2ozNMJ1yd6YypN9dBzCd+cMV0TLASzlrgrOGE4S1FEdB1xHLRbxl80iZ3S+ 3B3IQb9oULtT+YvHvVJVD6DKYWYiyWhbeMTe9mtTJPSd01e/MaWGfFOXjt1aR923HG7M AS/rTwsj8xdw/09zpeklv9sBOXOgjtGtp5rFttSqWEMMrXGgwTajHwdgSUZhjZ+ua5RD 56RF3cF2YZrSuKSfeogJKeljBmIg7FYgVAcKY4ZRXtAiPHBM5gENsJhBKrAe9LVLj+hZ QYVJ3dEly0d75TEjNJkv4knWAfaYVClm/4HObWFpbq3sDC77xh3k5tJJtULb5YIWdU6A mb/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bC4MxiMR6/WdBb2kDanGoPVgU3HczlOrNCuENL6GncA=; b=cr/NTkI6nNXlz9NjiP3tNgJrArVoI7DuI0OYcvZ1xkFz8icLy7xLs1K55ZnOAF+QJx +QhtUWP8a19BMV1lt2Sri6xMmufDz7TNpigSO8uVUqRF5CkwhRTN5i0UoCk34eHV4p2P OhjGSw0V6V4hVbNa7VBrKKKi+0JRYdxj225Ls2kDBcqP3L7dnnuS87vngRvrxEDJYoou DmY8NFhB+up22cbTWRLZWPo38p03qEpOJ0Jf/Y3qE8Aa2P5iWcaqQdzgxNftam1g4yai nAMulUB4nx4cxLjIJ77zewKJM7fkpDYTDwA8dGZNm5Z8JKVg4NAFQUOLH68uYllYpQEZ 9cjg== X-Gm-Message-State: AOAM530KNZQna74d2I/fvI36QUwhuTvlnRhO2VOX60EaqsSwjBmjeiHE IjD4VNvkgeSBkUa8on/iG6DWKg== X-Received: by 2002:a17:90a:c506:: with SMTP id k6mr31496920pjt.198.1626714833812; Mon, 19 Jul 2021 10:13:53 -0700 (PDT) Received: from [192.168.1.187] ([198.8.77.61]) by smtp.gmail.com with ESMTPSA id k5sm21279333pfu.142.2021.07.19.10.13.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jul 2021 10:13:53 -0700 (PDT) Subject: Re: [syzbot] INFO: task hung in io_sq_thread_park (2) To: Pavel Begunkov , syzbot , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, syzkaller-bugs@googlegroups.com, will@kernel.org References: <000000000000e1f38205c73b72cc@google.com> From: Jens Axboe Message-ID: <3ff29943-0f93-1381-1c8a-46f80aecd0b4@kernel.dk> Date: Mon, 19 Jul 2021 11:13:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/21 10:57 AM, Pavel Begunkov wrote: > On 7/16/21 11:57 AM, syzbot wrote: >> Hello, >> >> syzbot has tested the proposed patch but the reproducer is still triggering an issue: >> WARNING in io_uring_cancel_generic > > __arm_poll doesn't remove a second poll entry in case of failed > __io_queue_proc(), it's most likely the cause here. > > #syz test: https://github.com/isilence/linux.git syztest_sqpoll_hang Was my thought on seeing the last debug run too. Haven't written a test case, but my initial thought was catching this at the time that double poll is armed, in __io_queue_proc(). Totally untested, just tossing it out there. diff --git a/fs/io_uring.c b/fs/io_uring.c index 0cac361bf6b8..ed33de5fffd2 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5002,6 +5002,9 @@ static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt, if (unlikely(poll->head)) { struct io_poll_iocb *poll_one = poll; + /* first poll failed, don't arm double poll */ + if (pt->error) + return; /* already have a 2nd entry, fail a third attempt */ if (*poll_ptr) { pt->error = -EINVAL; -- Jens Axboe