diff options
author | Frank Blaschka <frank.blaschka@de.ibm.com> | 2011-11-14 21:31:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-16 17:28:14 -0500 |
commit | 1d36cb479f204a0fedc1a3e7ce7b32c0a2c48769 (patch) | |
tree | 17ec1075b6d239c6e3113e34ed7c78511a820e90 /drivers/s390 | |
parent | 1d503563f7601a249d015d3fad40b08e8d6a394b (diff) |
qeth: l3 fix rcu splat in xmit
when use dst_get_neighbour to get neighbour, we need
rcu_read_lock to protect, since dst_get_neighbour uses
rcu_dereference.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index e4c1176ee25b..4d5307ddbe55 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -2756,11 +2756,13 @@ int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb) | |||
2756 | struct neighbour *n = NULL; | 2756 | struct neighbour *n = NULL; |
2757 | struct dst_entry *dst; | 2757 | struct dst_entry *dst; |
2758 | 2758 | ||
2759 | rcu_read_lock(); | ||
2759 | dst = skb_dst(skb); | 2760 | dst = skb_dst(skb); |
2760 | if (dst) | 2761 | if (dst) |
2761 | n = dst_get_neighbour(dst); | 2762 | n = dst_get_neighbour(dst); |
2762 | if (n) { | 2763 | if (n) { |
2763 | cast_type = n->type; | 2764 | cast_type = n->type; |
2765 | rcu_read_unlock(); | ||
2764 | if ((cast_type == RTN_BROADCAST) || | 2766 | if ((cast_type == RTN_BROADCAST) || |
2765 | (cast_type == RTN_MULTICAST) || | 2767 | (cast_type == RTN_MULTICAST) || |
2766 | (cast_type == RTN_ANYCAST)) | 2768 | (cast_type == RTN_ANYCAST)) |
@@ -2768,6 +2770,8 @@ int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb) | |||
2768 | else | 2770 | else |
2769 | return RTN_UNSPEC; | 2771 | return RTN_UNSPEC; |
2770 | } | 2772 | } |
2773 | rcu_read_unlock(); | ||
2774 | |||
2771 | /* try something else */ | 2775 | /* try something else */ |
2772 | if (skb->protocol == ETH_P_IPV6) | 2776 | if (skb->protocol == ETH_P_IPV6) |
2773 | return (skb_network_header(skb)[24] == 0xff) ? | 2777 | return (skb_network_header(skb)[24] == 0xff) ? |
@@ -2847,6 +2851,8 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, | |||
2847 | } | 2851 | } |
2848 | 2852 | ||
2849 | hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr); | 2853 | hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr); |
2854 | |||
2855 | rcu_read_lock(); | ||
2850 | dst = skb_dst(skb); | 2856 | dst = skb_dst(skb); |
2851 | if (dst) | 2857 | if (dst) |
2852 | n = dst_get_neighbour(dst); | 2858 | n = dst_get_neighbour(dst); |
@@ -2893,6 +2899,7 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, | |||
2893 | QETH_CAST_UNICAST | QETH_HDR_PASSTHRU; | 2899 | QETH_CAST_UNICAST | QETH_HDR_PASSTHRU; |
2894 | } | 2900 | } |
2895 | } | 2901 | } |
2902 | rcu_read_unlock(); | ||
2896 | } | 2903 | } |
2897 | 2904 | ||
2898 | static inline void qeth_l3_hdr_csum(struct qeth_card *card, | 2905 | static inline void qeth_l3_hdr_csum(struct qeth_card *card, |