Bluetooth: Serialize RFCOMMCREATEDEV and RFCOMMRELEASEDEV ioctls
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 10 Feb 2014 01:59:18 +0000 (20:59 -0500)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 14 Feb 2014 21:39:31 +0000 (13:39 -0800)
commit033ace99c444daa4141b84419f670513ce637b77
tree6640d710788117d3dbf9c76dd15e870dddbddec5
parent7611fcedd6caae0586397508a2414788d87a231c
Bluetooth: Serialize RFCOMMCREATEDEV and RFCOMMRELEASEDEV ioctls

At least two different race conditions exist with multiple concurrent
RFCOMMCREATEDEV and RFCOMMRELEASEDEV ioctls:
* Multiple concurrent RFCOMMCREATEDEVs with RFCOMM_REUSE_DLC can
  mistakenly share the same DLC.
* RFCOMMRELEASEDEV can destruct the rfcomm_dev still being
  constructed by RFCOMMCREATEDEV.

Introduce rfcomm_ioctl_mutex to serialize these add/remove operations.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Tested-By: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/rfcomm/tty.c