lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201710242056.y9oHozaI%fengguang.wu@intel.com>
Date:   Tue, 24 Oct 2017 20:27:38 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     kbuild-all@...org, kernel test robot <fengguang.wu@...el.com>,
        David Miller <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net] tcp/dccp: fix other lockdep splats accessing
 ireq_opt

Hi Eric,

[auto build test WARNING on net/master]

url:    https://github.com/0day-ci/linux/commits/Eric-Dumazet/tcp-dccp-fix-other-lockdep-splats-accessing-ireq_opt/20171024-200038
config: i386-randconfig-x079-201743 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/list.h:4,
                    from include/linux/module.h:9,
                    from net//8021q/vlan_dev.c:25:
   include/net/inet_sock.h: In function 'ireq_opt_deref':
   include/net/inet_sock.h:138:29: error: 'ireq' is a pointer; did you mean to use '->'?
             refcount_read(&ireq.req->rsk_refcnt) > 0);
                                ^
            ->
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
   include/linux/rcupdate.h:292:3: note: in expansion of macro 'if'
      if (debug_lockdep_rcu_enabled() && !__warned && (c)) { \
      ^~
>> include/linux/rcupdate.h:350:2: note: in expansion of macro 'RCU_LOCKDEP_WARN'
     RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
     ^~~~~~~~~~~~~~~~
   include/linux/rcupdate.h:486:2: note: in expansion of macro '__rcu_dereference_check'
     __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
     ^~~~~~~~~~~~~~~~~~~~~~~
   include/net/inet_sock.h:137:9: note: in expansion of macro 'rcu_dereference_check'
     return rcu_dereference_check(ireq->ireq_opt,
            ^~~~~~~~~~~~~~~~~~~~~
   include/net/inet_sock.h:138:29: error: 'ireq' is a pointer; did you mean to use '->'?
             refcount_read(&ireq.req->rsk_refcnt) > 0);
                                ^
            ->
   include/linux/compiler.h:156:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
   include/linux/rcupdate.h:292:3: note: in expansion of macro 'if'
      if (debug_lockdep_rcu_enabled() && !__warned && (c)) { \
      ^~
>> include/linux/rcupdate.h:350:2: note: in expansion of macro 'RCU_LOCKDEP_WARN'
     RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
     ^~~~~~~~~~~~~~~~
   include/linux/rcupdate.h:486:2: note: in expansion of macro '__rcu_dereference_check'
     __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
     ^~~~~~~~~~~~~~~~~~~~~~~
   include/net/inet_sock.h:137:9: note: in expansion of macro 'rcu_dereference_check'
     return rcu_dereference_check(ireq->ireq_opt,
            ^~~~~~~~~~~~~~~~~~~~~
   include/net/inet_sock.h:138:29: error: 'ireq' is a pointer; did you mean to use '->'?
             refcount_read(&ireq.req->rsk_refcnt) > 0);
                                ^
            ->
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
   include/linux/rcupdate.h:292:3: note: in expansion of macro 'if'
      if (debug_lockdep_rcu_enabled() && !__warned && (c)) { \
      ^~
>> include/linux/rcupdate.h:350:2: note: in expansion of macro 'RCU_LOCKDEP_WARN'
     RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
     ^~~~~~~~~~~~~~~~
   include/linux/rcupdate.h:486:2: note: in expansion of macro '__rcu_dereference_check'
     __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
     ^~~~~~~~~~~~~~~~~~~~~~~
   include/net/inet_sock.h:137:9: note: in expansion of macro 'rcu_dereference_check'
     return rcu_dereference_check(ireq->ireq_opt,
            ^~~~~~~~~~~~~~~~~~~~~

vim +/RCU_LOCKDEP_WARN +350 include/linux/rcupdate.h

632ee2001 Paul E. McKenney 2010-02-22  283  
4221a9918 Tetsuo Handa     2010-06-26  284  /**
f78f5b90c Paul E. McKenney 2015-06-18  285   * RCU_LOCKDEP_WARN - emit lockdep splat if specified condition is met
f78f5b90c Paul E. McKenney 2015-06-18  286   * @c: condition to check
f78f5b90c Paul E. McKenney 2015-06-18  287   * @s: informative message
f78f5b90c Paul E. McKenney 2015-06-18  288   */
f78f5b90c Paul E. McKenney 2015-06-18  289  #define RCU_LOCKDEP_WARN(c, s)						\
f78f5b90c Paul E. McKenney 2015-06-18  290  	do {								\
f78f5b90c Paul E. McKenney 2015-06-18  291  		static bool __section(.data.unlikely) __warned;		\
f78f5b90c Paul E. McKenney 2015-06-18 @292  		if (debug_lockdep_rcu_enabled() && !__warned && (c)) {	\
f78f5b90c Paul E. McKenney 2015-06-18  293  			__warned = true;				\
f78f5b90c Paul E. McKenney 2015-06-18  294  			lockdep_rcu_suspicious(__FILE__, __LINE__, s);	\
f78f5b90c Paul E. McKenney 2015-06-18  295  		}							\
f78f5b90c Paul E. McKenney 2015-06-18  296  	} while (0)
f78f5b90c Paul E. McKenney 2015-06-18  297  
50406b98b Paul E. McKenney 2012-01-12  298  #if defined(CONFIG_PROVE_RCU) && !defined(CONFIG_PREEMPT_RCU)
50406b98b Paul E. McKenney 2012-01-12  299  static inline void rcu_preempt_sleep_check(void)
50406b98b Paul E. McKenney 2012-01-12  300  {
f78f5b90c Paul E. McKenney 2015-06-18  301  	RCU_LOCKDEP_WARN(lock_is_held(&rcu_lock_map),
5cf05ad75 Paul E. McKenney 2012-05-17  302  			 "Illegal context switch in RCU read-side critical section");
50406b98b Paul E. McKenney 2012-01-12  303  }
50406b98b Paul E. McKenney 2012-01-12  304  #else /* #ifdef CONFIG_PROVE_RCU */
d0df7a349 Paul E. McKenney 2017-05-03  305  static inline void rcu_preempt_sleep_check(void) { }
50406b98b Paul E. McKenney 2012-01-12  306  #endif /* #else #ifdef CONFIG_PROVE_RCU */
50406b98b Paul E. McKenney 2012-01-12  307  
b3fbab057 Paul E. McKenney 2011-05-24  308  #define rcu_sleep_check()						\
b3fbab057 Paul E. McKenney 2011-05-24  309  	do {								\
50406b98b Paul E. McKenney 2012-01-12  310  		rcu_preempt_sleep_check();				\
f78f5b90c Paul E. McKenney 2015-06-18  311  		RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map),	\
41f4abd92 Joe Perches      2013-12-05  312  				 "Illegal context switch in RCU-bh read-side critical section"); \
f78f5b90c Paul E. McKenney 2015-06-18  313  		RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map),	\
41f4abd92 Joe Perches      2013-12-05  314  				 "Illegal context switch in RCU-sched read-side critical section"); \
b3fbab057 Paul E. McKenney 2011-05-24  315  	} while (0)
b3fbab057 Paul E. McKenney 2011-05-24  316  
ca5ecddfa Paul E. McKenney 2010-04-28  317  #else /* #ifdef CONFIG_PROVE_RCU */
ca5ecddfa Paul E. McKenney 2010-04-28  318  
f78f5b90c Paul E. McKenney 2015-06-18  319  #define RCU_LOCKDEP_WARN(c, s) do { } while (0)
b3fbab057 Paul E. McKenney 2011-05-24  320  #define rcu_sleep_check() do { } while (0)
ca5ecddfa Paul E. McKenney 2010-04-28  321  
ca5ecddfa Paul E. McKenney 2010-04-28  322  #endif /* #else #ifdef CONFIG_PROVE_RCU */
ca5ecddfa Paul E. McKenney 2010-04-28  323  
ca5ecddfa Paul E. McKenney 2010-04-28  324  /*
ca5ecddfa Paul E. McKenney 2010-04-28  325   * Helper functions for rcu_dereference_check(), rcu_dereference_protected()
ca5ecddfa Paul E. McKenney 2010-04-28  326   * and rcu_assign_pointer().  Some of these could be folded into their
ca5ecddfa Paul E. McKenney 2010-04-28  327   * callers, but they are left separate in order to ease introduction of
ca5ecddfa Paul E. McKenney 2010-04-28  328   * multiple flavors of pointers to match the multiple flavors of RCU
ca5ecddfa Paul E. McKenney 2010-04-28  329   * (e.g., __rcu_bh, * __rcu_sched, and __srcu), should this make sense in
ca5ecddfa Paul E. McKenney 2010-04-28  330   * the future.
ca5ecddfa Paul E. McKenney 2010-04-28  331   */
53ecfba25 Paul E. McKenney 2010-09-13  332  
53ecfba25 Paul E. McKenney 2010-09-13  333  #ifdef __CHECKER__
53ecfba25 Paul E. McKenney 2010-09-13  334  #define rcu_dereference_sparse(p, space) \
53ecfba25 Paul E. McKenney 2010-09-13  335  	((void)(((typeof(*p) space *)p) == p))
53ecfba25 Paul E. McKenney 2010-09-13  336  #else /* #ifdef __CHECKER__ */
53ecfba25 Paul E. McKenney 2010-09-13  337  #define rcu_dereference_sparse(p, space)
53ecfba25 Paul E. McKenney 2010-09-13  338  #endif /* #else #ifdef __CHECKER__ */
53ecfba25 Paul E. McKenney 2010-09-13  339  
ca5ecddfa Paul E. McKenney 2010-04-28  340  #define __rcu_access_pointer(p, space) \
ca5ecddfa Paul E. McKenney 2010-04-28  341  ({ \
7d0ae8086 Paul E. McKenney 2015-03-03  342  	typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \
53ecfba25 Paul E. McKenney 2010-09-13  343  	rcu_dereference_sparse(p, space); \
ca5ecddfa Paul E. McKenney 2010-04-28  344  	((typeof(*p) __force __kernel *)(_________p1)); \
ca5ecddfa Paul E. McKenney 2010-04-28  345  })
ca5ecddfa Paul E. McKenney 2010-04-28  346  #define __rcu_dereference_check(p, c, space) \
ca5ecddfa Paul E. McKenney 2010-04-28  347  ({ \
ac59853c0 Pranith Kumar    2014-11-13  348  	/* Dependency order vs. p above. */ \
ac59853c0 Pranith Kumar    2014-11-13  349  	typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \
f78f5b90c Paul E. McKenney 2015-06-18 @350  	RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
53ecfba25 Paul E. McKenney 2010-09-13  351  	rcu_dereference_sparse(p, space); \
ac59853c0 Pranith Kumar    2014-11-13  352  	((typeof(*p) __force __kernel *)(________p1)); \
ca5ecddfa Paul E. McKenney 2010-04-28  353  })
ca5ecddfa Paul E. McKenney 2010-04-28  354  #define __rcu_dereference_protected(p, c, space) \
ca5ecddfa Paul E. McKenney 2010-04-28  355  ({ \
f78f5b90c Paul E. McKenney 2015-06-18  356  	RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
53ecfba25 Paul E. McKenney 2010-09-13  357  	rcu_dereference_sparse(p, space); \
ca5ecddfa Paul E. McKenney 2010-04-28  358  	((typeof(*p) __force __kernel *)(p)); \
ca5ecddfa Paul E. McKenney 2010-04-28  359  })
995f14056 Paul E. McKenney 2016-07-01  360  #define rcu_dereference_raw(p) \
995f14056 Paul E. McKenney 2016-07-01  361  ({ \
995f14056 Paul E. McKenney 2016-07-01  362  	/* Dependency order vs. p above. */ \
995f14056 Paul E. McKenney 2016-07-01  363  	typeof(p) ________p1 = lockless_dereference(p); \
995f14056 Paul E. McKenney 2016-07-01  364  	((typeof(*p) __force __kernel *)(________p1)); \
995f14056 Paul E. McKenney 2016-07-01  365  })
ca5ecddfa Paul E. McKenney 2010-04-28  366  

:::::: The code at line 350 was first introduced by commit
:::::: f78f5b90c4ffa559e400c3919a02236101f29f3f rcu: Rename rcu_lockdep_assert() to RCU_LOCKDEP_WARN()

:::::: TO: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
:::::: CC: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (32321 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ