Re: use after free in sysfs_find_dirent

From: Ming Lei
Date: Mon Mar 18 2013 - 23:40:46 EST


Hi Sasha,

On Tue, Mar 19, 2013 at 10:06 AM, Sasha Levin <levinsasha928@xxxxxxxxx> wrote:
> [ 232.822703] sysfs_dir_pos-973 sysfs_dirent use after free: vx855(vx855)-bind, 0-25520352

Looks filp->f_pos is changed as zero by llseek(), so may leave
filp->private_data
point to one refcount-balanced sysfs_dirent object, which will be put
again afterwards.

Hope we are luck this time, please try the attachment patch.


Thanks,
--
Ming Lei

Attachment: sysfs-fix-readdir-v2.patch
Description: Binary data