netfilter: nf_conntrack: fix hash resizing with namespaces
[safe/jmp/linux-2.6] / include / linux / binfmts.h
index 7394b5b..cd4349b 100644 (file)
@@ -18,6 +18,7 @@ struct pt_regs;
 #define BINPRM_BUF_SIZE 128
 
 #ifdef __KERNEL__
+#include <linux/list.h>
 
 #define CORENAME_MAX_SIZE 128
 
@@ -34,17 +35,20 @@ struct linux_binprm{
 #endif
        struct mm_struct *mm;
        unsigned long p; /* current top of mem */
-       unsigned int sh_bang:1,
-                    misc_bang:1;
+       unsigned int
+               cred_prepared:1,/* true if creds already prepared (multiple
+                                * preps happen for interpreters) */
+               cap_effective:1;/* true if has elevated effective capabilities,
+                                * false if not; except for init which inherits
+                                * its parent's caps anyway */
 #ifdef __alpha__
        unsigned int taso:1;
 #endif
        unsigned int recursion_depth;
        struct file * file;
-       int e_uid, e_gid;
-       kernel_cap_t cap_post_exec_permitted;
-       bool cap_effective;
-       void *security;
+       struct cred *cred;      /* new credentials */
+       int unsafe;             /* how unsafe this exec is (mask of LSM_UNSAFE_*) */
+       unsigned int per_clear; /* bits to clear in current->personality */
        int argc, envc;
        char * filename;        /* Name of binary as seen by procps */
        char * interp;          /* Name of the binary really executed. Most
@@ -64,6 +68,14 @@ struct linux_binprm{
 
 #define BINPRM_MAX_RECURSION 4
 
+/* Function parameter for binfmt->coredump */
+struct coredump_params {
+       long signr;
+       struct pt_regs *regs;
+       struct file *file;
+       unsigned long limit;
+};
+
 /*
  * This structure defines the functions that are used to load the binary formats that
  * linux accepts.
@@ -73,12 +85,24 @@ struct linux_binfmt {
        struct module *module;
        int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
        int (*load_shlib)(struct file *);
-       int (*core_dump)(long signr, struct pt_regs *regs, struct file *file, unsigned long limit);
+       int (*core_dump)(struct coredump_params *cprm);
        unsigned long min_coredump;     /* minimal dump size */
        int hasvdso;
 };
 
-extern int register_binfmt(struct linux_binfmt *);
+extern int __register_binfmt(struct linux_binfmt *fmt, int insert);
+
+/* Registration of default binfmt handlers */
+static inline int register_binfmt(struct linux_binfmt *fmt)
+{
+       return __register_binfmt(fmt, 0);
+}
+/* Same as above, but adds a new binfmt at the top of the list */
+static inline int insert_binfmt(struct linux_binfmt *fmt)
+{
+       return __register_binfmt(fmt, 1);
+}
+
 extern void unregister_binfmt(struct linux_binfmt *);
 
 extern int prepare_binprm(struct linux_binprm *);
@@ -101,9 +125,10 @@ extern int setup_arg_pages(struct linux_binprm * bprm,
                           int executable_stack);
 extern int bprm_mm_init(struct linux_binprm *bprm);
 extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
-extern void compute_creds(struct linux_binprm *binprm);
-extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
-extern int set_binfmt(struct linux_binfmt *new);
+extern int prepare_bprm_creds(struct linux_binprm *bprm);
+extern void install_exec_creds(struct linux_binprm *bprm);
+extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
+extern void set_binfmt(struct linux_binfmt *new);
 extern void free_bprm(struct linux_binprm *);
 
 #endif /* __KERNEL__ */