Message ID | 167518067379.4906.5578847349116389476.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2834963wrn; Tue, 31 Jan 2023 08:05:19 -0800 (PST) X-Google-Smtp-Source: AK7set8XJZNaF5+jI4nDpFlt8yoSrTJRoJics2RHcWCMWZpCSsCQVO01hQIgT3gDQgRcOv2QUgns X-Received: by 2002:a17:906:4d5a:b0:88a:723:f646 with SMTP id b26-20020a1709064d5a00b0088a0723f646mr6213504ejv.75.1675181118933; Tue, 31 Jan 2023 08:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675181118; cv=none; d=google.com; s=arc-20160816; b=s1HcOxo9Ah/dPFnEWkWnnBz3ADH3SuWiBRj9HHHURq+qDDt7k+HZCpGN+sMN14ZTCa vw670ob3AK8MoDg0Bc48MfxXKWjQ1R0yAzS56k/ypO2ywB2Knun+tmtJlxfVZkX8ajNE IM3qfz1/t2FubNVbYlSoc7ohStv2utqG1uRUs2bMikGWxSNV7Ar728orK/fev4GH1htY x1zNvlh8TEsXH0GDvNxs/ITJyio/pZXT2VON+ul7seAmRP5+DWUrPBDyRdZ+ECUlmz3I nPr0xN5qPd4eRNUkniin2MjWTAyZx25gD72ko/pXu571MTKD4CD0n5BQIQ1wxdaeb7CY GJLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=TZzJ+GQ2T/0Ua8BfIYWMuAMISueCW/XtJ+YiNk66U1I=; b=QbMS4NK4cdWJt+x1W1KUBO77Fe8on2JV0mJerpT51D42sDOXpD4jeXkuEBUWO9sYfb tm1fbJda+Jj1vp83JXfkwD0AK2GwTqF5E3NMCFLlLEZFhvnOS69WTgyYpPn5fAlLYuQU Hf5JNWYnYibDyawDWcZ4jH7CiGgdF2B8y6ve+sdGofo5rsMR6MDzL44S3OMRM3ofYiRt BmkaEkugau/SwqbuTlfaUf0uyiJCKtoVmIAvrCtmoc/EaRieA0/wZ6cYaO4nRtdhbAzB ymCKGaSW2nWZxcb8JGXv2tYXi9QKIxfSELNVvuZuTAPVjq2t6HJyZ1ADQRFxb3THvzW7 vDSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pzbnRaPL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=h7RpaJHa; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a170906104d00b008626e197ac4si18257998ejj.975.2023.01.31.08.04.54; Tue, 31 Jan 2023 08:05:18 -0800 (PST) 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=pass header.i=@linutronix.de header.s=2020 header.b=pzbnRaPL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=h7RpaJHa; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233493AbjAaP6B (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Tue, 31 Jan 2023 10:58:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233495AbjAaP56 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Jan 2023 10:57:58 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94124ED5; Tue, 31 Jan 2023 07:57:56 -0800 (PST) Date: Tue, 31 Jan 2023 15:57:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675180674; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TZzJ+GQ2T/0Ua8BfIYWMuAMISueCW/XtJ+YiNk66U1I=; b=pzbnRaPLaQ/3gI7t6UbZa/Oa5PmR4y47cA+G2DKLBBCcUfEM/1uHI3tAcsTXD9NMw1CEBK qqoOhiPwvWe4w6NY9A/s+kE1k3Eflef7H6ginQ+Om6K8s8pBnyPhwgZ+my6HLznBL8wfEQ FYxn06Xxk7KrQwGcC7Mwn6N1Sz6ee9QJmk3Rs7a2HC0OouUzCYDRGywy28WzI9BiQ/4xqb +KHVpSsL9M1nZO9Jxy0BntK8BBIAfMhkEkQT1Lp8l3ekFOl3j1IrvnaeqJUJlMLiGWsO4l 8UFG2ePQtQR/c/AhQSZm41uLc1G8AXrl51ntd1jLTvTMgOME3LHLJToHvvQP8A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675180674; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TZzJ+GQ2T/0Ua8BfIYWMuAMISueCW/XtJ+YiNk66U1I=; b=h7RpaJHa6/0UI7mJcEDt5gunf0evL5A/bBsDZrDv12iro0vvgltSIUVG8vDBeIeyOwBfPB gA6Atrza6/OTsVAQ== From: "tip-bot2 for Ashok Raj" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/microcode] x86/microcode: Allow only "1" as a late reload trigger value Cc: Thomas Gleixner <tglx@linutronix.de>, Ashok Raj <ashok.raj@intel.com>, "Borislav Petkov (AMD)" <bp@alien8.de>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230130213955.6046-3-ashok.raj@intel.com> References: <20230130213955.6046-3-ashok.raj@intel.com> MIME-Version: 1.0 Message-ID: <167518067379.4906.5578847349116389476.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756554716887646834?= X-GMAIL-MSGID: =?utf-8?q?1756554716887646834?= |
Series |
[tip:,x86/microcode] x86/microcode: Allow only "1" as a late reload trigger value
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Jan. 31, 2023, 3:57 p.m. UTC
The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 25d0dc4b957cc8674f8554e85f18a00467e876d7 Gitweb: https://git.kernel.org/tip/25d0dc4b957cc8674f8554e85f18a00467e876d7 Author: Ashok Raj <ashok.raj@intel.com> AuthorDate: Mon, 30 Jan 2023 13:39:48 -08:00 Committer: Borislav Petkov (AMD) <bp@alien8.de> CommitterDate: Tue, 31 Jan 2023 16:47:03 +01:00 x86/microcode: Allow only "1" as a late reload trigger value Microcode gets reloaded late only if "1" is written to the reload file. However, the code silently treats any other unsigned integer as a successful write even though no actions are performed to load microcode. Make the loader more strict to accept only "1" as a trigger value and return an error otherwise. [ bp: Massage commit message. ] Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230130213955.6046-3-ashok.raj@intel.com --- arch/x86/kernel/cpu/microcode/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 61d57d9..fdd1e7e 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -475,11 +475,8 @@ static ssize_t reload_store(struct device *dev, ssize_t ret = 0; ret = kstrtoul(buf, 0, &val); - if (ret) - return ret; - - if (val != 1) - return size; + if (ret || val != 1) + return -EINVAL; cpus_read_lock();