Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp233298rwb; Thu, 6 Oct 2022 17:36:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hD0UmnEOmp8j5cH7is2o03ETCUwOllelgsJlVsAjId/8VkEhD6vr5NRTdjlnEPykPqhq3 X-Received: by 2002:a17:902:e5c3:b0:176:d1b9:ee33 with SMTP id u3-20020a170902e5c300b00176d1b9ee33mr2116878plf.122.1665103017842; Thu, 06 Oct 2022 17:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665103017; cv=none; d=google.com; s=arc-20160816; b=K3AHmVjhr4fli+zq7injr02mF4aVyJujC4ULhyn58LFKr6/73w7OPHJufjogtvDuBG A7VCDDcjtcbppj/Hvh9ws/Qd5Cspfj2r1jzCGNHz97GxdBXWi1eR5rv9z235oIqdwT7Z CPckLLOo9VHVkN2WnGaQ8ulgNWbvmDQAoCG/fyr8LiG7y5eP8rCf/rpLm15K6wVCueBJ b+ea8Tm4DK8VQqL8zLi5t8RUoLTGo6kqozx6ahEdrcKGFs+rS4Tv4JeyrqaO/4NsTeBc JiYZkiEQ1L4qIgkZ/ewCDcKuGUwYKSUxkZFVpiYhOazAtuSHkGbeLyCXKl1Wz8rkGzUo USBg== 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=lhumk7loW+962AX8hCR6F46wrrP6cqHeoz6oa2OTOgg=; b=EBd7zFrsHKr1G7b43aqxyVdFzp3eNSXJX/B0yh5Ou16NH/1Kj6L4O2vGv3kY8S9I3t Iw/CvTHZVvWqaYckudRXeiBllIkXWmXk46/qPMrXPbVNFUfIx25Y2AIS4esPyctcQmvb FmvqPpHzff5BxMUKUm5M/eM2Uda5wfAXeCffK+CWI3sQ4RGwf00NBmgLKsVv4tAvmFAy eAq2JMf9MUs3mEi/RltYQdWQA8Vxr55SpyAQK5r8NWSzz3TJqjx1VA2KVa58OrufABDI 8rlWWTdCw+nk57UmxHr5P0thGZVm0ZjkMTI8aT6QF17B2xHqPQ8ZXbTgA+iJEKl7qwLM N/TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=ad5c8QOx; 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 h15-20020a170902f7cf00b001715a583d46si533754plw.474.2022.10.06.17.36.45; Thu, 06 Oct 2022 17:36:57 -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=fail header.i=@igalia.com header.s=20170329 header.b=ad5c8QOx; 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 S232156AbiJFXfq (ORCPT + 99 others); Thu, 6 Oct 2022 19:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231941AbiJFXfn (ORCPT ); Thu, 6 Oct 2022 19:35:43 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711A5CD5D0; Thu, 6 Oct 2022 16:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lhumk7loW+962AX8hCR6F46wrrP6cqHeoz6oa2OTOgg=; b=ad5c8QOxs2lMH8kVtuyYZJuzDS nTyJaJ7eg80mUv+CymZPJ6Aj+cjb84t6D8kFjd6lOX5pQxHeah614bgQG4ejvj9kEK5UcdiSIOkt3 Vja+nCHb4FghEJMNt8OAI7lKAdrrJPNv3Mbrle+XIqiTw1H6bR6Zpxk1sTs86qwPFBO3SaoZEZE6K V5mngGTdQXfEZXA4ITuBQxlIyw4pKP97r8uc1AIHJtVempgiC/z78pY5wWO2EJzu3nKQUlZDl+zFH iVGamMlm9IfZ0HqVxm0BE/qESVN7o7b+E0Usj6Sf7YlONDMvgGTZNiucMgND8siVbGxhHvW1z/qdm td+BivRQ==; Received: from 201-43-120-40.dsl.telesp.net.br ([201.43.120.40] helo=[192.168.1.60]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1ogaOy-00C7OK-Ez; Fri, 07 Oct 2022 01:35:40 +0200 Message-ID: Date: Thu, 6 Oct 2022 20:35:27 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 1/8] pstore: Improve error reporting in case of backend overlap Content-Language: en-US To: Kees Cook Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, anton@enomsg.org, ccross@android.com, tony.luck@intel.com References: <20221006224212.569555-1-gpiccoli@igalia.com> <20221006224212.569555-2-gpiccoli@igalia.com> <202210061627.E29FCDBE1@keescook> From: "Guilherme G. Piccoli" In-Reply-To: <202210061627.E29FCDBE1@keescook> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 On 06/10/2022 20:27, Kees Cook wrote: > On Thu, Oct 06, 2022 at 07:42:05PM -0300, Guilherme G. Piccoli wrote: >> The pstore infrastructure supports one single backend at a time; >> trying to load a another backend causes an error and displays a >> message, introduced on commit 0d7cd09a3dbb ("pstore: Improve >> register_pstore() error reporting"). >> >> Happens that this message is not really clear about the situation, >> also the current error returned (-EPERM) isn't accurate, whereas >> -EBUSY makes more sense. We have another place in the code that >> relies in the -EBUSY return for a similar check. >> >> So, make it consistent here by returning -EBUSY and using a >> similar message in both scenarios. >> >> Signed-off-by: Guilherme G. Piccoli >> --- >> fs/pstore/platform.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c >> index 0c034ea39954..c32957e4b256 100644 >> --- a/fs/pstore/platform.c >> +++ b/fs/pstore/platform.c >> @@ -562,8 +562,9 @@ static int pstore_write_user_compat(struct pstore_record *record, >> int pstore_register(struct pstore_info *psi) >> { >> if (backend && strcmp(backend, psi->name)) { >> - pr_warn("ignoring unexpected backend '%s'\n", psi->name); >> - return -EPERM; >> + pr_warn("backend '%s' already in use: ignoring '%s'\n", >> + backend, psi->name); >> + return -EBUSY; > > Thank you! Yes, this has bothered me for a while. :) Heheh ditto! Thank you for the great and fast review =)