Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2184797iof; Tue, 7 Jun 2022 22:30:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA88pz4M2eIgZ/w61peqfaaTYGWW31YY0T5ijDPtQyqOAA+gg/T4PZtkR9otOWGPw+7gBj X-Received: by 2002:a05:6a00:2386:b0:51c:3ca7:b185 with SMTP id f6-20020a056a00238600b0051c3ca7b185mr6694544pfc.8.1654666243987; Tue, 07 Jun 2022 22:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666243; cv=none; d=google.com; s=arc-20160816; b=bmdWeAIn13HrJd6X3/LO9ltoisGqrH4jNZvKQiM4TPtx3zOFEk3X00y5qUMY8m6lfU /qMJCTaddipTbjLj627ouWoGleqnzEzgrhjqPpdVgiH2azP6xtKEs7xifKsm/g73qn6t gpzC8B+2gOsw5VnRnnGw1zgSp31DexifgxQYDyYzH2VBTXsKZhfPajUiORxx5uXN7b9J 5bLdNKZeylm/KcpabZaOWzya4XUCbXin7CXqjTZ2lk82OkOun1ledl2iZ+QqjVR6HDlD msp94i6YwMRN2VfRILP3EzWfCo+kzg2kNeUZnJRdMxuzNP5HY43HO88gEtnDY7aVsQuC DfLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X9td6AaIw+rTNPHq0AiRmZkPXyDw8ybuO/F6WSi66as=; b=JHwxRWY2AscLldDdvLwD5LyBG/dtgh7cmJUH5b3NnP1JgfSASs31WdjPuYUlHcPZpd GMp+W+m2Kps4Ujd2buFvb3ypebyPEEqS2X8yFJH7Z296OMKnh428ytpu31B7t1OHcnAP DDYAOiv8JrH9GKzuRNg+M81irbH49XrzuEnRTNIt1vVQnPJoG2dAU5beIijEhjZyoXt8 8hm+wYYaAFnS0jEBIbAzcIle9UAWZ4hWwG7ewh1LeMIqtPvLMEuLapDFvBnowZVDM4wb 4//e1qQU/17r0rRKpn7athKJdRDY9epqS4oHfPNQSLlKc0PG3vD9Zu8cV2nWkdXIr0N7 aBZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D7w2QyGY; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x62-20020a638641000000b003fe046301d2si4495285pgd.527.2022.06.07.22.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:30:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D7w2QyGY; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58B1F35446B; Tue, 7 Jun 2022 21:57:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348204AbiFGRxu (ORCPT + 99 others); Tue, 7 Jun 2022 13:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348125AbiFGRgF (ORCPT ); Tue, 7 Jun 2022 13:36:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10566115CB4; Tue, 7 Jun 2022 10:32:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 267B3B822B4; Tue, 7 Jun 2022 17:32:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 812AAC34115; Tue, 7 Jun 2022 17:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623130; bh=1ASL6fBMDAmWBj3axiWH/dhSFOu0lxh5MMkutiN/P/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7w2QyGYgv+xwlL2jjD2ESX1W0EZt2Xh+NKZk6xPFOTGNLPlfiCfz4CoBiOpJ8akY CDOVIPoARZec6I0cJcJ2DSnsRUtru26CG3aHBIwXkGGYyO7u0TrFJWxEZlQNxyS+lH ///Hpq0JT87BdWQvqfRwq3V7VYro+thgzeI1caVk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vishal Verma , Dave Jiang , Ira Weiny , Jeff Moyer , Krzysztof Kensicki , Dan Williams , Sasha Levin Subject: [PATCH 5.10 289/452] nvdimm: Allow overwrite in the presence of disabled dimms Date: Tue, 7 Jun 2022 19:02:26 +0200 Message-Id: <20220607164917.162007878@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 From: Dan Williams [ Upstream commit bb7bf697fed58eae9d3445944e457ab0de4da54f ] It is not clear why the original implementation of overwrite support required the dimm driver to be active before overwrite could proceed. In fact that can lead to cases where the kernel retains an invalid cached copy of the labels from before the overwrite. Unfortunately the kernel has not only allowed that case, but enforced it. Going forward, allow for overwrite to happen while the label area is offline, and follow-on with updates to 'ndctl sanitize-dimm --overwrite' to trigger the label area invalidation by default. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: Jeff Moyer Reported-by: Krzysztof Kensicki Fixes: 7d988097c546 ("acpi/nfit, libnvdimm/security: Add security DSM overwrite support") Signed-off-by: Dan Williams Signed-off-by: Sasha Levin --- drivers/nvdimm/security.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/nvdimm/security.c b/drivers/nvdimm/security.c index 4b80150e4afa..b5aa55c61461 100644 --- a/drivers/nvdimm/security.c +++ b/drivers/nvdimm/security.c @@ -379,11 +379,6 @@ static int security_overwrite(struct nvdimm *nvdimm, unsigned int keyid) || !nvdimm->sec.flags) return -EOPNOTSUPP; - if (dev->driver == NULL) { - dev_dbg(dev, "Unable to overwrite while DIMM active.\n"); - return -EINVAL; - } - rc = check_security_state(nvdimm); if (rc) return rc; -- 2.35.1