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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202505072001.RHUTj8Jo-lkp@intel.com>
Date: Wed, 7 May 2025 21:08:36 +0800
From: kernel test robot <lkp@...el.com>
To: Taehee Yoo <ap420073@...il.com>, davem@...emloft.net, kuba@...nel.org,
	pabeni@...hat.com, edumazet@...gle.com, andrew+netdev@...n.ch,
	horms@...nel.org, almasrymina@...gle.com, sdf@...ichev.me,
	netdev@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	asml.silence@...il.com, dw@...idwei.uk, skhawaja@...gle.com,
	willemb@...gle.com, jdamato@...tly.com, ap420073@...il.com
Subject: Re: [PATCH net v2] net: devmem: fix kernel panic when socket close
 after module unload

Hi Taehee,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Taehee-Yoo/net-devmem-fix-kernel-panic-when-socket-close-after-module-unload/20250506-221010
base:   net/main
patch link:    https://lore.kernel.org/r/20250506140858.2660441-1-ap420073%40gmail.com
patch subject: [PATCH net v2] net: devmem: fix kernel panic when socket close after module unload
config: i386-defconfig (https://download.01.org/0day-ci/archive/20250507/202505072001.RHUTj8Jo-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505072001.RHUTj8Jo-lkp@intel.com/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 <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505072001.RHUTj8Jo-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/core/netdev-genl.c:879:60: error: too many arguments to function call, expected 3, have 4
     879 |         binding = net_devmem_bind_dmabuf(netdev, dmabuf_fd, priv, info->extack);
         |                   ~~~~~~~~~~~~~~~~~~~~~~                          ^~~~~~~~~~~~
   net/core/devmem.h:132:1: note: 'net_devmem_bind_dmabuf' declared here
     132 | net_devmem_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd,
         | ^                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     133 |                        struct netlink_ext_ack *extack)
         |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +879 net/core/netdev-genl.c

   827	
   828	int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
   829	{
   830		struct nlattr *tb[ARRAY_SIZE(netdev_queue_id_nl_policy)];
   831		struct net_devmem_dmabuf_binding *binding;
   832		u32 ifindex, dmabuf_fd, rxq_idx;
   833		struct netdev_nl_sock *priv;
   834		struct net_device *netdev;
   835		struct sk_buff *rsp;
   836		struct nlattr *attr;
   837		int rem, err = 0;
   838		void *hdr;
   839	
   840		if (GENL_REQ_ATTR_CHECK(info, NETDEV_A_DEV_IFINDEX) ||
   841		    GENL_REQ_ATTR_CHECK(info, NETDEV_A_DMABUF_FD) ||
   842		    GENL_REQ_ATTR_CHECK(info, NETDEV_A_DMABUF_QUEUES))
   843			return -EINVAL;
   844	
   845		ifindex = nla_get_u32(info->attrs[NETDEV_A_DEV_IFINDEX]);
   846		dmabuf_fd = nla_get_u32(info->attrs[NETDEV_A_DMABUF_FD]);
   847	
   848		priv = genl_sk_priv_get(&netdev_nl_family, NETLINK_CB(skb).sk);
   849		if (IS_ERR(priv))
   850			return PTR_ERR(priv);
   851	
   852		rsp = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL);
   853		if (!rsp)
   854			return -ENOMEM;
   855	
   856		hdr = genlmsg_iput(rsp, info);
   857		if (!hdr) {
   858			err = -EMSGSIZE;
   859			goto err_genlmsg_free;
   860		}
   861	
   862		err = 0;
   863		netdev = netdev_get_by_index_lock(genl_info_net(info), ifindex);
   864		if (!netdev) {
   865			err = -ENODEV;
   866			goto err_genlmsg_free;
   867		}
   868		if (!netif_device_present(netdev))
   869			err = -ENODEV;
   870		else if (!netdev_need_ops_lock(netdev))
   871			err = -EOPNOTSUPP;
   872		if (err) {
   873			NL_SET_BAD_ATTR(info->extack,
   874					info->attrs[NETDEV_A_DEV_IFINDEX]);
   875			goto err_unlock;
   876		}
   877	
   878		mutex_lock(&priv->lock);
 > 879		binding = net_devmem_bind_dmabuf(netdev, dmabuf_fd, priv, info->extack);
   880		if (IS_ERR(binding)) {
   881			err = PTR_ERR(binding);
   882			goto err_unlock_sock;
   883		}
   884	
   885		nla_for_each_attr_type(attr, NETDEV_A_DMABUF_QUEUES,
   886				       genlmsg_data(info->genlhdr),
   887				       genlmsg_len(info->genlhdr), rem) {
   888			err = nla_parse_nested(
   889				tb, ARRAY_SIZE(netdev_queue_id_nl_policy) - 1, attr,
   890				netdev_queue_id_nl_policy, info->extack);
   891			if (err < 0)
   892				goto err_unbind;
   893	
   894			if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_ID) ||
   895			    NL_REQ_ATTR_CHECK(info->extack, attr, tb, NETDEV_A_QUEUE_TYPE)) {
   896				err = -EINVAL;
   897				goto err_unbind;
   898			}
   899	
   900			if (nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != NETDEV_QUEUE_TYPE_RX) {
   901				NL_SET_BAD_ATTR(info->extack, tb[NETDEV_A_QUEUE_TYPE]);
   902				err = -EINVAL;
   903				goto err_unbind;
   904			}
   905	
   906			rxq_idx = nla_get_u32(tb[NETDEV_A_QUEUE_ID]);
   907	
   908			err = net_devmem_bind_dmabuf_to_queue(netdev, rxq_idx, binding,
   909							      info->extack);
   910			if (err)
   911				goto err_unbind;
   912		}
   913	
   914		list_add(&binding->list, &priv->bindings);
   915	
   916		nla_put_u32(rsp, NETDEV_A_DMABUF_ID, binding->id);
   917		genlmsg_end(rsp, hdr);
   918	
   919		err = genlmsg_reply(rsp, info);
   920		if (err)
   921			goto err_unbind;
   922	
   923		mutex_unlock(&priv->lock);
   924		netdev_unlock(netdev);
   925	
   926		return 0;
   927	
   928	err_unbind:
   929		net_devmem_unbind_dmabuf(binding);
   930	err_unlock_sock:
   931		mutex_unlock(&priv->lock);
   932	err_unlock:
   933		netdev_unlock(netdev);
   934	err_genlmsg_free:
   935		nlmsg_free(rsp);
   936		return err;
   937	}
   938	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ