Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp785605pxb; Tue, 5 Apr 2022 23:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKQAqTDw/SA4kElphEpV+74A1g+U1+BKfeldSk7OE6OGo92dVTq0xoyVeasLsFi/o0/eDm X-Received: by 2002:a17:90b:3a84:b0:1c7:bc91:a870 with SMTP id om4-20020a17090b3a8400b001c7bc91a870mr8184074pjb.155.1649225726644; Tue, 05 Apr 2022 23:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649225726; cv=none; d=google.com; s=arc-20160816; b=mxmRv4PDJ8qmTC+kYWdaAyAiNbhd6oGse9BJ6TZWy0I0JsaIvSUiquJPrbM6qnx55z 97Azf5bMiuBV0eaQcI/WjOG8GOtSPVqDChrvzgrno6p0z7dkbWt6YNGXdppNjINYGGwO mXbEf7UNobkMfmtEmmcdspVfRlxwcm0C1fr0E3IxAmE5hQ6ATpx4p9B1sozvbn86L8yB JAvmA0/QFsDRYjbvkKQKzccz7PCaMbQec4ePZ5rwTbNyCGPaTlY5LjWl4BGFiYYYjc23 +Z7b0AI8i/yxhQgL2jlQ0Iaz1kxU6AbEzBOKEMgvOJWc6ZuOtRv8y0wTIQhQT4qQujDX 0S2w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UDL2dhmJrCNToj/HGsyDQ7DuZlLclp5wFLMD60mJIDk=; b=tHl0QqmQTuqgD2VUM12/rWORCtpkn/xve1EV2Q07kxmpABzvMDkYt9Ue63hguK827D 0U2DKKku7E6krhiZvf4lohO6XzIOW9WKgGUi8IEs9SPYdt9isXXwvdb5fzHPE1QxvCn/ c/DlQ+hDvLe67mdP2yW4NaYjBunv1NOnW6T8Uxl9cOvQ7ATZlwgnZ2gAoIWIfl4SbgSn 8myGYmAdh+gGRjl3H3FyrRc+e7B2Z8rVThF6t4Rwz1Q915xO3XfERwXVhiBfihU8KBvt TUtJGqzj1HT/bl4bkPr0WFDlTAln9ECrM8tHTi+DjFhvCsNjfgfmjaulN8pA/CLdzVyc f41g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="S/B6B6pY"; 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=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mh9-20020a17090b4ac900b001bd14e01f4dsi4660211pjb.59.2022.04.05.23.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 23:15:26 -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=@alien8.de header.s=dkim header.b="S/B6B6pY"; 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=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B12B947D59F; Tue, 5 Apr 2022 23:06:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1846958AbiDFCLS (ORCPT + 99 others); Tue, 5 Apr 2022 22:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455499AbiDEQAG (ORCPT ); Tue, 5 Apr 2022 12:00:06 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A385DA15; Tue, 5 Apr 2022 08:16:02 -0700 (PDT) Received: from zn.tnic (p2e55dff8.dip0.t-ipconnect.de [46.85.223.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 093DF1EC053B; Tue, 5 Apr 2022 17:15:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1649171757; h=from:from: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=UDL2dhmJrCNToj/HGsyDQ7DuZlLclp5wFLMD60mJIDk=; b=S/B6B6pYfurNbBNbI4KbkkR3uHedbbjg7UNT2jV1Q4qeYZQwaEBUHwRMr+grYfQGCMjRML YS/NXOyWYq3sbQxeJQczSgnmOErjoLD349KtuAenIDbryMtxYVeOHUmj4ivD68y7y/gmlb KVZ7pAR54/PR/seX/1pPg+SYhJXY0Hs= From: Borislav Petkov To: LKML Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 07/11] usb: typec: tcpm: Fix undefined behavior due to shift overflowing the constant Date: Tue, 5 Apr 2022 17:15:13 +0200 Message-Id: <20220405151517.29753-8-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405151517.29753-1-bp@alien8.de> References: <20220405151517.29753-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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=no 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: Borislav Petkov Fix: drivers/usb/typec/tcpm/tcpm.c: In function ‘run_state_machine’: drivers/usb/typec/tcpm/tcpm.c:4724:3: error: case label does not reduce to an integer constant case BDO_MODE_TESTDATA: ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org --- include/linux/usb/pd_bdo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/usb/pd_bdo.h b/include/linux/usb/pd_bdo.h index 033fe3e17141..7c25b88d79f9 100644 --- a/include/linux/usb/pd_bdo.h +++ b/include/linux/usb/pd_bdo.h @@ -15,7 +15,7 @@ #define BDO_MODE_CARRIER2 (5 << 28) #define BDO_MODE_CARRIER3 (6 << 28) #define BDO_MODE_EYE (7 << 28) -#define BDO_MODE_TESTDATA (8 << 28) +#define BDO_MODE_TESTDATA (8U << 28) #define BDO_MODE_MASK(mode) ((mode) & 0xf0000000) -- 2.35.1