From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Antony Antony <antony.antony@secunet.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
netdev@vger.kernel.org, Tobias Brunner <tobias@strongswan.org>
Subject: Re: [PATCH RFC ipsec] xfrm: fix panic in xfrm_delete from userspace on ARM 32
Date: Thu, 20 Oct 2022 15:44:53 +0200 [thread overview]
Message-ID: <20221020134453.3pacvts4gfbxcygo@intra2net.com> (raw)
In-Reply-To: <20221020131602.5gzed3e6jrfbaeps@intra2net.com>
You wrote on Thu, Oct 20, 2022 at 03:16:02PM +0200:
> > We all know that it can't be a fix. It is hard to judge by this
> > calltrace, but it looks like something in x->km is not set. It is
> > probably ".all" field.
small update: I'm not sure if I can trust the output of my disassembly,
but I just recompiled the kernel rpm under test with CONFIG_DEBUG_INFO
and when I do this with the address from the backtrace:
(gdb) list *__xfrm_state_delete+0xc9
0x2269 is in __xfrm_state_delete (./include/linux/list.h:856).
851 static inline void __hlist_del(struct hlist_node *n)
852 {
853 struct hlist_node *next = n->next;
854 struct hlist_node **pprev = n->pprev;
855
856 WRITE_ONCE(*pprev, next);
857 if (next)
858 WRITE_ONCE(next->pprev, pprev);
859 }
860
which seems to match the suspected "list_del(&x->km.all)"
call from the code in 5.15.73:
*******************************
int __xfrm_state_delete(struct xfrm_state *x)
{
struct net *net = xs_net(x);
int err = -ESRCH;
if (x->km.state != XFRM_STATE_DEAD) {
x->km.state = XFRM_STATE_DEAD;
spin_lock(&net->xfrm.xfrm_state_lock);
list_del(&x->km.all);
hlist_del_rcu(&x->bydst);
hlist_del_rcu(&x->bysrc);
if (x->km.seq)
hlist_del_rcu(&x->byseq);
if (x->id.spi)
hlist_del_rcu(&x->byspi);
net->xfrm.state_num--;
spin_unlock(&net->xfrm.xfrm_state_lock);
if (x->encap_sk)
sock_put(rcu_dereference_raw(x->encap_sk));
xfrm_dev_state_delete(x);
/* All xfrm_state objects are created by xfrm_state_alloc.
* The xfrm_state_alloc call gives a reference, and that
* is what we are dropping here.
*/
xfrm_state_put(x);
err = 0;
}
return err;
}
*******************************
I'll still wait for another crash to appear using
a CONFIG_DEBUG_INFO enabled kernel to be sure.
HTH,
Thomas
prev parent reply other threads:[~2022-10-20 13:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 7:44 [PATCH RFC ipsec] xfrm: fix panic in xfrm_delete from userspace on ARM 32 Antony Antony
2022-05-12 17:54 ` Leon Romanovsky
2022-10-20 13:16 ` Thomas Jarosch
2022-10-20 13:44 ` Thomas Jarosch [this message]
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=20221020134453.3pacvts4gfbxcygo@intra2net.com \
--to=thomas.jarosch@intra2net.com \
--cc=antony.antony@secunet.com \
--cc=leon@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=tobias@strongswan.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.