Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6236515iob; Tue, 10 May 2022 13:36:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcMa3yPsNVsp1Z3KwtryHMdmyD9PWaYloIM4eTqu0mDRqOvtjEPjW0HaMQTADGZ8Zi1L/F X-Received: by 2002:a63:9d8a:0:b0:3ab:6ae4:fc25 with SMTP id i132-20020a639d8a000000b003ab6ae4fc25mr18345062pgd.496.1652214961003; Tue, 10 May 2022 13:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652214960; cv=none; d=google.com; s=arc-20160816; b=GxYW8p+LCsafkjdcPa56ybiPe4aPp2drgow1x8oAC4oCyeFdbtt2WIsoNs4J87hg/h OJMapNH3w6i7I8RQ2/bqajAuAjbFa1+Chnqo7Uf7PcCWlsqeX66EQBqlW1BAQ3TrOQ54 fnKz+zah2XjPc/AxCsMNIBNbCSbVD3ZNc4dQdqY82bKtQYo4laEfCVX6hcFIONPIK2TW Op/z3HnL8Lu6DNIlxbiX0v8HMq6KqP0VXDkwe3/GJLQ4/YnI+2LFZv/XSyYYI1LH71w/ OQtsNRNtAlLgZHCJoO3dtusfAHAImTc0Ymzj4uJ91DCNrx1APeahsG/0jXHmDxg0U2e3 +7sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jZUSRXkZxNZtiLPiDBjNAgeYZQgwEuzvzJ+EvFyugT0=; b=hywr9UDbA5YBK9ep3TP6Fy+WlOWUkOpWRU/un6KSuwijiRcKdSFitEa/fzwEfZ6flE KxOBGkKeEIkqjOOr3DT9WcVo4f9U0sZMRjSs7KU/0IUGFPsrGYwVRpvepunxs7rnFWoi sRpXsppo/EfBEWXmyAv2yKtBjUU8FbIpCzPqe6OILSeYfEYnVcFJdebf1hlXY2UK8qyb dCDttK0MvG6PN2/6YheunUPN+dmhEh8Bku/sJBfY2RAb8hXOZzTDcx/ptMb6Xb/a7uHw UG0xPatOJgtazf02nhgxn2Wo3DojDRigWXbM5vp6BmzQ40XML/pf9tBGQcFejkfAOZPv 10fQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a056a001c8200b0050d2a9a54f4si15948814pfw.372.2022.05.10.13.35.45; Tue, 10 May 2022 13:36:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345466AbiEJPTz (ORCPT + 99 others); Tue, 10 May 2022 11:19:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345238AbiEJPTH (ORCPT ); Tue, 10 May 2022 11:19:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F049703C1; Tue, 10 May 2022 07:56:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BC0113D5; Tue, 10 May 2022 07:56:48 -0700 (PDT) Received: from bogus (unknown [10.57.0.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54C773F73D; Tue, 10 May 2022 07:56:46 -0700 (PDT) Date: Tue, 10 May 2022 15:56:40 +0100 From: Sudeep Holla To: "Limonciello, Mario" Cc: Jassi Brar , Sudeep Holla , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "erhard_f@mailbox.org" Subject: Re: [PATCH] mailbox: pcc: Fix an invalid-load caught by the address sanitizer Message-ID: <20220510145640.xx2b3umlrylorxgs@bogus> References: <20220509141716.1270-1-mario.limonciello@amd.com> <20220510144656.nxbayvxdfcia3ykm@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, May 10, 2022 at 02:49:12PM +0000, Limonciello, Mario wrote: > [Public] > > > -----Original Message----- > > From: Sudeep Holla > > Sent: Tuesday, May 10, 2022 09:47 > > To: Limonciello, Mario > > Cc: Jassi Brar ; Sudeep Holla > > ; linux-acpi@vger.kernel.org; linux- > > kernel@vger.kernel.org > > Subject: Re: [PATCH] mailbox: pcc: Fix an invalid-load caught by the address > > sanitizer > > > > On Mon, May 09, 2022 at 09:17:16AM -0500, Mario Limonciello wrote: > > > `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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz > > illa.kernel.org%2Fshow_bug.cgi%3Fid%3D215587&data=05%7C01%7Cm > > ario.limonciello%40amd.com%7C2a6407ffdf5944577aee08da3293f29b%7C3dd > > 8961fe4884e608e11a82d994e183d%7C0%7C0%7C637877908262860256%7CUn > > known%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 > > Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=lTXBFYCNnM > > Pt6KnL34rQWXT%2BZvdEwvmIdMWGI%2BfluCo%3D&reserved=0 > > > Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into > > pcc_mbox_probe") > > > > Thanks for catching and fixing this. > > > > Reviewed-by: Sudeep Holla > > > > -- > > Regards, > > Sudeep > > I'll take the credit for fixing, but I realized I forgot to add a link and attribution > to the original reporter. Here are some more tags to add: > Ah OK. Not sure if the tools pick up the tags added like this. If not better to post a version with all tags added which makes it easy to apply. I see the reporter has tested it as well, so guess tested-by can be added as well. > Reported-by: erhard_f@mailbox.org > Link: https://bugzilla.kernel.org/show_bug.cgi?id=215587 -- Regards, Sudeep