public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches•com>
To: Kees Cook <keescook@chromium•org>, linux-kernel@vger•kernel.org
Cc: Amitkumar Karwar <akarwar@marvell•com>,
	Nishant Sarmukadam <nishants@marvell•com>,
	Kalle Valo <kvalo@codeaurora•org>,
	Steve French <sfrench@samba•org>,
	linux-wireless@vger•kernel.org, netdev@vger•kernel.org,
	linux-cifs@vger•kernel.org, samba-technical@lists•samba.org
Subject: Re: [PATCH] lib: fix callers of strtobool to use char array
Date: Wed, 27 Jan 2016 16:58:28 -0800	[thread overview]
Message-ID: <1453942708.10099.41.camel@perches.com> (raw)
In-Reply-To: <20160128004542.GA15247@www.outflux.net>

On Wed, 2016-01-27 at 16:45 -0800, Kees Cook wrote:
> Some callers of strtobool were passing a pointer to unterminated strings.
> This fixes the issue and consolidates some logic in cifs.

This may be incomplete as it duplicates the behavior for
the old number of characters, but this is not a solution
for the entry of a bool that is "on" or "off".

> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
[]
> @@ -290,7 +305,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
>  			}
>  		}
>  		spin_unlock(&cifs_tcp_ses_lock);
> -	}
> +	} else
> +		return rc;

Likely better to reverse the test and unindent the
preceding block.

Otherwise, please make sure to use the general brace
form of when one branch needs braces, the other branch
should have them too.

  reply	other threads:[~2016-01-28  0:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  0:45 [PATCH] lib: fix callers of strtobool to use char array Kees Cook
2016-01-28  0:58 ` Joe Perches [this message]
2016-01-28  1:03   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453942708.10099.41.camel@perches.com \
    --to=joe@perches$(echo .)com \
    --cc=akarwar@marvell$(echo .)com \
    --cc=keescook@chromium$(echo .)org \
    --cc=kvalo@codeaurora$(echo .)org \
    --cc=linux-cifs@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-wireless@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nishants@marvell$(echo .)com \
    --cc=samba-technical@lists$(echo .)samba.org \
    --cc=sfrench@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox