Patch "ipv4: add missing initialization for flowi4_uid" has been added to the 4.10-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
ipv4: add missing initialization for flowi4_uid
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ipv4-add-missing-initialization-for-flowi4_uid.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Sat Mar 18 22:03:53 CST 2017
From: Julian Anastasov <[email protected]>
Date: Sun, 26 Feb 2017 15:50:52 +0200
Subject: ipv4: add missing initialization for flowi4_uid
From: Julian Anastasov <[email protected]>
[ Upstream commit 8bcfd0925ef15f072ba1e7bee2c25e9e1b5fd6ca ]
Avoid matching of random stack value for uid when rules are looked up on input route or when RP filter is used. Problem should affect only setups that use ip rules with uid range.
--- net/ipv4/fib_frontend.c | 6 +++--- net/ipv4/route.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
net/ipv4/fib_frontend.c +3 -3
@@ -319,7 +319,7 @@ static int __fib_validate_source(structint ret, no_addr;struct fib_result res;struct flowi4 fl4; -struct net *net; +struct net *net =dev_net (dev);bool dev_match; fl4.flowi4_oif =0 ;
@@ -332,6 +332,7 @@ static int __fib_validate_source(struct fl4.flowi4_scope =RT_SCOPE_UNIVERSE ; fl4.flowi4_tun_key.tun_id =0 ; fl4.flowi4_flags =0 ; + fl4.flowi4_uid =sock_net_uid (net,NULL ); no_addr = idev->ifa_list ==NULL ;
@@ -339,13 +340,12 @@ static int __fib_validate_source(structtrace_fib_validate_source (dev, &fl4); - net =dev_net (dev);if (fib_lookup (net, &fl4, &res,0 )) goto last_resort;if (res.type !=RTN_UNICAST && (res.type !=RTN_LOCAL || !IN_DEV_ACCEPT_LOCAL (idev))) goto e_inval; -if (!rpf && !fib_num_tclassid_users (dev_net (dev)) && +if (!rpf && !fib_num_tclassid_users (net) && (dev->ifindex != oif || !IN_DEV_TX_REDIRECTS (idev))) goto last_resort;fib_combine_itag (itag, &res);
net/ipv4/route.c +1 -0
@@ -1858,6 +1858,7 @@ static int ip_route_input_slow(struct sk fl4.flowi4_flags =0 ; fl4.daddr = daddr; fl4.saddr = saddr; + fl4.flowi4_uid =sock_net_uid (net,NULL ); err =fib_lookup (net, &fl4, &res,0 );if (err !=0 ) {if (!IN_DEV_FORWARD (in_dev))
Patches currently in stable-queue which might be from [email protected] are
queue-4.10/ipv4-mask-tos-for-input-route.patch queue-4.10/ipv4-add-missing-initialization-for-flowi4_uid.patch