From patchwork Fri Nov 10 19:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Kiryushin X-Patchwork-Id: 163962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1345301vqs; Fri, 10 Nov 2023 11:48:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwOTZteVLHt8HrT6w0B0ElpBnIMEDuCpUveGIQ28RvCMZkHAXvbI3S3r1P2uzGuUUxjKhB X-Received: by 2002:a05:6808:1413:b0:3ad:f866:39bd with SMTP id w19-20020a056808141300b003adf86639bdmr408631oiv.27.1699645694269; Fri, 10 Nov 2023 11:48:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699645694; cv=none; d=google.com; s=arc-20160816; b=FGfO/0yIJ3P8Zp5xhspMZ7RKUo+hwLJ7yGrAKeTO7meSUoKgAvCJHtLaNq0nTjPoTt v+gswTGY6tRhO3bNnKdHZMI+Ac8h+sZ2iNrFbjwgT8IEU9dFZFaOihJMSaBVfzOp0nw4 K7bcogWGoPOoLU2XporQBLgPANF4RfW89OxiFZF1IZxjvg9asK0iCFeOGRpIz5YeBgIJ ags6yAHvj4tjsUvdOuKKozFC6+lB2LKFBrab1UzT5iIfruTAkD9zEakeK9tSMJ63oV/5 ZJtLDc10lrBc+2NDUGULsIsFmTlAK1ZAu2/KHA4VB1cn2kEs+MxEIaUNfcVNFRTfGy4U 8qQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language:cc:to :subject:from:user-agent:mime-version:date:message-id; bh=UiRPXr9xNiZKldYjCjBIJbpZ0EvhZwXLgD47sWV3NYg=; fh=JaqT4i1j9uExX1Vc17dT3yDbdQ6xkR9pDBX+LkKf1Ro=; b=FMAL8Ktt9ttsCAJMqoTTHpEUHjOAoLIRvpoRFQ8sXJv0E8MqA2F34ijGXEjiabUd5z zk5A+X+jW+6ajy86oa/CJ3IPlY3DoFqLa3DydfbCaH3M8l842FRp4844FJSTx+19B1ss V1cVB86vUqL6cNJZ6BwJVLMnTFT+2d2aVhMuhMdzKujD+bWs+coW5ExsK6qJIPaQL9fE auvy722W82IGSEvyfSEuXTHK13EJheSBdrd4i4fnakdfPXU1bqwLIgy0SzDSbjKzTUGC zt0SvRIjL5VjCLsroY9QAVxBhsKpX1UYMvU0ouQ2sdN7SY8nZtJa6yCibk2ihHPBn7Mn QJ9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id c128-20020a633586000000b005be3117805esi98309pga.327.2023.11.10.11.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 11:48:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2FE5783805D6; Fri, 10 Nov 2023 11:48:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346326AbjKJTsA (ORCPT + 29 others); Fri, 10 Nov 2023 14:48:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236274AbjKJTrq (ORCPT ); Fri, 10 Nov 2023 14:47:46 -0500 Received: from relay161.nicmail.ru (relay161.nicmail.ru [91.189.117.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 003FB6A48; Fri, 10 Nov 2023 11:45:24 -0800 (PST) Received: from [10.28.138.149] (port=40524 helo=[192.168.95.111]) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1r1XRP-0007NN-6C; Fri, 10 Nov 2023 22:45:20 +0300 Received: from [87.245.155.195] (account kiryushin@ancud.ru HELO [192.168.95.111]) by incarp1102.mail.hosting.nic.ru (Exim 5.55) with id 1r1XRP-00H8mB-2j; Fri, 10 Nov 2023 22:45:19 +0300 Message-ID: Date: Fri, 10 Nov 2023 22:45:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Nikita Kiryushin Subject: [PATCH] ACPI: OSL: Initialize output value To: "Rafael J. Wysocki" Cc: Len Brown , Lin Ming , Bob Moore , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Content-Language: en-US X-MS-Exchange-Organization-SCL: -1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 10 Nov 2023 11:48:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782207683503949314 X-GMAIL-MSGID: 1782207683503949314 Buffer variable for result (value32) is not initialized. This can lead to unexpected behavior, if underlying platform-specific raw_pci_read fails to report error (uninitialized value will be treated as valid pci-read result), or exposition of unexpected data to PCI config space reader. Zeroing of buffer value addresses the later problem and makes the behavior in the former case somewhat more predictable. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c5f0231ee6b0 ("ACPICA: Fix acpi_os_read_pci_configuration prototype") Signed-off-by: Nikita Kiryushin --- drivers/acpi/osl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index c09cc3c68633..d3c0f7f01a29 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -788,7 +788,7 @@ acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, u32 reg, u64 *value, u32 width) { int result, size; - u32 value32; + u32 value32 = 0U; if (!value) return AE_BAD_PARAMETER;