On Tue, Jan 17, 2017 at 10:45:45AM -0500, Jeff Layton wrote:
> On Mon, 2017-01-16 at 17:50 +0100, Greg KH wrote:
> > From: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> > 
> > There are a number of usermode helper binaries that are "hard coded" in
> > the kernel today, so mark them as "const" to make it harder for someone
> > to change where the variables point to.
> > 
> > Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
> > Cc: Thomas Sailer <t.sai...@alumni.ethz.ch>
> > Cc: "Rafael J. Wysocki" <rafael.j.wyso...@intel.com>
> > Cc: Johan Hovold <jo...@kernel.org>
> > Cc: Alex Elder <el...@kernel.org>
> > Cc: "J. Bruce Fields" <bfie...@fieldses.org>
> > Cc: Jeff Layton <jlay...@poochiereds.net>
> > Cc: David Howells <dhowe...@redhat.com>
> > Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>



> > --- a/fs/nfsd/nfs4layouts.c
> > +++ b/fs/nfsd/nfs4layouts.c
> > @@ -613,6 +613,7 @@ nfsd4_cb_layout_fail(struct nfs4_layout_stateid *ls)
> >  {
> >     struct nfs4_client *clp = ls->ls_stid.sc_client;
> >     char addr_str[INET6_ADDRSTRLEN];
> > +   static char const nfsd_recall_failed[] = "/sbin/nfsd-recall-failed";
> >     static char *envp[] = {
> >             "HOME=/",
> >             "TERM=linux",
> > @@ -628,12 +629,13 @@ nfsd4_cb_layout_fail(struct nfs4_layout_stateid *ls)
> >             "nfsd: client %s failed to respond to layout recall. "
> >             "  Fencing..\n", addr_str);
> >  
> > -   argv[0] = "/sbin/nfsd-recall-failed";
> > +   argv[0] = (char *)nfsd_recall_failed;
> >     argv[1] = addr_str;
> >     argv[2] = ls->ls_file->f_path.mnt->mnt_sb->s_id;
> >     argv[3] = NULL;
> >  
> > -   error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
> > +   error = call_usermodehelper(nfsd_recall_failed, argv, envp,
> > +                               UMH_WAIT_PROC);
> >     if (error) {
> >             printk(KERN_ERR "nfsd: fence failed for client %s: %d!\n",
> >                     addr_str, error);
> 
> Do we need a similar fix in nfsd4_umh_cltrack_upcall?

Not that I can tell, as the call_usermodehelper() binary it calls is
dynamically created (it's not a static string).  Unless I'm misreading
the code?

thanks,

greg k-h

Reply via email to