mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
netlink/route: validate family attribute
PR: 283818 (cherry picked from commit cdacb12065e4d85416655743da5bc6b17a9d9119)
This commit is contained in:
parent
f2a49434b5
commit
96e6fc517f
1 changed files with 3 additions and 3 deletions
|
|
@ -956,7 +956,7 @@ rtnl_handle_newroute(struct nlmsghdr *hdr, struct nlpcb *nlp,
|
|||
/* pre-2.6.19 Linux API compatibility */
|
||||
if (attrs.rtm_table > 0 && attrs.rta_table == 0)
|
||||
attrs.rta_table = attrs.rtm_table;
|
||||
if (attrs.rta_table >= V_rt_numfibs) {
|
||||
if (attrs.rta_table >= V_rt_numfibs || attrs.rtm_family > AF_MAX) {
|
||||
NLMSG_REPORT_ERR_MSG(npt, "invalid fib");
|
||||
return (EINVAL);
|
||||
}
|
||||
|
|
@ -1019,7 +1019,7 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp,
|
|||
return (ESRCH);
|
||||
}
|
||||
|
||||
if (attrs.rta_table >= V_rt_numfibs) {
|
||||
if (attrs.rta_table >= V_rt_numfibs || attrs.rtm_family > AF_MAX) {
|
||||
NLMSG_REPORT_ERR_MSG(npt, "invalid fib");
|
||||
return (EINVAL);
|
||||
}
|
||||
|
|
@ -1042,7 +1042,7 @@ rtnl_handle_getroute(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *
|
|||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
if (attrs.rta_table >= V_rt_numfibs) {
|
||||
if (attrs.rta_table >= V_rt_numfibs || attrs.rtm_family > AF_MAX) {
|
||||
NLMSG_REPORT_ERR_MSG(npt, "invalid fib");
|
||||
return (EINVAL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue