Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2361976rdg; Mon, 16 Oct 2023 01:47:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt481o5WknOob5eE1vUbAfSS2JdpW+T7DVQlRIINhqWtZyjTNXGvv1z+gB0O2jWcaAU+cR X-Received: by 2002:a05:6808:16a6:b0:3ad:f6a5:431f with SMTP id bb38-20020a05680816a600b003adf6a5431fmr40915171oib.0.1697446071636; Mon, 16 Oct 2023 01:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697446071; cv=none; d=google.com; s=arc-20160816; b=X+txRabriy9VcjtLFF0YBTIqeJu729MKB+FZiwdxeX2l+tMyrlkWKIcMUoOlC68il8 Qc+s9eoO9FVxiLXNp8gqI75o5ht4vSCH54UcwNqeN47QzSU1sqSqjalF+httcsJKW2QP v18MILaDf1Rc6CK37qoe5pOMUIUNl0DYRF8BgZuTF/3YrmBY+NKRHTNKeYMk+faXIfjx TWK+dgCByNiD0cO3hkPytN14sUw0EWZccTW1Yhu+EyKew/kiNR18lUUzaXJjQh/qnNfv 7QzebAEGVRyp4fTE88j99swZyG4+wMllv7TWhH7iZjNwxslRfRZJRVtJH5ECywbpTchF HmvA== 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=Fmni1eY2AJSoSSFhXU3+NeEK4NNpSWMHWqTcHLX4FxQ=; fh=RuklxgbSe2va3ktX0wqhbUYaq6PlxO+q/jkgxyMwA3k=; b=U/bhsOCEdR4O22EdN+rtc9N5L4wnKsn7CYyTfeXkY0/KWPTpW1H2/dru/8TznxrkGx cccmCkdoDizPfh22t2bq1OMwvNMc4rdsTOUevs78HZMxh2AIymIwZj/Oic8LbJ7xD522 tBsStU59MlhzGPLyLvIgPheFn42wwOW0XMSVGlPIwUr+vRaximU21xBqMiWoj909Ah4c jK8E1aZhBwwafYrBUu5+lsCXgNzlag2FpvyOP6Lztjei/REDkoh7OvSahwEx16k86Y8b X1WqoSPdPH6JAT35iE+hRIeErI4xYZhon1dSGEx+Q6MLG1ArTF5023tVBaGR6WGUBCO2 dP0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cybW2ZD1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m12-20020a656a0c000000b005ab00d84e1esi8036658pgu.765.2023.10.16.01.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 01:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cybW2ZD1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A32008050F93; Mon, 16 Oct 2023 01:47:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232849AbjJPIrm (ORCPT + 99 others); Mon, 16 Oct 2023 04:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232903AbjJPIri (ORCPT ); Mon, 16 Oct 2023 04:47:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D6B9B; Mon, 16 Oct 2023 01:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697446057; x=1728982057; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wjZpxVJ5dbr8+1cfQF6ueToBM+d0ID9OcBGdQ/RRLzY=; b=cybW2ZD1+Vl/SecBklpuGfx5AThkbxZCanaQGR+V010hi+0AU4DXiwC1 Ajo3cZ82Skq0FFQ1J/y0PylLtrFMwP2eKlVAA7jEBbV8hbgZHmWW0gs+D 6VdKOEEXGAjEHNSLi/E43uPWfSI0vWpdEQb/ff+uGPrrFFkqAZx0C9NzR 14HgsnJ5rWSvqueL0HPJC7TDbOrFqjyku5ny+7ld9hKUNE3z1xVOdayeA Wrhcdpcn8M05VXOTOHoO2FLzqGl5L7cIAoSmeBq8CTgblpPkstF0qFpQp Zxzp9RqlLnKnJJkUC4s1DfbzSAcK4h4aD1L91HBIWC0BdQYzopbGPkcuZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="385320643" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="385320643" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 01:47:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="846320819" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="846320819" Received: from bmihaile-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.37.165]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 01:47:26 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id BE7CA10A1EC; Mon, 16 Oct 2023 11:47:23 +0300 (+03) Date: Mon, 16 Oct 2023 11:47:23 +0300 From: kirill.shutemov@linux.intel.com To: Binbin Wu Cc: dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] selftests/x86/lam: Zero out buffer for readlink() Message-ID: <20231016084723.icjv6mj64ocx2hoj@box> References: <20231016062446.695-1-binbin.wu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016062446.695-1-binbin.wu@linux.intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 01:47:49 -0700 (PDT) On Mon, Oct 16, 2023 at 02:24:46PM +0800, Binbin Wu wrote: > Zero out the buffer for readlink() since readlink() does not append a > terminating null byte to the buffer. Also change the buffer length > passed to readlink() to 'PATH_MAX - 1' to ensure the resulting string > is always null terminated. > > Fixes: 833c12ce0f430 ("selftests/x86/lam: Add inherit test cases for linear-address masking") > > Signed-off-by: Binbin Wu Reviewed-by: Kirill A. Shutemov -- Kiryl Shutsemau / Kirill A. Shutemov