Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kmod: make usermodehelper path a const string

This is in preparation for making it so that usermode helper programs
can't be changed, if desired, by userspace. We will tackle the mess of
cleaning up the write-ability of argv and env later, that's going to
take more work, for much less gain...

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+6 -5
+4 -3
include/linux/kmod.h
··· 56 56 struct subprocess_info { 57 57 struct work_struct work; 58 58 struct completion *complete; 59 - char *path; 59 + const char *path; 60 60 char **argv; 61 61 char **envp; 62 62 int wait; ··· 67 67 }; 68 68 69 69 extern int 70 - call_usermodehelper(char *path, char **argv, char **envp, int wait); 70 + call_usermodehelper(const char *path, char **argv, char **envp, int wait); 71 71 72 72 extern struct subprocess_info * 73 - call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask, 73 + call_usermodehelper_setup(const char *path, char **argv, char **envp, 74 + gfp_t gfp_mask, 74 75 int (*init)(struct subprocess_info *info, struct cred *new), 75 76 void (*cleanup)(struct subprocess_info *), void *data); 76 77
+2 -2
kernel/kmod.c
··· 516 516 * Function must be runnable in either a process context or the 517 517 * context in which call_usermodehelper_exec is called. 518 518 */ 519 - struct subprocess_info *call_usermodehelper_setup(char *path, char **argv, 519 + struct subprocess_info *call_usermodehelper_setup(const char *path, char **argv, 520 520 char **envp, gfp_t gfp_mask, 521 521 int (*init)(struct subprocess_info *info, struct cred *new), 522 522 void (*cleanup)(struct subprocess_info *info), ··· 613 613 * This function is the equivalent to use call_usermodehelper_setup() and 614 614 * call_usermodehelper_exec(). 615 615 */ 616 - int call_usermodehelper(char *path, char **argv, char **envp, int wait) 616 + int call_usermodehelper(const char *path, char **argv, char **envp, int wait) 617 617 { 618 618 struct subprocess_info *info; 619 619 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;