mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-21 07:58:31 +07:00
netlabel: Fix a potential NULL pointer dereference
Fix a potential NULL pointer dereference seen when trying to remove a static label configuration with an invalid address/mask combination. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
efba01803c
commit
d25830e550
@ -574,9 +574,10 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
|
|||||||
list_entry = netlbl_af4list_remove(addr->s_addr, mask->s_addr,
|
list_entry = netlbl_af4list_remove(addr->s_addr, mask->s_addr,
|
||||||
&iface->addr4_list);
|
&iface->addr4_list);
|
||||||
spin_unlock(&netlbl_unlhsh_lock);
|
spin_unlock(&netlbl_unlhsh_lock);
|
||||||
if (list_entry == NULL)
|
if (list_entry != NULL)
|
||||||
|
entry = netlbl_unlhsh_addr4_entry(list_entry);
|
||||||
|
else
|
||||||
ret_val = -ENOENT;
|
ret_val = -ENOENT;
|
||||||
entry = netlbl_unlhsh_addr4_entry(list_entry);
|
|
||||||
|
|
||||||
audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
|
audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
|
||||||
audit_info);
|
audit_info);
|
||||||
@ -634,9 +635,10 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
|
|||||||
spin_lock(&netlbl_unlhsh_lock);
|
spin_lock(&netlbl_unlhsh_lock);
|
||||||
list_entry = netlbl_af6list_remove(addr, mask, &iface->addr6_list);
|
list_entry = netlbl_af6list_remove(addr, mask, &iface->addr6_list);
|
||||||
spin_unlock(&netlbl_unlhsh_lock);
|
spin_unlock(&netlbl_unlhsh_lock);
|
||||||
if (list_entry == NULL)
|
if (list_entry != NULL)
|
||||||
|
entry = netlbl_unlhsh_addr6_entry(list_entry);
|
||||||
|
else
|
||||||
ret_val = -ENOENT;
|
ret_val = -ENOENT;
|
||||||
entry = netlbl_unlhsh_addr6_entry(list_entry);
|
|
||||||
|
|
||||||
audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
|
audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
|
||||||
audit_info);
|
audit_info);
|
||||||
|
Loading…
Reference in New Issue
Block a user