fs/ext4/orphan.c:78:18: sparse: sparse: cast from restricted __le32
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a90af8f15bdc9449ee2d24e1d73fa3f7e8633f81
commit: 4a79a98c7b19dd3d4cfe9200fbc384ba9119e039 ext4: Improve scalability of ext4 orphan file handling
date: 3 months ago
config: sparc64-randconfig-s031-20211116 (attached as .config)
compiler: sparc64-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://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 4a79a98c7b19dd3d4cfe9200fbc384ba9119e039
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc64 SHELL=/bin/bash drivers/usb/host/ fs/ext4/ lib/
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 >>)
>> fs/ext4/orphan.c:78:18: sparse: sparse: cast from restricted __le32
>> fs/ext4/orphan.c:78:18: sparse: sparse: cast from restricted __le32
>> fs/ext4/orphan.c:78:18: sparse: sparse: cast to restricted __le32
vim +78 fs/ext4/orphan.c
10
11 static int ext4_orphan_file_add(handle_t *handle, struct inode *inode)
12 {
13 int i, j, start;
14 struct ext4_orphan_info *oi = &EXT4_SB(inode->i_sb)->s_orphan_info;
15 int ret = 0;
16 bool found = false;
17 __le32 *bdata;
18 int inodes_per_ob = ext4_inodes_per_orphan_block(inode->i_sb);
19 int looped = 0;
20
21 /*
22 * Find block with free orphan entry. Use CPU number for a naive hash
23 * for a search start in the orphan file
24 */
25 start = raw_smp_processor_id()*13 % oi->of_blocks;
26 i = start;
27 do {
28 if (atomic_dec_if_positive(&oi->of_binfo[i].ob_free_entries)
29 >= 0) {
30 found = true;
31 break;
32 }
33 if (++i >= oi->of_blocks)
34 i = 0;
35 } while (i != start);
36
37 if (!found) {
38 /*
39 * For now we don't grow or shrink orphan file. We just use
40 * whatever was allocated at mke2fs time. The additional
41 * credits we would have to reserve for each orphan inode
42 * operation just don't seem worth it.
43 */
44 return -ENOSPC;
45 }
46
47 ret = ext4_journal_get_write_access(handle, inode->i_sb,
48 oi->of_binfo[i].ob_bh, EXT4_JTR_ORPHAN_FILE);
49 if (ret) {
50 atomic_inc(&oi->of_binfo[i].ob_free_entries);
51 return ret;
52 }
53
54 bdata = (__le32 *)(oi->of_binfo[i].ob_bh->b_data);
55 /* Find empty slot in a block */
56 j = 0;
57 do {
58 if (looped) {
59 /*
60 * Did we walk through the block several times without
61 * finding free entry? It is theoretically possible
62 * if entries get constantly allocated and freed or
63 * if the block is corrupted. Avoid indefinite looping
64 * and bail. We'll use orphan list instead.
65 */
66 if (looped > 3) {
67 atomic_inc(&oi->of_binfo[i].ob_free_entries);
68 return -ENOSPC;
69 }
70 cond_resched();
71 }
72 while (bdata[j]) {
73 if (++j >= inodes_per_ob) {
74 j = 0;
75 looped++;
76 }
77 }
> 78 } while (cmpxchg(&bdata[j], (__le32)0, cpu_to_le32(inode->i_ino)) !=
79 (__le32)0);
80
81 EXT4_I(inode)->i_orphan_idx = i * inodes_per_ob + j;
82 ext4_set_inode_state(inode, EXT4_STATE_ORPHAN_FILE);
83
84 return ext4_handle_dirty_metadata(handle, NULL, oi->of_binfo[i].ob_bh);
85 }
86
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH v5 2/2] bluetooth: Add MGMT Adv Monitor Device Found/Lost events
by kernel test robot
Hi Manish,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20211118]
[cannot apply to bluetooth/master v5.16-rc1]
[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/Manish-Mandlik/bluetooth-Handle-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: m68k-randconfig-r016-20211121 (attached as .config)
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://github.com/0day-ci/linux/commit/9d49f17ae7d7c8f17e51a8d1e0fece8f7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Manish-Mandlik/bluetooth-Handle-MSFT-Monitor-Device-Event/20211121-004127
git checkout 9d49f17ae7d7c8f17e51a8d1e0fece8f76cc2dd6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
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 >>):
>> net/bluetooth/mgmt.c:9542:6: warning: no previous prototype for 'mgmt_adv_monitor_device_found' [-Wmissing-prototypes]
9542 | void mgmt_adv_monitor_device_found(struct hci_dev *hdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/mgmt_adv_monitor_device_found +9542 net/bluetooth/mgmt.c
9541
> 9542 void mgmt_adv_monitor_device_found(struct hci_dev *hdev,
9543 struct mgmt_ev_device_found *ev,
9544 size_t ev_size, bool discovering)
9545 {
9546 char buf[518];
9547 struct mgmt_ev_adv_monitor_device_found *advmon_ev = (void *)buf;
9548 size_t advmon_ev_size;
9549 struct monitored_device *dev, *tmp;
9550 bool matched = false;
9551 bool notified = false;
9552
9553 /* Make sure that the buffer is big enough */
9554 advmon_ev_size = ev_size + (sizeof(*advmon_ev) - sizeof(*ev));
9555 if (advmon_ev_size > sizeof(buf))
9556 return;
9557
9558 /* ADV_MONITOR_DEVICE_FOUND is similar to DEVICE_FOUND event except
9559 * that it also has 'monitor_handle'. Make a copy of DEVICE_FOUND and
9560 * store monitor_handle of the matched monitor.
9561 */
9562 memcpy(&advmon_ev->addr, ev, ev_size);
9563
9564 hdev->advmon_pend_notify = false;
9565
9566 list_for_each_entry_safe(dev, tmp, &hdev->monitored_devices, list) {
9567 if (!bacmp(&dev->bdaddr, &advmon_ev->addr.bdaddr)) {
9568 matched = true;
9569
9570 if (!dev->notified) {
9571 advmon_ev->monitor_handle =
9572 cpu_to_le16(dev->handle);
9573
9574 mgmt_event(MGMT_EV_ADV_MONITOR_DEVICE_FOUND,
9575 hdev, advmon_ev, advmon_ev_size,
9576 NULL);
9577
9578 notified = true;
9579 dev->notified = true;
9580 }
9581 }
9582
9583 if (!dev->notified)
9584 hdev->advmon_pend_notify = true;
9585 }
9586
9587 if (!discovering &&
9588 ((matched && !notified) || !msft_monitor_supported(hdev))) {
9589 /* Handle 0 indicates that we are not active scanning and this
9590 * is a subsequent advertisement report for an already matched
9591 * Advertisement Monitor or the controller offloading support
9592 * is not available.
9593 */
9594 advmon_ev->monitor_handle = 0;
9595
9596 mgmt_event(MGMT_EV_ADV_MONITOR_DEVICE_FOUND, hdev, advmon_ev,
9597 advmon_ev_size, NULL);
9598 }
9599 }
9600
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH v5 1/2] bluetooth: Handle MSFT Monitor Device Event
by kernel test robot
Hi Manish,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20211118]
[cannot apply to bluetooth/master v5.16-rc1]
[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/Manish-Mandlik/bluetooth-Handle-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: m68k-randconfig-r016-20211121 (attached as .config)
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://github.com/0day-ci/linux/commit/7965690cffd0ffe53b33e1cebc2d03883...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Manish-Mandlik/bluetooth-Handle-MSFT-Monitor-Device-Event/20211121-004127
git checkout 7965690cffd0ffe53b33e1cebc2d0388322cc42e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
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 net/bluetooth/msft.c:6:
net/bluetooth/msft.c: In function 'msft_monitor_device_evt':
>> include/net/bluetooth/bluetooth.h:212:16: warning: format '%x' expects a matching 'unsigned int' argument [-Wformat=]
212 | BT_ERR("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
| ^~~~~~
include/net/bluetooth/bluetooth.h:199:40: note: in definition of macro 'BT_ERR'
199 | #define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__)
| ^~~
net/bluetooth/msft.c:692:17: note: in expansion of macro 'bt_dev_err'
692 | bt_dev_err(hdev,
| ^~~~~~~~~~
vim +212 include/net/bluetooth/bluetooth.h
^1da177e4c3f41 Linus Torvalds 2005-04-16 206
6f558b70fb39fc Loic Poulain 2015-08-30 207 #define bt_dev_info(hdev, fmt, ...) \
6f558b70fb39fc Loic Poulain 2015-08-30 208 BT_INFO("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
594b31ea7dc610 Frederic Danis 2015-09-23 209 #define bt_dev_warn(hdev, fmt, ...) \
594b31ea7dc610 Frederic Danis 2015-09-23 210 BT_WARN("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
6f558b70fb39fc Loic Poulain 2015-08-30 211 #define bt_dev_err(hdev, fmt, ...) \
6f558b70fb39fc Loic Poulain 2015-08-30 @212 BT_ERR("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
6f558b70fb39fc Loic Poulain 2015-08-30 213 #define bt_dev_dbg(hdev, fmt, ...) \
6f558b70fb39fc Loic Poulain 2015-08-30 214 BT_DBG("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
6f558b70fb39fc Loic Poulain 2015-08-30 215
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[RFC PATCH] xfs: fix duplicated inclusion
by kernel test robot
Generated by: scripts/checkincludes.pl
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
xfs_attr.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 2bdd1517e4178..0178a416377bc 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -18,7 +18,6 @@
#include "xfs_trans.h"
#include "xfs_bmap.h"
#include "xfs_bmap_btree.h"
-#include "xfs_attr.h"
#include "xfs_attr_leaf.h"
#include "xfs_attr_remote.h"
#include "xfs_quota.h"
10 months
[mark:arm64/preempt-dynamic-static-key 6/6] kernel/sched/core.c:6435:43: warning: no previous prototype for function 'preempt_schedule'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/preempt-dynamic-static-key
head: 47c5f8b3abb64dcd6ac43521d24ca9e7d7891dcc
commit: 47c5f8b3abb64dcd6ac43521d24ca9e7d7891dcc [6/6] arm64: support PREEMPT_DYNAMIC
config: arm64-buildonly-randconfig-r004-20211118 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c46becf500df2a7fb4b4fce16178a036c344315a)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id...
git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
git fetch --no-tags mark arm64/preempt-dynamic-static-key
git checkout 47c5f8b3abb64dcd6ac43521d24ca9e7d7891dcc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
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 >>):
kernel/sched/core.c:3439:6: warning: no previous prototype for function 'sched_set_stop_task' [-Wmissing-prototypes]
void sched_set_stop_task(int cpu, struct task_struct *stop)
^
kernel/sched/core.c:3439:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void sched_set_stop_task(int cpu, struct task_struct *stop)
^
static
kernel/sched/core.c:6359:35: warning: no previous prototype for function 'schedule_user' [-Wmissing-prototypes]
asmlinkage __visible void __sched schedule_user(void)
^
kernel/sched/core.c:6359:22: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage __visible void __sched schedule_user(void)
^
static
>> kernel/sched/core.c:6435:43: warning: no previous prototype for function 'preempt_schedule' [-Wmissing-prototypes]
asmlinkage __visible void __sched notrace preempt_schedule(void)
^
kernel/sched/core.c:6435:22: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage __visible void __sched notrace preempt_schedule(void)
^
static
>> kernel/sched/core.c:6483:43: warning: no previous prototype for function 'preempt_schedule_notrace' [-Wmissing-prototypes]
asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
^
kernel/sched/core.c:6483:22: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
^
static
4 warnings generated.
vim +/preempt_schedule +6435 kernel/sched/core.c
a18b5d01819235 kernel/sched/core.c Frederic Weisbecker 2015-01-22 6429
c1a280b68d4e6b kernel/sched/core.c Thomas Gleixner 2019-07-26 6430 #ifdef CONFIG_PREEMPTION
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6431 /*
a49b4f4012ef23 kernel/sched/core.c Valentin Schneider 2019-09-23 6432 * This is the entry point to schedule() from in-kernel preemption
a49b4f4012ef23 kernel/sched/core.c Valentin Schneider 2019-09-23 6433 * off of preempt_enable.
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6434 */
722a9f9299ca72 kernel/sched/core.c Andi Kleen 2014-05-02 @6435 asmlinkage __visible void __sched notrace preempt_schedule(void)
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6436 {
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6437 /*
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6438 * If there is a non-zero preempt_count or interrupts are disabled,
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6439 * we do not want to preempt the current task. Just return..
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6440 */
fbb00b568bc930 kernel/sched/core.c Frederic Weisbecker 2013-06-19 6441 if (likely(!preemptible()))
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6442 return;
a18b5d01819235 kernel/sched/core.c Frederic Weisbecker 2015-01-22 6443 preempt_schedule_common();
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6444 }
376e242429bf85 kernel/sched/core.c Masami Hiramatsu 2014-04-17 6445 NOKPROBE_SYMBOL(preempt_schedule);
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 6446 EXPORT_SYMBOL(preempt_schedule);
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6447
2c9a98d3bc8087 kernel/sched/core.c Peter Zijlstra (Intel 2021-01-18 6448) #ifdef CONFIG_PREEMPT_DYNAMIC
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6449 #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL)
67bb8fb8cf8e8a kernel/sched/core.c Mark Rutland 2021-11-09 6450 #ifndef preempt_schedule_dynamic_enabled
67bb8fb8cf8e8a kernel/sched/core.c Mark Rutland 2021-11-09 6451 #define preempt_schedule_dynamic_enabled preempt_schedule
67bb8fb8cf8e8a kernel/sched/core.c Mark Rutland 2021-11-09 6452 #define preempt_schedule_dynamic_disabled NULL
67bb8fb8cf8e8a kernel/sched/core.c Mark Rutland 2021-11-09 6453 #endif
67bb8fb8cf8e8a kernel/sched/core.c Mark Rutland 2021-11-09 6454 DEFINE_STATIC_CALL(preempt_schedule, preempt_schedule_dynamic_enabled);
ef72661e28c64a kernel/sched/core.c Peter Zijlstra 2021-01-25 6455 EXPORT_STATIC_CALL_TRAMP(preempt_schedule);
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6456 #elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY)
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6457 static DEFINE_STATIC_KEY_TRUE(sk_dynamic_preempt_schedule);
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6458 void __sched notrace dynamic_preempt_schedule(void)
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6459 {
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6460 if (!static_branch_unlikely(&sk_dynamic_preempt_schedule))
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6461 return;
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6462 preempt_schedule();
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6463 }
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6464 NOKPROBE_SYMBOL(dynamic_preempt_schedule);
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6465 EXPORT_SYMBOL(dynamic_preempt_schedule);
19f12e212caad8 kernel/sched/core.c Mark Rutland 2021-11-09 6466 #endif
2c9a98d3bc8087 kernel/sched/core.c Peter Zijlstra (Intel 2021-01-18 6467) #endif
2c9a98d3bc8087 kernel/sched/core.c Peter Zijlstra (Intel 2021-01-18 6468)
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6469 /**
4eaca0a887eaee kernel/sched/core.c Frederic Weisbecker 2015-06-04 6470 * preempt_schedule_notrace - preempt_schedule called by tracing
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6471 *
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6472 * The tracing infrastructure uses preempt_enable_notrace to prevent
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6473 * recursion and tracing preempt enabling caused by the tracing
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6474 * infrastructure itself. But as tracing can happen in areas coming
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6475 * from userspace or just about to enter userspace, a preempt enable
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6476 * can occur before user_exit() is called. This will cause the scheduler
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6477 * to be called when the system is still in usermode.
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6478 *
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6479 * To prevent this, the preempt_enable_notrace will use this function
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6480 * instead of preempt_schedule() to exit user context if needed before
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6481 * calling the scheduler.
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6482 */
4eaca0a887eaee kernel/sched/core.c Frederic Weisbecker 2015-06-04 @6483 asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6484 {
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6485 enum ctx_state prev_ctx;
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6486
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6487 if (likely(!preemptible()))
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6488 return;
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6489
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6490 do {
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6491 /*
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6492 * Because the function tracer can trace preempt_count_sub()
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6493 * and it also uses preempt_enable/disable_notrace(), if
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6494 * NEED_RESCHED is set, the preempt_enable_notrace() called
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6495 * by the function tracer will call this function again and
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6496 * cause infinite recursion.
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6497 *
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6498 * Preemption must be disabled here before the function
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6499 * tracer can trace. Break up preempt_disable() into two
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6500 * calls. One to disable preemption without fear of being
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6501 * traced. The other to still record the preemption latency,
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6502 * which can also be traced by the function tracer.
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6503 */
3d8f74dd4ca1da kernel/sched/core.c Peter Zijlstra 2015-09-28 6504 preempt_disable_notrace();
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6505 preempt_latency_start(1);
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6506 /*
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6507 * Needs preempt disabled in case user_exit() is traced
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6508 * and the tracer calls preempt_enable_notrace() causing
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6509 * an infinite recursion.
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6510 */
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6511 prev_ctx = exception_enter();
b4bfa3fcfe3b82 kernel/sched/core.c Thomas Gleixner 2021-08-15 6512 __schedule(SM_PREEMPT);
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6513 exception_exit(prev_ctx);
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6514
47252cfbac0364 kernel/sched/core.c Steven Rostedt 2016-03-21 6515 preempt_latency_stop(1);
3d8f74dd4ca1da kernel/sched/core.c Peter Zijlstra 2015-09-28 6516 preempt_enable_no_resched_notrace();
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6517 } while (need_resched());
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6518 }
4eaca0a887eaee kernel/sched/core.c Frederic Weisbecker 2015-06-04 6519 EXPORT_SYMBOL_GPL(preempt_schedule_notrace);
009f60e2763568 kernel/sched/core.c Oleg Nesterov 2014-10-05 6520
:::::: The code at line 6435 was first introduced by commit
:::::: 722a9f9299ca720a3f14660e7c0dce7b76a9cb42 asmlinkage: Add explicit __visible to drivers/*, lib/*, kernel/*
:::::: TO: Andi Kleen <ak(a)linux.intel.com>
:::::: CC: H. Peter Anvin <hpa(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH v2 10/20] linux/container_of.h: Remove unnecessary cast
by kernel test robot
Hi Alejandro,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.16-rc1 next-20211118]
[cannot apply to drm-intel/for-linux-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/Alejandro-Colomar/linux-stddef-h...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: csky-randconfig-s031-20211118 (attached as .config)
compiler: csky-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/ed03be33a3de1708b5a06ea31cc6cd857...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alejandro-Colomar/linux-stddef-h-linux-offsetof-h-Split-offsetof-into-a-separate-header/20211120-220144
git checkout ed03be33a3de1708b5a06ea31cc6cd8573890649
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=csky
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 >>)
drivers/char/ipmi/ipmi_msghandler.c:200:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/char/ipmi/ipmi_msghandler.c:200:17: sparse: struct ipmi_user [noderef] __rcu *
drivers/char/ipmi/ipmi_msghandler.c:200:17: sparse: struct ipmi_user *
drivers/char/ipmi/ipmi_msghandler.c:1251:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/char/ipmi/ipmi_msghandler.c:1251:9: sparse: struct ipmi_user [noderef] __rcu *
drivers/char/ipmi/ipmi_msghandler.c:1251:9: sparse: struct ipmi_user *
drivers/char/ipmi/ipmi_msghandler.c:1320:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/char/ipmi/ipmi_msghandler.c:1320:9: sparse: struct ipmi_user [noderef] __rcu *
drivers/char/ipmi/ipmi_msghandler.c:1320:9: sparse: struct ipmi_user *
>> drivers/char/ipmi/ipmi_msghandler.c:3701:25: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const *__mptr @@ got struct list_head [noderef] __rcu * @@
drivers/char/ipmi/ipmi_msghandler.c:203:9: sparse: sparse: context imbalance in 'acquire_ipmi_user' - different lock contexts for basic block
drivers/char/ipmi/ipmi_msghandler.c: note: in included file (through include/linux/notifier.h, include/linux/memory_hotplug.h, include/linux/mmzone.h, ...):
include/linux/srcu.h:188:9: sparse: sparse: context imbalance in 'release_ipmi_user' - unexpected unlock
drivers/char/ipmi/ipmi_msghandler.c:942:9: sparse: sparse: context imbalance in 'deliver_response' - different lock contexts for basic block
drivers/char/ipmi/ipmi_msghandler.c:1303:13: sparse: sparse: context imbalance in '_ipmi_destroy_user' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1385:5: sparse: sparse: context imbalance in 'ipmi_get_version' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1407:5: sparse: sparse: context imbalance in 'ipmi_set_my_address' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1429:5: sparse: sparse: context imbalance in 'ipmi_get_my_address' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1451:5: sparse: sparse: context imbalance in 'ipmi_set_my_LUN' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1473:5: sparse: sparse: context imbalance in 'ipmi_get_my_LUN' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1495:5: sparse: sparse: context imbalance in 'ipmi_get_maintenance_mode' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1520:5: sparse: sparse: context imbalance in 'ipmi_set_maintenance_mode' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1562:5: sparse: sparse: context imbalance in 'ipmi_set_gets_events' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1659:5: sparse: sparse: context imbalance in 'ipmi_register_for_cmd' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1704:5: sparse: sparse: context imbalance in 'ipmi_unregister_for_cmd' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:1869:39: sparse: sparse: context imbalance in 'smi_send' - unexpected unlock
drivers/char/ipmi/ipmi_msghandler.c:2372:5: sparse: sparse: context imbalance in 'ipmi_request_settime' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:2411:5: sparse: sparse: context imbalance in 'ipmi_request_supply_msgs' - wrong count at exit
drivers/char/ipmi/ipmi_msghandler.c:4687:39: sparse: sparse: context imbalance in 'handle_new_recv_msgs' - unexpected unlock
drivers/char/ipmi/ipmi_msghandler.c:4744:9: sparse: sparse: context imbalance in 'smi_recv_tasklet' - different lock contexts for basic block
drivers/char/ipmi/ipmi_msghandler.c:4779:39: sparse: sparse: context imbalance in 'ipmi_smi_msg_received' - unexpected unlock
drivers/char/ipmi/ipmi_msghandler.c:4875:39: sparse: sparse: context imbalance in 'check_msg_timeout' - unexpected unlock
vim +3701 drivers/char/ipmi/ipmi_msghandler.c
b2c03941b50944 Corey Minyard 2006-12-06 3674
6a0d23ed338ed7 Corey Minyard 2018-04-11 3675 void ipmi_unregister_smi(struct ipmi_smi *intf)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3676 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3677 struct ipmi_smi_watcher *w;
e86ee2d44b4405 Corey Minyard 2018-04-05 3678 int intf_num = intf->intf_num, index;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3679
bca0324d09e413 Corey Minyard 2006-12-06 3680 mutex_lock(&ipmi_interfaces_mutex);
b2c03941b50944 Corey Minyard 2006-12-06 3681 intf->intf_num = -1;
7ea0ed2b5be817 Corey Minyard 2014-11-06 3682 intf->in_shutdown = true;
bca0324d09e413 Corey Minyard 2006-12-06 3683 list_del_rcu(&intf->link);
bca0324d09e413 Corey Minyard 2006-12-06 3684 mutex_unlock(&ipmi_interfaces_mutex);
e86ee2d44b4405 Corey Minyard 2018-04-05 3685 synchronize_srcu(&ipmi_interfaces_srcu);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3686
e86ee2d44b4405 Corey Minyard 2018-04-05 3687 /* At this point no users can be added to the interface. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3688
c70d749986f6f1 Corey Minyard 2008-04-29 3689 /*
c70d749986f6f1 Corey Minyard 2008-04-29 3690 * Call all the watcher interfaces to tell them that
e86ee2d44b4405 Corey Minyard 2018-04-05 3691 * an interface is going away.
c70d749986f6f1 Corey Minyard 2008-04-29 3692 */
e86ee2d44b4405 Corey Minyard 2018-04-05 3693 mutex_lock(&smi_watchers_mutex);
393d2cc354d150 Corey Minyard 2005-11-07 3694 list_for_each_entry(w, &smi_watchers, link)
b2c03941b50944 Corey Minyard 2006-12-06 3695 w->smi_gone(intf_num);
b2c03941b50944 Corey Minyard 2006-12-06 3696 mutex_unlock(&smi_watchers_mutex);
393d2cc354d150 Corey Minyard 2005-11-07 3697
e86ee2d44b4405 Corey Minyard 2018-04-05 3698 index = srcu_read_lock(&intf->users_srcu);
e86ee2d44b4405 Corey Minyard 2018-04-05 3699 while (!list_empty(&intf->users)) {
e86ee2d44b4405 Corey Minyard 2018-04-05 3700 struct ipmi_user *user =
e86ee2d44b4405 Corey Minyard 2018-04-05 @3701 container_of(list_next_rcu(&intf->users),
e86ee2d44b4405 Corey Minyard 2018-04-05 3702 struct ipmi_user, link);
e86ee2d44b4405 Corey Minyard 2018-04-05 3703
e86ee2d44b4405 Corey Minyard 2018-04-05 3704 _ipmi_destroy_user(user);
e86ee2d44b4405 Corey Minyard 2018-04-05 3705 }
e86ee2d44b4405 Corey Minyard 2018-04-05 3706 srcu_read_unlock(&intf->users_srcu, index);
e86ee2d44b4405 Corey Minyard 2018-04-05 3707
2512e40e48d21d Corey Minyard 2018-08-22 3708 if (intf->handlers->shutdown)
e86ee2d44b4405 Corey Minyard 2018-04-05 3709 intf->handlers->shutdown(intf->send_info);
e86ee2d44b4405 Corey Minyard 2018-04-05 3710
e86ee2d44b4405 Corey Minyard 2018-04-05 3711 cleanup_smi_msgs(intf);
e86ee2d44b4405 Corey Minyard 2018-04-05 3712
e86ee2d44b4405 Corey Minyard 2018-04-05 3713 ipmi_bmc_unregister(intf);
e86ee2d44b4405 Corey Minyard 2018-04-05 3714
e86ee2d44b4405 Corey Minyard 2018-04-05 3715 cleanup_srcu_struct(&intf->users_srcu);
393d2cc354d150 Corey Minyard 2005-11-07 3716 kref_put(&intf->refcount, intf_free);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3717 }
c70d749986f6f1 Corey Minyard 2008-04-29 3718 EXPORT_SYMBOL(ipmi_unregister_smi);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3719
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[freescale-fslc:pr/493 4/10] drivers/misc/uboot_bootcount.c:70:50: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device...
by kernel test robot
tree: https://github.com/Freescale/linux-fslc pr/493
head: 4095f16ba8dccb30a4b20aead5efc191a07f21f5
commit: 88f59122f76cf1f1a59b770abf44962f95ebfd95 [4/10] drivers, misc: add U-Boot bootcount driver
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/Freescale/linux-fslc/commit/88f59122f76cf1f1a59b770abf...
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/493
git checkout 88f59122f76cf1f1a59b770abf44962f95ebfd95
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kobject.h:20,
from include/linux/energy_model.h:7,
from include/linux/device.h:16,
from include/linux/miscdevice.h:7,
from drivers/misc/uboot_bootcount.c:17:
>> drivers/misc/uboot_bootcount.c:70:50: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
70 | static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
| ^~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:104:10: note: in definition of macro '__ATTR'
104 | .show = _show, \
| ^~~~~
drivers/misc/uboot_bootcount.c:70:8: note: in expansion of macro 'DEVICE_ATTR'
70 | static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
| ^~~~~~~~~~~
drivers/misc/uboot_bootcount.c:70:50: note: (near initialization for 'dev_attr_bootcount.show')
70 | static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
| ^~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:104:10: note: in definition of macro '__ATTR'
104 | .show = _show, \
| ^~~~~
drivers/misc/uboot_bootcount.c:70:8: note: in expansion of macro 'DEVICE_ATTR'
70 | static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
| ^~~~~~~~~~~
>> drivers/misc/uboot_bootcount.c:71:3: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, const char *, size_t)' {aka 'long int (*)(struct device *, struct device_attribute *, const char *, long unsigned int)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, const char *, size_t)' {aka 'int (*)(struct device *, struct device_attribute *, const char *, long unsigned int)'} [-Werror=incompatible-pointer-types]
71 | store_str_bootcount);
| ^~~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:105:11: note: in definition of macro '__ATTR'
105 | .store = _store, \
| ^~~~~~
drivers/misc/uboot_bootcount.c:70:8: note: in expansion of macro 'DEVICE_ATTR'
70 | static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
| ^~~~~~~~~~~
drivers/misc/uboot_bootcount.c:71:3: note: (near initialization for 'dev_attr_bootcount.store')
71 | store_str_bootcount);
| ^~~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:105:11: note: in definition of macro '__ATTR'
105 | .store = _store, \
| ^~~~~~
drivers/misc/uboot_bootcount.c:70:8: note: in expansion of macro 'DEVICE_ATTR'
70 | static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
vim +70 drivers/misc/uboot_bootcount.c
69
> 70 static DEVICE_ATTR(bootcount, S_IWUSR | S_IRUGO, show_str_bootcount,
> 71 store_str_bootcount);
72
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH] ipv6: check return value of ipv6_skip_exthdr
by kernel test robot
Hi Jordy,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on klassert-ipsec/master]
[also build test WARNING on klassert-ipsec-next/master linux/master v5.16-rc1 next-20211118]
[cannot apply to linus/master]
[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/Jordy-Zomer/ipv6-check-return-va...
base: https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git master
config: arm64-buildonly-randconfig-r004-20211118 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c46becf500df2a7fb4b4fce16178a036c344315a)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/afe093a81395e12df66d6b2145bcb98d4...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jordy-Zomer/ipv6-check-return-value-of-ipv6_skip_exthdr/20211118-021714
git checkout afe093a81395e12df66d6b2145bcb98d4fc67b55
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
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 >>):
>> net/ipv6/esp6.c:814:4: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
goto out;
^
net/ipv6/esp6.c:812:3: note: previous statement is here
if (offset < 0)
^
1 warning generated.
vim +/if +814 net/ipv6/esp6.c
782
783 int esp6_input_done2(struct sk_buff *skb, int err)
784 {
785 struct xfrm_state *x = xfrm_input_state(skb);
786 struct xfrm_offload *xo = xfrm_offload(skb);
787 struct crypto_aead *aead = x->data;
788 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
789 int hdr_len = skb_network_header_len(skb);
790
791 if (!xo || !(xo->flags & CRYPTO_DONE))
792 kfree(ESP_SKB_CB(skb)->tmp);
793
794 if (unlikely(err))
795 goto out;
796
797 err = esp_remove_trailer(skb);
798 if (unlikely(err < 0))
799 goto out;
800
801 if (x->encap) {
802 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
803 int offset = skb_network_offset(skb) + sizeof(*ip6h);
804 struct xfrm_encap_tmpl *encap = x->encap;
805 u8 nexthdr = ip6h->nexthdr;
806 __be16 frag_off, source;
807 struct udphdr *uh;
808 struct tcphdr *th;
809
810 offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off);
811
812 if (offset < 0)
813 err = -EINVAL;
> 814 goto out;
815
816 uh = (void *)(skb->data + offset);
817 th = (void *)(skb->data + offset);
818 hdr_len += offset;
819
820 switch (x->encap->encap_type) {
821 case TCP_ENCAP_ESPINTCP:
822 source = th->source;
823 break;
824 case UDP_ENCAP_ESPINUDP:
825 case UDP_ENCAP_ESPINUDP_NON_IKE:
826 source = uh->source;
827 break;
828 default:
829 WARN_ON_ONCE(1);
830 err = -EINVAL;
831 goto out;
832 }
833
834 /*
835 * 1) if the NAT-T peer's IP or port changed then
836 * advertize the change to the keying daemon.
837 * This is an inbound SA, so just compare
838 * SRC ports.
839 */
840 if (!ipv6_addr_equal(&ip6h->saddr, &x->props.saddr.in6) ||
841 source != encap->encap_sport) {
842 xfrm_address_t ipaddr;
843
844 memcpy(&ipaddr.a6, &ip6h->saddr.s6_addr, sizeof(ipaddr.a6));
845 km_new_mapping(x, &ipaddr, source);
846
847 /* XXX: perhaps add an extra
848 * policy check here, to see
849 * if we should allow or
850 * reject a packet from a
851 * different source
852 * address/port.
853 */
854 }
855
856 /*
857 * 2) ignore UDP/TCP checksums in case
858 * of NAT-T in Transport Mode, or
859 * perform other post-processing fixes
860 * as per draft-ietf-ipsec-udp-encaps-06,
861 * section 3.1.2
862 */
863 if (x->props.mode == XFRM_MODE_TRANSPORT)
864 skb->ip_summed = CHECKSUM_UNNECESSARY;
865 }
866
867 skb_postpull_rcsum(skb, skb_network_header(skb),
868 skb_network_header_len(skb));
869 skb_pull_rcsum(skb, hlen);
870 if (x->props.mode == XFRM_MODE_TUNNEL)
871 skb_reset_transport_header(skb);
872 else
873 skb_set_transport_header(skb, -hdr_len);
874
875 /* RFC4303: Drop dummy packets without any error */
876 if (err == IPPROTO_NONE)
877 err = -EINVAL;
878
879 out:
880 return err;
881 }
882 EXPORT_SYMBOL_GPL(esp6_input_done2);
883
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months