lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 25 Jul 2022 18:47:44 -0700
From:   Jakub Kicinski <>
To:     Jiri Pirko <>
Subject: Re: [patch net-next v4 01/12] net: devlink: make sure that
 devlink_try_get() works with valid pointer during xarray iteration

On Mon, 25 Jul 2022 10:29:14 +0200 Jiri Pirko wrote:
> From: Jiri Pirko <>
> Remove dependency on devlink_mutex during devlinks xarray iteration.
> The reason is that devlink_register/unregister() functions taking
> devlink_mutex would deadlock during devlink reload operation of devlink
> instance which registers/unregisters nested devlink instances.
> The devlinks xarray consistency is ensured internally by xarray.
> There is a reference taken when working with devlink using
> devlink_try_get(). But there is no guarantee that devlink pointer
> picked during xarray iteration is not freed before devlink_try_get()
> is called.
> Make sure that devlink_try_get() works with valid pointer.
> Achieve it by:
> 1) Splitting devlink_put() so the completion is sent only
>    after grace period. Completion unblocks the devlink_unregister()
>    routine, which is followed-up by devlink_free()
> 2) During devlinks xa_array iteration, get devlink pointer from xa_array
>    holding RCU read lock and taking reference using devlink_try_get()
>    before unlock.
> Signed-off-by: Jiri Pirko <>

Reviewed-by: Jakub Kicinski <>

Powered by blists - more mailing lists