If the struct mac copied into the kernel has a negative length, return
EINVAL rather than failing the following malloc due to the value being too large.
This commit is contained in:
parent
6cfa0cbdee
commit
cc7b13bfe0
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
@ -1176,7 +1176,8 @@ static int
|
||||
mac_check_structmac_consistent(struct mac *mac)
|
||||
{
|
||||
|
||||
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
if (mac->m_buflen < 0 ||
|
||||
mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
|
||||
return (EINVAL);
|
||||
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user