From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753850Ab0IVRnj (ORCPT ); Wed, 22 Sep 2010 13:43:39 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:50053 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753096Ab0IVRnh convert rfc822-to-8bit (ORCPT ); Wed, 22 Sep 2010 13:43:37 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=alIUvlKMqH+ljOplfeI0SoTRNsqQfpJLxozexzY1RIhi4tEh0I9W6E0WrpqjjyJvY9 OPvRVVgasDx956j8mvDR0wEiU+YhBxQu+16Alv6N/NdcNrXypSjoQutWieaAjEcGbGXm 7BwjUeEgYCOCMN0V7Dxm7t2V4P5FX84FovCgM= References: <1285137524.6378.160.camel@edumazet-laptop> <1285165636.2639.421.camel@edumazet-laptop> In-Reply-To: <1285165636.2639.421.camel@edumazet-laptop> Mime-Version: 1.0 (iPhone Mail 8B117) Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=utf-8 Message-Id: Cc: Herbert Xu , "Paul E. McKenney" , LKML , "David S.Miller" , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , Patrick McHardy X-Mailer: iPhone Mail (8B117) From: Miles Lane Subject: Re: 2.6.36-rc5-git1 -- include/linux/netpoll.h:67 invoked rcu_dereference_check() without protection! Date: Wed, 22 Sep 2010 13:43:26 -0400 To: Eric Dumazet Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org That worked for me. Thanks! Miles This message sent using my interplanetary mobile messaging device. On Sep 22, 2010, at 10:27 AM, Eric Dumazet wrote: > Le mercredi 22 septembre 2010 à 08:38 +0200, Eric Dumazet a écrit : >> Le mercredi 22 septembre 2010 à 00:22 -0400, Miles Lane a écrit : >>> [ INFO: suspicious rcu_dereference_check() usage. ] >>> --------------------------------------------------- >>> include/linux/netpoll.h:67 invoked rcu_dereference_check() without protection! >>> >>> other info that might help us debug this: >>> >>> >>> rcu_scheduler_active = 1, debug_locks = 1 >>> 1 lock held by avahi-daemon/1597: >>> #0: (sk_lock-AF_INET6){+.+.+.}, at: [] >>> udpv6_sendmsg+0x6c2/0x9e6 [ipv6] >>> >>> stack backtrace: >>> Pid: 1597, comm: avahi-daemon Not tainted 2.6.36-rc5 #13 >>> Call Trace: >>> [] lockdep_rcu_dereference+0x9d/0xa6 >>> [] netif_rx+0x4e/0x1a7 >>> [] ? get_parent_ip+0x11/0x41 >>> [] netif_rx_ni+0x1e/0x58 >>> [] ip6_dev_loopback_xmit+0xc0/0xc7 [ipv6] >>> [] ip6_finish_output2+0x199/0x3b6 [ipv6] >>> [] ip6_finish_output+0xf0f/0xf27 [ipv6] >>> [] ? csum_partial_copy_from_user+0xb4/0xea >>> [] ? csum_partial_copy_fromiovecend+0x178/0x1bd >>> [] ip6_output+0x158/0x161 [ipv6] >>> [] ? get_parent_ip+0x11/0x41 >>> [] ip6_local_out+0x5d/0x62 [ipv6] >>> [] ip6_push_pending_frames+0x466/0x524 [ipv6] >>> [] udp_v6_push_pending_frames+0x27f/0x2fb [ipv6] >>> [] ? udpv6_sendmsg+0x6c2/0x9e6 [ipv6] >>> [] udpv6_sendmsg+0x7c5/0x9e6 [ipv6] >>> [] ? inet_sendmsg+0x0/0x11f >>> [] inet_sendmsg+0x112/0x11f >>> [] ? inet_sendmsg+0x0/0x11f >>> [] sock_sendmsg+0xe7/0x108 >>> [] ? might_fault+0x63/0xb3 >>> [] ? might_fault+0xac/0xb3 >>> [] ? might_fault+0x63/0xb3 >>> [] sys_sendmsg+0x24f/0x2d6 >>> [] ? get_parent_ip+0x11/0x41 >>> [] ? sub_preempt_count+0x92/0xa6 >>> [] ? __srcu_read_unlock+0x3b/0x57 >>> [] ? sysret_check+0x27/0x62 >>> [] system_call_fastpath+0x16/0x1b# >> >> Oh well. >> >> Thanks for the report. Could you please test following patch ? >> >> >> [PATCH] rcu: rcu_dereference_bh() is hard irq safe >> >> rcu_dereference_bh() doesnt know yet about hard irq being disabled, so >> lockdep can trigger in netpoll_rx() after commit f0f9deae9e7c4 (netpoll: >> Disable IRQ around RCU dereference in netpoll_rx) >> >> Reported-by: Miles Lane >> Signed-off-by: Eric Dumazet >> --- >> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h >> index 9fbc54a..435c502 100644 >> --- a/include/linux/rcupdate.h >> +++ b/include/linux/rcupdate.h >> @@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) >> * Makes rcu_dereference_check() do the dirty work. >> */ >> #define rcu_dereference_bh(p) \ >> - rcu_dereference_check(p, rcu_read_lock_bh_held()) >> + rcu_dereference_check(p, rcu_read_lock_bh_held() || in_irq()) > > oops, I meant irqs_disabled() here, not in_irq() > >> >> /** >> * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched >> > >