lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 23 Nov 2014 14:24:38 -0500 (EST)
From:	David Miller <>
Subject: Re: [PATCH 1/1] fix return code from fib_rules_lookup() 

From: Ani Sinha <>
Date: Fri, 21 Nov 2014 22:25:21 -0800

>  fib_lookup() api returns two different types of error
>  codes. When no custom FIB rules are installed and
>  lookup fails, it returns ENETUNREACH. However, when
>  custom rules are installed, __fib_lookup() calls
>  fib_rules_lookup() which returns ESRCH when the rule
>  lookup fails. This patch makes both code paths return
>  identical error codes under lookup failure.
> Signed-off-by: Ani Sinha <>

How does this relate to the already committed:

commit 49dd18ba4615eaa72f15c9087dea1c2ab4744cf5
Author: Panu Matilainen <>
Date:   Fri Nov 14 13:14:32 2014 +0200

    ipv4: Fix incorrect error code when adding an unreachable route
    Trying to add an unreachable route incorrectly returns -ESRCH if
    if custom FIB rules are present:
    [root@...alhost ~]# ip route add dev eth0 via
    RTNETLINK answers: Network is unreachable
    [root@...alhost ~]# ip rule add to table 200
    [root@...alhost ~]# ip route add dev eth0 via
    RTNETLINK answers: No such process
    [root@...alhost ~]#
    Commit 83886b6b636173b206f475929e58fac75c6f2446 ("[NET]: Change "not found"
    return value for rule lookup") changed fib_rules_lookup()
    to use -ESRCH as a "not found" code internally, but for user space it
    should be translated into -ENETUNREACH. Handle the translation centrally in
    ipv4-specific fib_lookup(), leaving the DECnet case alone.
    On a related note, commit b7a71b51ee37d919e4098cd961d59a883fd272d8
    ("ipv4: removed redundant conditional") removed a similar translation from
    ip_route_input_slow() prematurely AIUI.
    Fixes: b7a71b51ee37 ("ipv4: removed redundant conditional")
    Signed-off-by: Panu Matilainen <>
    Signed-off-by: David S. Miller <>

diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index f2e1573..8f7bd56 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -62,6 +62,10 @@ int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
 		res->tclassid = 0;
+	if (err == -ESRCH)
+		err = -ENETUNREACH;
 	return err;
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists