lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20181117.165411.1610101046754885624.davem@davemloft.net>
Date:   Sat, 17 Nov 2018 16:54:11 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     lkp@...el.com
Cc:     jasowang@...hat.com, kbuild-all@...org, netdev@...r.kernel.org
Subject: Re: [net-next:master 114/114] drivers/net/tun.c:2503:42: warning:
 Using plain integer as NULL pointer

From: kbuild test robot <lkp@...el.com>
Date: Sun, 18 Nov 2018 07:13:44 +0800

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
> head:   f9e06c45cb28beb30a6a474952ead7da2b8940f3
> commit: f9e06c45cb28beb30a6a474952ead7da2b8940f3 [114/114] tuntap: free XDP dropped packets in a batch
> config: x86_64-allmodconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         git checkout f9e06c45cb28beb30a6a474952ead7da2b8940f3
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All warnings (new ones prefixed by >>):
> 
>    include/linux/slab.h:332:43: warning: dubious: x & !y
>    include/linux/slab.h:332:43: warning: dubious: x & !y
>>> drivers/net/tun.c:2503:42: warning: Using plain integer as NULL pointer

Fixed as follows:

====================
>From 6f0271d92963bc8588ad7058622ec7b1e94852de Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@...emloft.net>
Date: Sat, 17 Nov 2018 16:53:46 -0800
Subject: [PATCH] tun: Adjust on-stack tun_page initialization.

Instead of constantly playing with the struct initializer
syntax trying to make gcc and CLang both happy, just clear
it out using memset().

>> drivers/net/tun.c:2503:42: warning: Using plain integer as NULL pointer

Reported-by: kbuild test robot <lkp@...el.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
---
 drivers/net/tun.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index e90a7923a5f6..36163a147d39 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2500,10 +2500,12 @@ static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
 		return -EBADFD;
 
 	if (ctl && (ctl->type == TUN_MSG_PTR)) {
-		struct tun_page tpage = {0};
+		struct tun_page tpage;
 		int n = ctl->num;
 		int flush = 0;
 
+		memset(&tpage, 0, sizeof(tpage));
+
 		local_bh_disable();
 		rcu_read_lock();
 
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ