lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Sep 2016 21:45:19 -0400
From:   Theodore Ts'o <tytso@....edu>
To:     gmail <yngsion@...il.com>
Cc:     linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        jack@...e.cz
Subject: Re: [PATCH] ext4: release bh in make_indexed_dir

On Fri, Sep 30, 2016 at 01:36:30AM +0800, gmail wrote:
> The commit 6050d47adcad
> ("ext4: bail out from make_indexed_dir() on first error")
> miss to release bh in make_indexed_dir.
> 
> Signed-off-by: yangsheng <yngsion@...il.com>

There's no missing brelse() as far as I can see.  bh is assigned to
frame->bh, and the call to dx_release(frames) will release bh.

	       	   	   		      	   - Ted

> ---
>  fs/ext4/namei.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index 38ca0fe..465f960 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -2058,19 +2058,18 @@ static int make_indexed_dir(handle_t *handle, struct ext4_filename *fname,
>  		retval = PTR_ERR(de);
>  		goto out_frames;
>  	}
> -	dx_release(frames);
>  
>  	retval = add_dirent_to_buf(handle, fname, dir, inode, de, bh);
> -	brelse(bh);
> -	return retval;
>  out_frames:
>  	/*
>  	 * Even if the block split failed, we have to properly write
>  	 * out all the changes we did so far. Otherwise we can end up
>  	 * with corrupted filesystem.
>  	 */
> -	ext4_mark_inode_dirty(handle, dir);
> +	if (retval)
> +		ext4_mark_inode_dirty(handle, dir);
>  	dx_release(frames);
> +	brelse(bh);
>  	return retval;
>  }
>  
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ