mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
[IPV6] lockdep: annotate __icmpv6_socket
Split off __icmpv6_socket's sk->sk_dst_lock class, because it gets used from softirqs, which is safe for __icmpv6_sockets (because they never get directly used via userspace syscalls), but unsafe for normal sockets. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
deb47c66e1
commit
640c41c77a
1 changed files with 13 additions and 0 deletions
|
@ -712,6 +712,11 @@ static int icmpv6_rcv(struct sk_buff **pskb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Special lock-class for __icmpv6_socket:
|
||||||
|
*/
|
||||||
|
static struct lock_class_key icmpv6_socket_sk_dst_lock_key;
|
||||||
|
|
||||||
int __init icmpv6_init(struct net_proto_family *ops)
|
int __init icmpv6_init(struct net_proto_family *ops)
|
||||||
{
|
{
|
||||||
struct sock *sk;
|
struct sock *sk;
|
||||||
|
@ -730,6 +735,14 @@ int __init icmpv6_init(struct net_proto_family *ops)
|
||||||
|
|
||||||
sk = per_cpu(__icmpv6_socket, i)->sk;
|
sk = per_cpu(__icmpv6_socket, i)->sk;
|
||||||
sk->sk_allocation = GFP_ATOMIC;
|
sk->sk_allocation = GFP_ATOMIC;
|
||||||
|
/*
|
||||||
|
* Split off their lock-class, because sk->sk_dst_lock
|
||||||
|
* gets used from softirqs, which is safe for
|
||||||
|
* __icmpv6_socket (because those never get directly used
|
||||||
|
* via userspace syscalls), but unsafe for normal sockets.
|
||||||
|
*/
|
||||||
|
lockdep_set_class(&sk->sk_dst_lock,
|
||||||
|
&icmpv6_socket_sk_dst_lock_key);
|
||||||
|
|
||||||
/* Enough space for 2 64K ICMP packets, including
|
/* Enough space for 2 64K ICMP packets, including
|
||||||
* sk_buff struct overhead.
|
* sk_buff struct overhead.
|
||||||
|
|
Loading…
Reference in a new issue