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] [day] [month] [year] [list]
Date:   Tue, 27 Nov 2018 10:19:43 +0100
From:   Jan Kara <jack@...e.cz>
To:     Pan Bian <bianpan2016@....com>
Cc:     Jan Kara <jack@...e.com>, linux-ext4@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext2: fix potential use after free

On Sun 25-11-18 08:58:02, Pan Bian wrote:
> The function ext2_xattr_set calls brelse(bh) to drop the reference count
> of bh. After that, bh may be freed. However, following brelse(bh),
> it reads bh->b_data via macro HDR(bh). This may result in a
> use-after-free bug. This patch moves brelse(bh) after reading field.
> 
> Signed-off-by: Pan Bian <bianpan2016@....com>

Thanks for the fix! I've added the patch to my tree.

								Honza

> ---
>  fs/ext2/xattr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
> index 62d9a659a..dd8f10d 100644
> --- a/fs/ext2/xattr.c
> +++ b/fs/ext2/xattr.c
> @@ -612,9 +612,9 @@ bad_block:		ext2_error(sb, "ext2_xattr_set",
>  	}
>  
>  cleanup:
> -	brelse(bh);
>  	if (!(bh && header == HDR(bh)))
>  		kfree(header);
> +	brelse(bh);
>  	up_write(&EXT2_I(inode)->xattr_sem);
>  
>  	return error;
> -- 
> 2.7.4
> 
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ