Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp774574rwo; Wed, 2 Aug 2023 04:08:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQ3kTm+TocVX8Q4+xg0vfMA8lCNfnztEZwr4hg4movwaP2i2+spUH6lFOsSnijJUrofHqV X-Received: by 2002:a05:6a00:1512:b0:666:ad0c:c0f4 with SMTP id q18-20020a056a00151200b00666ad0cc0f4mr20475077pfu.23.1690974496817; Wed, 02 Aug 2023 04:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690974496; cv=none; d=google.com; s=arc-20160816; b=J2KSD1gEIEaOzjlzm8syEqWtw2U7Fb0/zrUIdBdEsSNongIljoaA/BJ8U/U3Y4t76V fl6DuNWungpgbv2e1LiVHIFRPmIR6wkw8tB/j5cR55Axs/MO345teMNZx+xF0CoB7r3l NJRVkMz0NjGglSQcYEHcusvYUZdxmooe2EWcecdQBJN1IrE9xVW1lIwpmt816sU/258o Bo9ex2x2diZeUEWHCNykSsMjrAIlW4FMg9Hfjx5xmW023dDDdB6fVi0ucZlrYFMO2N5z LY/5U5akdebHurKzzBnGhMSDHoMNXKAhDxMfOWER4dYgZF0T4TAPeQgHYnCMIkNqMpds UByA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YgNcim2dL7pjjmrHNNKr7SZxjAPH2vynKbx9rcM8Mlw=; fh=zW1ppFYtto1G4aqO1z4h5hFVUYA/J7AdkXccuBkBrD0=; b=q3MvxsRTLVDkNiU19rJlvpBzDncp+w4va1StWRrFvALCRGsPQrWtXuVzq+YMZUC6Rg 5lAkusStj3AeIQfSeLOMxwhxTMyjw5+IDQgbfO3HGsH/79MDZ+EWDKfuEfKdJjatFW7i HkJ+t2pfXFmmnixKQFbJ/yOinl5dQsUFJD0obKpXGtayW+oAJ8qJziokIETSVtqGWnAs 9gY1DCwiuh5xyd+zXqkvt/N/A7qi9w4ZXppFeUF9SRuZo+hR422DPuYla1WZdPvTVsOc TeqdoeyR4OG/mR+poVGhUeCKXjSsw8Y81kcQXyzzT1Ix9EmlNkaCppgQZrbitZEZ9KZM 4RpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWplNLg7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a056a0022d400b0066844d4ec59si10957657pfj.168.2023.08.02.04.08.02; Wed, 02 Aug 2023 04:08:16 -0700 (PDT) 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=@linaro.org header.s=google header.b=YWplNLg7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234146AbjHBKoF (ORCPT + 99 others); Wed, 2 Aug 2023 06:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232740AbjHBKnn (ORCPT ); Wed, 2 Aug 2023 06:43:43 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F3E30F7 for ; Wed, 2 Aug 2023 03:41:35 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fc0aecf15bso71421975e9.1 for ; Wed, 02 Aug 2023 03:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690972893; x=1691577693; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YgNcim2dL7pjjmrHNNKr7SZxjAPH2vynKbx9rcM8Mlw=; b=YWplNLg7UPqde5B60m6OlJf5GN/pzFSb0R/iqkm3PB+Aa3UMsWIbRcf1T/qla7arVx GQ9twU0WygEmXeQtFkliWx6MNXs7fNpNcQqGnGlMmC6tpgp8+EzJrH1v8gU3Flkl+tdm 9sayaVbI3FrfxwxpFiWaQX0p/aRVAdhbfS34vwd8iY4O+i+jGGRxXpDR89h07/u1fKkv tQuGN4A97NkVLcgKW3yJ3Byfl5QXCh0xw+kzT7ZFo+CsmYnp0jHYJFxTBeMQVbINlq7A FL68fC/rQwsdl7YoIwjSklcDptw2lXp22joZ/efQNyQmG4GVqv1hExYeL1shzWkT10VG HhKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690972893; x=1691577693; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YgNcim2dL7pjjmrHNNKr7SZxjAPH2vynKbx9rcM8Mlw=; b=JhHyCmukmPro1e4ySzCbhwxnapGr18S16h3Vm6pS8JKJd022eCLCbUY7drH2eXKdf3 8dy+wNxDxly9Arvas4nrYI+5dKz4yw9SnWEu7Hw9+fUwwLUB42cwd7qULoPYHkVyY7cC Dyo7mE8weMdZTSkviEmkrr/a8cNIbBcHyY5AdwxZJ1TPQlXIj6e3UmSXXwVY7KUVO3z6 Vo2mKoxQL/hZBlXJiATyjN3zgjjdydLePYQPwSNHevuD+4jTZkL8TM/IN+DY2KQI7eI+ BLcAHoxBTahN7cgnhZDtMgZSWK/9+xZTikSgh5kP+BM6ov+4vhRe3FxCjL0jgbzPewMQ NsgQ== X-Gm-Message-State: ABy/qLZ9nDgxR17GRGIslud8y6a68yyWRlBywCJ4lgi1vzWhTg3+Pm6N X36OlTvZdUeGmZW3bqmdehFNeQ== X-Received: by 2002:adf:e792:0:b0:317:69c7:98ad with SMTP id n18-20020adfe792000000b0031769c798admr4622443wrm.3.1690972893500; Wed, 02 Aug 2023 03:41:33 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id y1-20020adfd081000000b003179d5aee63sm10531548wrh.91.2023.08.02.03.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 03:41:33 -0700 (PDT) Date: Wed, 2 Aug 2023 13:41:30 +0300 From: Dan Carpenter To: Su Hui Cc: chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, trond.myklebust@hammerspace.com, anna@kernel.org, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, bfields@fieldses.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] fs: lockd: avoid possible wrong NULL parameter Message-ID: <0bd584fd-74ac-4b08-ae03-12e329ab186e@kadam.mountain> References: <20230802080544.3239967-1-suhui@nfschina.com> <531df8ee-ba09-49df-8201-4221df5853c6@kadam.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <531df8ee-ba09-49df-8201-4221df5853c6@kadam.mountain> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 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 There was a big fight about memcpy() in 2010. https://lwn.net/Articles/416821/ It's sort of related but also sort of different. My understanding is that the glibc memcpy() says that memcpy() always does a dereference so it can delete all the NULL checks which come after. The linux kernel uses -fno-delete-null-pointer-checks to turn this behavior off. regards, dan carpenter