aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_misc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:38 -0400
commit54e514b91b95d6441c12a7955addfb9f9d2afc65 (patch)
tree8b73d901bd2a6ec5a31f34a8954e5ea92216dd6c /fs/binfmt_misc.c
parent4fc8adcfec3da639da76e8314c9ccefe5bf9a045 (diff)
parent6c8c90319c0bb1c9e0b68e721359b89ae4f28465 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge third patchbomb from Andrew Morton: - various misc things - a couple of lib/ optimisations - provide DIV_ROUND_CLOSEST_ULL() - checkpatch updates - rtc tree - befs, nilfs2, hfs, hfsplus, fatfs, adfs, affs, bfs - ptrace fixes - fork() fixes - seccomp cleanups - more mmap_sem hold time reductions from Davidlohr * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (138 commits) proc: show locks in /proc/pid/fdinfo/X docs: add missing and new /proc/PID/status file entries, fix typos drivers/rtc/rtc-at91rm9200.c: make IO endian agnostic Documentation/spi/spidev_test.c: fix warning drivers/rtc/rtc-s5m.c: allow usage on device type different than main MFD type .gitignore: ignore *.tar MAINTAINERS: add Mediatek SoC mailing list tomoyo: reduce mmap_sem hold for mm->exe_file powerpc/oprofile: reduce mmap_sem hold for exe_file oprofile: reduce mmap_sem hold for mm->exe_file mips: ip32: add platform data hooks to use DS1685 driver lib/Kconfig: fix up HAVE_ARCH_BITREVERSE help text x86: switch to using asm-generic for seccomp.h sparc: switch to using asm-generic for seccomp.h powerpc: switch to using asm-generic for seccomp.h parisc: switch to using asm-generic for seccomp.h mips: switch to using asm-generic for seccomp.h microblaze: use asm-generic for seccomp.h arm: use asm-generic for seccomp.h seccomp: allow COMPAT sigreturn overrides ...
Diffstat (limited to 'fs/binfmt_misc.c')
-rw-r--r--fs/binfmt_misc.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 97aff2879cda..9dcb05409ba7 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -9,6 +9,7 @@
9 9
10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11 11
12#include <linux/kernel.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/init.h> 14#include <linux/init.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
@@ -521,9 +522,8 @@ static int parse_command(const char __user *buffer, size_t count)
521 522
522static void entry_status(Node *e, char *page) 523static void entry_status(Node *e, char *page)
523{ 524{
524 char *dp; 525 char *dp = page;
525 char *status = "disabled"; 526 const char *status = "disabled";
526 const char *flags = "flags: ";
527 527
528 if (test_bit(Enabled, &e->flags)) 528 if (test_bit(Enabled, &e->flags))
529 status = "enabled"; 529 status = "enabled";
@@ -533,12 +533,10 @@ static void entry_status(Node *e, char *page)
533 return; 533 return;
534 } 534 }
535 535
536 sprintf(page, "%s\ninterpreter %s\n", status, e->interpreter); 536 dp += sprintf(dp, "%s\ninterpreter %s\n", status, e->interpreter);
537 dp = page + strlen(page);
538 537
539 /* print the special flags */ 538 /* print the special flags */
540 sprintf(dp, "%s", flags); 539 dp += sprintf(dp, "flags: ");
541 dp += strlen(flags);
542 if (e->flags & MISC_FMT_PRESERVE_ARGV0) 540 if (e->flags & MISC_FMT_PRESERVE_ARGV0)
543 *dp++ = 'P'; 541 *dp++ = 'P';
544 if (e->flags & MISC_FMT_OPEN_BINARY) 542 if (e->flags & MISC_FMT_OPEN_BINARY)
@@ -550,21 +548,11 @@ static void entry_status(Node *e, char *page)
550 if (!test_bit(Magic, &e->flags)) { 548 if (!test_bit(Magic, &e->flags)) {
551 sprintf(dp, "extension .%s\n", e->magic); 549 sprintf(dp, "extension .%s\n", e->magic);
552 } else { 550 } else {
553 int i; 551 dp += sprintf(dp, "offset %i\nmagic ", e->offset);
554 552 dp = bin2hex(dp, e->magic, e->size);
555 sprintf(dp, "offset %i\nmagic ", e->offset);
556 dp = page + strlen(page);
557 for (i = 0; i < e->size; i++) {
558 sprintf(dp, "%02x", 0xff & (int) (e->magic[i]));
559 dp += 2;
560 }
561 if (e->mask) { 553 if (e->mask) {
562 sprintf(dp, "\nmask "); 554 dp += sprintf(dp, "\nmask ");
563 dp += 6; 555 dp = bin2hex(dp, e->mask, e->size);
564 for (i = 0; i < e->size; i++) {
565 sprintf(dp, "%02x", 0xff & (int) (e->mask[i]));
566 dp += 2;
567 }
568 } 556 }
569 *dp++ = '\n'; 557 *dp++ = '\n';
570 *dp = '\0'; 558 *dp = '\0';