Bluetooth: cmtp: cmtp_add_connection() should verify that it's dealing with l2cap...
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 19 Dec 2014 06:20:58 +0000 (06:20 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 1 Nov 2017 21:12:41 +0000 (22:12 +0100)
commitecce864b83040205ad7b7b1d44c73ad51f316914
treef85c0d0cbebdf2e0823881fbcca74e3a7cae3059
parentb8d57eb2f414876510ffffa88105a9d4f350f575
Bluetooth: cmtp: cmtp_add_connection() should verify that it's dealing with l2cap socket

commit 96c26653ce65bf84f3212f8b00d4316c1efcbf4c upstream.

... rather than relying on ciptool(8) never passing it anything else.  Give
it e.g. an AF_UNIX connected socket (from socketpair(2)) and it'll oops,
trying to evaluate &l2cap_pi(sock->sk)->chan->dst...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/bluetooth/cmtp/core.c