Bluetooth: Delay check for conn->smp in smp_conn_security()
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 4 Sep 2015 09:22:46 +0000 (12:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:43:18 +0000 (14:43 -0700)
commit25cbde3442a1fd07fc233bd881ded2f5bc8f4e26
treeade99918838fdf93e3dfb5b48cd2fff6e71cd309
parenta365025b053c37cfe27d16a4cf32e971cde3b41d
Bluetooth: Delay check for conn->smp in smp_conn_security()

commit d8949aad3eab5d396f4fefcd581773bf07b9a79e upstream.

There are several actions that smp_conn_security() might make that do
not require a valid SMP context (conn->smp pointer). One of these
actions is to encrypt the link with an existing LTK. If the SMP
context wasn't initialized properly we should still allow the
independent actions to be done, i.e. the check for the context should
only be done at the last possible moment.

Reported-by: Chuck Ebbert <cebbert.lkml@gmail.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/smp.c