Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2195027iof; Tue, 7 Jun 2022 22:50:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0JBMR+u1TKay5TA5HfuTKIA8uOUCsx3JQrHzQj1NnvPBuZ9YmGMHKGOAtZU+lY+PCgCJX X-Received: by 2002:a65:64c8:0:b0:3fa:91bf:a5d8 with SMTP id t8-20020a6564c8000000b003fa91bfa5d8mr29132275pgv.473.1654667442176; Tue, 07 Jun 2022 22:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667442; cv=none; d=google.com; s=arc-20160816; b=NbGOtj5Oag7VgFnptEWB2NWwu+MW5FLZczmFt5f3EvK9YpDmKH4S8wBjWF0uCZDFG6 6NrPHxdxIoYAA+1qkcdO2hlMVL1YNaeUcR+zwEKVQafiQ39PEwmbV7IJ3/oG6jMHJs6f t7sxNpqLOE4qCo0lz1dr1PSbhOJ7A7RM/S9XDq/KvwPd/LOLsFxlvgi2tDGSojHi1T5/ YedxN5aIW2Tb6ok1eKNqpUpkTIV1zeAw7MYvqhU3ZBm7l2BYyzHGmrh2bB8kiqEs/FVy tTqWcYQcJbi98F1Lk0SpC5pZIUrIvNk7cFlj4poc84XYn923j3EBXXcoZYcWmf6GkWii 5TkA== 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=015bwJD75POPABYMoSX7ByWn70ds9gFkq17S42yyeQI=; b=HNlyCwSWXF7HfNmlV9JztSn+xCGY0n70sMtErx6/yuzu27gZsemijAsfHhBZwZBqoa JW4ijsXD3is0StW6lXKD3vRr4N17B+72Huro+xgMwOxvj+YXoSzPx9HkVU8pWiBYKHFK s2S/tiyD1WwtEoGEc/wOjpZ6s4cybFXKWebHoulua1wZ78KJN9yofs2TZaW9n+0JFlF9 xsqZwIPA9z6C/186reg7pi+X/hmv+4RiTzMfgWHia0UzkzTtaFZUie7L7Cu7vCuDHpiT dOQgT2NO0UAqOkHX2R3yz61EaNRGMQ4aep11/cwmE4taWaQdqWajkYr5wDQGv1xNhrZP qa5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IVUVRtjK; 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 c137-20020a624e8f000000b0050d28930dbcsi24283666pfb.192.2022.06.07.22.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:50:42 -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=IVUVRtjK; 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 746143A8F83; Tue, 7 Jun 2022 22:17:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391324AbiFHAhv (ORCPT + 99 others); Tue, 7 Jun 2022 20:37:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382206AbiFGWG4 (ORCPT ); Tue, 7 Jun 2022 18:06:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 078AE2534C5; Tue, 7 Jun 2022 12:16:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 97D2161922; Tue, 7 Jun 2022 19:16:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A428AC385A2; Tue, 7 Jun 2022 19:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629400; bh=KiuypoSUd6NP4ZOZhLO+Q6SdpDwgU1oyK6PAXpq4hFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IVUVRtjKAGq7jppZ2bXXVDtjXM/Gvty2BY2ccYKE6a4ZDAy7q1EkytPo5qNhWBuok ZtEfu2SjKgE7Ea+wzJ2fy7K5zWAsmJLBRuK17jG6vDftt+hVlRc0qnDeiIuaY0KR3z MwcbyiN5W9dPzJ146htl/zVz67T06WP+MKdVaS8A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Limonciello , Sudeep Holla , Jassi Brar , Sasha Levin Subject: [PATCH 5.18 637/879] mailbox: pcc: Fix an invalid-load caught by the address sanitizer Date: Tue, 7 Jun 2022 19:02:35 +0200 Message-Id: <20220607165021.338940803@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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: Mario Limonciello [ Upstream commit 369e4ef87a8f5da7c348ec2c61ec5cd726e8337a ] `pcc_mailbox_probe` doesn't initialize all memory that has been allocated before the first time that one of it's members `txdone_irq` may be accessed. This leads to a an invalid load any time that this member is accessed: [ 2.429769] UBSAN: invalid-load in drivers/mailbox/pcc.c:684:22 [ 2.430324] UBSAN: invalid-load in drivers/mailbox/mailbox.c:486:12 [ 4.276782] UBSAN: invalid-load in drivers/acpi/cppc_acpi.c:314:45 Link: https://bugzilla.kernel.org/show_bug.cgi?id=215587 Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Signed-off-by: Mario Limonciello Reviewed-by: Sudeep Holla Signed-off-by: Jassi Brar Signed-off-by: Sasha Levin --- drivers/mailbox/pcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index ed18936b8ce6..ebfa33a40fce 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -654,7 +654,7 @@ static int pcc_mbox_probe(struct platform_device *pdev) goto err; } - pcc_mbox_ctrl = devm_kmalloc(dev, sizeof(*pcc_mbox_ctrl), GFP_KERNEL); + pcc_mbox_ctrl = devm_kzalloc(dev, sizeof(*pcc_mbox_ctrl), GFP_KERNEL); if (!pcc_mbox_ctrl) { rc = -ENOMEM; goto err; -- 2.35.1