Re: [PATCH 2/2] sysfs: handle failure path correctly for readdir()

2013-03-20 Thread Shuah Khan
On Wed, Mar 20, 2013 at 9:25 AM, Ming Lei wrote: > In case of 'if (filp->f_pos == 0 or 1)' of sysfs_readdir(), > the failure from filldir() isn't handled, and the reference counter > of the sysfs_dirent object pointed by filp->private_data will be > released without clearing filp->private_data, s

[PATCH 2/2] sysfs: handle failure path correctly for readdir()

2013-03-20 Thread Ming Lei
In case of 'if (filp->f_pos == 0 or 1)' of sysfs_readdir(), the failure from filldir() isn't handled, and the reference counter of the sysfs_dirent object pointed by filp->private_data will be released without clearing filp->private_data, so use after free bug will be triggered later. This patch