From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB7BAC46467 for ; Thu, 12 Jan 2023 02:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235211AbjALCiD (ORCPT ); Wed, 11 Jan 2023 21:38:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235069AbjALCh6 (ORCPT ); Wed, 11 Jan 2023 21:37:58 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFEDB4086D for ; Wed, 11 Jan 2023 18:37:57 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id 17so18848564pll.0 for ; Wed, 11 Jan 2023 18:37:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+xNIzBPTtTRx2kuPODk3rAgC3nOVwzXC63nsQ3n3Zy0=; b=P8DZemtB5yYpewZqD7SRrdG6XBZ8xBDTHFzZ03Eo7eX5nu6iFg9rkJUc6OQ1aBw86v 78BYK1TxZLvQHCpCTpwGoxkWp7mDtt10JqqbPtC8IzhqQLYMzgd+ZAqS4+a5Y4EUZBzO RnAGEjEiIKCSIHauu6Sc6IP7G8DSyLdfDmmLR/pw5vQAfQWZ25koGExzqDlhbIOCHikG OQJgyl3Wgt3zJ9rjgF2fa5BsXnaDljrtKa4Wnyo2rTao3HeAtrXKxBWHbRyx4BWWmkYl FOKLxv27/TopFzzCLp7kZwREmHOSsvzMfMw8K1/2Tfg8OOTnEpTNEzx/iKcHcjXU0mCT 1WEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+xNIzBPTtTRx2kuPODk3rAgC3nOVwzXC63nsQ3n3Zy0=; b=kczBT+MyZFnxNns7WpChwk7/ewrH1AC5CyVrtM7U8ur9fdLdKl3X4eJDq8HGU1joDr LaxRv/lYhh3IJLVHsVr1+KTCoYGt2H+XLmw7pL0DIPD+4twN05P7nDSzkTB8bwgzrsC0 QJGAvJ1PkP6FjwAOLe+SaaQqYJci67c+zP2dDLvMKXQnaaDgyavkwppcEic9SVqh8zKa l4WGT618SUXqkBkN+YABz77SnRZu5cQrzzqJDtth7+cV4SVBFzQiGrxVKw9FUOrrwdEI xNHxKdkQPB8NZDt0FWtAzHPOJvg1X7Bu5ZX8EuDRSTnbBVQAWY3psGRI8UQytLa8YNbL 6pKA== X-Gm-Message-State: AFqh2kodBh2vvsyG4+BRtWkscDtFmbL/c4UBAKPz5jIYd35TjN+mLbR8 ZV4528KoElsHEmnNi9bhBKW4BHRSP8Z/iA7V X-Google-Smtp-Source: AMrXdXsUpZ7y8YaSgT5qCgYTFjwHKNNGRlg6WzrgVx9MxHH54c947yP/WZpRfcpeclE7Cwzb9nOFdQ== X-Received: by 2002:a05:6a20:54a1:b0:a5:170:9acf with SMTP id i33-20020a056a2054a100b000a501709acfmr26441538pzk.3.1673491077430; Wed, 11 Jan 2023 18:37:57 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id t16-20020a170902b21000b0018996404dd5sm10900316plr.109.2023.01.11.18.37.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 18:37:56 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 19:37:55 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] io_uring: Add NULL checks for current->io_uring Content-Language: en-US To: Jia-Ju Bai , asml.silence@gmail.com Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, TOTE Robot References: <20230111101907.600820-1-baijiaju1990@gmail.com> <63d8e95e-894c-4268-648e-35e504ea80b6@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/11/23 7:10 PM, Jia-Ju Bai wrote: > > > On 2023/1/11 22:49, Jens Axboe wrote: >> On 1/11/23 3:19 AM, Jia-Ju Bai wrote: >>> As described in a previous commit 998b30c3948e, current->io_uring could >>> be NULL, and thus a NULL check is required for this variable. >>> >>> In the same way, other functions that access current->io_uring also >>> require NULL checks of this variable. >> This seems odd. Have you actually seen traces of this, or is it just >> based on "guess it can be NULL sometimes, check it in all spots"? >> > > Thanks for the reply! > I checked the previous commit and inferred that there may be some problems. > I am not quite sure of this, and thus want to listen to your opinions :) I'd invite you to look over each of them separately, and see if that path could potentially lead to current->io_uring == NULL and thus being an issue. I think that'd be a useful exercise, and you never know that you might find :-) -- Jens Axboe