|
@@ -58,7 +58,7 @@ static int l2cap_validate_bredr_psm(u16 psm)
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* Restrict usage of well-known PSMs */
|
|
|
- if (psm < 0x1001 && !capable(CAP_NET_BIND_SERVICE))
|
|
|
+ if (psm < L2CAP_PSM_DYN_START && !capable(CAP_NET_BIND_SERVICE))
|
|
|
return -EACCES;
|
|
|
|
|
|
return 0;
|
|
@@ -67,11 +67,11 @@ static int l2cap_validate_bredr_psm(u16 psm)
|
|
|
static int l2cap_validate_le_psm(u16 psm)
|
|
|
{
|
|
|
/* Valid LE_PSM ranges are defined only until 0x00ff */
|
|
|
- if (psm > 0x00ff)
|
|
|
+ if (psm > L2CAP_PSM_LE_DYN_END)
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* Restrict fixed, SIG assigned PSM values to CAP_NET_BIND_SERVICE */
|
|
|
- if (psm <= 0x007f && !capable(CAP_NET_BIND_SERVICE))
|
|
|
+ if (psm < L2CAP_PSM_LE_DYN_START && !capable(CAP_NET_BIND_SERVICE))
|
|
|
return -EACCES;
|
|
|
|
|
|
return 0;
|