opnsense-src/sys/conf
Jessica Clarke 8a6ab0f71f Pre-quote macros passed to .incbin to avoid unwanted substitution
Currently for the MFS, firmware and VDSO template assembly files we pass
the path to include with .incbin unquoted and use __XSTRING within the
assembly file to stringify it. However, __XSTRING doesn't just perform a
single level of expansion, it performs the normal full expansion of the
macro, and so if the path itself happens to tokenise to something that
includes a defined macro in it that will itself be substituted. For
example, with #define MACRO 1, a path like /path/containing/MACRO/in/it
will expand to /path/containing/1/in/it and then, when stringified, end
up as "/path/containing/1/in/it", not the intended string. Normally,
macros have names that start or end witih underscores and are unlikely
to appear in a tokenised path (even if technically they could), but now
that we've switched to GNU C as of commit ec41a96daa ("sys: Switch the
kernel's C standard from C99 to GNU99.") there are a few new macros
defined which don't start or end with underscores: unix, which is always
defined to 1, and i386, which is defined to 1 on i386. The former
probably doesn't appear in user paths in practice, but the latter has
been seen to and is likely quite common in the wild.

Fix this by defining the macro pre-quoted instead of using __XSTRING.
Note that technically we don't need to do this for vdso_wrap.S today as
all the paths passed to it are safe file names with no user-controlled
prefix but we should do it anyway for consistency and robustness against
future changes.

This allows make tinderbox to pass when built with source and object
directories inside ~/path-with-unix, which would otherwise expand to
~/path-with-1 and break.

PR:	272744
Fixes:	ec41a96daa ("sys: Switch the kernel's C standard from C99 to GNU99.")
2023-07-28 05:08:43 +01:00
..
config.mk config.mk: All options in DEFAULTS are now defined in opt_global.h 2022-10-24 12:13:04 -06:00
dtb.build.mk dtb: Be much less verbose in the building of dtb 2022-10-29 10:13:54 -06:00
dtb.mk
files base: Remove support for the VTOC8 partitioning scheme 2023-07-26 13:16:12 +02:00
files.amd64 superio+ncthwm: Add hardware monitoring support 2023-07-01 11:19:53 -06:00
files.arm zfs: merge openzfs/zfs@431083f75 2023-04-03 16:49:30 +02:00
files.arm64 arm64: Enable the Hyper-V keyboard driver 2023-06-21 13:17:40 +01:00
files.i386 Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
files.powerpc Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
files.riscv Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
files.x86 ipmi: add Block Transfer interface support 2023-06-07 12:30:47 +03:00
kern.mk sys: Switch the kernel's C standard from C99 to GNU99. 2023-07-01 12:21:13 -07:00
kern.opts.mk kern.opts.mk: rationalize i386 EFI default with src.opts.mk 2023-05-12 11:04:00 -04:00
kern.post.mk Pre-quote macros passed to .incbin to avoid unwanted substitution 2023-07-28 05:08:43 +01:00
kern.pre.mk Pre-quote macros passed to .incbin to avoid unwanted substitution 2023-07-28 05:08:43 +01:00
kmod.mk Pre-quote macros passed to .incbin to avoid unwanted substitution 2023-07-28 05:08:43 +01:00
kmod.opts.mk Add a kmod.opts.mk. 2019-11-21 18:14:26 +00:00
kmod_syms.awk kmod_syms.awk: fix removal of the export list from the symbol table 2021-11-18 15:56:24 +02:00
kmod_syms_prefix.awk
ldscript.amd64 amd64: do not assume that kernel is loaded at 2M physical 2021-07-31 16:53:42 +03:00
ldscript.arm Eliminate the generated ldscript for arm and arm64, and strip $a/$d marker 2019-12-29 18:17:12 +00:00
ldscript.arm64 arm64: add read_frequently, read_mostluy and exclusive_cache_line to linker script 2021-08-23 15:22:17 +02:00
ldscript.i386
ldscript.kmod.amd64 Move PLTs to the beginning of amd64 kernel modules. 2020-09-16 13:51:47 +00:00
ldscript.kmod.i386
ldscript.powerpc [PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities. 2020-05-07 19:32:49 +00:00
ldscript.powerpc64 [PowerPC] Fix build-id note on powerpc64 kernel 2020-06-01 19:40:59 +00:00
ldscript.powerpc64le [PowerPC64LE] Set up powerpc.powerpc64le architecture 2020-09-22 23:49:30 +00:00
ldscript.powerpcspe [PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities. 2020-05-07 19:32:49 +00:00
ldscript.riscv Set the LMA of the riscv kernel to the OpenSBI jump target by default 2020-02-04 00:06:16 +00:00
Makefile.amd64 Clarify DTR_ENABLED make variable 2023-01-12 11:03:49 -04:00
Makefile.arm ipq4018: add TCSR definitions from Linux. 2021-10-18 19:18:01 +00:00
Makefile.arm64 arm64: Use FULLKERNEL instead of .ALLSRC in .bin target 2023-04-18 11:41:57 -04:00
Makefile.i386
Makefile.powerpc Stop adding -Wredundant-decls to CWARNFLAGS. 2022-02-07 12:47:51 -08:00
Makefile.riscv riscv: always include frame pointer 2023-01-12 11:04:24 -04:00
newvers.sh kern.post.mk allow NEWVERS_{ENV,ARGS} 2023-07-17 12:03:35 -07:00
NOTES base: Remove support for the VTOC8 partitioning scheme 2023-07-26 13:16:12 +02:00
options base: Remove support for the VTOC8 partitioning scheme 2023-07-26 13:16:12 +02:00
options.amd64 x86: Add MPTABLE_LINUX_BUG_COMPAT option 2022-10-17 23:02:22 -07:00
options.arm arm: Remove useless armv6/armv7 options 2022-10-20 10:48:31 -06:00
options.arm64 arm64: emulate swp/swpb instructions 2023-05-15 10:42:10 -05:00
options.i386 x86: Add MPTABLE_LINUX_BUG_COMPAT option 2022-10-17 23:02:22 -07:00
options.powerpc powerpc/pseries: Allow radix pmap in pseries for ISA 3.0 2021-08-11 19:07:04 -05:00
options.riscv riscv: retire the FPE kernel option 2023-05-02 15:01:31 -03:00
std.nodebug Exclude DEBUG_VFS_LOCKS from non-debug kernel configs 2022-02-02 19:27:32 +02:00
sysent.mk sysent: regenerate files every time 2021-12-16 20:56:28 -06:00
systags.sh Fix kernel-tags target. 2020-01-23 13:56:12 +00:00
vdso_amd64.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vdso_amd64_ia32.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE retire cp(4) driver 2022-12-13 15:24:52 -05:00