public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ecryptfs: re-order a condition for static checkers
Date: Fri, 14 Dec 2018 11:51:13 +0000	[thread overview]
Message-ID: <20181214115113.GM10347@kadam> (raw)

Can we merge this patch?  KASAN will probably complain about this as
well, I think...

regards,
dan carpenter

On Wed, Aug 22, 2018 at 01:43:59PM +0300, Dan Carpenter wrote:
> Static checkers complain that we are using "s->i" as an offset before
> we check whether it is within bounds.  It doesn't matter much but we
> can easily swap the order of the checks to make everyone happy.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index e74fe84d0886..624ff4409c61 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -1063,8 +1063,9 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
>  		       "rc = [%d]\n", __func__, rc);
>  		goto out_free_unlock;
>  	}
> -	while (s->decrypted_filename[s->i] != '\0'
> -	       && s->i < s->block_aligned_filename_size)
> +
> +	while (s->i < s->block_aligned_filename_size &&
> +	       s->decrypted_filename[s->i] != '\0')
>  		s->i++;
>  	if (s->i = s->block_aligned_filename_size) {
>  		printk(KERN_WARNING "%s: Invalid tag 70 packet; could not "

             reply	other threads:[~2018-12-14 11:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 11:51 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-29 22:37 [PATCH] ecryptfs: re-order a condition for static checkers Tyler Hicks
2018-08-22 10:43 Dan Carpenter

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=20181214115113.GM10347@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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