[chrome-os:chromeos-4.4 9959/9999] drivers/md/dm-crypt.c:1594:43: warning: signed and unsigned type in conditional expression
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head: ccf40bc6e3f39dc1d6410b6a2c97869bfe4f3ff5
commit: 2e533e1931bd9bc7be1d9b66871418cd0fc966c5 [9959/9999] BACKPORT: dm crypt: add ability to use keys from the kernel key retention service
config: xtensa-randconfig-r023-20220208 (https://download.01.org/0day-ci/archive/20220209/202202090841.7KnHh5Ph-lk...)
compiler: xtensa-linux-gcc (GCC) 7.5.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
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-4.4
git checkout 2e533e1931bd9bc7be1d9b66871418cd0fc966c5
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross O=build_dir ARCH=xtensa SHELL=/bin/bash drivers/md/
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 >>):
^~~~~~~~~
include/linux/scatterlist.h:140:10: note: in expansion of macro 'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^~~~~~~~~~~~~~~
arch/xtensa/include/asm/page.h:175:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
^
include/linux/compiler.h:153:53: note: in definition of macro 'unlikely'
# define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
^
include/linux/scatterlist.h:140:2: note: in expansion of macro 'BUG_ON'
BUG_ON(!virt_addr_valid(buf));
^~~~~~
arch/xtensa/include/asm/page.h:183:32: note: in expansion of macro 'pfn_valid'
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
^~~~~~~~~
include/linux/scatterlist.h:140:10: note: in expansion of macro 'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^~~~~~~~~~~~~~~
arch/xtensa/include/asm/page.h:175:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
^
include/linux/compiler.h:126:47: note: in definition of macro 'likely_notrace'
#define likely_notrace(x) __builtin_expect(!!(x), 1)
^
include/linux/compiler.h:153:58: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0))
^~~~~~~~~~~~~~~~
include/asm-generic/bug.h:58:36: note: in expansion of macro 'unlikely'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
^~~~~~~~
include/linux/scatterlist.h:140:2: note: in expansion of macro 'BUG_ON'
BUG_ON(!virt_addr_valid(buf));
^~~~~~
arch/xtensa/include/asm/page.h:183:32: note: in expansion of macro 'pfn_valid'
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
^~~~~~~~~
include/linux/scatterlist.h:140:10: note: in expansion of macro 'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^~~~~~~~~~~~~~~
In file included from include/linux/uaccess.h:8:0,
from include/linux/highmem.h:8,
from include/linux/bio.h:23,
from drivers/md/dm-crypt.c:16:
arch/xtensa/include/asm/checksum.h: In function 'csum_and_copy_to_user':
arch/xtensa/include/asm/uaccess.h:189:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size)))
^
arch/xtensa/include/asm/uaccess.h:190:49: note: in expansion of macro '__user_ok'
#define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size)))
^~~~~~~~~
arch/xtensa/include/asm/uaccess.h:191:37: note: in expansion of macro '__access_ok'
#define access_ok(type, addr, size) __access_ok((unsigned long)(addr), (size))
^~~~~~~~~~~
arch/xtensa/include/asm/checksum.h:248:6: note: in expansion of macro 'access_ok'
if (access_ok(VERIFY_WRITE, dst, len))
^~~~~~~~~
include/net/checksum.h: In function 'csum_and_copy_from_user':
arch/xtensa/include/asm/uaccess.h:189:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size)))
^
arch/xtensa/include/asm/uaccess.h:190:49: note: in expansion of macro '__user_ok'
#define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size)))
^~~~~~~~~
arch/xtensa/include/asm/uaccess.h:191:37: note: in expansion of macro '__access_ok'
#define access_ok(type, addr, size) __access_ok((unsigned long)(addr), (size))
^~~~~~~~~~~
include/net/checksum.h:33:6: note: in expansion of macro 'access_ok'
if (access_ok(VERIFY_READ, src, len))
^~~~~~~~~
In file included from include/crypto/algapi.h:18:0,
from drivers/md/dm-crypt.c:31:
include/linux/skbuff.h: In function 'skb_add_data':
include/linux/skbuff.h:2687:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
&csum, from) == copy) {
^~
include/linux/skbuff.h:2691:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
} else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
^~
include/linux/skbuff.h: In function 'skb_can_coalesce':
include/linux/skbuff.h:2705:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
off == frag->page_offset + skb_frag_size(frag);
^~
include/linux/skbuff.h: In function 'memcpy_from_msg':
include/linux/skbuff.h:2933:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
^~
include/linux/skbuff.h: In function 'memcpy_to_msg':
include/linux/skbuff.h:2938:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
^~
drivers/md/dm-crypt.c: In function 'crypt_iv_benbi_ctr':
drivers/md/dm-crypt.c:430:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (1 << log != bs) {
^~
drivers/md/dm-crypt.c: In function 'crypt_setkey':
drivers/md/dm-crypt.c:1482:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < cc->tfms_count; i++) {
^
drivers/md/dm-crypt.c: In function 'get_key_size':
>> drivers/md/dm-crypt.c:1594:43: warning: signed and unsigned type in conditional expression [-Wsign-compare]
return (*key_string[0] == ':') ? -EINVAL : strlen(*key_string) >> 1;
^
drivers/md/dm-crypt.c: In function 'crypt_message':
drivers/md/dm-crypt.c:2163:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (key_size < 0 || cc->key_size != key_size) {
^~
vim +1594 drivers/md/dm-crypt.c
1591
1592 static int get_key_size(char **key_string)
1593 {
> 1594 return (*key_string[0] == ':') ? -EINVAL : strlen(*key_string) >> 1;
1595 }
1596
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [RFC PATCH net-next v4 1/6] gtp: Allow to create GTP device without FDs
by kernel test robot
Hi Marcin,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marcin-Szycik/ice-GTP-support-in...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 41414c9bdbb87cc5fbeee7dfc33137a96710fcac
config: arm64-randconfig-s032-20220208 (https://download.01.org/0day-ci/archive/20220209/202202090710.dTUDKxN3-lk...)
compiler: aarch64-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/926dc9532fd0b964087f8d72f0331efe7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marcin-Szycik/ice-GTP-support-in-switchdev/20220205-005556
git checkout 926dc9532fd0b964087f8d72f0331efe70cd25bc
# 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=arm64 SHELL=/bin/bash drivers/net/
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/net/gtp.c:868:43: sparse: sparse: cast to restricted __be16
>> drivers/net/gtp.c:868:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] local_udp_port @@ got unsigned short [usertype] @@
drivers/net/gtp.c:868:41: sparse: expected restricted __be16 [usertype] local_udp_port
drivers/net/gtp.c:868:41: sparse: got unsigned short [usertype]
drivers/net/gtp.c:870:43: sparse: sparse: cast to restricted __be16
drivers/net/gtp.c:870:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] local_udp_port @@ got unsigned short [usertype] @@
drivers/net/gtp.c:870:41: sparse: expected restricted __be16 [usertype] local_udp_port
drivers/net/gtp.c:870:41: sparse: got unsigned short [usertype]
vim +868 drivers/net/gtp.c
855
856 static struct sock *gtp_encap_create_sock(int type, struct gtp_dev *gtp)
857 {
858 struct udp_tunnel_sock_cfg tuncfg = {};
859 struct udp_port_cfg udp_conf = {
860 .local_ip.s_addr = htonl(INADDR_ANY),
861 .family = AF_INET,
862 };
863 struct net *net = gtp->net;
864 struct socket *sock;
865 int err;
866
867 if (type == UDP_ENCAP_GTP0)
> 868 udp_conf.local_udp_port = ntohs(GTP0_PORT);
869 else if (type == UDP_ENCAP_GTP1U)
870 udp_conf.local_udp_port = ntohs(GTP1U_PORT);
871 else
872 return ERR_PTR(-EINVAL);
873
874 err = udp_sock_create(net, &udp_conf, &sock);
875 if (err)
876 return ERR_PTR(err);
877
878 tuncfg.sk_user_data = gtp;
879 tuncfg.encap_type = type;
880 tuncfg.encap_rcv = gtp_encap_recv;
881 tuncfg.encap_destroy = NULL;
882
883 setup_udp_tunnel_sock(net, sock, &tuncfg);
884
885 return sock->sk;
886 }
887
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH v2] include: linux: Reorganize timekeeping and ktime headers
by kernel test robot
Hi Carlos,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on geert-m68k/for-next]
[also build test ERROR on tip/timers/core tip/x86/core linus/master v5.17-rc3]
[cannot apply to next-20220208]
[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/Carlos-Bilbao/include-linux-Reor...
base: https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git for-next
config: alpha-randconfig-r001-20220208 (https://download.01.org/0day-ci/archive/20220209/202202090656.Bx5FpSa7-lk...)
compiler: alpha-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/5ed7d76f2d6aabedc437bc0b99020dc65...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Carlos-Bilbao/include-linux-Reorganize-timekeeping-and-ktime-headers/20220209-001309
git checkout 5ed7d76f2d6aabedc437bc0b99020dc655ab5719
# 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=alpha SHELL=/bin/bash arch/alpha/kernel/
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 >>):
arch/alpha/kernel/osf_sys.c: In function '__do_sys_osf_settimeofday':
>> arch/alpha/kernel/osf_sys.c:1013:16: error: implicit declaration of function 'do_sys_settimeofday64'; did you mean 'sys_settimeofday'? [-Werror=implicit-function-declaration]
1013 | return do_sys_settimeofday64(tv ? &kts : NULL, tz ? &ktz : NULL);
| ^~~~~~~~~~~~~~~~~~~~~
| sys_settimeofday
cc1: some warnings being treated as errors
vim +1013 arch/alpha/kernel/osf_sys.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 997
e5d9a90c36e05dd Ivan Kokshaysky 2009-01-29 998 SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
e5d9a90c36e05dd Ivan Kokshaysky 2009-01-29 999 struct timezone __user *, tz)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1000 {
ce4c253573ad184 Arnd Bergmann 2017-11-08 1001 struct timespec64 kts;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1002 struct timezone ktz;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1003
^1da177e4c3f415 Linus Torvalds 2005-04-16 1004 if (tv) {
ce4c253573ad184 Arnd Bergmann 2017-11-08 1005 if (get_tv32(&kts, tv))
^1da177e4c3f415 Linus Torvalds 2005-04-16 1006 return -EFAULT;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1007 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1008 if (tz) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 1009 if (copy_from_user(&ktz, tz, sizeof(*tz)))
^1da177e4c3f415 Linus Torvalds 2005-04-16 1010 return -EFAULT;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1011 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1012
ce4c253573ad184 Arnd Bergmann 2017-11-08 @1013 return do_sys_settimeofday64(tv ? &kts : NULL, tz ? &ktz : NULL);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1014 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1015
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ardb:hctr2 3/8] crypto/hctr2.c:115:38: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git hctr2
head: 5bb01649223080b7cde5740f441eb5e758ec357f
commit: 09533ad0ea8fa56420aa6e866b11c0685e862bd1 [3/8] crypto: hctr2 - Add HCTR2 support
config: sparc64-randconfig-s032-20220208 (https://download.01.org/0day-ci/archive/20220209/202202090607.wkQ2yto6-lk...)
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/ardb/linux.git/commit/?id...
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb hctr2
git checkout 09533ad0ea8fa56420aa6e866b11c0685e862bd1
# 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=sparc64 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 >>)
>> crypto/hctr2.c:115:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long @@ got restricted __le64 [usertype] @@
crypto/hctr2.c:115:38: sparse: expected unsigned long long
crypto/hctr2.c:115:38: sparse: got restricted __le64 [usertype]
crypto/hctr2.c:117:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long @@ got restricted __le64 [usertype] @@
crypto/hctr2.c:117:38: sparse: expected unsigned long long
crypto/hctr2.c:117:38: sparse: got restricted __le64 [usertype]
vim +115 crypto/hctr2.c
103
104 static int hctr2_hash_tweak(struct skcipher_request *req, u8 *iv)
105 {
106 u64 tweak_length_part[2];
107 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
108 const struct hctr2_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
109 struct hctr2_request_ctx *rctx = skcipher_request_ctx(req);
110 struct shash_desc *hash_desc = &rctx->u.hash_desc;
111 int err;
112
113 memset(tweak_length_part, 0, sizeof(tweak_length_part));
114 if (req->cryptlen % POLYVAL_BLOCK_SIZE == 0)
> 115 tweak_length_part[0] = cpu_to_le64(TWEAK_SIZE * 8 * 2 + 2);
116 else
117 tweak_length_part[0] = cpu_to_le64(TWEAK_SIZE * 8 * 2 + 3);
118
119 hash_desc->tfm = tctx->hash;
120 err = crypto_shash_init(hash_desc);
121 if (err)
122 return err;
123
124 err = crypto_shash_update(hash_desc, (u8 *)tweak_length_part, sizeof(tweak_length_part));
125 if (err)
126 return err;
127 err = crypto_shash_update(hash_desc, iv, TWEAK_SIZE);
128 return err;
129 }
130
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
fs/dlm/midcomms.c:913:22: sparse: sparse: restricted __le32 degrades to integer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 555f3d7be91a873114c9656069f1a9fa476ec41a
commit: 658bd576f95ed597e519cdadf1c86ac87c17aea5 fs: dlm: move version conversion to compile time
date: 3 months ago
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220209/202202090632.SQ22xw2f-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 658bd576f95ed597e519cdadf1c86ac87c17aea5
# 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=x86_64 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 >>)
fs/dlm/midcomms.c:213:1: sparse: sparse: symbol '__srcu_struct_nodes_srcu' was not declared. Should it be static?
fs/dlm/midcomms.c:570:25: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:678:19: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:680:16: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:718:27: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:737:25: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:747:25: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:756:23: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:766:42: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:769:26: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:804:23: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:838:27: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:898:26: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:920:25: sparse: sparse: cast to restricted __le32
>> fs/dlm/midcomms.c:913:22: sparse: sparse: restricted __le32 degrades to integer
fs/dlm/midcomms.c:916:22: sparse: sparse: restricted __le32 degrades to integer
fs/dlm/midcomms.c:1056:20: sparse: sparse: context imbalance in 'dlm_midcomms_get_mhandle' - wrong count at exit
fs/dlm/midcomms.c: note: in included file (through include/linux/notifier.h, arch/x86/include/asm/uprobes.h, include/linux/uprobes.h, ...):
include/linux/srcu.h:188:9: sparse: sparse: context imbalance in 'dlm_midcomms_commit_mhandle' - unexpected unlock
vim +913 fs/dlm/midcomms.c
871
872 /*
873 * Called from the low-level comms layer to process a buffer of
874 * commands.
875 */
876
877 int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
878 {
879 const unsigned char *ptr = buf;
880 const struct dlm_header *hd;
881 uint16_t msglen;
882 int ret = 0;
883
884 while (len >= sizeof(struct dlm_header)) {
885 hd = (struct dlm_header *)ptr;
886
887 /* no message should be more than DLM_MAX_SOCKET_BUFSIZE or
888 * less than dlm_header size.
889 *
890 * Some messages does not have a 8 byte length boundary yet
891 * which can occur in a unaligned memory access of some dlm
892 * messages. However this problem need to be fixed at the
893 * sending side, for now it seems nobody run into architecture
894 * related issues yet but it slows down some processing.
895 * Fixing this issue should be scheduled in future by doing
896 * the next major version bump.
897 */
898 msglen = le16_to_cpu(hd->h_length);
899 if (msglen > DLM_MAX_SOCKET_BUFSIZE ||
900 msglen < sizeof(struct dlm_header)) {
901 log_print("received invalid length header: %u from node %d, will abort message parsing",
902 msglen, nodeid);
903 return -EBADMSG;
904 }
905
906 /* caller will take care that leftover
907 * will be parsed next call with more data
908 */
909 if (msglen > len)
910 break;
911
912 switch (hd->h_version) {
> 913 case cpu_to_le32(DLM_VERSION_3_1):
914 dlm_midcomms_receive_buffer_3_1((union dlm_packet *)ptr, nodeid);
915 break;
916 case cpu_to_le32(DLM_VERSION_3_2):
917 dlm_midcomms_receive_buffer_3_2((union dlm_packet *)ptr, nodeid);
918 break;
919 default:
920 log_print("received invalid version header: %u from node %d, will skip this message",
921 le32_to_cpu(hd->h_version), nodeid);
922 break;
923 }
924
925 ret += msglen;
926 len -= msglen;
927 ptr += msglen;
928 }
929
930 return ret;
931 }
932
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week