mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
9 changed files with 18 additions and 9 deletions
|
|
@ -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 a new issue