Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / proc / kcore.c
index 5ab9c2a..5c08a9c 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/proc_fs.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
+#include <linux/capability.h>
 #include <linux/elf.h>
 #include <linux/elfcore.h>
 #include <linux/vmalloc.h>
 
 static int open_kcore(struct inode * inode, struct file * filp)
 {
-       return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
+       return -EPERM;
 }
 
 static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *);
 
-struct file_operations proc_kcore_operations = {
+const struct file_operations proc_kcore_operations = {
        .read           = read_kcore,
        .open           = open_kcore,
 };
@@ -84,7 +85,7 @@ static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
        }
        *elf_buflen =   sizeof(struct elfhdr) + 
                        (*nphdr + 2)*sizeof(struct elf_phdr) + 
-                       3 * sizeof(struct memelfnote) +
+                       3 * (sizeof(struct elf_note) + 4) +
                        sizeof(struct elf_prstatus) +
                        sizeof(struct elf_prpsinfo) +
                        sizeof(struct task_struct);