The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=031fbf8dc962ca8d458b217ba2b4a9e637b7e932

commit 031fbf8dc962ca8d458b217ba2b4a9e637b7e932
Author:     Gleb Smirnoff <gleb...@freebsd.org>
AuthorDate: 2025-01-29 22:06:57 +0000
Commit:     Gleb Smirnoff <gleb...@freebsd.org>
CommitDate: 2025-01-29 23:48:55 +0000

    netlink/route: fix fib number validation in old Linux compat mode
    
    The value passed via old field also needs to be validated.
    
    PR:                     283848
    Fixes:                  f34aca55adef1e28cd68b2e6705a0cac03f0238e
---
 sys/netlink/route/rt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c
index 1ee18f994c65..9750ad9d0649 100644
--- a/sys/netlink/route/rt.c
+++ b/sys/netlink/route/rt.c
@@ -952,10 +952,10 @@ rtnl_handle_newroute(struct nlmsghdr *hdr, struct nlpcb 
*nlp,
                return (EINVAL);
        }
 
-       if (attrs.rtm_table > 0 && attrs.rta_table == 0) {
-               /* pre-2.6.19 Linux API compatibility */
+       /* pre-2.6.19 Linux API compatibility */
+       if (attrs.rtm_table > 0 && attrs.rta_table == 0)
                attrs.rta_table = attrs.rtm_table;
-       } else if (attrs.rta_table >= V_rt_numfibs) {
+       if (attrs.rta_table >= V_rt_numfibs) {
                NLMSG_REPORT_ERR_MSG(npt, "invalid fib");
                return (EINVAL);
        }

Reply via email to