[v5,0/2] ceph: fix the use-after-free bug for file_lock

Message ID 20221214033512.659913-1-xiubli@redhat.com
Headers
Series ceph: fix the use-after-free bug for file_lock |

Message

Xiubo Li Dec. 14, 2022, 3:35 a.m. UTC
  From: Xiubo Li <xiubli@redhat.com>

Changed in V5:
- s/fl_inode/inode/

Changed in V4:
- repeat the afs in fs.h instead of adding ceph specific header file

Changed in V3:
- switched to vfs_inode_has_locks() helper to fix another ceph file lock
bug, thanks Jeff!
- this patch series is based on Jeff's previous VFS lock patch:
  https://patchwork.kernel.org/project/ceph-devel/list/?series=695950

Changed in V2:
- switch to file_lock.fl_u to fix the race bug
- and the most code will be in the ceph layer


Xiubo Li (2):
  ceph: switch to vfs_inode_has_locks() to fix file lock bug
  ceph: add ceph specific member support for file_lock

 fs/ceph/caps.c     |  2 +-
 fs/ceph/locks.c    | 24 ++++++++++++++++++------
 fs/ceph/super.h    |  1 -
 include/linux/fs.h |  3 +++
 4 files changed, 22 insertions(+), 8 deletions(-)
  

Comments

Ilya Dryomov Jan. 2, 2023, 11:50 a.m. UTC | #1
On Wed, Dec 14, 2022 at 4:35 AM <xiubli@redhat.com> wrote:
>
> From: Xiubo Li <xiubli@redhat.com>
>
> Changed in V5:
> - s/fl_inode/inode/
>
> Changed in V4:
> - repeat the afs in fs.h instead of adding ceph specific header file
>
> Changed in V3:
> - switched to vfs_inode_has_locks() helper to fix another ceph file lock
> bug, thanks Jeff!
> - this patch series is based on Jeff's previous VFS lock patch:
>   https://patchwork.kernel.org/project/ceph-devel/list/?series=695950
>
> Changed in V2:
> - switch to file_lock.fl_u to fix the race bug
> - and the most code will be in the ceph layer
>
>
> Xiubo Li (2):
>   ceph: switch to vfs_inode_has_locks() to fix file lock bug
>   ceph: add ceph specific member support for file_lock
>
>  fs/ceph/caps.c     |  2 +-
>  fs/ceph/locks.c    | 24 ++++++++++++++++++------
>  fs/ceph/super.h    |  1 -
>  include/linux/fs.h |  3 +++
>  4 files changed, 22 insertions(+), 8 deletions(-)
>
> --
> 2.31.1
>

Hi Xiubo,

I have adjusted the title of the second patch to actually reflect its
purpose: "ceph: avoid use-after-free in ceph_fl_release_lock()".  With
that:

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>

Thanks,

                Ilya
  
Xiubo Li Jan. 3, 2023, 12:35 a.m. UTC | #2
On 02/01/2023 19:50, Ilya Dryomov wrote:
> On Wed, Dec 14, 2022 at 4:35 AM <xiubli@redhat.com> wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> Changed in V5:
>> - s/fl_inode/inode/
>>
>> Changed in V4:
>> - repeat the afs in fs.h instead of adding ceph specific header file
>>
>> Changed in V3:
>> - switched to vfs_inode_has_locks() helper to fix another ceph file lock
>> bug, thanks Jeff!
>> - this patch series is based on Jeff's previous VFS lock patch:
>>    https://patchwork.kernel.org/project/ceph-devel/list/?series=695950
>>
>> Changed in V2:
>> - switch to file_lock.fl_u to fix the race bug
>> - and the most code will be in the ceph layer
>>
>>
>> Xiubo Li (2):
>>    ceph: switch to vfs_inode_has_locks() to fix file lock bug
>>    ceph: add ceph specific member support for file_lock
>>
>>   fs/ceph/caps.c     |  2 +-
>>   fs/ceph/locks.c    | 24 ++++++++++++++++++------
>>   fs/ceph/super.h    |  1 -
>>   include/linux/fs.h |  3 +++
>>   4 files changed, 22 insertions(+), 8 deletions(-)
>>
>> --
>> 2.31.1
>>
> Hi Xiubo,
>
> I have adjusted the title of the second patch to actually reflect its
> purpose: "ceph: avoid use-after-free in ceph_fl_release_lock()".  With
> that:
>
> Reviewed-by: Ilya Dryomov <idryomov@gmail.com>

Hi Ilya,

Sure. Looks better.

I will revise it.

Thanks

- Xiubo


> Thanks,
>
>                  Ilya
>