drivers/net/bareudp.c:288:12: sparse: sparse: incorrect type in assignment (different address spaces)
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 735d2f48cadaa9a87e7c7601667878de70c771c5 commit: bc773b15eb19ae3e27dd3a3377f2fe006ce5f382 [3495/3796] bareudp: Store struct sock in struct bareudp_dev. config: hexagon-randconfig-r131-20260506 (https://download.01.org/0day-ci/archive/20260506/[email protected]/config) compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3) sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260506/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/net/bareudp.c:288:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sock *sk @@ got struct sock [noderef] __rcu *sk @@
drivers/net/bareudp.c:288:12: sparse: expected struct sock *sk
drivers/net/bareudp.c:288:12: sparse: got struct sock [noderef] __rcu *sk
drivers/net/bareudp.c:623:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] port @@ got unsigned short @@
drivers/net/bareudp.c:623:20: sparse: expected restricted __be16 [usertype] port
drivers/net/bareudp.c:623:20: sparse: got unsigned short
drivers/net/bareudp.c:624:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] ethertype @@ got unsigned short @@
drivers/net/bareudp.c:624:25: sparse: expected restricted __be16 [usertype] ethertype
drivers/net/bareudp.c:624:25: sparse: got unsigned short
vim +288 drivers/net/bareudp.c
283
284 static void bareudp_sock_release(struct bareudp_dev *bareudp)
285 {
286 struct sock *sk;
287
> 288 sk = bareudp->sk;
289 rcu_assign_pointer(bareudp->sk, NULL);
290 synchronize_net();
291 udp_tunnel_sock_release(sk);
292 }
293
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 25 lines · kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 735d2f48cadaa9a87e7c7601667878de70c771c5 commit: bc773b15eb19ae3e27dd3a3377f2fe006ce5f382 [3495/3796] bareudp: Store struct sock in struct bareudp_dev. config: hexagon-randconfig-r131-20260506 (https://download.01.org/0day-ci/archive/20260506/[email protected]/config) compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3) sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260506/[email protected]/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/sparse warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/net/bareudp.c:288:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sock *sk @@ got struct sock [noderef]__rcu*sk @@
drivers/net/bareudp.c:288:12: sparse: expected struct sock *sk
drivers/net/bareudp.c:288:12: sparse: got struct sock [noderef]__rcu*sk
drivers/net/bareudp.c:623:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted__be16[usertype] port @@ got unsigned short @@
drivers/net/bareudp.c:623:20: sparse: expected restricted__be16[usertype] port
drivers/net/bareudp.c:623:20: sparse: got unsigned short
drivers/net/bareudp.c:624:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted__be16[usertype] ethertype @@ got unsigned short @@
drivers/net/bareudp.c:624:25: sparse: expected restricted__be16[usertype] ethertype
drivers/net/bareudp.c:624:25: sparse: got unsigned short
Quoted 8 lines
vim +288
drivers/net/bareudp.c283 284 static void bareudp_sock_release(struct bareudp_dev *bareudp) 285 { 286 struct sock *sk; 287Quoted 1 line
288 sk =
bareudp->sk;
Will use rcu_dereference_protected() here.
Thanks
Quoted 9 lines
289 rcu_assign_pointer(bareudp->sk, NULL); 290 synchronize_net(); 291 udp_tunnel_sock_release(sk);292 }
293--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki