LARTC
[Top] [All Lists]

[LARTC] Re: [NET]: Fix fib_rules compatibility breakage

To: Thomas Graf <tgraf@suug.ch>
Subject: [LARTC] Re: [NET]: Fix fib_rules compatibility breakage
From: Patrick McHardy <kaber@trash.net>
Date: Tue, 20 Mar 2007 17:59:44 +0100
Cc: Linux Netdev List <netdev@vger.kernel.org>, "David S. Miller" <davem@davemloft.net>, lartc@mailman.ds9a.nl
Delivered-to: sp-com-lists@consult.net
Delivered-to: lartc-list@securepoint.com
Delivered-to: lartc@outpost.ds9a.nl
In-reply-to: <20070320164004.GN521@postel.suug.ch>
List-archive: <http://mailman.ds9a.nl/pipermail/lartc>
List-help: <mailto:lartc-request@mailman.ds9a.nl?subject=help>
List-id: "Mailinglist of the Linux Advanced Routing &amp; Traffic Control project" <lartc.mailman.ds9a.nl>
List-post: <mailto:lartc@mailman.ds9a.nl>
List-subscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=subscribe>
List-unsubscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=unsubscribe>
References: <200703190046.47021.luciano@lugmen.org.ar> <45FE2587.3050205@trash.net> <20070319152532.GL521@postel.suug.ch> <45FF7D07.4040103@trash.net> <45FF8269.3000606@trash.net> <20070320164004.GN521@postel.suug.ch>
Sender: lartc-bounces@mailman.ds9a.nl
User-agent: Debian Thunderbird 1.0.7 (X11/20051019)
Thomas Graf wrote:
> @@ -242,10 +239,10 @@ static int fib4_rule_compare(struct fib_
>               return 0;
>  #endif
>  
> -     if (tb[FRA_SRC] && (rule4->src != nla_get_be32(tb[FRA_SRC])))
> +     if (frh->src_len && (rule4->src != nla_get_be32(tb[FRA_SRC])))
>               return 0;
>  
> -     if (tb[FRA_DST] && (rule4->dst != nla_get_be32(tb[FRA_DST])))
> +     if (frh->dst_len && (rule4->dst != nla_get_be32(tb[FRA_DST])))
>               return 0;
>  


The presence of the attributes when src_len/dst_len is non-zero
is only verified in fib_newrule, so this looks like it might crash
when something broken sets src_len/dst_len to a non-zero value
without actually adding the attributes.

Other than that it looks fine.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

<Prev in Thread] Current Thread [Next in Thread>