From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH] RDMA/cma: Execute rdma_cm destruction from a handler properly
Date: Sat, 27 Jun 2020 17:04:28 +0800 [thread overview]
Message-ID: <202006271609.4IGJbiM7%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6406 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200627004519.GB25301@ziepe.ca>
References: <20200627004519.GB25301@ziepe.ca>
TO: Jason Gunthorpe <jgg@ziepe.ca>
TO: Hillf Danton <hdanton@sina.com>
CC: syzbot <syzbot+a929647172775e335941@syzkaller.appspotmail.com>
CC: chuck.lever(a)oracle.com
CC: dledford(a)redhat.com
CC: leon(a)kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: linux-rdma(a)vger.kernel.org
CC: parav(a)mellanox.com
CC: Markus Elfring <Markus.Elfring@web.de>
CC: syzkaller-bugs(a)googlegroups.com
Hi Jason,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.8-rc2 next-20200626]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jason-Gunthorpe/RDMA-cma-Execute-rdma_cm-destruction-from-a-handler-properly/20200627-084914
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1590a2e1c681b0991bd42c992cabfd380e0338f2
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: m68k-randconfig-c022-20200624 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/infiniband/core/cma.c:3165:2-8: preceding lock on line 3130
drivers/infiniband/core/cma.c:2029:2-8: preceding lock on line 1961
drivers/infiniband/core/cma.c:4362:2-8: preceding lock on line 4310
drivers/infiniband/core/cma.c:2344:2-8: preceding lock on line 2296
drivers/infiniband/core/cma.c:2690:0-1: preceding lock on line 2674
drivers/infiniband/core/cma.c:3832:2-8: preceding lock on line 3783
drivers/infiniband/core/cma.c:2667:0-1: preceding lock on line 2652
# https://github.com/0day-ci/linux/commit/4f31059eb305530933a4de9428cedd02d32d94f1
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 4f31059eb305530933a4de9428cedd02d32d94f1
vim +3165 drivers/infiniband/core/cma.c
e51060f08a6196 Sean Hefty 2006-06-17 3121
e51060f08a6196 Sean Hefty 2006-06-17 3122 static void addr_handler(int status, struct sockaddr *src_addr,
e51060f08a6196 Sean Hefty 2006-06-17 3123 struct rdma_dev_addr *dev_addr, void *context)
e51060f08a6196 Sean Hefty 2006-06-17 3124 {
e51060f08a6196 Sean Hefty 2006-06-17 3125 struct rdma_id_private *id_priv = context;
7582df826734ba Parav Pandit 2018-07-29 3126 struct rdma_cm_event event = {};
5fc01fb846bce8 Myungho Jung 2019-01-09 3127 struct sockaddr *addr;
5fc01fb846bce8 Myungho Jung 2019-01-09 3128 struct sockaddr_storage old_addr;
e51060f08a6196 Sean Hefty 2006-06-17 3129
de910bd9213700 Or Gerlitz 2008-07-14 @3130 mutex_lock(&id_priv->handler_mutex);
550e5ca77e9698 Nir Muchtar 2011-05-20 3131 if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_QUERY,
550e5ca77e9698 Nir Muchtar 2011-05-20 3132 RDMA_CM_ADDR_RESOLVED))
61a73c708f3729 Sean Hefty 2006-09-01 3133 goto out;
61a73c708f3729 Sean Hefty 2006-09-01 3134
5fc01fb846bce8 Myungho Jung 2019-01-09 3135 /*
5fc01fb846bce8 Myungho Jung 2019-01-09 3136 * Store the previous src address, so that if we fail to acquire
5fc01fb846bce8 Myungho Jung 2019-01-09 3137 * matching rdma device, old address can be restored back, which helps
5fc01fb846bce8 Myungho Jung 2019-01-09 3138 * to cancel the cma listen operation correctly.
5fc01fb846bce8 Myungho Jung 2019-01-09 3139 */
5fc01fb846bce8 Myungho Jung 2019-01-09 3140 addr = cma_src_addr(id_priv);
5fc01fb846bce8 Myungho Jung 2019-01-09 3141 memcpy(&old_addr, addr, rdma_addr_size(addr));
5fc01fb846bce8 Myungho Jung 2019-01-09 3142 memcpy(addr, src_addr, rdma_addr_size(src_addr));
498683c6a7eec5 Moni Shoua 2017-01-05 3143 if (!status && !id_priv->cma_dev) {
ff11c6cd521f4f Parav Pandit 2018-09-15 3144 status = cma_acquire_dev_by_src_ip(id_priv);
498683c6a7eec5 Moni Shoua 2017-01-05 3145 if (status)
498683c6a7eec5 Moni Shoua 2017-01-05 3146 pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to acquire device. status %d\n",
498683c6a7eec5 Moni Shoua 2017-01-05 3147 status);
a6e4d254c19b54 Håkon Bugge 2019-09-02 3148 } else if (status) {
498683c6a7eec5 Moni Shoua 2017-01-05 3149 pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to resolve IP. status %d\n", status);
498683c6a7eec5 Moni Shoua 2017-01-05 3150 }
e51060f08a6196 Sean Hefty 2006-06-17 3151
e51060f08a6196 Sean Hefty 2006-06-17 3152 if (status) {
5fc01fb846bce8 Myungho Jung 2019-01-09 3153 memcpy(addr, &old_addr,
5fc01fb846bce8 Myungho Jung 2019-01-09 3154 rdma_addr_size((struct sockaddr *)&old_addr));
550e5ca77e9698 Nir Muchtar 2011-05-20 3155 if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_RESOLVED,
550e5ca77e9698 Nir Muchtar 2011-05-20 3156 RDMA_CM_ADDR_BOUND))
e51060f08a6196 Sean Hefty 2006-06-17 3157 goto out;
a1b1b61f80aba4 Sean Hefty 2006-11-30 3158 event.event = RDMA_CM_EVENT_ADDR_ERROR;
a1b1b61f80aba4 Sean Hefty 2006-11-30 3159 event.status = status;
7b85627b9f02f9 Moni Shoua 2013-12-12 3160 } else
a1b1b61f80aba4 Sean Hefty 2006-11-30 3161 event.event = RDMA_CM_EVENT_ADDR_RESOLVED;
e51060f08a6196 Sean Hefty 2006-06-17 3162
ed999f820a6c57 Chuck Lever 2019-12-18 3163 if (cma_cm_event_handler(id_priv, &event)) {
4f31059eb30553 Jason Gunthorpe 2020-06-26 3164 destroy_id_handler_unlock(id_priv);
e51060f08a6196 Sean Hefty 2006-06-17 @3165 return;
e51060f08a6196 Sean Hefty 2006-06-17 3166 }
e51060f08a6196 Sean Hefty 2006-06-17 3167 out:
de910bd9213700 Or Gerlitz 2008-07-14 3168 mutex_unlock(&id_priv->handler_mutex);
e51060f08a6196 Sean Hefty 2006-06-17 3169 }
e51060f08a6196 Sean Hefty 2006-06-17 3170
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26577 bytes --]
next reply other threads:[~2020-06-27 9:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-27 9:04 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-27 18:04 [PATCH] RDMA/cma: Execute rdma_cm destruction from a handler properly kernel test robot
2020-06-27 5:38 kernel test robot
2020-06-27 0:45 KASAN: use-after-free Read in addr_handler (2) Jason Gunthorpe
2020-06-27 2:38 ` [PATCH] RDMA/cma: Execute rdma_cm destruction from a handler properly kernel test robot
2020-06-27 2:38 ` kernel test robot
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=202006271609.4IGJbiM7%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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.