[kees:for-next/array-bounds 9/10] arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_t[1]'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/array-bounds
head: 3ccac0d2ba34a8e6f722975136f06c30fb586ca0
commit: 4ba545781e20f49cf1175e11d9f606e621040acf [9/10] Makefile: Enable -Warray-bounds
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220125/202201251648.VyzfPvSk-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees for-next/array-bounds
git checkout 4ba545781e20f49cf1175e11d9f606e621040acf
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash block/ drivers/accessibility/speakup/ drivers/infiniband/sw/siw/ kernel/rcu/ mm/ net/ipv4/ net/sched/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/cpumask.h:13,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:62,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from mm/swap_state.c:10:
mm/swap_state.c: In function 'swap_cluster_readahead':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
mm/swap_state.c:71:17: note: while referencing 'swapin_readahead_hits'
71 | static atomic_t swapin_readahead_hits = ATOMIC_INIT(4);
| ^~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
kernel/rcu/rcutorture.c: In function 'rcu_torture_stats_print':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from kernel/rcu/rcutorture.c:51:
kernel/rcu/rcu.h:254:25: note: while referencing '___rfd_beenhere'
254 | static atomic_t ___rfd_beenhere = ATOMIC_INIT(0); \
| ^~~~~~~~~~~~~~~
kernel/rcu/rcutorture.c:1915:17: note: in expansion of macro 'rcu_ftrace_dump'
1915 | rcu_ftrace_dump(DUMP_ALL);
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
kernel/rcu/rcutorture.c: In function 'rcu_torture_writer':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from kernel/rcu/rcutorture.c:51:
kernel/rcu/rcu.h:254:25: note: while referencing '___rfd_beenhere'
254 | static atomic_t ___rfd_beenhere = ATOMIC_INIT(0); \
| ^~~~~~~~~~~~~~~
kernel/rcu/rcutorture.c:1287:41: note: in expansion of macro 'rcu_ftrace_dump'
1287 | rcu_ftrace_dump(DUMP_ALL);
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
kernel/rcu/rcutorture.c: In function 'rcu_torture_fwd_prog':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_long_t[1]' {aka 'atomic_t[1]'} [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
kernel/rcu/rcutorture.c:2170:22: note: while referencing 'rcu_fwd_max_cbs'
2170 | static atomic_long_t rcu_fwd_max_cbs;
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
kernel/rcu/rcutorture.c: In function 'rcu_torture_one_read':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from kernel/rcu/rcutorture.c:51:
kernel/rcu/rcu.h:254:25: note: while referencing '___rfd_beenhere'
254 | static atomic_t ___rfd_beenhere = ATOMIC_INIT(0); \
| ^~~~~~~~~~~~~~~
kernel/rcu/rcutorture.c:1650:17: note: in expansion of macro 'rcu_ftrace_dump'
1650 | rcu_ftrace_dump(DUMP_ALL);
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from kernel/rcu/rcutorture.c:18:
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'int[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
kernel/rcu/rcutorture.c:241:12: note: while referencing 'err_segs_recorded'
241 | static int err_segs_recorded;
| ^~~~~~~~~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/cpumask.h:13,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:62,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from kernel/rcu/rcuscale.c:15:
kernel/rcu/rcuscale.c: In function 'rcu_scale_writer':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'atomic_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from kernel/rcu/rcuscale.c:43:
kernel/rcu/rcu.h:254:25: note: while referencing '___rfd_beenhere'
254 | static atomic_t ___rfd_beenhere = ATOMIC_INIT(0); \
| ^~~~~~~~~~~~~~~
kernel/rcu/rcuscale.c:464:33: note: in expansion of macro 'rcu_ftrace_dump'
464 | rcu_ftrace_dump(DUMP_ALL);
| ^~~~~~~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from block/blk-mq.c:9:
block/blk-mq.c: In function 'blk_complete_reqs.constprop':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'struct llist_head[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from include/asm-generic/percpu.h:7,
from ./arch/m68k/include/generated/asm/percpu.h:1,
from include/linux/irqflags.h:17,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/mm_types_task.h:13,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from block/blk-mq.c:9:
block/blk-mq.c:46:42: note: while referencing 'blk_cpu_done'
46 | static DEFINE_PER_CPU(struct llist_head, blk_cpu_done);
| ^~~~~~~~~~~~
include/linux/percpu-defs.h:95:51: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
95 | __PCPU_ATTRS(sec) __weak __typeof__(type) name
| ^~~~
block/blk-mq.c:46:8: note: in expansion of macro 'DEFINE_PER_CPU'
46 | static DEFINE_PER_CPU(struct llist_head, blk_cpu_done);
| ^~~~~~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/rcupdate.h:25,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/miscdevice.h:7,
from drivers/accessibility/speakup/devsynth.c:3:
drivers/accessibility/speakup/devsynth.c: In function 'speakup_file_open':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'int[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
drivers/accessibility/speakup/devsynth.c:11:12: note: while referencing 'dev_opened'
11 | static int dev_opened;
| ^~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/cpumask.h:13,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:62,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from drivers/accessibility/speakup/selection.c:2:
drivers/accessibility/speakup/selection.c: In function 'speakup_cancel_selection':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'struct speakup_selection_work[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
drivers/accessibility/speakup/selection.c:57:38: note: while referencing 'speakup_sel_work'
57 | static struct speakup_selection_work speakup_sel_work = {
| ^~~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/cpumask.h:13,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:62,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from drivers/accessibility/speakup/selection.c:2:
drivers/accessibility/speakup/selection.c: In function 'speakup_cancel_paste':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'struct speakup_selection_work[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
drivers/accessibility/speakup/selection.c:116:38: note: while referencing 'speakup_paste_work'
116 | static struct speakup_selection_work speakup_paste_work = {
| ^~~~~~~~~~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/jump_label.h:261,
from include/linux/once.h:6,
from include/linux/random.h:13,
from include/linux/net.h:18,
from drivers/infiniband/sw/siw/siw_qp_tx.c:8:
drivers/infiniband/sw/siw/siw_qp_tx.c: In function 'siw_run_sq':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'struct tx_task_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from include/asm-generic/percpu.h:7,
from ./arch/m68k/include/generated/asm/percpu.h:1,
from include/linux/irqflags.h:17,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/jump_label.h:261,
from include/linux/once.h:6,
from include/linux/random.h:13,
from include/linux/net.h:18,
from drivers/infiniband/sw/siw/siw_qp_tx.c:8:
drivers/infiniband/sw/siw/siw_qp_tx.c:1200:41: note: while referencing 'siw_tx_task_g'
1200 | static DEFINE_PER_CPU(struct tx_task_t, siw_tx_task_g);
| ^~~~~~~~~~~~~
include/linux/percpu-defs.h:95:51: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
95 | __PCPU_ATTRS(sec) __weak __typeof__(type) name
| ^~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:1200:8: note: in expansion of macro 'DEFINE_PER_CPU'
1200 | static DEFINE_PER_CPU(struct tx_task_t, siw_tx_task_g);
| ^~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/jump_label.h:261,
from include/linux/once.h:6,
from include/linux/random.h:13,
from include/linux/net.h:18,
from drivers/infiniband/sw/siw/siw_qp_tx.c:8:
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'struct tx_task_t[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from include/asm-generic/percpu.h:7,
from ./arch/m68k/include/generated/asm/percpu.h:1,
from include/linux/irqflags.h:17,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/jump_label.h:261,
from include/linux/once.h:6,
from include/linux/random.h:13,
from include/linux/net.h:18,
from drivers/infiniband/sw/siw/siw_qp_tx.c:8:
drivers/infiniband/sw/siw/siw_qp_tx.c:1200:41: note: while referencing 'siw_tx_task_g'
1200 | static DEFINE_PER_CPU(struct tx_task_t, siw_tx_task_g);
| ^~~~~~~~~~~~~
include/linux/percpu-defs.h:95:51: note: in definition of macro 'DEFINE_PER_CPU_SECTION'
95 | __PCPU_ATTRS(sec) __weak __typeof__(type) name
| ^~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:1200:8: note: in expansion of macro 'DEFINE_PER_CPU'
1200 | static DEFINE_PER_CPU(struct tx_task_t, siw_tx_task_g);
| ^~~~~~~~~~~~~~
--
In file included from arch/m68k/include/asm/atomic.h:7,
from include/linux/atomic.h:7,
from include/linux/crypto.h:15,
from include/crypto/hash.h:11,
from net/ipv4/tcp.c:246:
net/ipv4/tcp.c: In function 'tcp_leave_memory_pressure':
>> arch/m68k/include/asm/cmpxchg.h:64:17: warning: array subscript 'volatile struct __xchg_dummy[0]' is partly outside array bounds of 'long unsigned int[1]' [-Warray-bounds]
64 | __asm__ __volatile__
| ^~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/preempt.h:10,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/crypto.h:15,
from include/crypto/hash.h:11,
from net/ipv4/tcp.c:246:
net/ipv4/tcp.c:325:19: note: while referencing 'tcp_memory_pressure'
325 | EXPORT_SYMBOL_GPL(tcp_memory_pressure);
| ^~~~~~~~~~~~~~~~~~~
include/linux/export.h:98:28: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:160:41: note: in expansion of macro '__EXPORT_SYMBOL'
160 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:164:41: note: in expansion of macro '_EXPORT_SYMBOL'
164 | #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
| ^~~~~~~~~~~~~~
net/ipv4/tcp.c:325:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
325 | EXPORT_SYMBOL_GPL(tcp_memory_pressure);
| ^~~~~~~~~~~~~~~~~
..
vim +64 arch/m68k/include/asm/cmpxchg.h
803f69144f0d48 David Howells 2012-03-28 11
803f69144f0d48 David Howells 2012-03-28 12 #ifndef CONFIG_RMW_INSNS
803f69144f0d48 David Howells 2012-03-28 13 static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
803f69144f0d48 David Howells 2012-03-28 14 {
803f69144f0d48 David Howells 2012-03-28 15 unsigned long flags, tmp;
803f69144f0d48 David Howells 2012-03-28 16
803f69144f0d48 David Howells 2012-03-28 17 local_irq_save(flags);
803f69144f0d48 David Howells 2012-03-28 18
803f69144f0d48 David Howells 2012-03-28 19 switch (size) {
803f69144f0d48 David Howells 2012-03-28 20 case 1:
803f69144f0d48 David Howells 2012-03-28 21 tmp = *(u8 *)ptr;
803f69144f0d48 David Howells 2012-03-28 22 *(u8 *)ptr = x;
803f69144f0d48 David Howells 2012-03-28 23 x = tmp;
803f69144f0d48 David Howells 2012-03-28 24 break;
803f69144f0d48 David Howells 2012-03-28 25 case 2:
803f69144f0d48 David Howells 2012-03-28 26 tmp = *(u16 *)ptr;
803f69144f0d48 David Howells 2012-03-28 27 *(u16 *)ptr = x;
803f69144f0d48 David Howells 2012-03-28 28 x = tmp;
803f69144f0d48 David Howells 2012-03-28 29 break;
803f69144f0d48 David Howells 2012-03-28 30 case 4:
803f69144f0d48 David Howells 2012-03-28 31 tmp = *(u32 *)ptr;
803f69144f0d48 David Howells 2012-03-28 32 *(u32 *)ptr = x;
803f69144f0d48 David Howells 2012-03-28 33 x = tmp;
803f69144f0d48 David Howells 2012-03-28 34 break;
803f69144f0d48 David Howells 2012-03-28 35 default:
803f69144f0d48 David Howells 2012-03-28 36 tmp = __invalid_xchg_size(x, ptr, size);
803f69144f0d48 David Howells 2012-03-28 37 break;
803f69144f0d48 David Howells 2012-03-28 38 }
803f69144f0d48 David Howells 2012-03-28 39
803f69144f0d48 David Howells 2012-03-28 40 local_irq_restore(flags);
803f69144f0d48 David Howells 2012-03-28 41 return x;
803f69144f0d48 David Howells 2012-03-28 42 }
803f69144f0d48 David Howells 2012-03-28 43 #else
803f69144f0d48 David Howells 2012-03-28 44 static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
803f69144f0d48 David Howells 2012-03-28 45 {
803f69144f0d48 David Howells 2012-03-28 46 switch (size) {
803f69144f0d48 David Howells 2012-03-28 47 case 1:
803f69144f0d48 David Howells 2012-03-28 48 __asm__ __volatile__
803f69144f0d48 David Howells 2012-03-28 49 ("moveb %2,%0\n\t"
803f69144f0d48 David Howells 2012-03-28 50 "1:\n\t"
803f69144f0d48 David Howells 2012-03-28 51 "casb %0,%1,%2\n\t"
803f69144f0d48 David Howells 2012-03-28 52 "jne 1b"
803f69144f0d48 David Howells 2012-03-28 53 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
803f69144f0d48 David Howells 2012-03-28 54 break;
803f69144f0d48 David Howells 2012-03-28 55 case 2:
803f69144f0d48 David Howells 2012-03-28 56 __asm__ __volatile__
803f69144f0d48 David Howells 2012-03-28 57 ("movew %2,%0\n\t"
803f69144f0d48 David Howells 2012-03-28 58 "1:\n\t"
803f69144f0d48 David Howells 2012-03-28 59 "casw %0,%1,%2\n\t"
803f69144f0d48 David Howells 2012-03-28 60 "jne 1b"
803f69144f0d48 David Howells 2012-03-28 61 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
803f69144f0d48 David Howells 2012-03-28 62 break;
803f69144f0d48 David Howells 2012-03-28 63 case 4:
803f69144f0d48 David Howells 2012-03-28 @64 __asm__ __volatile__
803f69144f0d48 David Howells 2012-03-28 65 ("movel %2,%0\n\t"
803f69144f0d48 David Howells 2012-03-28 66 "1:\n\t"
803f69144f0d48 David Howells 2012-03-28 67 "casl %0,%1,%2\n\t"
803f69144f0d48 David Howells 2012-03-28 68 "jne 1b"
803f69144f0d48 David Howells 2012-03-28 69 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
803f69144f0d48 David Howells 2012-03-28 70 break;
803f69144f0d48 David Howells 2012-03-28 71 default:
803f69144f0d48 David Howells 2012-03-28 72 x = __invalid_xchg_size(x, ptr, size);
803f69144f0d48 David Howells 2012-03-28 73 break;
803f69144f0d48 David Howells 2012-03-28 74 }
803f69144f0d48 David Howells 2012-03-28 75 return x;
803f69144f0d48 David Howells 2012-03-28 76 }
803f69144f0d48 David Howells 2012-03-28 77 #endif
803f69144f0d48 David Howells 2012-03-28 78
:::::: The code at line 64 was first introduced by commit
:::::: 803f69144f0d48863c68f9d111b56849c7cef5bb Disintegrate asm/system.h for M68K
:::::: TO: David Howells <dhowells(a)redhat.com>
:::::: CC: David Howells <dhowells(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[linux-next:master 550/1252] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_pptable.h:163:17: warning: field smc_pptable within 'struct smu_11_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_powerplay_table' being packed, which can lea...
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 74e5dee6a5b9683e4e78aad784c6c807833cb89b
commit: 837d542a09cd533055423dfca7e621a9c1d13c5b [550/1252] drm/amd/pm: relocate the power related headers
config: arm-randconfig-r001-20220118 (https://download.01.org/0day-ci/archive/20220125/202201251530.UEfWRPS9-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7b3d30728816403d1fd73cc5082e9fb761262bce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 837d542a09cd533055423dfca7e621a9c1d13c5b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/arcturus_ppt.c:37:
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_pptable.h:163:17: warning: field smc_pptable within 'struct smu_11_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access]
PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h
^
1 warning generated.
--
In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:39:
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_7_pptable.h:193:17: warning: field smc_pptable within 'struct smu_11_0_7_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_7_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access]
PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h
^
1 warning generated.
--
In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/aldebaran_ppt.c:37:
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0_pptable.h:161:12: warning: field smc_pptable within 'struct smu_13_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_13_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access]
PPTable_t smc_pptable; //PPTable_t in driver_if.h
^
1 warning generated.
vim +163 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_pptable.h
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 137
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 138 struct smu_11_0_powerplay_table
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 139 {
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 140 struct atom_common_table_header header;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 141 uint8_t table_revision;
4b2bb705a0b72f drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Kenneth Feng 2019-04-04 142 uint16_t table_size; //Driver portion table size. The offset to smc_pptable including header size
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 143 uint32_t golden_pp_id;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 144 uint32_t golden_revision;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 145 uint16_t format_id;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 146 uint32_t platform_caps; //POWERPLAYABLE::ulPlatformCaps
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 147
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 148 uint8_t thermal_controller_type; //one of SMU_11_0_PP_THERMALCONTROLLER
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 149
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 150 uint16_t small_power_limit1;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 151 uint16_t small_power_limit2;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 152 uint16_t boost_power_limit;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 153 uint16_t od_turbo_power_limit; //Power limit setting for Turbo mode in Performance UI Tuning.
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 154 uint16_t od_power_save_power_limit; //Power limit setting for PowerSave/Optimal mode in Performance UI Tuning.
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 155 uint16_t software_shutdown_temp;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 156
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 157 uint16_t reserve[6]; //Zero filled field reserved for future use
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 158
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 159 struct smu_11_0_power_saving_clock_table power_saving_clock;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 160 struct smu_11_0_overdrive_table overdrive_table;
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 161
73abde4d864b38 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Matt Coffin 2019-11-11 162 #ifndef SMU_11_0_PARTIAL_PPTABLE
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 @163 PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h
73abde4d864b38 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Matt Coffin 2019-11-11 164 #endif
2dd1209e576068 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2019-02-12 165 } __attribute__((packed));
ae35cd6a480f9c drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h Huang Rui 2018-12-12 166
:::::: The code at line 163 was first introduced by commit
:::::: ae35cd6a480f9c2ac356f792c9a9321a5863776a drm/amd/powerplay: add pptable header for smu11
:::::: TO: Huang Rui <ray.huang(a)amd.com>
:::::: CC: Alex Deucher <alexander.deucher(a)amd.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH v6 31/39] kasan, vmalloc: only tag normal vmalloc allocations
by kernel test robot
Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc1 next-20220124]
[cannot apply to arm64/for-next/core rostedt-trace/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/andrey-konovalov-linux-dev/kasan...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
config: microblaze-randconfig-s032-20220124 (https://download.01.org/0day-ci/archive/20220125/202201251520.0CgVaz6r-lk...)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/e53c62ef4d4998f3bdd75ec887bc39a1e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review andrey-konovalov-linux-dev/kasan-vmalloc-arm64-add-vmalloc-tagging-support-for-SW-HW_TAGS/20220125-021005
git checkout e53c62ef4d4998f3bdd75ec887bc39a1ef2dd740
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> mm/vmalloc.c:2224:49: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted kasan_vmalloc_flags_t [usertype] flags @@ got unsigned int @@
mm/vmalloc.c:2224:49: sparse: expected restricted kasan_vmalloc_flags_t [usertype] flags
mm/vmalloc.c:2224:49: sparse: got unsigned int
mm/vmalloc.c:2463:53: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted kasan_vmalloc_flags_t [usertype] flags @@ got unsigned int @@
mm/vmalloc.c:2463:53: sparse: expected restricted kasan_vmalloc_flags_t [usertype] flags
mm/vmalloc.c:2463:53: sparse: got unsigned int
mm/vmalloc.c:3148:29: sparse: sparse: invalid assignment: |=
mm/vmalloc.c:3148:29: sparse: left side has type restricted kasan_vmalloc_flags_t
mm/vmalloc.c:3148:29: sparse: right side has type unsigned int
mm/vmalloc.c:3165:21: sparse: sparse: invalid assignment: |=
mm/vmalloc.c:3165:21: sparse: left side has type restricted kasan_vmalloc_flags_t
mm/vmalloc.c:3165:21: sparse: right side has type unsigned int
mm/vmalloc.c:3167:29: sparse: sparse: invalid assignment: |=
mm/vmalloc.c:3167:29: sparse: left side has type restricted kasan_vmalloc_flags_t
mm/vmalloc.c:3167:29: sparse: right side has type unsigned int
vim +2224 mm/vmalloc.c
2176
2177 /**
2178 * vm_map_ram - map pages linearly into kernel virtual address (vmalloc space)
2179 * @pages: an array of pointers to the pages to be mapped
2180 * @count: number of pages
2181 * @node: prefer to allocate data structures on this node
2182 *
2183 * If you use this function for less than VMAP_MAX_ALLOC pages, it could be
2184 * faster than vmap so it's good. But if you mix long-life and short-life
2185 * objects with vm_map_ram(), it could consume lots of address space through
2186 * fragmentation (especially on a 32bit machine). You could see failures in
2187 * the end. Please use this function for short-lived objects.
2188 *
2189 * Returns: a pointer to the address that has been mapped, or %NULL on failure
2190 */
2191 void *vm_map_ram(struct page **pages, unsigned int count, int node)
2192 {
2193 unsigned long size = (unsigned long)count << PAGE_SHIFT;
2194 unsigned long addr;
2195 void *mem;
2196
2197 if (likely(count <= VMAP_MAX_ALLOC)) {
2198 mem = vb_alloc(size, GFP_KERNEL);
2199 if (IS_ERR(mem))
2200 return NULL;
2201 addr = (unsigned long)mem;
2202 } else {
2203 struct vmap_area *va;
2204 va = alloc_vmap_area(size, PAGE_SIZE,
2205 VMALLOC_START, VMALLOC_END, node, GFP_KERNEL);
2206 if (IS_ERR(va))
2207 return NULL;
2208
2209 addr = va->va_start;
2210 mem = (void *)addr;
2211 }
2212
2213 if (vmap_pages_range(addr, addr + size, PAGE_KERNEL,
2214 pages, PAGE_SHIFT) < 0) {
2215 vm_unmap_ram(mem, count);
2216 return NULL;
2217 }
2218
2219 /*
2220 * Mark the pages as accessible, now that they are mapped.
2221 * With hardware tag-based KASAN, marking is skipped for
2222 * non-VM_ALLOC mappings, see __kasan_unpoison_vmalloc().
2223 */
> 2224 mem = kasan_unpoison_vmalloc(mem, size, KASAN_VMALLOC_PROT_NORMAL);
2225
2226 return mem;
2227 }
2228 EXPORT_SYMBOL(vm_map_ram);
2229
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
arch/x86/events/rapl.c:540:59: sparse: sparse: Using plain integer as NULL pointer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 0036fb00a756a2f6e360d44e2e3d2200a8afbc9b perf/x86/rapl: fix AMD event handling
date: 7 days ago
config: i386-randconfig-s001-20220124 (https://download.01.org/0day-ci/archive/20220125/202201251514.ZEiF0Q7N-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0036fb00a756a2f6e360d44e2e3d2200a8afbc9b
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/events/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/x86/events/rapl.c:540:59: sparse: sparse: Using plain integer as NULL pointer
arch/x86/events/rapl.c:542:59: sparse: sparse: Using plain integer as NULL pointer
arch/x86/events/rapl.c:543:59: sparse: sparse: Using plain integer as NULL pointer
arch/x86/events/rapl.c:544:59: sparse: sparse: Using plain integer as NULL pointer
vim +540 arch/x86/events/rapl.c
533
534 /*
535 * Force to PERF_RAPL_MAX size due to:
536 * - perf_msr_probe(PERF_RAPL_MAX)
537 * - want to use same event codes across both architectures
538 */
539 static struct perf_msr amd_rapl_msrs[] = {
> 540 [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, 0, false, 0 },
541 [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr, false, RAPL_MSR_MASK },
542 [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, 0, false, 0 },
543 [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, 0, false, 0 },
544 [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, 0, false, 0 },
545 };
546
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Wycena paneli fotowoltaicznych
by Jakub Daroch
Dzień dobry,
dostrzegam możliwość współpracy z Państwa firmą.
Świadczymy kompleksową obsługę inwestycji w fotowoltaikę, która obniża koszty energii elektrycznej nawet o 90%.
Czy są Państwo zainteresowani weryfikacją wstępnych propozycji?
Pozdrawiam,
Jakub Daroch
7 months, 4 weeks
[kees:for-next/array-bounds 9/10] arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/array-bounds
head: 3ccac0d2ba34a8e6f722975136f06c30fb586ca0
commit: 4ba545781e20f49cf1175e11d9f606e621040acf [9/10] Makefile: Enable -Warray-bounds
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220125/202201251510.55XdBprq-lk...)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees for-next/array-bounds
git checkout 4ba545781e20f49cf1175e11d9f606e621040acf
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash arch/sh/kernel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/sh/kernel/machvec.c: In function 'early_parse_mv':
arch/sh/kernel/machvec.c:44:15: warning: variable 'mv_comma' set but not used [-Wunused-but-set-variable]
44 | char *mv_comma;
| ^~~~~~~~
arch/sh/kernel/machvec.c: In function 'sh_mv_setup':
>> arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Warray-bounds]
105 | sh_mv = *(struct sh_machine_vector *)&__machvec_start;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/sh/kernel/machvec.c:13:
arch/sh/include/asm/sections.h:7:13: note: while referencing '__machvec_start'
7 | extern long __machvec_start, __machvec_end;
| ^~~~~~~~~~~~~~~
vim +105 arch/sh/kernel/machvec.c
9655ad03af2d23 Paul Mundt 2007-05-14 80
9655ad03af2d23 Paul Mundt 2007-05-14 81 void __init sh_mv_setup(void)
9655ad03af2d23 Paul Mundt 2007-05-14 82 {
82f81f4784479d Paul Mundt 2007-05-15 83 /*
82f81f4784479d Paul Mundt 2007-05-15 84 * Only overload the machvec if one hasn't been selected on
82f81f4784479d Paul Mundt 2007-05-15 85 * the command line with sh_mv=
82f81f4784479d Paul Mundt 2007-05-15 86 */
fd8f20e8e2f8f1 Paul Mundt 2007-05-15 87 if (!machvec_selected) {
82f81f4784479d Paul Mundt 2007-05-15 88 unsigned long machvec_size;
82f81f4784479d Paul Mundt 2007-05-15 89
82f81f4784479d Paul Mundt 2007-05-15 90 machvec_size = ((unsigned long)&__machvec_end -
82f81f4784479d Paul Mundt 2007-05-15 91 (unsigned long)&__machvec_start);
82f81f4784479d Paul Mundt 2007-05-15 92
5556410e220387 Paul Mundt 2007-08-07 93 /*
5556410e220387 Paul Mundt 2007-08-07 94 * Sanity check for machvec section alignment. Ensure
5556410e220387 Paul Mundt 2007-08-07 95 * __initmv hasn't been misused.
5556410e220387 Paul Mundt 2007-08-07 96 */
5556410e220387 Paul Mundt 2007-08-07 97 if (machvec_size % sizeof(struct sh_machine_vector))
5556410e220387 Paul Mundt 2007-08-07 98 panic("machvec misaligned, invalid __initmv use?");
5556410e220387 Paul Mundt 2007-08-07 99
82f81f4784479d Paul Mundt 2007-05-15 100 /*
82f81f4784479d Paul Mundt 2007-05-15 101 * If the machvec hasn't been preselected, use the first
82f81f4784479d Paul Mundt 2007-05-15 102 * vector (usually the only one) from .machvec.init.
82f81f4784479d Paul Mundt 2007-05-15 103 */
82f81f4784479d Paul Mundt 2007-05-15 104 if (machvec_size >= sizeof(struct sh_machine_vector))
82f81f4784479d Paul Mundt 2007-05-15 @105 sh_mv = *(struct sh_machine_vector *)&__machvec_start;
:::::: The code at line 105 was first introduced by commit
:::::: 82f81f4784479df17a80caff4a7156da0a2f7dea sh: Kill off machvec aliases.
:::::: TO: Paul Mundt <lethal(a)linux-sh.org>
:::::: CC: Paul Mundt <lethal(a)hera.kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH 03/10] staging: r8188eu: remove DBG_88E calls from core/rtw_mlme_ext.c
by kernel test robot
Hi Phillip,
I love your patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.17-rc1 next-20220124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Phillip-Potter/Cleanup-and-remov...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fa783154524a71ab74e293cd8251155e5971952b
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220125/202201251504.QbCNelqi-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8b7efc8d3123ad5411beb88fc84fab814...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Phillip-Potter/Cleanup-and-removal-of-DBG_88E-macro/20220125-125206
git checkout 8b7efc8d3123ad5411beb88fc84fab8141f8b60f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/staging/r8188eu/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/staging/r8188eu/core/rtw_mlme_ext.c: In function 'OnAssocReq':
>> drivers/staging/r8188eu/core/rtw_mlme_ext.c:919:33: warning: variable 'reassoc' set but not used [-Wunused-but-set-variable]
919 | unsigned char reassoc, *p, *pos, *wpa_ie;
| ^~~~~~~
drivers/staging/r8188eu/core/rtw_mlme_ext.c: In function 'OnAction_back':
>> drivers/staging/r8188eu/core/rtw_mlme_ext.c:1580:38: warning: variable 'reason_code' set but not used [-Wunused-but-set-variable]
1580 | unsigned short tid, status, reason_code = 0;
| ^~~~~~~~~~~
vim +/reassoc +919 drivers/staging/r8188eu/core/rtw_mlme_ext.c
15865124feed88 Phillip Potter 2021-07-28 913
15865124feed88 Phillip Potter 2021-07-28 914 unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame)
15865124feed88 Phillip Potter 2021-07-28 915 {
15865124feed88 Phillip Potter 2021-07-28 916 u16 capab_info;
15865124feed88 Phillip Potter 2021-07-28 917 struct rtw_ieee802_11_elems elems;
15865124feed88 Phillip Potter 2021-07-28 918 struct sta_info *pstat;
15865124feed88 Phillip Potter 2021-07-28 @919 unsigned char reassoc, *p, *pos, *wpa_ie;
15865124feed88 Phillip Potter 2021-07-28 920 unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
15865124feed88 Phillip Potter 2021-07-28 921 int i, ie_len, wpa_ie_len, left;
15865124feed88 Phillip Potter 2021-07-28 922 unsigned char supportRate[16];
15865124feed88 Phillip Potter 2021-07-28 923 int supportRateNum;
15865124feed88 Phillip Potter 2021-07-28 924 unsigned short status = _STATS_SUCCESSFUL_;
15865124feed88 Phillip Potter 2021-07-28 925 unsigned short frame_type, ie_offset = 0;
15865124feed88 Phillip Potter 2021-07-28 926 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
15865124feed88 Phillip Potter 2021-07-28 927 struct security_priv *psecuritypriv = &padapter->securitypriv;
15865124feed88 Phillip Potter 2021-07-28 928 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
3b522a11b50476 Michael Straube 2021-08-09 929 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
3b522a11b50476 Michael Straube 2021-08-09 930 struct wlan_bssid_ex *cur = &pmlmeinfo->network;
15865124feed88 Phillip Potter 2021-07-28 931 struct sta_priv *pstapriv = &padapter->stapriv;
15865124feed88 Phillip Potter 2021-07-28 932 u8 *pframe = precv_frame->rx_data;
15865124feed88 Phillip Potter 2021-07-28 933 uint pkt_len = precv_frame->len;
3b522a11b50476 Michael Straube 2021-08-09 934 struct wifidirect_info *pwdinfo = &padapter->wdinfo;
15865124feed88 Phillip Potter 2021-07-28 935 u8 p2p_status_code = P2P_STATUS_SUCCESS;
15865124feed88 Phillip Potter 2021-07-28 936 u8 *p2pie;
15865124feed88 Phillip Potter 2021-07-28 937 u32 p2pielen = 0;
15865124feed88 Phillip Potter 2021-07-28 938
15865124feed88 Phillip Potter 2021-07-28 939 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
15865124feed88 Phillip Potter 2021-07-28 940 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 941
15865124feed88 Phillip Potter 2021-07-28 942 frame_type = GetFrameSubType(pframe);
15865124feed88 Phillip Potter 2021-07-28 943 if (frame_type == WIFI_ASSOCREQ) {
15865124feed88 Phillip Potter 2021-07-28 944 reassoc = 0;
15865124feed88 Phillip Potter 2021-07-28 945 ie_offset = _ASOCREQ_IE_OFFSET_;
15865124feed88 Phillip Potter 2021-07-28 946 } else { /* WIFI_REASSOCREQ */
15865124feed88 Phillip Potter 2021-07-28 947 reassoc = 1;
15865124feed88 Phillip Potter 2021-07-28 948 ie_offset = _REASOCREQ_IE_OFFSET_;
15865124feed88 Phillip Potter 2021-07-28 949 }
15865124feed88 Phillip Potter 2021-07-28 950
8b7efc8d3123ad Phillip Potter 2022-01-24 951 if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset)
15865124feed88 Phillip Potter 2021-07-28 952 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 953
15865124feed88 Phillip Potter 2021-07-28 954 pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
15865124feed88 Phillip Potter 2021-07-28 955 if (pstat == (struct sta_info *)NULL) {
15865124feed88 Phillip Potter 2021-07-28 956 status = _RSON_CLS2_;
15865124feed88 Phillip Potter 2021-07-28 957 goto asoc_class2_error;
15865124feed88 Phillip Potter 2021-07-28 958 }
15865124feed88 Phillip Potter 2021-07-28 959
15865124feed88 Phillip Potter 2021-07-28 960 capab_info = get_unaligned_le16(pframe + WLAN_HDR_A3_LEN);
15865124feed88 Phillip Potter 2021-07-28 961
15865124feed88 Phillip Potter 2021-07-28 962 left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset);
15865124feed88 Phillip Potter 2021-07-28 963 pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset);
15865124feed88 Phillip Potter 2021-07-28 964
15865124feed88 Phillip Potter 2021-07-28 965 /* check if this stat has been successfully authenticated/assocated */
15865124feed88 Phillip Potter 2021-07-28 966 if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) {
15865124feed88 Phillip Potter 2021-07-28 967 if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) {
15865124feed88 Phillip Potter 2021-07-28 968 status = _RSON_CLS2_;
15865124feed88 Phillip Potter 2021-07-28 969 goto asoc_class2_error;
15865124feed88 Phillip Potter 2021-07-28 970 } else {
15865124feed88 Phillip Potter 2021-07-28 971 pstat->state &= (~WIFI_FW_ASSOC_SUCCESS);
15865124feed88 Phillip Potter 2021-07-28 972 pstat->state |= WIFI_FW_ASSOC_STATE;
15865124feed88 Phillip Potter 2021-07-28 973 }
15865124feed88 Phillip Potter 2021-07-28 974 } else {
15865124feed88 Phillip Potter 2021-07-28 975 pstat->state &= (~WIFI_FW_AUTH_SUCCESS);
15865124feed88 Phillip Potter 2021-07-28 976 pstat->state |= WIFI_FW_ASSOC_STATE;
15865124feed88 Phillip Potter 2021-07-28 977 }
15865124feed88 Phillip Potter 2021-07-28 978 pstat->capability = capab_info;
15865124feed88 Phillip Potter 2021-07-28 979 /* now parse all ieee802_11 ie to point to elems */
15865124feed88 Phillip Potter 2021-07-28 980 if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed ||
15865124feed88 Phillip Potter 2021-07-28 981 !elems.ssid) {
15865124feed88 Phillip Potter 2021-07-28 982 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 983 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 984 }
15865124feed88 Phillip Potter 2021-07-28 985
15865124feed88 Phillip Potter 2021-07-28 986 /* now we should check all the fields... */
15865124feed88 Phillip Potter 2021-07-28 987 /* checking SSID */
15865124feed88 Phillip Potter 2021-07-28 988 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len,
15865124feed88 Phillip Potter 2021-07-28 989 pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 990 if (!p)
15865124feed88 Phillip Potter 2021-07-28 991 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 992
15865124feed88 Phillip Potter 2021-07-28 993 if (ie_len == 0) { /* broadcast ssid, however it is not allowed in assocreq */
15865124feed88 Phillip Potter 2021-07-28 994 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 995 } else {
15865124feed88 Phillip Potter 2021-07-28 996 /* check if ssid match */
15865124feed88 Phillip Potter 2021-07-28 997 if (memcmp((void *)(p + 2), cur->Ssid.Ssid, cur->Ssid.SsidLength))
15865124feed88 Phillip Potter 2021-07-28 998 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 999
15865124feed88 Phillip Potter 2021-07-28 1000 if (ie_len != cur->Ssid.SsidLength)
15865124feed88 Phillip Potter 2021-07-28 1001 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 1002 }
15865124feed88 Phillip Potter 2021-07-28 1003
15865124feed88 Phillip Potter 2021-07-28 1004 if (_STATS_SUCCESSFUL_ != status)
15865124feed88 Phillip Potter 2021-07-28 1005 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1006
15865124feed88 Phillip Potter 2021-07-28 1007 /* check if the supported rate is ok */
15865124feed88 Phillip Potter 2021-07-28 1008 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SUPPORTEDRATES_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 1009 if (!p) {
15865124feed88 Phillip Potter 2021-07-28 1010 /* use our own rate set as statoin used */
15865124feed88 Phillip Potter 2021-07-28 1011 /* memcpy(supportRate, AP_BSSRATE, AP_BSSRATE_LEN); */
15865124feed88 Phillip Potter 2021-07-28 1012 /* supportRateNum = AP_BSSRATE_LEN; */
15865124feed88 Phillip Potter 2021-07-28 1013
15865124feed88 Phillip Potter 2021-07-28 1014 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 1015 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1016 } else {
15865124feed88 Phillip Potter 2021-07-28 1017 memcpy(supportRate, p + 2, ie_len);
15865124feed88 Phillip Potter 2021-07-28 1018 supportRateNum = ie_len;
15865124feed88 Phillip Potter 2021-07-28 1019
15865124feed88 Phillip Potter 2021-07-28 1020 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _EXT_SUPPORTEDRATES_IE_, &ie_len,
15865124feed88 Phillip Potter 2021-07-28 1021 pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 1022 if (p) {
15865124feed88 Phillip Potter 2021-07-28 1023 if (supportRateNum <= sizeof(supportRate)) {
15865124feed88 Phillip Potter 2021-07-28 1024 memcpy(supportRate + supportRateNum, p + 2, ie_len);
15865124feed88 Phillip Potter 2021-07-28 1025 supportRateNum += ie_len;
15865124feed88 Phillip Potter 2021-07-28 1026 }
15865124feed88 Phillip Potter 2021-07-28 1027 }
15865124feed88 Phillip Potter 2021-07-28 1028 }
15865124feed88 Phillip Potter 2021-07-28 1029
15865124feed88 Phillip Potter 2021-07-28 1030 /* todo: mask supportRate between AP & STA -> move to update raid */
15865124feed88 Phillip Potter 2021-07-28 1031 /* get_matched_rate(pmlmeext, supportRate, &supportRateNum, 0); */
15865124feed88 Phillip Potter 2021-07-28 1032
15865124feed88 Phillip Potter 2021-07-28 1033 /* update station supportRate */
15865124feed88 Phillip Potter 2021-07-28 1034 pstat->bssratelen = supportRateNum;
15865124feed88 Phillip Potter 2021-07-28 1035 memcpy(pstat->bssrateset, supportRate, supportRateNum);
15865124feed88 Phillip Potter 2021-07-28 1036 UpdateBrateTblForSoftAP(pstat->bssrateset, pstat->bssratelen);
15865124feed88 Phillip Potter 2021-07-28 1037
15865124feed88 Phillip Potter 2021-07-28 1038 /* check RSN/WPA/WPS */
15865124feed88 Phillip Potter 2021-07-28 1039 pstat->dot8021xalg = 0;
15865124feed88 Phillip Potter 2021-07-28 1040 pstat->wpa_psk = 0;
15865124feed88 Phillip Potter 2021-07-28 1041 pstat->wpa_group_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1042 pstat->wpa2_group_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1043 pstat->wpa_pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1044 pstat->wpa2_pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1045 memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie));
15865124feed88 Phillip Potter 2021-07-28 1046 if ((psecuritypriv->wpa_psk & BIT(1)) && elems.rsn_ie) {
15865124feed88 Phillip Potter 2021-07-28 1047 int group_cipher = 0, pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1048
15865124feed88 Phillip Potter 2021-07-28 1049 wpa_ie = elems.rsn_ie;
15865124feed88 Phillip Potter 2021-07-28 1050 wpa_ie_len = elems.rsn_ie_len;
15865124feed88 Phillip Potter 2021-07-28 1051
15865124feed88 Phillip Potter 2021-07-28 1052 if (rtw_parse_wpa2_ie(wpa_ie - 2, wpa_ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
15865124feed88 Phillip Potter 2021-07-28 1053 pstat->dot8021xalg = 1;/* psk, todo:802.1x */
15865124feed88 Phillip Potter 2021-07-28 1054 pstat->wpa_psk |= BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1055
15865124feed88 Phillip Potter 2021-07-28 1056 pstat->wpa2_group_cipher = group_cipher & psecuritypriv->wpa2_group_cipher;
15865124feed88 Phillip Potter 2021-07-28 1057 pstat->wpa2_pairwise_cipher = pairwise_cipher & psecuritypriv->wpa2_pairwise_cipher;
15865124feed88 Phillip Potter 2021-07-28 1058
15865124feed88 Phillip Potter 2021-07-28 1059 if (!pstat->wpa2_group_cipher)
15865124feed88 Phillip Potter 2021-07-28 1060 status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1061
15865124feed88 Phillip Potter 2021-07-28 1062 if (!pstat->wpa2_pairwise_cipher)
15865124feed88 Phillip Potter 2021-07-28 1063 status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1064 } else {
15865124feed88 Phillip Potter 2021-07-28 1065 status = WLAN_STATUS_INVALID_IE;
15865124feed88 Phillip Potter 2021-07-28 1066 }
15865124feed88 Phillip Potter 2021-07-28 1067 } else if ((psecuritypriv->wpa_psk & BIT(0)) && elems.wpa_ie) {
15865124feed88 Phillip Potter 2021-07-28 1068 int group_cipher = 0, pairwise_cipher = 0;
15865124feed88 Phillip Potter 2021-07-28 1069
15865124feed88 Phillip Potter 2021-07-28 1070 wpa_ie = elems.wpa_ie;
15865124feed88 Phillip Potter 2021-07-28 1071 wpa_ie_len = elems.wpa_ie_len;
15865124feed88 Phillip Potter 2021-07-28 1072
15865124feed88 Phillip Potter 2021-07-28 1073 if (rtw_parse_wpa_ie(wpa_ie - 2, wpa_ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
15865124feed88 Phillip Potter 2021-07-28 1074 pstat->dot8021xalg = 1;/* psk, todo:802.1x */
15865124feed88 Phillip Potter 2021-07-28 1075 pstat->wpa_psk |= BIT(0);
15865124feed88 Phillip Potter 2021-07-28 1076
15865124feed88 Phillip Potter 2021-07-28 1077 pstat->wpa_group_cipher = group_cipher & psecuritypriv->wpa_group_cipher;
15865124feed88 Phillip Potter 2021-07-28 1078 pstat->wpa_pairwise_cipher = pairwise_cipher & psecuritypriv->wpa_pairwise_cipher;
15865124feed88 Phillip Potter 2021-07-28 1079
15865124feed88 Phillip Potter 2021-07-28 1080 if (!pstat->wpa_group_cipher)
15865124feed88 Phillip Potter 2021-07-28 1081 status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1082
15865124feed88 Phillip Potter 2021-07-28 1083 if (!pstat->wpa_pairwise_cipher)
15865124feed88 Phillip Potter 2021-07-28 1084 status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
15865124feed88 Phillip Potter 2021-07-28 1085 } else {
15865124feed88 Phillip Potter 2021-07-28 1086 status = WLAN_STATUS_INVALID_IE;
15865124feed88 Phillip Potter 2021-07-28 1087 }
15865124feed88 Phillip Potter 2021-07-28 1088 } else {
15865124feed88 Phillip Potter 2021-07-28 1089 wpa_ie = NULL;
15865124feed88 Phillip Potter 2021-07-28 1090 wpa_ie_len = 0;
15865124feed88 Phillip Potter 2021-07-28 1091 }
15865124feed88 Phillip Potter 2021-07-28 1092
15865124feed88 Phillip Potter 2021-07-28 1093 if (_STATS_SUCCESSFUL_ != status)
15865124feed88 Phillip Potter 2021-07-28 1094 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1095
15865124feed88 Phillip Potter 2021-07-28 1096 pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
552838fdcaef2c Michael Straube 2021-08-01 1097 if (!wpa_ie) {
8b7efc8d3123ad Phillip Potter 2022-01-24 1098 if (elems.wps_ie)
15865124feed88 Phillip Potter 2021-07-28 1099 pstat->flags |= WLAN_STA_WPS;
15865124feed88 Phillip Potter 2021-07-28 1100 /* wpabuf_free(sta->wps_ie); */
15865124feed88 Phillip Potter 2021-07-28 1101 /* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */
15865124feed88 Phillip Potter 2021-07-28 1102 /* elems.wps_ie_len - 4); */
8b7efc8d3123ad Phillip Potter 2022-01-24 1103 else
15865124feed88 Phillip Potter 2021-07-28 1104 pstat->flags |= WLAN_STA_MAYBE_WPS;
15865124feed88 Phillip Potter 2021-07-28 1105
15865124feed88 Phillip Potter 2021-07-28 1106 /* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */
15865124feed88 Phillip Potter 2021-07-28 1107 /* that the selected registrar of AP is _FLASE */
15865124feed88 Phillip Potter 2021-07-28 1108 if ((psecuritypriv->wpa_psk > 0) && (pstat->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) {
15865124feed88 Phillip Potter 2021-07-28 1109 if (pmlmepriv->wps_beacon_ie) {
15865124feed88 Phillip Potter 2021-07-28 1110 u8 selected_registrar = 0;
15865124feed88 Phillip Potter 2021-07-28 1111
15865124feed88 Phillip Potter 2021-07-28 1112 rtw_get_wps_attr_content(pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len, WPS_ATTR_SELECTED_REGISTRAR, &selected_registrar, NULL);
15865124feed88 Phillip Potter 2021-07-28 1113
15865124feed88 Phillip Potter 2021-07-28 1114 if (!selected_registrar) {
15865124feed88 Phillip Potter 2021-07-28 1115 status = _STATS_UNABLE_HANDLE_STA_;
15865124feed88 Phillip Potter 2021-07-28 1116
15865124feed88 Phillip Potter 2021-07-28 1117 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1118 }
15865124feed88 Phillip Potter 2021-07-28 1119 }
15865124feed88 Phillip Potter 2021-07-28 1120 }
15865124feed88 Phillip Potter 2021-07-28 1121 } else {
15865124feed88 Phillip Potter 2021-07-28 1122 int copy_len;
15865124feed88 Phillip Potter 2021-07-28 1123
15865124feed88 Phillip Potter 2021-07-28 1124 if (psecuritypriv->wpa_psk == 0) {
15865124feed88 Phillip Potter 2021-07-28 1125 status = WLAN_STATUS_INVALID_IE;
15865124feed88 Phillip Potter 2021-07-28 1126
15865124feed88 Phillip Potter 2021-07-28 1127 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1128 }
15865124feed88 Phillip Potter 2021-07-28 1129
15865124feed88 Phillip Potter 2021-07-28 1130 if (elems.wps_ie) {
15865124feed88 Phillip Potter 2021-07-28 1131 pstat->flags |= WLAN_STA_WPS;
15865124feed88 Phillip Potter 2021-07-28 1132 copy_len = 0;
15865124feed88 Phillip Potter 2021-07-28 1133 } else {
15865124feed88 Phillip Potter 2021-07-28 1134 copy_len = ((wpa_ie_len + 2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)) : (wpa_ie_len + 2);
15865124feed88 Phillip Potter 2021-07-28 1135 }
15865124feed88 Phillip Potter 2021-07-28 1136 if (copy_len > 0)
15865124feed88 Phillip Potter 2021-07-28 1137 memcpy(pstat->wpa_ie, wpa_ie - 2, copy_len);
15865124feed88 Phillip Potter 2021-07-28 1138 }
15865124feed88 Phillip Potter 2021-07-28 1139 /* check if there is WMM IE & support WWM-PS */
15865124feed88 Phillip Potter 2021-07-28 1140 pstat->flags &= ~WLAN_STA_WME;
15865124feed88 Phillip Potter 2021-07-28 1141 pstat->qos_option = 0;
15865124feed88 Phillip Potter 2021-07-28 1142 pstat->qos_info = 0;
15865124feed88 Phillip Potter 2021-07-28 1143 pstat->has_legacy_ac = true;
15865124feed88 Phillip Potter 2021-07-28 1144 pstat->uapsd_vo = 0;
15865124feed88 Phillip Potter 2021-07-28 1145 pstat->uapsd_vi = 0;
15865124feed88 Phillip Potter 2021-07-28 1146 pstat->uapsd_be = 0;
15865124feed88 Phillip Potter 2021-07-28 1147 pstat->uapsd_bk = 0;
15865124feed88 Phillip Potter 2021-07-28 1148 if (pmlmepriv->qospriv.qos_option) {
15865124feed88 Phillip Potter 2021-07-28 1149 p = pframe + WLAN_HDR_A3_LEN + ie_offset; ie_len = 0;
15865124feed88 Phillip Potter 2021-07-28 1150 for (;;) {
15865124feed88 Phillip Potter 2021-07-28 1151 p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
552838fdcaef2c Michael Straube 2021-08-01 1152 if (p) {
15865124feed88 Phillip Potter 2021-07-28 1153 if (!memcmp(p + 2, WMM_IE, 6)) {
15865124feed88 Phillip Potter 2021-07-28 1154 pstat->flags |= WLAN_STA_WME;
15865124feed88 Phillip Potter 2021-07-28 1155
15865124feed88 Phillip Potter 2021-07-28 1156 pstat->qos_option = 1;
15865124feed88 Phillip Potter 2021-07-28 1157 pstat->qos_info = *(p + 8);
15865124feed88 Phillip Potter 2021-07-28 1158
15865124feed88 Phillip Potter 2021-07-28 1159 pstat->max_sp_len = (pstat->qos_info >> 5) & 0x3;
15865124feed88 Phillip Potter 2021-07-28 1160
15865124feed88 Phillip Potter 2021-07-28 1161 if ((pstat->qos_info & 0xf) != 0xf)
15865124feed88 Phillip Potter 2021-07-28 1162 pstat->has_legacy_ac = true;
15865124feed88 Phillip Potter 2021-07-28 1163 else
15865124feed88 Phillip Potter 2021-07-28 1164 pstat->has_legacy_ac = false;
15865124feed88 Phillip Potter 2021-07-28 1165
15865124feed88 Phillip Potter 2021-07-28 1166 if (pstat->qos_info & 0xf) {
15865124feed88 Phillip Potter 2021-07-28 1167 if (pstat->qos_info & BIT(0))
15865124feed88 Phillip Potter 2021-07-28 1168 pstat->uapsd_vo = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1169 else
15865124feed88 Phillip Potter 2021-07-28 1170 pstat->uapsd_vo = 0;
15865124feed88 Phillip Potter 2021-07-28 1171
15865124feed88 Phillip Potter 2021-07-28 1172 if (pstat->qos_info & BIT(1))
15865124feed88 Phillip Potter 2021-07-28 1173 pstat->uapsd_vi = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1174 else
15865124feed88 Phillip Potter 2021-07-28 1175 pstat->uapsd_vi = 0;
15865124feed88 Phillip Potter 2021-07-28 1176
15865124feed88 Phillip Potter 2021-07-28 1177 if (pstat->qos_info & BIT(2))
15865124feed88 Phillip Potter 2021-07-28 1178 pstat->uapsd_bk = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1179 else
15865124feed88 Phillip Potter 2021-07-28 1180 pstat->uapsd_bk = 0;
15865124feed88 Phillip Potter 2021-07-28 1181
15865124feed88 Phillip Potter 2021-07-28 1182 if (pstat->qos_info & BIT(3))
15865124feed88 Phillip Potter 2021-07-28 1183 pstat->uapsd_be = BIT(0) | BIT(1);
15865124feed88 Phillip Potter 2021-07-28 1184 else
15865124feed88 Phillip Potter 2021-07-28 1185 pstat->uapsd_be = 0;
15865124feed88 Phillip Potter 2021-07-28 1186 }
15865124feed88 Phillip Potter 2021-07-28 1187 break;
15865124feed88 Phillip Potter 2021-07-28 1188 }
15865124feed88 Phillip Potter 2021-07-28 1189 } else {
15865124feed88 Phillip Potter 2021-07-28 1190 break;
15865124feed88 Phillip Potter 2021-07-28 1191 }
15865124feed88 Phillip Potter 2021-07-28 1192 p = p + ie_len + 2;
15865124feed88 Phillip Potter 2021-07-28 1193 }
15865124feed88 Phillip Potter 2021-07-28 1194 }
15865124feed88 Phillip Potter 2021-07-28 1195
15865124feed88 Phillip Potter 2021-07-28 1196 /* save HT capabilities in the sta object */
15865124feed88 Phillip Potter 2021-07-28 1197 memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
15865124feed88 Phillip Potter 2021-07-28 1198 if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct ieee80211_ht_cap)) {
15865124feed88 Phillip Potter 2021-07-28 1199 pstat->flags |= WLAN_STA_HT;
15865124feed88 Phillip Potter 2021-07-28 1200
15865124feed88 Phillip Potter 2021-07-28 1201 pstat->flags |= WLAN_STA_WME;
15865124feed88 Phillip Potter 2021-07-28 1202
15865124feed88 Phillip Potter 2021-07-28 1203 memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct ieee80211_ht_cap));
15865124feed88 Phillip Potter 2021-07-28 1204 } else {
15865124feed88 Phillip Potter 2021-07-28 1205 pstat->flags &= ~WLAN_STA_HT;
15865124feed88 Phillip Potter 2021-07-28 1206 }
15865124feed88 Phillip Potter 2021-07-28 1207 if ((!pmlmepriv->htpriv.ht_option) && (pstat->flags & WLAN_STA_HT)) {
15865124feed88 Phillip Potter 2021-07-28 1208 status = _STATS_FAILURE_;
15865124feed88 Phillip Potter 2021-07-28 1209 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1210 }
15865124feed88 Phillip Potter 2021-07-28 1211
15865124feed88 Phillip Potter 2021-07-28 1212 pstat->flags |= WLAN_STA_NONERP;
15865124feed88 Phillip Potter 2021-07-28 1213 for (i = 0; i < pstat->bssratelen; i++) {
15865124feed88 Phillip Potter 2021-07-28 1214 if ((pstat->bssrateset[i] & 0x7f) > 22) {
15865124feed88 Phillip Potter 2021-07-28 1215 pstat->flags &= ~WLAN_STA_NONERP;
15865124feed88 Phillip Potter 2021-07-28 1216 break;
15865124feed88 Phillip Potter 2021-07-28 1217 }
15865124feed88 Phillip Potter 2021-07-28 1218 }
15865124feed88 Phillip Potter 2021-07-28 1219
15865124feed88 Phillip Potter 2021-07-28 1220 if (pstat->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
15865124feed88 Phillip Potter 2021-07-28 1221 pstat->flags |= WLAN_STA_SHORT_PREAMBLE;
15865124feed88 Phillip Potter 2021-07-28 1222 else
15865124feed88 Phillip Potter 2021-07-28 1223 pstat->flags &= ~WLAN_STA_SHORT_PREAMBLE;
15865124feed88 Phillip Potter 2021-07-28 1224
15865124feed88 Phillip Potter 2021-07-28 1225 if (status != _STATS_SUCCESSFUL_)
15865124feed88 Phillip Potter 2021-07-28 1226 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1227
15865124feed88 Phillip Potter 2021-07-28 1228 pstat->is_p2p_device = false;
15865124feed88 Phillip Potter 2021-07-28 1229 if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
15865124feed88 Phillip Potter 2021-07-28 1230 p2pie = rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, pkt_len - WLAN_HDR_A3_LEN - ie_offset, NULL, &p2pielen);
15865124feed88 Phillip Potter 2021-07-28 1231 if (p2pie) {
15865124feed88 Phillip Potter 2021-07-28 1232 pstat->is_p2p_device = true;
15865124feed88 Phillip Potter 2021-07-28 1233 p2p_status_code = (u8)process_assoc_req_p2p_ie(pwdinfo, pframe, pkt_len, pstat);
15865124feed88 Phillip Potter 2021-07-28 1234 if (p2p_status_code > 0) {
15865124feed88 Phillip Potter 2021-07-28 1235 pstat->p2p_status_code = p2p_status_code;
15865124feed88 Phillip Potter 2021-07-28 1236 status = _STATS_CAP_FAIL_;
15865124feed88 Phillip Potter 2021-07-28 1237 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1238 }
15865124feed88 Phillip Potter 2021-07-28 1239 }
15865124feed88 Phillip Potter 2021-07-28 1240 }
15865124feed88 Phillip Potter 2021-07-28 1241 pstat->p2p_status_code = p2p_status_code;
15865124feed88 Phillip Potter 2021-07-28 1242
15865124feed88 Phillip Potter 2021-07-28 1243 /* TODO: identify_proprietary_vendor_ie(); */
15865124feed88 Phillip Potter 2021-07-28 1244 /* Realtek proprietary IE */
15865124feed88 Phillip Potter 2021-07-28 1245 /* identify if this is Broadcom sta */
15865124feed88 Phillip Potter 2021-07-28 1246 /* identify if this is ralink sta */
15865124feed88 Phillip Potter 2021-07-28 1247 /* Customer proprietary IE */
15865124feed88 Phillip Potter 2021-07-28 1248
15865124feed88 Phillip Potter 2021-07-28 1249 /* get a unique AID */
8b7efc8d3123ad Phillip Potter 2022-01-24 1250 if (pstat->aid == 0) {
15865124feed88 Phillip Potter 2021-07-28 1251 for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
552838fdcaef2c Michael Straube 2021-08-01 1252 if (!pstapriv->sta_aid[pstat->aid - 1])
15865124feed88 Phillip Potter 2021-07-28 1253 break;
15865124feed88 Phillip Potter 2021-07-28 1254
15865124feed88 Phillip Potter 2021-07-28 1255 /* if (pstat->aid > NUM_STA) { */
15865124feed88 Phillip Potter 2021-07-28 1256 if (pstat->aid > pstapriv->max_num_sta) {
15865124feed88 Phillip Potter 2021-07-28 1257 pstat->aid = 0;
15865124feed88 Phillip Potter 2021-07-28 1258
15865124feed88 Phillip Potter 2021-07-28 1259 status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
15865124feed88 Phillip Potter 2021-07-28 1260
15865124feed88 Phillip Potter 2021-07-28 1261 goto OnAssocReqFail;
15865124feed88 Phillip Potter 2021-07-28 1262 } else {
15865124feed88 Phillip Potter 2021-07-28 1263 pstapriv->sta_aid[pstat->aid - 1] = pstat;
15865124feed88 Phillip Potter 2021-07-28 1264 }
15865124feed88 Phillip Potter 2021-07-28 1265 }
15865124feed88 Phillip Potter 2021-07-28 1266
15865124feed88 Phillip Potter 2021-07-28 1267 pstat->state &= (~WIFI_FW_ASSOC_STATE);
15865124feed88 Phillip Potter 2021-07-28 1268 pstat->state |= WIFI_FW_ASSOC_SUCCESS;
15865124feed88 Phillip Potter 2021-07-28 1269
15865124feed88 Phillip Potter 2021-07-28 1270 spin_lock_bh(&pstapriv->auth_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1271 if (!list_empty(&pstat->auth_list)) {
15865124feed88 Phillip Potter 2021-07-28 1272 list_del_init(&pstat->auth_list);
15865124feed88 Phillip Potter 2021-07-28 1273 pstapriv->auth_list_cnt--;
15865124feed88 Phillip Potter 2021-07-28 1274 }
15865124feed88 Phillip Potter 2021-07-28 1275 spin_unlock_bh(&pstapriv->auth_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1276
15865124feed88 Phillip Potter 2021-07-28 1277 spin_lock_bh(&pstapriv->asoc_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1278 if (list_empty(&pstat->asoc_list)) {
15865124feed88 Phillip Potter 2021-07-28 1279 pstat->expire_to = pstapriv->expire_to;
15865124feed88 Phillip Potter 2021-07-28 1280 list_add_tail(&pstat->asoc_list, &pstapriv->asoc_list);
15865124feed88 Phillip Potter 2021-07-28 1281 pstapriv->asoc_list_cnt++;
15865124feed88 Phillip Potter 2021-07-28 1282 }
15865124feed88 Phillip Potter 2021-07-28 1283 spin_unlock_bh(&pstapriv->asoc_list_lock);
15865124feed88 Phillip Potter 2021-07-28 1284
15865124feed88 Phillip Potter 2021-07-28 1285 /* now the station is qualified to join our BSS... */
15865124feed88 Phillip Potter 2021-07-28 1286 if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) {
15865124feed88 Phillip Potter 2021-07-28 1287 /* 1 bss_cap_update & sta_info_update */
15865124feed88 Phillip Potter 2021-07-28 1288 bss_cap_update_on_sta_join(padapter, pstat);
15865124feed88 Phillip Potter 2021-07-28 1289 sta_info_update(padapter, pstat);
15865124feed88 Phillip Potter 2021-07-28 1290
15865124feed88 Phillip Potter 2021-07-28 1291 /* issue assoc rsp before notify station join event. */
15865124feed88 Phillip Potter 2021-07-28 1292 if (frame_type == WIFI_ASSOCREQ)
15865124feed88 Phillip Potter 2021-07-28 1293 issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1294 else
15865124feed88 Phillip Potter 2021-07-28 1295 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1296
15865124feed88 Phillip Potter 2021-07-28 1297 /* 2 - report to upper layer */
15865124feed88 Phillip Potter 2021-07-28 1298 rtw_indicate_sta_assoc_event(padapter, pstat);
15865124feed88 Phillip Potter 2021-07-28 1299
15865124feed88 Phillip Potter 2021-07-28 1300 /* 3-(1) report sta add event */
15865124feed88 Phillip Potter 2021-07-28 1301 report_add_sta_event(padapter, pstat->hwaddr, pstat->aid);
15865124feed88 Phillip Potter 2021-07-28 1302 }
15865124feed88 Phillip Potter 2021-07-28 1303
15865124feed88 Phillip Potter 2021-07-28 1304 return _SUCCESS;
15865124feed88 Phillip Potter 2021-07-28 1305
15865124feed88 Phillip Potter 2021-07-28 1306 asoc_class2_error:
15865124feed88 Phillip Potter 2021-07-28 1307
15865124feed88 Phillip Potter 2021-07-28 1308 issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status);
15865124feed88 Phillip Potter 2021-07-28 1309
15865124feed88 Phillip Potter 2021-07-28 1310 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 1311
15865124feed88 Phillip Potter 2021-07-28 1312 OnAssocReqFail:
15865124feed88 Phillip Potter 2021-07-28 1313
15865124feed88 Phillip Potter 2021-07-28 1314 pstat->aid = 0;
15865124feed88 Phillip Potter 2021-07-28 1315 if (frame_type == WIFI_ASSOCREQ)
15865124feed88 Phillip Potter 2021-07-28 1316 issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1317 else
15865124feed88 Phillip Potter 2021-07-28 1318 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
15865124feed88 Phillip Potter 2021-07-28 1319
15865124feed88 Phillip Potter 2021-07-28 1320 return _FAIL;
15865124feed88 Phillip Potter 2021-07-28 1321 }
15865124feed88 Phillip Potter 2021-07-28 1322
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks