]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
rtld: Remove DL_ARGV_NOT_RELRO
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 3 May 2022 16:01:44 +0000 (17:01 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 3 May 2022 16:24:31 +0000 (17:24 +0100)
This is no longer needed because _dl_skip_args is always 0, so the
target specific code that modifies argv after relro protection is
applied is no longer used.

After the patch relro protection is applied to _dl_argv consistently
on all targets.
---
v4:
- New patch.

12 files changed:
elf/rtld.c
sysdeps/aarch64/dl-sysdep.h
sysdeps/alpha/dl-sysdep.h [deleted file]
sysdeps/arc/dl-sysdep.h
sysdeps/arm/dl-sysdep.h
sysdeps/csky/dl-sysdep.h [deleted file]
sysdeps/generic/ldsodefs.h
sysdeps/ia64/dl-sysdep.h [deleted file]
sysdeps/nios2/dl-sysdep.h
sysdeps/s390/s390-32/dl-sysdep.h [deleted file]
sysdeps/sparc/dl-sysdep.h [deleted file]
sysdeps/unix/sysv/linux/ia64/dl-sysdep.h

index d959dab0d016a068ab4461c31d079a1e1d705f09..afff1b87fa95c2f0f03df695265de3ed2aff8eaf 100644 (file)
@@ -157,16 +157,9 @@ static void dl_main_state_init (struct dl_main_state *state);
 extern char **_environ attribute_hidden;
 static void process_envvars (struct dl_main_state *state);
 
-#ifdef DL_ARGV_NOT_RELRO
-int _dl_argc attribute_hidden;
-char **_dl_argv = NULL;
-/* Nonzero if we were run directly.  */
-unsigned int _dl_skip_args attribute_hidden;
-#else
 int _dl_argc attribute_relro attribute_hidden;
 char **_dl_argv attribute_relro = NULL;
 unsigned int _dl_skip_args attribute_relro attribute_hidden;
-#endif
 rtld_hidden_data_def (_dl_argv)
 
 #ifndef THREAD_SET_STACK_GUARD
index 667786671c36fa41acde3f8c0593a2ca2eeb44c0..1516dd7d3fd340c76395fbd4ef43f34c013208f1 100644 (file)
@@ -18,8 +18,4 @@
 
 #include_next <dl-sysdep.h>
 
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
-
 #define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/alpha/dl-sysdep.h b/sysdeps/alpha/dl-sysdep.h
deleted file mode 100644 (file)
index 3099ee4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code.  Alpha version.
-   Copyright (C) 2002-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
index da060ceeeebc98ac99b5788f028f10cf1cdc95b4..cf4d160a73fcaee7f432cfa1844b7028f8a1e257 100644 (file)
@@ -18,8 +18,4 @@
 
 #include_next <dl-sysdep.h>
 
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
-
 #define DL_EXTERN_PROTECTED_DATA
index ce7a84a7de19f2b9868faa4c2136a1f86ea8f894..7a991074368457be27336be985f4e3ce1b2b99bf 100644 (file)
@@ -18,8 +18,4 @@
 
 #include_next <dl-sysdep.h>
 
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
-
 #define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/csky/dl-sysdep.h b/sysdeps/csky/dl-sysdep.h
deleted file mode 100644 (file)
index fc8a58b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code.  C-SKY version.
-   Copyright (C) 2018-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
index 31de149f23dd171f0451eba916aab42af69f7e12..e3c4d09bc68eba0fb1d4a6662f29fdbe1d69c9d0 100644 (file)
@@ -762,18 +762,10 @@ rtld_hidden_proto (__libc_stack_end)
 
 /* Parameters passed to the dynamic linker.  */
 extern int _dl_argc attribute_hidden attribute_relro;
-extern char **_dl_argv
-#ifndef DL_ARGV_NOT_RELRO
-     attribute_relro
-#endif
-     ;
+extern char **_dl_argv attribute_relro;
 rtld_hidden_proto (_dl_argv)
 #if IS_IN (rtld)
-extern unsigned int _dl_skip_args attribute_hidden
-# ifndef DL_ARGV_NOT_RELRO
-     attribute_relro
-# endif
-     ;
+extern unsigned int _dl_skip_args attribute_hidden attribute_relro;
 #endif
 #define rtld_progname _dl_argv[0]
 
diff --git a/sysdeps/ia64/dl-sysdep.h b/sysdeps/ia64/dl-sysdep.h
deleted file mode 100644 (file)
index e3a58be..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code.  IA-64 version.
-   Copyright (C) 2002-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
index 03546500426df625c8954b58c145e95c042bd5b2..257b37c258e2aba7ad39b2fd8636c9a30532cd6c 100644 (file)
@@ -18,8 +18,4 @@
 
 #include_next <dl-sysdep.h>
 
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
-
 #define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/s390/s390-32/dl-sysdep.h b/sysdeps/s390/s390-32/dl-sysdep.h
deleted file mode 100644 (file)
index 699b50f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code.  S/390 version.
-   Copyright (C) 2014-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/sparc/dl-sysdep.h b/sysdeps/sparc/dl-sysdep.h
deleted file mode 100644 (file)
index f32f16a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code.  SPARC version.
-   Copyright (C) 2002-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
index 0d2a1d093a45cde6c99799b10f38222a0c5f3613..aa1de6b3616ca2ba74ff2b997a535f9765d5fbc5 100644 (file)
@@ -48,8 +48,4 @@ extern int _dl_sysinfo_break attribute_hidden;
        ".previous");
 #endif
 
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
-   might write into it after _dl_start returns.  */
-#define DL_ARGV_NOT_RELRO 1
-
 #endif /* dl-sysdep.h */