From patchwork Tue Oct 25 15:32:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1082951wru; Tue, 25 Oct 2022 08:59:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6T6yglrMLBuCPQi/yb1t2kP4MR3HhIodysFJ8Ei18/3d3OVz3PEIrdr7HXebuVAfuQLBGQ X-Received: by 2002:a17:906:fe0a:b0:76f:e373:d84b with SMTP id wy10-20020a170906fe0a00b0076fe373d84bmr33322714ejb.297.1666713572164; Tue, 25 Oct 2022 08:59:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666713572; cv=pass; d=google.com; s=arc-20160816; b=qsEVGu1Fp+FUk3lRrbwNd00SwzjH9LwlpM4+wPnvTDWtaBSlcJ/xpn8zXbM3c4xbeQ oOEYnu7nYeygOrad99T9NYZXWJ+LoxFq7m5+Aj5xI0ow2EPf/iXVrSsTickt23oJtkBQ TUt7XNLwtIEQDJES0vXrRYJyDZliMSn+QFj2PCobBArPdeItfaiWrP2rVJr9efxMK2Z4 RUqCSOy5ZoXdFPO56WXXDTolzUlh98zfxPAo6uromzdHYws+xjWa4yVXfT34g/WIqieV jqX/5feVNezOm/D5r3hndQmxiu+boYIrsDXj6MOHfS4O1UXL3vyJD7NB7/5no55d9soO 4A8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-disposition:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=AQKfWvYPG1fY+cprL2ygqP5adC2OINl0HM+Y8eo56MY=; b=bxnhDAhoeun3lkQS0MIK8ev1l40yuyaVPeqVPpmbpEJCK+e8jDSyFmiQ5p6EAJGep2 cwLp5HffkDw4P7PreXNEkye4vFN12cq/XHHsZIRyMyMhZrt0OvWeolFoyOCdKanMIAW5 92Wbg46cMU39QadKNQl41cvzYqXWlC/re+nvxHNe2UZAJzxIjTB+UwqaWLLO+d+4zZSx OfC9HPULAexy8ei5mW3U4tFCKUO4hUgsEvKT5TEjt7ICQ3ojE0u0gXPRgIQYvZBaYEJT jpEoZmjLwArdCYbl3ZuAuqMTAHvSM57D79Eu5Ypq4UqL0Rilm93B4UHQegVEsvtlZNdu wpBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=BgsCqNDo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=M3uOizin; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a17090699c300b00773db392e1esi3442849ejn.997.2022.10.25.08.59.07; Tue, 25 Oct 2022 08:59:32 -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; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=BgsCqNDo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=M3uOizin; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbiJYPdn (ORCPT + 99 others); Tue, 25 Oct 2022 11:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232842AbiJYPdl (ORCPT ); Tue, 25 Oct 2022 11:33:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BC65BB3A6; Tue, 25 Oct 2022 08:33:40 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29PFTulE023414; Tue, 25 Oct 2022 15:33:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=AQKfWvYPG1fY+cprL2ygqP5adC2OINl0HM+Y8eo56MY=; b=BgsCqNDoCla1vsq2OtwT8WPe4xcvuT4ndaXXQmbznKsJlFxH7wGIbGUWlgEbv5Ij0KBp Mw6KyEuNF6MyNUy6ectU93JXKN2+4ik3K7PBUX8Y5/zVXLNMXtiwN7dA2Fru+2jibGtz gW1Llz68OK4stlsY2caXNR4BgNHNy/LQLRm22SbicMjIjgbXQahFdhh78d8/LluT7thj I63LBYIr4NSM4ugWPSAP4ePDcb/HaNOsfKIqutD/ENtSZxGdLJr9gfReZvtA7JsN303O 44MyXi7+9heqEhjPskR7Y9MU2Sdyd4oOLYgTMl73/hZyrwdr4dJp7Kd1atUitshAZgpw Cw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc741vbvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Oct 2022 15:33:00 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29PEmitV039926; Tue, 25 Oct 2022 15:32:59 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6yas9fc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Oct 2022 15:32:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hc52alK8kDJvlvq5OcgXinxoIEdTujTmQo9gnAo5t8rA135icZL1NhCUiU7viSTocwGAgU8Gyr0q9ljX1omPaT/1WRQVwOdRSmLw8wwHcu7RNjUfuC1r7lK3/uBJfrfrcB+Cn5etYxybSnef0VdFCSCZmYa2LvIExYjGNriJ3yEKxd5rk9EYkORtDCS8SZ4idUdLUa7ifZIUxsWnPJMF/+VNfHc3+N6Xa28Cw7Lrdoen4I90cKNx/og9YDXTh2A9kKoYIUdMhcqkGVE2VJYe0DataRH2y5nxKdnU1qrxurHfuoXyUXujN8IPH7IpUA5QkYjvphamDRpEqH2imfi3/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AQKfWvYPG1fY+cprL2ygqP5adC2OINl0HM+Y8eo56MY=; b=aqqswRCV4JxGOjhZAbaw7G7brLkPGEp1KS4nRYqu3PdC3GfBkUIRVGWUF6oOhTGnAbxuMv6EQlYWwMqCexM0a5Vdob0Ahsg3SoHUL26zhj6vxjHnBK9xF6+msiAFb6gl7OSNWu/u2xuuag5cIPtgs33Nib0JcJmPf8FQUOhUseTJ7yltgcUj+/THJBrh8pJZ859RKThEqLm7O4wrXSb7YGyoUC6VmcCI5XOX4n4tE2V/h8nwBFc5p1YB0om/vV0BHGiF157I5xHyvHLiLmSNeLX7S5kw1aOP0gImUVw6EAdL5R0VLxwudF0tAaZjVK9/sZyhkc3yn/w3UkxGxvXSWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AQKfWvYPG1fY+cprL2ygqP5adC2OINl0HM+Y8eo56MY=; b=M3uOizinxyXbeAYUyb59+0GlCY7IPqtqi5Pvx+GPQoRKTfRx8fmAvNkqjh0YsTD+w5dSnD/Q4O8q5NpwNndcv+xBCFaDk7JTUbduPAdB8hvREBb7TZMRQM0TxIJ7YxFFUQIDNF+vokAJdKEvhULbDWklXz9K7t8Cioy+tGu8kw8= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by BN0PR10MB4837.namprd10.prod.outlook.com (2603:10b6:408:116::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 15:32:56 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::1b8e:540e:10f0:9aec]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::1b8e:540e:10f0:9aec%4]) with mapi id 15.20.5676.031; Tue, 25 Oct 2022 15:32:56 +0000 Date: Tue, 25 Oct 2022 18:32:49 +0300 From: Dan Carpenter To: Thomas Gleixner , Peter Zijlstra Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Josh Poimboeuf , Alexei Starovoitov , Song Liu , Nadav Amit , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] x86/retpoline: Fix crash printing warning Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0011.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::21) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2365:EE_|BN0PR10MB4837:EE_ X-MS-Office365-Filtering-Correlation-Id: 567bff20-68a8-49b3-d987-08dab69e30c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5r/yo0m49mlD6CGk6lZ8JyMO7A8h7B0yNGsyDm2p2Gu2yL69zp2mDh7RBT2hzHTy0Dq3GoRk17nCz0OktkX1ojJTLh7NIjRt70rR1/hXkSPpdUqBGQpkabsOshxTh1giKh3N52N+o2/KyC9Fb7BGptFN0+Roi0jEaXfdSYryTrfK/85FWeKWNEnClC2uJkn6qTUKmTvTslv3+Az3ofWe1RduaHsYRN/tvc89lUS/bs7heEJQZ3PQ0WEVNiUNNetHSGYyWIv9IZ14E38jog/3jZCiztalp+AYzTMP4//tnvvLXYEbVQ/FL9UrxQcSu+SpaAGUBFoogvXKWW9hNMITJceeZyBf95PmLOySC14o76Yja0I3cAgUjhu59FZIeMpdiNABce4V6fPpCRuJ/CMEJ64aPSPhiCQ33GIw3gWgTEwQfMatBozqNRiU092hkQj+MzHGuFncmX3GVgOc9e2sRNrmxBf0z52U9La5sVeobuf2Uhv+AyqtF6fS8EVNQuSyOr9n3N6Ke0xU7+/96uoxnzZrD0RmNa1zW7GTgJSthZPef91lm1TnkvmHYeALM8HeDbzaSGXp37fUxPge8D/ROhwLiRxU3mQUTqavm2l3tuM39Se6g+DhuyAf7Zo04dHr7oNieNpXwnIBQDWGsOycs3pBpmlxSrnt6A84ZdgzLYRt7TyPYgpzWyGOgSjkHjKKzUBma28KbtTcQHHJ70JuBA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(346002)(39860400002)(376002)(366004)(136003)(396003)(451199015)(6486002)(478600001)(33716001)(110136005)(6512007)(9686003)(316002)(83380400001)(86362001)(38100700002)(54906003)(6506007)(66946007)(66556008)(4326008)(8676002)(6666004)(186003)(4744005)(41300700001)(66476007)(26005)(7416002)(2906002)(44832011)(8936002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UkuvVOB57Olcqewz/1n+QIp/15NwbZDfpEZtHh1SnyK7BaEx9koxLtlW7lf22AksKN1uRd2I0fhjcukpn1yl9fPIpFDKXS35dMGjlPblbfTacRdyNbYilM3eUA7FZepuMYHbP5eqEXMzmTyBtLyZu5f7u/bRzCpoWB4sdk5wWMSwVBIr0ZiwEkeZg645LzpYKjDeOe2RGy7yRv3R3f6/EzwuQfc0dJiOEJ0IpQV6yqiPszhwuRpyXRqmhL1TsNEJA3/so7sA/ET2TN4GkC9/zpccc2S35HnUnH9DQf5ErUezT5y+LYsvz8UxapwsorZBgkYZY6RyRNDRl2jpf5zNHixuennsD9zwWfbx8Q7msHLU0BmnGNd0rTwaZG7bpb/klx5vc2YYIY5X7n/BTAKeJ1Sbnwdk4nV4s9HPgV6czd83ffiQ1o95VU8oEjjONL18yD/8wOUccTdcx4cvE1hslOcU0eAzmcOfM5EnHm9sQ+OdAugpUNUj0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UYhGBt27kNnov470mOjl3lXMYdPDOj0/SC6H7JEUXjmYg+1WTEypg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 567bff20-68a8-49b3-d987-08dab69e30c4 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 15:32:56.7203 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aZNi+mxkZ0Swpuq2FP/Tbfl0IAJwd3otnaQxhyTImUv9SBFfUO+FzfOCmbWl58CRlBwHXZ1lOe2IHAbVGa2F/6RUDaRftZRWon0I26BOmVU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB4837 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-25_09,2022-10-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210250089 X-Proofpoint-GUID: XpKdkFnYnVZTLZhFrbPHhrYPIonTcBiz X-Proofpoint-ORIG-GUID: XpKdkFnYnVZTLZhFrbPHhrYPIonTcBiz X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747675850647018606?= X-GMAIL-MSGID: =?utf-8?q?1747675850647018606?= The first argument of WARN() is a condition, so this will use "addr" as the format string and possibly crash. Fixes: 3b6c1747da48 ("x86/retpoline: Add SKL retthunk retpolines") Signed-off-by: Dan Carpenter --- arch/x86/kernel/alternative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 19221d77dc27..b4ac4e58c010 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -418,7 +418,7 @@ static int emit_call_track_retpoline(void *addr, struct insn *insn, int reg, u8 break; default: - WARN("%pS %px %*ph\n", addr, addr, 6, addr); + WARN(1, "%pS %px %*ph\n", addr, addr, 6, addr); return -1; }