ipvs: fix possible use of uninitialized ipvs pointer
Subsystems (3)
PATCH 1/1 ipvs: fix possible use of uninitialized ipvs pointer
5e26b1b3abce[1] moved a derreference on ipvs on sysctl_sloppy_sctp(ipvs) to before its initialization.
Fix now is to just move ipvs initialization a bit upper.
--- net/netfilter/ipvs/ip_vs_proto_sctp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/netfilter/ipvs/ip_vs_proto_sctp.c +3 -2
@@ -20,6 +20,9 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,sctp_sctphdr_t *sh, _sctph;__be16 _ports[2 ], *ports =NULL ; + net =skb_net (skb); + ipvs =net_ipvs (net); +if (likely (!ip_vs_iph_icmp (iph))) { sh =skb_header_pointer (skb, iph->len,sizeof (_sctph), &_sctph);if (sh) {
@@ -40,8 +43,6 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,return 0 ; } - net =skb_net (skb); - ipvs =net_ipvs (net);rcu_read_lock ();if (likely (!ip_vs_iph_inverse (iph))) svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
Signature · 1 line
2.4.3
Julian Anastasov
maintainerHello,
Quoted 7 lines · Marcelo Ricardo Leitner
5e26b1b3abce[1] moved a derreference on ipvs on
sysctl_sloppy_sctp(ipvs)to before its initialization.Fix now is to just move ipvs initialization a bit upper.
Fixes 5e26b1b3abce ("ipvs: support scheduling inverse and icmp SCTP packets")Signed-off-by Marcelo Ricardo Leitner <[email protected]>
This is already fixed in ipvs-next tree as part of the
Eric W. Biederman's work:
"ipvs: Hoist computation of ipvs earlier in sctp_conn_schedule"
Quoted 19 lines
--- net/netfilter/ipvs/ip_vs_proto_sctp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)net/netfilter/ipvs/ip_vs_proto_sctp.c +3
-0@@ -20,6 +20,9 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,sctp_sctphdr_t *sh, _sctph;__be16 _ports[2 ], *ports =NULL ; + net =skb_net (skb); + ipvs =net_ipvs (net); +if (likely (!ip_vs_iph_icmp (iph))) { sh =skb_header_pointer (skb, iph->len,sizeof (_sctph), &_sctph);if (sh) {
net/netfilter/ipvs/ip_vs_proto_sctp.c sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd, · line 48
Quoted 8 lines
net/netfilter/ipvs/ip_vs_proto_sctp.c +0
-2@@ -40,8 +43,6 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,return 0 ; } - net =skb_net (skb); - ipvs =net_ipvs (net);rcu_read_lock ();if (likely (!ip_vs_iph_inverse (iph))) svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
Regards
--
Julian Anastasov <[email protected]>
Em 29-09-2015 16:04, Julian Anastasov escreveu:
Quoted 10 lines
Hello,
Quoted 5 lines · Marcelo Ricardo Leitner
5e26b1b3abce[1] moved a derreference on ipvs on
sysctl_sloppy_sctp(ipvs)to before its initialization.Fix now is to just move ipvs initialization a bit upper.
Quoted 7 lines
Quoted 2 lines
Fixes 5e26b1b3abce ("ipvs: support scheduling inverse and icmp SCTP packets")Signed-off-by Marcelo Ricardo Leitner <[email protected]>This is already fixed in ipvs-next tree as part of the
Eric W. Biederman's work:"ipvs: Hoist computation of ipvs earlier in
sctp_conn_schedule"
Oh, right. Sorry the noise then. Thanks.
Marcelo