public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cupertino.miranda at oracle dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114523] New: bpf: ssa-phiopt optimization generates unverifiable code. Date: Thu, 28 Mar 2024 17:45:05 +0000 [thread overview] Message-ID: <bug-114523-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114523 Bug ID: 114523 Summary: bpf: ssa-phiopt optimization generates unverifiable code. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: cupertino.miranda at oracle dot com Target Milestone: --- BTF verifier is a static analyzer that identifies possible kernel threats with BPF applications. The example below is a small reproducer obtained from debugging the last issue presented in https://github.com/systemd/systemd/issues/31888. extern int bar (); int baz; int foo () { int quux = bar (); if (baz) { if (quux) return 1; } else { if (!quux) return 1; } return 0; } The following code gets optimized by phiopt2 like: Removing basic block 6 Removing basic block 4 Removing basic block 3 Removing basic block 5 Merging blocks 2 and 7 int foo () { int quux; int baz.0_1; int _2; _Bool _6; _Bool _11; _Bool _12; <bb 2> [local count: 1073741824]: quux_5 = bar (); baz.0_1 = baz; _6 = quux_5 == 0; _11 = baz.0_1 != 0; _12 = _6 ^ _11; _2 = (int) _12; return _2; } The produced code from this optimization, in the original issue in github, results in unverifiable code for the BPF execution environment. For now it is unclear if the problem is within the verifier or not. As a resolution for the problem 2 paths should be taken: - Create a reproducer in the testing environment for bpf-next and report the problem within the respective mailing list. - Disable the optimization for BPF until the verifier fixes the limitation if possible.
next reply other threads:[~2024-03-28 17:45 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-28 17:45 cupertino.miranda at oracle dot com [this message] 2024-03-28 17:50 ` [Bug target/114523] " pinskia at gcc dot gnu.org 2024-03-28 17:52 ` pinskia at gcc dot gnu.org 2024-03-28 17:58 ` pinskia at gcc dot gnu.org 2024-03-28 18:05 ` pinskia at gcc dot gnu.org 2024-03-28 18:09 ` pinskia at gcc dot gnu.org 2024-03-28 18:13 ` pinskia at gcc dot gnu.org 2024-03-28 18:20 ` pinskia at gcc dot gnu.org 2024-03-28 18:26 ` pinskia at gcc dot gnu.org 2024-03-28 19:17 ` jemarch at gcc dot gnu.org 2024-03-28 19:29 ` pinskia at gcc dot gnu.org 2024-03-28 19:31 ` pinskia at gcc dot gnu.org 2024-03-28 21:01 ` [Bug target/114523] bpf: unverifable code due to subreg usage pinskia at gcc dot gnu.org 2024-03-28 21:06 ` jemarch at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114523-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).