Commit ebbb16d9 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

NFC: Forbid SSAP binding to a not well known LLCP service

With not Well Known Services there is no guarantees as to which
SSAP the server will be listening on, so there is no reason to
support binding to a specific source SAP.
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 8b7e8eda
......@@ -234,25 +234,13 @@ u8 nfc_llcp_get_sdp_ssap(struct nfc_llcp_local *local,
return LLCP_WKS_NUM_SAP + ssap;
} else if (sock->ssap != 0) {
if (sock->ssap < LLCP_WKS_NUM_SAP) {
} else if (sock->ssap != 0 && sock->ssap < LLCP_WKS_NUM_SAP) {
if (!test_bit(sock->ssap, &local->local_wks)) {
set_bit(sock->ssap, &local->local_wks);
mutex_unlock(&local->sdp_lock);
return sock->ssap;
}
} else if (sock->ssap < LLCP_SDP_NUM_SAP) {
if (!test_bit(sock->ssap - LLCP_WKS_NUM_SAP,
&local->local_sdp)) {
set_bit(sock->ssap - LLCP_WKS_NUM_SAP,
&local->local_sdp);
mutex_unlock(&local->sdp_lock);
return sock->ssap;
}
}
}
mutex_unlock(&local->sdp_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment