Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10340528rwl; Wed, 11 Jan 2023 18:44:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXuPzWhTOrtuScmFDvLpuNVif5ib4A6Qv5A7YBUFkKpjY2G2Eb9ZqeOrgXlpI74KA/C5RleS X-Received: by 2002:a05:6a20:cc41:b0:b1:f593:e738 with SMTP id hq1-20020a056a20cc4100b000b1f593e738mr74507927pzb.28.1673491457405; Wed, 11 Jan 2023 18:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673491457; cv=none; d=google.com; s=arc-20160816; b=SxSWI+ucg3bduZstgZpLAlyodS+TFzLHwK0jiLG4/uj8CZQVglrJIi4kMlrj3dlVgw +spP69DNMtAGJFG9JfoNO7qlMjdwOn8wLGugjv2MabglAz/yIBBOauU2BjZripeHJgu1 TVAGgBIegM8gmEjwH1uf9RLF3J+2Vh64w8JvPC3xPUkB0yMIrVzJeqOhSPO4gczIhDB1 5dk22jWOCp0MF9cHWZ3kFed6ZUp0rXSGBRzsreXXwgMf+LcCnd+f128Z2boANbSMdItM oXN4ti+IepYdpXpDcZcV2LiU09ZX7MpQak6DQkgfS5qVwhUcbmiNgbO3+4wWcoI8Zmov UFjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+xNIzBPTtTRx2kuPODk3rAgC3nOVwzXC63nsQ3n3Zy0=; b=Gn+CG8KFeKBraQe6RCwoSeNf09makSQNR51bzFeyzUXmvAtCHG1suMj39Sa2h5rYHC 5wHa4LmDepBiE019hFgRhYCApQ0BRhDd2QDSAUYIRE4BVXoLjzLX2YiB0Zt9d5PhEOVA C6Nd8DTWEaQrmfNvJjCUCjmz9uD7XIvofhsHJWsyXvDSL3wjk5ZyxgtEGOgG+WxLbM4A ibxkPPX+CNcnFtb7iRyGBBLssLW+J5gbgS6nrFd7JfE0juq8XKJ5F1JOBWkyBlqRGmJI JHDgzhQDU00fzrsx8YeY87CigWbfidCo57IEAaLYIGYPn1tR9P4vEmm0x5lJI5occW71 8SAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=P8DZemtB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n64-20020a632743000000b00478e26efc95si15793155pgn.34.2023.01.11.18.44.10; Wed, 11 Jan 2023 18:44:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=P8DZemtB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235628AbjALCiC (ORCPT + 52 others); Wed, 11 Jan 2023 21:38:02 -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-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 X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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