Skip to contentSkip to conversation

fs-kernel-permit-disabling-the-uselib-syscall.patch removed from -mm tree

merged [email protected] 1 participant 1 message Apr 4, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Subject: [merged] fs-kernel-permit-disabling-the-uselib-syscall.patch removed from -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Fri, 04 Apr 2014 12:32:24 -0700

The patch titled
Subject: fs, kernel: permit disabling the uselib syscall
has been removed from the -mm tree. Its filename was
fs-kernel-permit-disabling-the-uselib-syscall.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Josh Triplett <[email protected]>
Subject: fs, kernel: permit disabling the uselib syscall

uselib hasn't been used since libc5; glibc does not use it. Support turning it off.

When disabled, also omit the load_elf_library implementation from binfmt_elf.c, which only uselib invokes.

bloat-o-meter:
add/remove: 0/4 grow/shrink: 0/1 up/down: 0/-785 (-785)
function old new delta
padzero 39 36 -3

uselib_flags                                  20       -     -20
sys_uselib                                   168       -    -168
SyS_uselib                                   168       -    -168
load_elf_library                             426       -    -426

The new CONFIG_USELIB defaults to `y'.

---

 fs/binfmt_elf.c |    9 ++++++++-
 fs/exec.c       |    2 ++
 init/Kconfig    |   10 ++++++++++
 kernel/sys_ni.c |    1 +
 4 files changed, 21 insertions(+), 1 deletion(-)
fs/binfmt_elf.c renamed from fs/binfmt_elf.c~fs-kernel-permit-disabling-the-uselib-syscall +8 -1
diff -puN fs/binfmt_elf.c~fs-kernel-permit-disabling-the-uselib-syscall fs/binfmt_elf.c
@@ -46,10 +46,15 @@
 #endif
 
 static int load_elf_binary(struct linux_binprm *bprm);
-static int load_elf_library(struct file *);
 static unsigned long elf_map(struct file *, unsigned long, struct elf_phdr *,
 				int, int, unsigned long);
 
+#ifdef CONFIG_USELIB
+static int load_elf_library(struct file *);
+#else
+#define load_elf_library NULL
+#endif
+
 /*
  * If we don't support core dumping, then supply a NULL so we
  * don't even try.
@@ -1005,6 +1010,7 @@ out_free_ph:
 	goto out;
 }
 
+#ifdef CONFIG_USELIB
 /* This is really simpleminded and specialized - we are loading an
    a.out library that is given an ELF header. */
 static int load_elf_library(struct file *file)
@@ -1083,6 +1089,7 @@ out_free_ph:
 out:
 	return error;
 }
+#endif /* #ifdef CONFIG_USELIB */
 
 #ifdef CONFIG_ELF_CORE
 /*
fs/exec.c renamed from fs/exec.c~fs-kernel-permit-disabling-the-uselib-syscall +2 -0
diff -puN fs/exec.c~fs-kernel-permit-disabling-the-uselib-syscall fs/exec.c
@@ -97,6 +97,7 @@ static inline void put_binfmt(struct lin
 	module_put(fmt->module);
 }
 
+#ifdef CONFIG_USELIB
 /*
  * Note that a shared library must be both readable and executable due to
  * security reasons.
@@ -156,6 +157,7 @@ exit:
 out:
   	return error;
 }
+#endif /* #ifdef CONFIG_USELIB */
 
 #ifdef CONFIG_MMU
 /*
init/Kconfig renamed from init/Kconfig~fs-kernel-permit-disabling-the-uselib-syscall +10 -0
diff -puN init/Kconfig~fs-kernel-permit-disabling-the-uselib-syscall init/Kconfig
@@ -273,6 +273,16 @@ config FHANDLE
 	  get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
 	  syscalls.
 
+config USELIB
+	bool "uselib syscall"
+	default y
+	help
+	  This option enables the uselib syscall, a system call used in the
+	  dynamic linker from libc5 and earlier.  glibc does not use this
+	  system call.  If you intend to run programs built on libc5 or
+	  earlier, you may need to enable this syscall.  Current systems
+	  running glibc can safely disable this.
+
 config AUDIT
 	bool "Auditing support"
 	depends on NET
kernel/sys_ni.c renamed from kernel/sys_ni.c~fs-kernel-permit-disabling-the-uselib-syscall +1 -0
diff -puN kernel/sys_ni.c~fs-kernel-permit-disabling-the-uselib-syscall kernel/sys_ni.c
@@ -152,6 +152,7 @@ cond_syscall(sys_process_vm_readv);
 cond_syscall(sys_process_vm_writev);
 cond_syscall(compat_sys_process_vm_readv);
 cond_syscall(compat_sys_process_vm_writev);
+cond_syscall(sys_uselib);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);

_

Patches currently in -mm which might be from [email protected] are

origin.patch include-linux-crash_dumph-add-vmcore_cleanup-prototype.patch include-linux-crash_dumph-add-vmcore_cleanup-prototype-fix.patch cris-make-etrax_arch_v10-select-tty-for-use-in-debugport.patch ia64-select-config_tty-for-use-of-tty_write_message-in-unaligned.patch ppc-make-ppc_book3s_64-select-irq_work.patch kconfig-make-allnoconfig-disable-options-behind-embedded-and-expert.patch bug-when-config_bug-simplify-warn_on_once-and-family.patch include-asm-generic-bugh-style-fix-s-while0-while-0.patch bug-when-config_bug-make-warn-call-no_printk-to-check-format-and-args.patch bug-make-bug-always-stop-the-machine.patch x86-always-define-bug-and-have_arch_bug-even-with-config_bug.patch linux-next.patch
lglock-map-to-spinlock-when-config_smp.patch