From: Leon Romanovsky <leon@kernel.org>
To: Frank Huang <tigerinxm@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: rxe panic
Date: Wed, 25 Dec 2019 08:32:56 +0200 [thread overview]
Message-ID: <20191225063256.GB212002@unreal> (raw)
In-Reply-To: <CAKC_zSs=m_qPs06ZqxB-UJ_nHqhb+V2CBNKj3HsdJX+6eevqCA@mail.gmail.com>
On Wed, Dec 25, 2019 at 12:55:35PM +0800, Frank Huang wrote:
> hi, there is a panic on rdma_rxe module when the restart
> network.service or shutdown the switch.
>
> it looks like a use-after-free error.
>
> everytime it happens, there is the log "rdma_rxe: Unknown layer 3 protocol: 0"
The error print itself is harmless.
>
> is it a known error?
>
> my kernel version is 4.14.97
Your kernel is old enough and doesn't include refcount,
so I can't say for sure that it is the case, but the
following code is not correct and with refcount debug
it will be seen immediately.
1213 int rxe_responder(void *arg)
1214 {
1215 struct rxe_qp *qp = (struct rxe_qp *)arg;
1216 struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
1217 enum resp_states state;
1218 struct rxe_pkt_info *pkt = NULL;
1219 int ret = 0;
1220
1221 rxe_add_ref(qp); <------ USE-AFTER-FREE
1222
1223 qp->resp.aeth_syndrome = AETH_ACK_UNLIMITED;
1224
1225 if (!qp->valid) {
1226 ret = -EINVAL;
1227 goto done;
1228 }
Thanks
next prev parent reply other threads:[~2019-12-25 6:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-25 4:55 rxe panic Frank Huang
2019-12-25 5:27 ` Zhu Yanjun
2019-12-25 6:01 ` Frank Huang
2019-12-25 6:34 ` Zhu Yanjun
2019-12-25 7:10 ` Frank Huang
2019-12-25 6:32 ` Leon Romanovsky [this message]
2019-12-25 7:23 ` Frank Huang
2019-12-25 7:43 ` Frank Huang
2019-12-25 9:23 ` Leon Romanovsky
2019-12-26 1:08 ` Zhu Yanjun
2019-12-26 1:39 ` Frank Huang
2019-12-26 2:35 ` Zhu Yanjun
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=20191225063256.GB212002@unreal \
--to=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=tigerinxm@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox