lkml.org 
[lkml]   [2022]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] devlink: use devlink lock on DEVLINK_CMD_PORT_SPLIT
On Mon, 21 Feb 2022 14:33:25 +0100 Niels Dossche wrote:
> devlink_nl_cmd_port_split_doit is executed without taking the devlink
> instance lock. This function calls to devlink_port_get_from_info, which
> calls devlink_port_get_from_attrs, which calls
> devlink_port_get_by_index, which accesses devlink->port_list without the
> instance lock taken, while in other places devlink->port_list access
> always happens with the instance lock taken. The documentation in the
> struct also say that the devlink lock protects the port_list.
>
> The flag for no locking was added after refactoring the code to no
> longer use a global lock.
>
> Fixes: 2406e7e546b2 ("devlink: Add per devlink instance lock")
> Signed-off-by: Niels Dossche <niels.dossche@ugent.be>

You can't do this, driver will likely try to register ports and try
to re-acquire the same lock. I have a series queued to fix this by
moving the locking into drivers. I'll send it out this week.

\
 
 \ /
  Last update: 2022-02-22 06:54    [W:0.073 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site