Re: [PATCH] ext2: fix potential use after free

2018-11-27 Thread Jan Kara
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) a

[PATCH] ext2: fix potential use after free

2018-11-24 Thread Pan Bian
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 ---