Skip to contentSkip to conversation

frr: Fix build with bison rejecting paths in output directives

PATCH Yogita Urade -X (yurade - E INFOCHIPS PRIVATE LIMITED at Cisco) 1 participant 1 message Nov 18 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Kindly ignore this patch.
Sending new one with correct subject.

Regards,
Yogita Urade
________________________________
From: Yogita Urade -X (yurade - E INFOCHIPS PRIVATE LIMITED at Cisco) via openembedded-devel <[email protected]>
Sent: 18 November 2026 16:46
To: [email protected] <[email protected]>
Subject: [oe] [OE-core][wrynose][PATCH] frr: Fix build with bison rejecting paths in output directives

From: Khem Raj <[email protected]>

bison now carries the fix for CVE-2026-56390, which rejects '/' in %header/%defines and %output file names, so generating the command parser fails:

lib/command_parse.y:20.10-30: error: invalid %header file name ignored lib/command_parse.y:21.10-30: error: invalid %output file name ignored

Backport the upstream fix which drops these directives and passes the output file name with -o instead.

AI-Generated: Uses Claude Code

(cherry picked from commit cf06742a7c064d293c715e143fdabf91bf072893)
---
 ...ths-in-bison-output-defines-directiv.patch | 54 +++++++++++++++++++
 .../recipes-protocols/frr/frr_10.6.1.bb       |  1 +
 2 files changed, 55 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/frr/frr/0001-lib-Don-t-use-paths-in-bison-output-defines-directiv.patch
meta-networking/recipes-protocols/frr/frr/0001-lib-Don-t-use-paths-in-bison-output-defines-directiv.patch new file +54 -0
new file mode 100644
index 0000000000..ac732d9ebc
@@ -0,0 +1,54 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Donatas Abraitis <[email protected]>
+Date: Tue, 13 Oct 2026 15:33:02 +0300
+Subject: [PATCH] lib: Don't use paths in bison %output/%defines directives
+
+The fix for CVE-2026-56390 rejects any '/' in %output and %header (%defines)
+file names. The directive is then ignored, and bison reports an error
+and exits non-zero, which breaks the build:
+
+    invalid %output file name ignored
+    invalid %header file name ignored
+
+We only used these directives to place the generated files in lib/,
+because the .y.c rule ran bison without -o. Drop them and pass
+`-o $@` instead. With -d, bison derives lib/command_parse.h from the
+-o name, so the generated files stay the same.
+
+Signed-off-by: Donatas Abraitis <[email protected]>
+
+Upstream-Status: Backport [https://github.com/FRRouting/frr/commit/b7ad39d799d98c982713b29c1d0ba6d49691308b]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ lib/command_parse.y | 4 ----
+ lib/subdir.am       | 2 +-
+ 2 files changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/lib/command_parse.y b/lib/command_parse.y
+index bc04bc93bb4c..4d9377e5df87 100644
+--- a/lib/command_parse.y
++++ b/lib/command_parse.y
+@@ -16,10 +16,6 @@
+ %define api.pure full
+ /* define api.prefix {cmd_yy} */
+
+-/* names for generated header and parser files */
+-%defines "lib/command_parse.h"
+-%output  "lib/command_parse.c"
+-
+ /* note: code blocks are output in order, to both .c and .h:
+  *  1. %code requires
+  *  2. %union + bison forward decls
+diff --git a/lib/subdir.am b/lib/subdir.am
+index 20947c306d60..dafebacf8e7a 100644
+--- a/lib/subdir.am
++++ b/lib/subdir.am
+@@ -537,7 +537,7 @@ CLEANFILES += vtysh/vtysh_cmd.c $(vtysh_cmd_split)
+ .l.c:
+        $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
+ .y.c:
+-      $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
++      $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) -o $@ $<
+
+ #
+ # generated sources & extra foo
meta-networking/recipes-protocols/frr/frr_10.6.1.bb +1 -0
index 8f53cf68d5..bd977be214 100644
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://doc/licenses/GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a
 SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/10.6;tag=frr-${PV} \
            file://frr.pam \
            file://0001-lib-fix-mgmt_msg-recv-to-deal-with-mis-alignment.patch \
+           file://0001-lib-Don-t-use-paths-in-bison-output-defines-directiv.patch \
            "
 SRCREV = "71da51baee6fb2a02b24262defc46591c86e8a81"
 

--
2.35.6