From: kernel test robot <lkp@intel.com>
To: Taehee Yoo <ap420073@gmail.com>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, andrew+netdev@lunn.ch, horms@kernel.org,
almasrymina@google.com, sdf@fomichev.me, netdev@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
asml.silence@gmail.com, dw@davidwei.uk, skhawaja@google.com,
willemb@google.com, jdamato@fastly.com, ap420073@gmail.com
Subject: Re: [PATCH net v2] net: devmem: fix kernel panic when socket close after module unload
Date: Wed, 7 May 2025 21:08:36 +0800 [thread overview]
Message-ID: <202505072001.RHUTj8Jo-lkp@intel.com> (raw)
In-Reply-To: <20250506140858.2660441-1-ap420073@gmail.com>
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@intel.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
next prev parent reply other threads:[~2025-05-07 13:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 14:08 [PATCH net v2] net: devmem: fix kernel panic when socket close after module unload Taehee Yoo
2025-05-06 17:41 ` Stanislav Fomichev
2025-05-07 2:42 ` Jakub Kicinski
2025-05-07 4:22 ` Taehee Yoo
2025-05-06 22:07 ` Jakub Kicinski
2025-05-07 4:24 ` Taehee Yoo
2025-05-07 2:55 ` Jakub Kicinski
2025-05-07 4:55 ` Taehee Yoo
2025-05-07 13:23 ` Jakub Kicinski
2025-05-07 15:54 ` Taehee Yoo
2025-05-07 13:08 ` kernel test robot [this message]
2025-05-07 18:28 ` Mina Almasry
2025-05-08 9:59 ` Taehee Yoo
2025-05-08 20:45 ` Mina Almasry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202505072001.RHUTj8Jo-lkp@intel.com \
--to=lkp@intel.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=asml.silence@gmail.com \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=skhawaja@google.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.