]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ceph: ensure auth ops are defined before use
authorAlex Elder <elder@inktank.com>
Wed, 16 May 2012 20:16:39 +0000 (15:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 19:38:07 +0000 (11:38 -0800)
commit83d28f7956228e0dd1774aed1096392d3bfc0597
treec0d9780e35f34d0732bfbaa161f2ca3bd5f53768
parent018a2a13f3cb5e205618b1357124ff25eb3a8223
ceph: ensure auth ops are defined before use

(cherry picked from commit a255651d4cad89f1a606edd36135af892ada4f20)

In the create_authorizer method for both the mds and osd clients,
the auth_client->ops pointer is blindly dereferenced.  There is no
obvious guarantee that this pointer has been assigned.  And
furthermore, even if the ops pointer is non-null there is definitely
no guarantee that the create_authorizer or destroy_authorizer
methods are defined.

Add checks in both routines to make sure they are defined (non-null)
before use.  Add similar checks in a few other spots in these files
while we're at it.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/mds_client.c
net/ceph/osd_client.c