Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1215493pxb; Sun, 12 Sep 2021 11:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/VmYKYi2l6/p2iH0Xwvf1ah1ChBIRrro7zZzp5v6Hgn43cnu6psSM/hhh8sceHHmyrFoO X-Received: by 2002:a17:906:3157:: with SMTP id e23mr8713470eje.29.1631471017155; Sun, 12 Sep 2021 11:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631471017; cv=none; d=google.com; s=arc-20160816; b=xrs6dCCMXNk7GwnVblpfkqSqPStIMvhZhWhfzPmdIetyewczO5IA3e6fLYJPyQSKaK q9exjl+nz0pJL+VLrmKyN1onry+lBccHDccMRwB8kqs33sw4G/Ecpt5jLRSO1m0TO7nu LB16ctqyMc9IwhC+86Qt4vAuGHLdM8GzhAjSDm+u3AmhZlPto8owoY2FbOfdMdPkf0Oc 9Sz8jJO8hxE+LoPFUYkefiXz46VvwKas+bW7ehbHurjdBZUMQ1hfbXAMBigcxmJBsMNl T6xf8zCS3ZXvTfwA9FFVQq3Ch9D4+Nrji5qtFLXStkKYWBgNxqV+zKSsRNF5Pn/bJJr/ 99hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=U/bs3PjkeGfYHulbf2M0xJeDzF6gbg27groVLIx4AqE=; b=opGTQVuCRzcQyEWlpBuW+3AC4TTf/zQf/ykiXtLGDv1eA2HsoTH03HRxwO3DUyTPxJ IgBm8Q64qRFWMT+hVL7rlAZd3979NLMtrJ79ZOBrxqLLaLMEdBaRCDxzZ7EROQCJt19V 3H0DCzE9XwOeMNiOldR6RtFdAz1TNaad9aN1cKEnvpo7NezO+xpldHMiLzFQLiB4XqtJ xHSIOudAAJFqZVSxzRHY4dAPHVSQtrSjduVJvbDyc1xFmmLvKWWzs3NIk96kqchCs8f2 KbhoZzhTylw42ez60nNC42Q/YqX6pkRJyPhovjvcDeLZ5Kk3XwOo6LOUdT9c5XONEFad Eo1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="m/t9Q7Ur"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si5763512ejl.781.2021.09.12.11.23.13; Sun, 12 Sep 2021 11:23:37 -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=@gmail.com header.s=20210112 header.b="m/t9Q7Ur"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232959AbhILSXN (ORCPT + 99 others); Sun, 12 Sep 2021 14:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhILSXN (ORCPT ); Sun, 12 Sep 2021 14:23:13 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8549C061574; Sun, 12 Sep 2021 11:21:58 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id j1so4734015pjv.3; Sun, 12 Sep 2021 11:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=U/bs3PjkeGfYHulbf2M0xJeDzF6gbg27groVLIx4AqE=; b=m/t9Q7Ur2ewBwZZQPT2N75BnjIdMGQ8nTSJi99bX/jC3psPHN7FqYu6TeyAQvf46uc fKPxBwsJR4KslfxF3mUv1rQCfhLpdKddifYnsiaTmaIOxksj8bTYLVKoRNjGL6iN0NqL csNQz3F1TXAL7PlpNWSYIpoQdSsjethutrl8ibWiEDCybrH6zkT4K2bTCH7lqpwmmpEc w0SYBsA6tUCmocXPMs4VkgZchnxCTZDN3RovkMkVMYQW8F3cMd32Sm//SH7LO5tUBJ+s 14N/r4M3M3285atq+/tWsWAcNfCC4kjbJK9mZstborrOa8bLbGFHE5vfTLUXmUtW4aeG 9/8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=U/bs3PjkeGfYHulbf2M0xJeDzF6gbg27groVLIx4AqE=; b=nBpNPtW5Kjbw0NrLXHlT2Bzq+A91nhKsidXbTeJUD6o2NtoOYUPiY+LnknT/jVVUhR lT22L/nJ1YthyjRubZLS6sEKAZ6LbsDA4OYpo/1vnetEFNb6FjRl+AzF6s9XWDeO8ZGX +E2pkQK6m6u4TznWnfJ1ROYcgmeoLwdRU7s0lwTUiw+blEJTVlSCRFti0F1zXTEkMGcz 7rShOX8K5IwQ/5suuCMvyPG3XZdpOiohTXiKu731lxvzuns03ulFiecVfgWrMqdVvsMi 9wmyvbTRIxbzKt+WLH9k/+yerEYtKFwxUS5BuznifFQznr1GWyOvMMofxY/S2A6boAJD RLew== X-Gm-Message-State: AOAM532iofMMXnMxTxuwPtlmnh9phxwEwCDkgZEnaKpg1cQXKlGFbq7D AYfL+mwS8ECXm+PIdaSAX9bSs4y3C0Zr0g== X-Received: by 2002:a17:90a:8c8b:: with SMTP id b11mr8627118pjo.14.1631470918049; Sun, 12 Sep 2021 11:21:58 -0700 (PDT) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id g2sm4625419pfr.35.2021.09.12.11.21.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Sep 2021 11:21:57 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: io-uring: KASAN failure, presumably From: Nadav Amit In-Reply-To: <859829f3-ecd0-0c01-21d4-28c17382aa52@kernel.dk> Date: Sun, 12 Sep 2021 11:21:55 -0700 Cc: Pavel Begunkov , io-uring@vger.kernel.org, Linux Kernel Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: <2C3AECED-1915-4080-B143-5BA4D76FB5CD@gmail.com> <859829f3-ecd0-0c01-21d4-28c17382aa52@kernel.dk> To: Jens Axboe X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 12, 2021, at 11:15 AM, Jens Axboe wrote: >=20 > On 9/11/21 8:34 PM, Nadav Amit wrote: >> Hello Jens (& Pavel), >>=20 >> I hope you are having a nice weekend. I ran into a KASAN failure in = io-uring >> which I think is not "my fault". >>=20 >> The failure does not happen very infrequently, so my analysis is = based on >> reading the code. IIUC the failure, then I do not understand the code = well >> enough, as to say I do not understand how it was supposed to work. I = would >> appreciate your feedback. >>=20 >> The failure happens on my own custom kernel (do not try to correlate = the line >> numbers). The gist of the splat is: >=20 > I think this is specific to your use case, but I also think that we > should narrow the scope for this type of REQ_F_REISSUE trigger. It > really should only happen on bdev backed regular files, where we = cannot > easily pass back congestion. For that case, the completion for this is > called while we're in ->write_iter() for example, and hence there is = no > race here. >=20 > I'll ponder this a bit=E2=80=A6 I see what you are saying. The assumption is that write_iter() is = setting REQ_F_REISSUE, which is not the case in my use-case. Perhaps EAGAIN is anyhow not the right return value (in my case). I am not sure any other =E2=80=9Cinvalid" use-case exists, but some documentation/assertion(?) = can help. I changed the return error-codes and check that the issue is not triggered again. Thanks, as usual, for the quick response.=