From patchwork Fri Oct 15 13:42:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1541716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=DUqUuhUT; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=gEFhvUC2; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HW7Wr74tGz9sR4 for ; Sat, 16 Oct 2021 01:12:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wPtmVo+i1/CShG7iGflejqGiRC5pHbo403CHoHIu0Iw=; b=DUqUuhUTgy5Wda i5ff1BABcMcg7A8DfONtsqD2tq0XfwYzL6k6nEqgVSkbFobE7F/phbBn6UaOPHM10rw2WeTQx/ZcN IHnQ6U1i8MzJLf6hoKk/IEkmuT8n09Vfo60KbbdSnFXKdtZ+NXitD7yAtjfsB5gp2lZZUDjuLrkZE WpBILOTzSnltVCYhi/q8oeuXbBxYJTtvwkFR0yJEMlGbLKs9RrV6dWMWwXH0mYRr+P8ecPAX3lqN/ kaWG0cO7XTqQjXCeRy3kxwJVJeY2eVlZ/0ob0sGEWSFb+eGLjhRXPjBu+YfzMcGAxGJCQ27u8ov9I zb2HSf6fhtiMf31AJGCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbNwn-007UM8-39; Fri, 15 Oct 2021 14:12:33 +0000 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbNTn-007KSj-97 for opensbi@lists.infradead.org; Fri, 15 Oct 2021 13:42:36 +0000 Received: from workstation5.fritz.box (ip-88-152-144-157.hsi03.unitymediagroup.de [88.152.144.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 28BC53FFE4; Fri, 15 Oct 2021 13:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1634305351; bh=dbrjhNxShWP4ilpj6MGHK9/i9IYzsvtUWkKEFtJBj24=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=gEFhvUC21SVRl2w3RV1MJzw2ArgJYPPDeKLBc003Zect4Ehx3ljx8HBEP+00YKXel XKa4Bcb34T0duyGazDbyAAggodUAVIJlWB3JjPLlb1nZRk5tBCTXNPOfMdiwWYifc6 bpl0TLHAegTocdMAwoMIjVme60LmZplnPElHD4jfDjZIK9tRBsOHuP22LrNR7KaObU xAOZj3vuhnekDrs/OltgJWMDOdaNUbpA20t7HtWWnFU1focwwbZ2ATGCqvIHmOqVIH xsSLPuH4BhvgusDkh475/giDpNFwamk9DBmPhELYwLFEzDlLviG5OU6lkqqmbbtiWK Z4+kk1d0Jep3g== From: Heinrich Schuchardt To: Atish Patra , Anup Patel Cc: opensbi@lists.infradead.org, Heinrich Schuchardt Subject: [PATCH 1/1] lib: sbi: system reset with invalid parameters Date: Fri, 15 Oct 2021 15:42:21 +0200 Message-Id: <20211015134221.35427-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_064235_482409_DF754595 X-CRM114-Status: UNSURE ( 8.90 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The SBI specification requires that sbi_system_reset() returns SBI_ERR_INVALID_PARAM if reset_type or reset_reason are not valid. Signed-off-by: Heinrich Schuchardt --- lib/sbi/sbi_ecall_replace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [185.125.188.121 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The SBI specification requires that sbi_system_reset() returns SBI_ERR_INVALID_PARAM if reset_type or reset_reason are not valid. Signed-off-by: Heinrich Schuchardt Reviewed-by: Atish Patra Reviewed-by: Xiang W --- lib/sbi/sbi_ecall_replace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sbi/sbi_ecall_replace.c b/lib/sbi/sbi_ecall_replace.c index 5d24565..93f44da 100644 --- a/lib/sbi/sbi_ecall_replace.c +++ b/lib/sbi/sbi_ecall_replace.c @@ -151,7 +151,7 @@ static int sbi_ecall_srst_handler(unsigned long extid, unsigned long funcid, case SBI_SRST_RESET_TYPE_WARM_REBOOT: break; default: - return SBI_ENOTSUPP; + return SBI_EINVAL; } switch (regs->a1) { @@ -159,7 +159,7 @@ static int sbi_ecall_srst_handler(unsigned long extid, unsigned long funcid, case SBI_SRST_RESET_REASON_SYSFAIL: break; default: - return SBI_ENOTSUPP; + return SBI_EINVAL; } if (sbi_system_reset_supported(regs->a0, regs->a1))