diff --git a/libffi-3.1-libffi_tmpdir.patch b/libffi-3.1-libffi_tmpdir.patch new file mode 100644 index 0000000..960c328 --- /dev/null +++ b/libffi-3.1-libffi_tmpdir.patch @@ -0,0 +1,17 @@ +Most temp file directories need to be hardened against execution, but +libffi needs execute privileges. Add a libffi-specific temp directory +that can be set up by sysadmins as needed with suitable permissions. +This both ensures that libffi will have a valid temp directory to use +as well as preventing attempts to access other directories. + +diff -rup a/src/closures.c b/src/closures.c +--- a/src/closures.c 2014-05-11 09:54:19.000000000 -0400 ++++ b/src/closures.c 2020-04-29 20:50:00.454853909 -0400 +@@ -362,6 +362,7 @@ static struct + const char *arg; + int repeat; + } open_temp_exec_file_opts[] = { ++ { open_temp_exec_file_env, "LIBFFI_TMPDIR", 0 }, + { open_temp_exec_file_env, "TMPDIR", 0 }, + { open_temp_exec_file_dir, "/tmp", 0 }, + { open_temp_exec_file_dir, "/var/tmp", 0 }, diff --git a/libffi.spec b/libffi.spec index a90f3ee..5f7ca03 100644 --- a/libffi.spec +++ b/libffi.spec @@ -4,7 +4,7 @@ Name: libffi Version: 3.1 -Release: 24%{?dist} +Release: 25%{?dist} Summary: A portable foreign function interface library License: MIT URL: http://sourceware.org/libffi @@ -16,6 +16,7 @@ Patch0: libffi-3.1-fix-include-path.patch Patch1: libffi-3.1-fix-exec-stack.patch Patch2: libffi-aarch64-rhbz1174037.patch Patch3: libffi-3.1-aarch64-fix-exec-stack.patch +Patch4: libffi-3.1-libffi_tmpdir.patch BuildRequires: gcc %if %{without bootstrap} @@ -67,7 +68,7 @@ developing applications that use %{name}. %patch1 -p1 -b .execstack %patch2 -p1 -b .aarch64 %patch3 -p1 -b .aarch64execstack - +%patch4 -p1 -b .libffitmpdir %build %configure --disable-static @@ -120,6 +121,9 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/libffi-%{version} %{_infodir}/libffi.info.* %changelog +* Thu Apr 30 2020 DJ Delorie - 3.1-25 +- Add $LIBFFI_TMPDIR environment variable support (#1667620) + * Wed Jan 29 2020 Fedora Release Engineering - 3.1-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild