Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560075

Re: [PATCH 2/3] Make static usermode helper binaries constant

From "J. Bruce Fields" <bfields@fieldses.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] Make static usermode helper binaries constant
Date 2017-01-16 22:30 +0100
Message-ID <t0n0K-6iP-35@gated-at.bofh.it> (permalink)
References <t0iDL-30L-3@gated-at.bofh.it> <t0iNr-34Q-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 16, 2017 at 05:50:31PM +0100, Greg KH wrote:
> From: Greg Kroah-Hartman <gregkh@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.
> 
...
> --- a/drivers/pnp/pnpbios/core.c
> +++ b/drivers/pnp/pnpbios/core.c
> @@ -98,6 +98,7 @@ static struct completion unload_sem;
>   */
>  static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
>  {
> +	static char const sbin_pnpbios[] = "/sbin/pnpbios";
>  	char *argv[3], **envp, *buf, *scratch;
>  	int i = 0, value;
>  
> @@ -112,7 +113,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
>  	 * integrated into the driver core and use the usual infrastructure
>  	 * like sysfs and uevents
>  	 */
> -	argv[0] = "/sbin/pnpbios";
> +	argv[0] = (char *)sbin_pnpbios;

So here and elsewhere, can attackers write to argv[0] instead of to the
memory where the string lives?

Apologies if I'm rehashing earlier discussion, I did a quick search of
archives but could easily have missed something.

--b.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] make call_usermodehelper a bit more "safe" Greg KH <gregkh@linuxfoundation.org> - 2017-01-16 17:50 +0100
  [PATCH 2/3] Make static usermode helper binaries constant Greg KH <gregkh@linuxfoundation.org> - 2017-01-16 18:00 +0100
    Re: [PATCH 2/3] Make static usermode helper binaries constant "J. Bruce Fields" <bfields@fieldses.org> - 2017-01-16 22:30 +0100
      Re: [PATCH 2/3] Make static usermode helper binaries constant Greg KH <gregkh@linuxfoundation.org> - 2017-01-17 08:20 +0100
        Re: [PATCH 2/3] Make static usermode helper binaries constant "J. Bruce Fields" <bfields@fieldses.org> - 2017-01-17 16:20 +0100
          Re: [PATCH 2/3] Make static usermode helper binaries constant Greg KH <gregkh@linuxfoundation.org> - 2017-01-17 16:30 +0100
            Re: [kernel-hardening] Re: [PATCH 2/3] Make static usermode helper  binaries constant Greg KH <gregkh@linuxfoundation.org> - 2017-01-19 13:10 +0100
              Re: [kernel-hardening] Re: [PATCH 2/3] Make static usermode helper  binaries constant "J. Bruce Fields" <bfields@fieldses.org> - 2017-01-19 17:30 +0100
    Re: [PATCH 2/3] Make static usermode helper binaries constant Jeff Layton <jlayton@poochiereds.net> - 2017-01-17 16:50 +0100
      Re: [PATCH 2/3] Make static usermode helper binaries constant Greg KH <gregkh@linuxfoundation.org> - 2017-01-17 17:00 +0100
        Re: [PATCH 2/3] Make static usermode helper binaries constant Jeff Layton <jlayton@poochiereds.net> - 2017-01-17 17:10 +0100
          Re: [PATCH 2/3] Make static usermode helper binaries constant Greg KH <gregkh@linuxfoundation.org> - 2017-01-17 17:20 +0100
  [PATCH 1/3] kmod: make usermodehelper path a const string Greg KH <gregkh@linuxfoundation.org> - 2017-01-16 18:00 +0100
  Re: [PATCH 0/4] make call_usermodehelper a bit more "safe" Greg KH <gregkh@linuxfoundation.org> - 2017-01-16 18:00 +0100
  [PATCH 3/3] Introduce STATIC_USERMODEHELPER to mediate  call_usermodehelper() Greg KH <gregkh@linuxfoundation.org> - 2017-01-16 18:00 +0100
    Re: [PATCH 3/3] Introduce STATIC_USERMODEHELPER to mediate  call_usermodehelper() Jeff Layton <jlayton@poochiereds.net> - 2017-01-17 17:30 +0100
      Re: [PATCH 3/3] Introduce STATIC_USERMODEHELPER to mediate  call_usermodehelper() Greg KH <gregkh@linuxfoundation.org> - 2017-01-17 17:40 +0100
        Re: [PATCH 3/3] Introduce STATIC_USERMODEHELPER to mediate  call_usermodehelper() Jeff Layton <jlayton@poochiereds.net> - 2017-01-17 18:00 +0100
  Re: [PATCH 0/4] make call_usermodehelper a bit more "safe" Kees Cook <keescook@chromium.org> - 2017-01-17 18:30 +0100

csiph-web