Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp481200pxa; Tue, 11 Aug 2020 07:46:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzORlJfYZyT0tDCI997xoDIm5AgbbpoKlOELYR64AKoqhXqXlz5zVn82xUcSGj3aCCsJWPu X-Received: by 2002:a17:906:a4b:: with SMTP id x11mr28068919ejf.83.1597157204862; Tue, 11 Aug 2020 07:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597157204; cv=none; d=google.com; s=arc-20160816; b=j6byN3RcLluj9Zlj02jnmNZZXxOZjP/idjEPGh/8v5YN0zB4nAnSz8doxs2NYpy2gD FakPU9CUZnVirlUD37o86Q4scNHMiU6XalrpAMA7knUr/iaYDr9yj2Gr/mnbSWFPG8ix YPYtMCUD9r8acRpigOQ0C9gHde7Yc4NXenIAzB1m5St6febVnAI5aNEU8loCiQKUiLfp zi44JCoGZGyFvTWSVKF3gWwCfpHMm9zrqeC1Fpmk50aGKKQoFo5Glq9TO/Txnl5nMDyT kJc299Xp+rf15lOOjTcRb78vSKsGhrJiNLtHJztq4tYzEaI/68BaLd7ZbKEWd4Hcsh0a fxSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0TKJ8QiOGw2cS0Spzetvjqqgie96cDTA3YQauzdWsow=; b=VYutuFoK1AMACpDJm2KPbq1/eBRokTz0CGEz/JK+uCHwVEWXriVKIBsnpbRzyJvevN oQJ3ZIQhbtuZNyXnKKMImhT09pbVxI8LWUFm+K3DHUXRLlYs73tqmbETcSLOlBMXE0vI Z/Bsx2ZfqeHVrejdLHkhnxtMZspIZlS8qNlxeGzssDstKjovqVZpRUGc6989gYkhvHTD w6Xz4tgRSXQyH+h+LoYBd8T7i8IDMKeVpm5X0+UGpRHQ5fkrBhp0VlO8cPURvKxopD/s f8s5mK/iEuBtEurPqhRAFDcVdSRjhJCzpzQxk6CG8uT+hnLjqS4OrpJnAAEORgDgJZBU E+Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=sE1l4Jh9; 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 cb1si12259111edb.88.2020.08.11.07.46.21; Tue, 11 Aug 2020 07:46:44 -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=sE1l4Jh9; 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 S1728794AbgHKOpt (ORCPT + 99 others); Tue, 11 Aug 2020 10:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbgHKOps (ORCPT ); Tue, 11 Aug 2020 10:45:48 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924E3C061788 for ; Tue, 11 Aug 2020 07:45:48 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id u10so6908153plr.7 for ; Tue, 11 Aug 2020 07:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0TKJ8QiOGw2cS0Spzetvjqqgie96cDTA3YQauzdWsow=; b=sE1l4Jh9OMKhr6xkroUSS+SsiF3XTlxMVq54bvxBNHB0HnSBRmgi14cdjhUvy/fMtl gdau5+ZUXd9R7E1FQD26A22G4PI6hs0d1cDOFFVFNLUWQpYYKdeKQTWk+LmlJvc3PpSj NNboc4l12wzSTutNqGLd4oNJ9OxsfwP3ugQOa0LDf01ZD2l9kQQUnAio+1EI8/F6I90y CBoOE14OjyFNaHXtsLxUWEkFLeYfyBzqp9C5rmJHYr87GWLRcJwzW4LskCOJSZhri+m0 0XIDSqFtVfWxMBbJUwblt5zoQxxSCllh59qRDLqYCf1N12aUch673H4de3PfwPlPUxMx 6eBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0TKJ8QiOGw2cS0Spzetvjqqgie96cDTA3YQauzdWsow=; b=Fc8axcqs2t5LZj0ny5KWoTYneUPgJvRxinv0QON7BWHmvHFpzaJJbXCWiyS/M+p+SI dKEq8g89LP7l8FOCUlkVZE05aleAt92YorZ83NDm02S43D19k8jvcvkvrdQGMR5eSWI5 vQcGuawcxkzoTUEjZHVIqEWSJWjTXd5SgNc1IaKSLIBAayeCOg0XNlasc7+PXV0tWDTh HrxZ8P0tV4ZS2RDwnh84bq/372K28nQ6AMLB+5/Vz2ElA2F61cEAepzQv1/zbklRgXi4 lBLxzdrA32Z8yVG8YxWyVNND/Jx8NmAzB5kdbZmsDoOYmgUH+XnWGsg5DWQ8U7NqcBIj C2zQ== X-Gm-Message-State: AOAM5326U6YFjxyvJfjBjvDbyUndFPvdnsqe6PqwbInb6kN88HkXIHnw ArgUPdMaKrM5W0Vi6lfUrWK2lw== X-Received: by 2002:a17:90a:3ac5:: with SMTP id b63mr1480680pjc.3.1597157147934; Tue, 11 Aug 2020 07:45:47 -0700 (PDT) Received: from [192.168.1.182] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id bv17sm3003751pjb.0.2020.08.11.07.45.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2020 07:45:47 -0700 (PDT) Subject: Re: possible deadlock in __io_queue_deferred To: Stefano Garzarella Cc: syzbot , io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk References: <00000000000035fdf505ac87b7f9@google.com> <76cc7c43-2ebb-180d-c2c8-912972a3f258@kernel.dk> <20200811140010.gigc2amchytqmrkk@steredhat> <504b4b08-30c1-4ca8-ab3b-c9f0b58f0cfa@kernel.dk> <20200811144419.blu4wufu7t4dfqin@steredhat> From: Jens Axboe Message-ID: <23b58871-b8b6-9f5c-2a7b-f4bade6dee6e@kernel.dk> Date: Tue, 11 Aug 2020 08:45:46 -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: <20200811144419.blu4wufu7t4dfqin@steredhat> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/20 8:44 AM, Stefano Garzarella wrote: > On Tue, Aug 11, 2020 at 08:21:12AM -0600, Jens Axboe wrote: >> On 8/11/20 8:00 AM, Stefano Garzarella wrote: >>> On Mon, Aug 10, 2020 at 09:55:17AM -0600, Jens Axboe wrote: >>>> On 8/10/20 9:36 AM, syzbot wrote: >>>>> Hello, >>>>> >>>>> syzbot found the following issue on: >>>>> >>>>> HEAD commit: 449dc8c9 Merge tag 'for-v5.9' of git://git.kernel.org/pub/.. >>>>> git tree: upstream >>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=14d41e02900000 >>>>> kernel config: https://syzkaller.appspot.com/x/.config?x=9d25235bf0162fbc >>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=996f91b6ec3812c48042 >>>>> compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) >>>>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=133c9006900000 >>>>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1191cb1a900000 >>>>> >>>>> IMPORTANT: if you fix the issue, please add the following tag to the commit: >>>>> Reported-by: syzbot+996f91b6ec3812c48042@syzkaller.appspotmail.com >>>> >>>> Thanks, the below should fix this one. >>> >>> Yeah, it seems right to me, since only __io_queue_deferred() (invoked by >>> io_commit_cqring()) can be called with 'completion_lock' held. >> >> Right >> >>> Just out of curiosity, while exploring the code I noticed that we call >>> io_commit_cqring() always with the 'completion_lock' held, except in the >>> io_poll_* functions. >>> >>> That's because then there can't be any concurrency? >> >> Do you mean the iopoll functions? Because we're definitely holding it >> for the io_poll_* functions. > > Right, the only one seems io_iopoll_complete(). > > So, IIUC, in this case we are actively polling the level below, > so there shouldn't be any asynchronous events, is it right? Right, that's serialized by itself. -- Jens Axboe