Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2363242pxa; Mon, 3 Aug 2020 14:27:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvHC3I0wtBmh89hriYjGumsgUVh2X2sRbnA8zj7C0157yzaPBB5f9a4g9WhfiTJDa56HlP X-Received: by 2002:a17:906:698:: with SMTP id u24mr18110835ejb.57.1596490049943; Mon, 03 Aug 2020 14:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596490049; cv=none; d=google.com; s=arc-20160816; b=iNatTU3T85qM+rb3/ZalImbqlmtmshSMNwPnJzY6NjRzocShOS9koRnD5G1HlNATHG d7lovQFCW7M3nAvNzZ56QfiH/CkZJQ7/z9wV76nS0mDGK2bwC05etJbVso8PuAgMRaVh 5MM/uGi26bswgn5ZQ8B0m8fVw01LjNELhbKyiZrwcMTcIJ/Ui+b1regpQPm6J5GczGOt qiXcbnKg5lB9SUsn+tsba30/Ca/oot4zHDJFBJYYUo48iOUTF3S/8cepk9i/4+dcG2VN EAUr6DJ6M4Vf4qL2A8BuMTK2wQIMNgSOkM1DpmEWiM4PZhVKTmUg4SkdhVoNJkI5mFb7 z7JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:ironport-sdr:ironport-sdr; bh=SLrK4pUlDVXJUHJY7cuFyyRzH10EM1OWt3epDe8IHQM=; b=Y0CWDcCRgSpGBecqf/yhuxhi0OaKe8sGTyUzCMgMjpF57zalmpoAAJH1nqQqFunFBT pqTREymanoluGeOE8F95vZdoZyvSa/dPl+tbOtpaSDBv/b/6DtTewbeEUYlY9m+0UN9K u+VpBYKsdNxt+GJB0ziOFUcKkoXVHM+yiNlMc6ulsCFwXo6EoHavkRYjaeQm4YkhZNf1 Bztf20hmwvZUt1WYPkHJoANkaV46NWQUpVAuV9AwyHxUiyRbeE6TYzOcdcKwo+Tcap16 a0wK0V3Z0qdrBVjibRFxV/paLkjhyYKAcW5+AHHc5PweQyJRNSLBtVs3EUiG73iSzGKy G56w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si4306863eda.366.2020.08.03.14.27.07; Mon, 03 Aug 2020 14:27:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729152AbgHCV0U (ORCPT + 99 others); Mon, 3 Aug 2020 17:26:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:61897 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726398AbgHCV0U (ORCPT ); Mon, 3 Aug 2020 17:26:20 -0400 IronPort-SDR: ssX42FjQr0Xie2qeK3Sdgt3U3gQbyeCSKNemYYN9Flo7Wq2fl7JPDFhG6poFfjLVTECWUBq3LX QygLZ90mVgVA== X-IronPort-AV: E=McAfee;i="6000,8403,9702"; a="151434420" X-IronPort-AV: E=Sophos;i="5.75,431,1589266800"; d="scan'208";a="151434420" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2020 14:26:19 -0700 IronPort-SDR: RulXwNywhv1eI8mAx/l2FWKIOuoPQn3y862B8fRMfSTGFJVWGCJfUoaFdi2W5KFVaVNAJJW7qT 9QbcAWE9RiPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,431,1589266800"; d="scan'208";a="314981446" Received: from djiang5-mobl1.amr.corp.intel.com (HELO [10.255.79.119]) ([10.255.79.119]) by fmsmga004.fm.intel.com with ESMTP; 03 Aug 2020 14:26:19 -0700 Subject: Re: [PATCH 1/2] libnvdimm/security: 'security' attr never show 'overwrite' state To: Jane Chu , dan.j.williams@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, jmoyer@redhat.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org References: <1595606959-8516-1-git-send-email-jane.chu@oracle.com> <73f2eadf-3377-db62-ebd1-1eff99d4842e@oracle.com> From: Dave Jiang Message-ID: <69576669-632e-1821-2076-7bc47c0bbd85@intel.com> Date: Mon, 3 Aug 2020 14:26:18 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <73f2eadf-3377-db62-ebd1-1eff99d4842e@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/2020 2:10 PM, Jane Chu wrote: > Hi, Dave, > > On 8/3/2020 1:41 PM, Dave Jiang wrote: >> On 7/24/2020 9:09 AM, Jane Chu wrote: >>> Since >>> commit d78c620a2e82 ("libnvdimm/security: Introduce a 'frozen' attribute"), >>> when issue >>>   # ndctl sanitize-dimm nmem0 --overwrite >>> then immediately check the 'security' attribute, >>>   # cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/nmem0/security >>>   unlocked >>> Actually the attribute stays 'unlocked' through out the entire overwrite >>> operation, never changed.  That's because 'nvdimm->sec.flags' is a bitmap >>> that has both bits set indicating 'overwrite' and 'unlocked'. >>> But security_show() checks the mutually exclusive bits before it checks >>> the 'overwrite' bit at last. The order should be reversed. >>> >>> The commit also has a typo: in one occasion, 'nvdimm->sec.ext_state' >>> assignment is replaced with 'nvdimm->sec.flags' assignment for >>> the NVDIMM_MASTER type. >> >> May be best to split this fix to a different patch? Just thinking git bisect >> later on to track issues. Otherwise Reviewed-by: Dave Jiang >> > > Sure. I take it you meant to separate the typo fix from the change that tests > the OVERWRITE bit first? Yep! > > Regards, > -jane