Commit dac7c08f authored by Parav Pandit's avatar Parav Pandit Committed by David S. Miller
Browse files

devlink: Fix list access without lock while reading region

While finding the devlink device during region reading,
devlink device list is accessed and devlink device is
returned without holding a lock. This could lead to use-after-free
accesses.

While at it, add lockdep assert to ensure that all future callers hold
the lock when calling devlink_get_from_attrs().

Fixes: 4e54795a

 ("devlink: Add support for region snapshot read command")
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdd41ec2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment