kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Namjae Jeon" <namjae.jeon@samsung.com>
To: 'Dan Carpenter' <dan.carpenter@oracle.com>
Cc: 'Sungjong Seo' <sj1557.seo@samsung.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	'Tetsuhiro Kohada' <kohada.t2@gmail.com>
Subject: RE: [PATCH] exfat: Fix pontential use after free in exfat_load_upcase_table()
Date: Tue, 09 Jun 2020 00:37:48 +0000	[thread overview]
Message-ID: <00a401d63df6$3370adc0$9a520940$@samsung.com> (raw)
In-Reply-To: <20200608141629.GA1912173@mwanda>

> This code calls brelse(bh) and then dereferences "bh" on the next line resulting in a possible use
> after free.  The brelse() should just be moved down a line.
> 
> Fixes: b676fdbcf4c8 ("exfat: standardize checksum calculation")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied. Thanks!
> ---
>  fs/exfat/nls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c index c1ec056954974..57b5a7a4d1f7a 100644
> --- a/fs/exfat/nls.c
> +++ b/fs/exfat/nls.c
> @@ -692,8 +692,8 @@ static int exfat_load_upcase_table(struct super_block *sb,
>  				index++;
>  			}
>  		}
> -		brelse(bh);
>  		chksum = exfat_calc_chksum32(bh->b_data, i, chksum, CS_DEFAULT);
> +		brelse(bh);
>  	}
> 
>  	if (index >= 0xFFFF && utbl_checksum = chksum)
> --
> 2.26.2

      reply	other threads:[~2020-06-09  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200608141649epcas1p14558f3552afb0fcd3cd32a8c09afb880@epcas1p1.samsung.com>
2020-06-08 14:16 ` [PATCH] exfat: Fix pontential use after free in exfat_load_upcase_table() Dan Carpenter
2020-06-09  0:37   ` Namjae Jeon [this message]

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='00a401d63df6$3370adc0$9a520940$@samsung.com' \
    --to=namjae.jeon@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kohada.t2@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    /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;
as well as URLs for NNTP newsgroup(s).