From patchwork Tue Jul 11 07:19:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 118298 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp305595vqm; Tue, 11 Jul 2023 00:40:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0ZMUbOqVx9bLz+Gp3zLRrLgbEcE3BJU1qfZdDgwzCEiy2F79BbB3nUxJjK0pWXxZvI3Hg X-Received: by 2002:a17:902:f684:b0:1b8:a697:3719 with SMTP id l4-20020a170902f68400b001b8a6973719mr18611497plg.25.1689061236901; Tue, 11 Jul 2023 00:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689061236; cv=none; d=google.com; s=arc-20160816; b=nepMHHEziikDB7LBi2SSOdS5//y/hMpSZfKyP1Wg1pn9/w8Roj+5xjoS0rL8SLYVRA XG+LD58us4KD/FiIiHyjiHHKYfQz67rd4NJsHmq0NyoifEywzxFBdUR2GipsUqIBXpZz t/oyxbaSKFZriAzgh5a7C6ehso6968kW8ZYEY8RhwV5qF5JASReSGBQNK/n3QO9E6Bpi 3IzYIPk9+it57wmHhOieqx/Z+N0asfdISiCPW5vJGvQZgaFiVgpYJzPVqtMFbFkGBICL GL0C7yuJGwQjQL+CFPSVb1TfHSX5XjmzNRTyL7JVRO/R3JkpwsqtlJQXWd05FE8sTlJ7 Nnog== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=xRON641Prwmt7A4t6EJBbCJmTtEWBykCSOV9am7HjQc=; fh=Hjink8UqxZBIKrZjV14/iDtos+8gQIDDiYbL4Mxhxbk=; b=IE/k9hw1+FvrVSw1VT47zqkE9U7alxKEwJUFFymrKBuS+WuuDt8Sm2nbxqJDrk0nQk 1aNRf2d3Zi6tS6F5BL+NiSTS8SI0h+xkrAMwOK1WlfN9q2Ci8gIh3sfNUO1pJwIwfsyV Bar1eAP187RYlJ/BamR0vt3rwkDT8OfUWuA1i0mZPRiab+277gB7d1V/Q2YMcakxULw/ x64EjcIwtmTsXajDlk0AQ5bQ78tL3u/a7w7TyjsCK346TfKWkf950bcUDfOw1JZKc8IZ CVs/uj7tDWQRhjyjiuSVG6YmFeqgK4A1/Ca6GS1axRDkaXJNAtl6CYk+2vlmGQ9dk9Ah pTbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=MshxMeGR; 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=canonical.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf12-20020a17090305cc00b001b9d03d0bdesi1139028plb.79.2023.07.11.00.40.23; Tue, 11 Jul 2023 00:40:36 -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=@canonical.com header.s=20210705 header.b=MshxMeGR; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjGKHTg (ORCPT + 99 others); Tue, 11 Jul 2023 03:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjGKHTe (ORCPT ); Tue, 11 Jul 2023 03:19:34 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D779BE for ; Tue, 11 Jul 2023 00:19:33 -0700 (PDT) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 793683F36E for ; Tue, 11 Jul 2023 07:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1689059970; bh=xRON641Prwmt7A4t6EJBbCJmTtEWBykCSOV9am7HjQc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MshxMeGR8d1vq+idV04FZzLceYvL6aYkmdLurXVCOWVn/SdWoyGSw0dlPHpLTE+cd Zgxyki5HqhJzmf8SMOHqs1PlNts2WkzNdz80SCdHl5jmzkab+XLqcqKAHEuS3V5SmL TF+IF09moeev+/A60PgCidbrA+sawQRpn7CCZ4oxdKez7i1VLDwBdCjsPT4b7KD5/6 FF6F6I6kc27Kceusw5QJRMlCb24HnerniIX9f236RuAZV+m2yuWamhpUHhAfTY0/yL UOoviJUmbuUXZ38eh3F3G1Pkf48LdLbDpbuXHXtRrcp4dU/8mOYllbzGdQoCDN4s0p 0uQJZjpDrRE0w== Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-98df34aa83aso750111666b.1 for ; Tue, 11 Jul 2023 00:19:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689059967; x=1691651967; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xRON641Prwmt7A4t6EJBbCJmTtEWBykCSOV9am7HjQc=; b=iGPp0TFXFvYuk8p9qIakzXiRdK0jq+iPqVEBzEAE3mMBkXUlD2064ULSdCB3LaTq3W CkZRaEeiMxnu3WJlrSZA7fffO1BJ9pYkAPRb6+0aM4sdFaHhlSnwXl4aD3h5U7yY+UMF Zu0/qeLVVurEnhC1P7pl3TUrrZFNka6I6d2aDm9LjcZ2c5reyUVTn7GlEkMTW+nZNkTb DS5JBwfUCPIAs9x4XZyMtpB82alIvi/YRMpenACli1KMqRIP/JwdLA4DMifhmIPbH6Fj UXXUkoeZlXaowpfw+qjE3Kb4MrSLAh7FlAWyAOFj+qA6Hozrz7B3KHhkWFqkWCMSPd/P SWBQ== X-Gm-Message-State: ABy/qLadpvClD4iWBySao8Czo5aDcup82QKzTKCdQQoPk7wa5ecczqaT g0gfcGLQZ0nVk4CWMcANF5wSzLW0A4hhmS/i3s+zhzZxQ2AHrn8hAqRxCQfqtfPjUHdGICe0s0q 6KaFlcXYFrERJzCTUTu2heOJWP0xjC08DNitaNw1phQ== X-Received: by 2002:a17:906:d9:b0:98e:2413:952f with SMTP id 25-20020a17090600d900b0098e2413952fmr19698187eji.18.1689059967618; Tue, 11 Jul 2023 00:19:27 -0700 (PDT) X-Received: by 2002:a17:906:d9:b0:98e:2413:952f with SMTP id 25-20020a17090600d900b0098e2413952fmr19698159eji.18.1689059967069; Tue, 11 Jul 2023 00:19:27 -0700 (PDT) Received: from localhost.localdomain (host-95-234-206-203.retail.telecomitalia.it. [95.234.206.203]) by smtp.gmail.com with ESMTPSA id a25-20020a1709062b1900b00992ae4cf3c1sm740573ejg.186.2023.07.11.00.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 00:19:26 -0700 (PDT) From: Andrea Righi To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho Cc: Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Kees Cook , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rust: fix bindgen build error with UBSAN_BOUNDS_STRICT Date: Tue, 11 Jul 2023 09:19:14 +0200 Message-Id: <20230711071914.133946-1-andrea.righi@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: INBOX X-GMAIL-THRID: 1771109075658416863 X-GMAIL-MSGID: 1771109075658416863 With commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") if CONFIG_UBSAN is enabled and gcc supports -fsanitize=bounds-strict, we can trigger the following build error due to bindgen lacking support for this additional build option: BINDGEN rust/bindings/bindings_generated.rs error: unsupported argument 'bounds-strict' to option '-fsanitize=' Fix by adding -fsanitize=bounds-strict to the list of skipped gcc flags for bindgen. Fixes: 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") Signed-off-by: Andrea Righi Reviewed-by: Martin Rodriguez Reboredo Acked-by: Kees Cook --- rust/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/Makefile b/rust/Makefile index 7c9d9f11aec5..4124bfa01798 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -257,7 +257,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \ -fno-partial-inlining -fplugin-arg-arm_ssp_per_task_plugin-% \ -fno-reorder-blocks -fno-allow-store-data-races -fasan-shadow-offset=% \ -fzero-call-used-regs=% -fno-stack-clash-protection \ - -fno-inline-functions-called-once \ + -fno-inline-functions-called-once -fsanitize=bounds-strict \ --param=% --param asan-% # Derived from `scripts/Makefile.clang`.