ipv6 flowlabel: Ensure to take lock when modifying np->ip6_sk_fl_list.
Subsystems (4)
RFC 1/4 ipv6 flowlabel: Ensure to take lock when modifying np->ip6_sk_fl_list.
Signed-off-by YOSHIFUJI Hideaki <[email protected]>
--- net/ipv6/ip6_flowlabel.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
net/ipv6/ip6_flowlabel.c +11 -2
@@ -255,10 +255,19 @@ void fl6_free_socklist(struct sock *sk)struct ipv6_pinfo *np =inet6_sk (sk);struct ipv6_fl_socklist *sfl; -while ((sfl = np->ipv6_fl_list) !=NULL ) { - np->ipv6_fl_list = sfl->next; +if (!np->ipv6_fl_list) +return ; + +write_lock_bh (&ipv6_sk_fl_lock); + sfl = np->ipv6_fl_list; + np->ipv6_fl_list =NULL ; +write_unlock_bh (&ipv6_sk_fl_lock); + +while (sfl) { +struct ipv6_fl_socklist *next = sfl->next;fl_release (sfl->fl);kfree (sfl); + sfl = next; } }
Signature · 1 line
1.7.9.5
From: YOSHIFUJI Hideaki <[email protected]>
Date: Thu, 31 Jan 2013 04:26:42 +0900
Quoted 1 line
Signed-off-by YOSHIFUJI Hideaki <[email protected]>
Applied.