ocfs2_dlm: Add timeout to dlm join domain
[linux-drm-fsl-dcu.git] / fs / binfmt_elf_fdpic.c
index 9f0b7efc3df55f78765455ff60b756aba1297de6..a4d933a51208c5bcbfdd182b2412c3b1d369c140 100644 (file)
@@ -234,6 +234,14 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm,
                                goto error;
                        }
 
+                       /*
+                        * If the binary is not readable then enforce
+                        * mm->dumpable = 0 regardless of the interpreter's
+                        * permissions.
+                        */
+                       if (file_permission(interpreter, MAY_READ) < 0)
+                               bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP;
+
                        retval = kernel_read(interpreter, 0, bprm->buf,
                                             BINPRM_BUF_SIZE);
                        if (retval < 0)
@@ -706,12 +714,11 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
                return -ELIBBAD;
 
        size = sizeof(*loadmap) + nloads * sizeof(*seg);
-       loadmap = kmalloc(size, GFP_KERNEL);
+       loadmap = kzalloc(size, GFP_KERNEL);
        if (!loadmap)
                return -ENOMEM;
 
        params->loadmap = loadmap;
-       memset(loadmap, 0, size);
 
        loadmap->version = ELF32_FDPIC_LOADMAP_VERSION;
        loadmap->nsegs = nloads;
@@ -1322,7 +1329,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
        prstatus->pr_pid = p->pid;
        prstatus->pr_ppid = p->parent->pid;
        prstatus->pr_pgrp = process_group(p);
-       prstatus->pr_sid = p->signal->session;
+       prstatus->pr_sid = process_session(p);
        if (thread_group_leader(p)) {
                /*
                 * This is the record for the group leader.  Add in the
@@ -1371,7 +1378,7 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
        psinfo->pr_pid = p->pid;
        psinfo->pr_ppid = p->parent->pid;
        psinfo->pr_pgrp = process_group(p);
-       psinfo->pr_sid = p->signal->session;
+       psinfo->pr_sid = process_session(p);
 
        i = p->state ? ffz(~p->state) + 1 : 0;
        psinfo->pr_state = i;