]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rbd: harden get_lock_owner_info() a bit
authorIlya Dryomov <idryomov@gmail.com>
Sat, 8 Jul 2023 14:16:59 +0000 (16:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:46 +0000 (10:22 +0200)
commitbb25c5c0e4ae164d631396bc4e8d9afe2121a4eb
treee3ddcf5fe8771c84d5339658aef0556de2c34597
parentb223e9ffb64d74822d71d2db23052a713bea4bff
rbd: harden get_lock_owner_info() a bit

commit 8ff2c64c9765446c3cef804fb99da04916603e27 upstream.

- we want the exclusive lock type, so test for it directly
- use sscanf() to actually parse the lock cookie and avoid admitting
  invalid handles
- bail if locker has a blank address

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/rbd.c
net/ceph/messenger.c