[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y75+hwMTgQaFp9qL@nanopsycho>
Date: Wed, 11 Jan 2023 10:16:55 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, jacob.e.keller@...el.com,
syzbot+d94d214ea473e218fc89@...kaller.appspotmail.com
Subject: Re: [PATCH net-next] devlink: keep the instance mutex alive until
references are gone
Wed, Jan 11, 2023 at 05:29:08AM CET, kuba@...nel.org wrote:
>The reference needs to keep the instance memory around, but also
>the instance lock must remain valid. Users will take the lock,
>check registration status and release the lock. mutex_destroy()
>etc. belong in the same place as the freeing of the memory.
>
>Unfortunately lockdep_unregister_key() sleeps so we need
>to switch the an rcu_work.
>
>Note that the problem is a bit hard to repro, because
>devlink_pernet_pre_exit() iterates over registered instances.
>AFAIU the instances must get devlink_free()d concurrently with
>the namespace getting deleted for the problem to occur.
>
>Reported-by: syzbot+d94d214ea473e218fc89@...kaller.appspotmail.com
>Fixes: 9053637e0da7 ("devlink: remove the registration guarantee of references")
>Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Reviewed-by: Jiri Pirko <jiri@...dia.com>
>---
>Jiri, this will likely conflict with your series, sorry :(
Yeah, I will rebase and send v5 after this is applied, no worries.
Powered by blists - more mailing lists