Catégories
CVE-2023-53591

net/mlx5e: Fix deadlock in tc route query code

Résumé

net/mlx5e: Fix deadlock in tc route query code

Description d'origine

La description telle que publiée par la source (souvent en anglais).

In the Linux kernel, the following vulnerability has been resolved:

net/mlx5e: Fix deadlock in tc route query code

Cited commit causes ABBA deadlock[0] when peer flows are created while
holding the devcom rw semaphore. Due to peer flows offload implementation
the lock is taken much higher up the call chain and there is no obvious way
to easily fix the deadlock. Instead, since tc route query code needs the
peer eswitch structure only to perform a lookup in xarray and doesn't
perform any sleeping operations with it, refactor the code for lockless
execution in following ways:

  • RCUify the devcom 'data' pointer. When resetting the pointer
    synchronously wait for RCU grace period before returning. This is fine
    since devcom is currently only used for synchronization of
    pairing/unpairing of eswitches which is rare and already expensive as-is.

  • Wrap all usages of 'paired' boolean in {READ|WRITE}_ONCE(). The flag has
    already been used in some unlocked contexts without proper
    annotations (e.g. users of mlx5_devcom_is_paired() function), but it wasn't
    an issue since all relevant code paths checked it again after obtaining the
    devcom semaphore. Now it is also used by mlx5_devcom_get_peer_data_rcu() as
    "best effort" check to return NULL when devcom is being unpaired. Note that
    while RCU read lock doesn't prevent the unpaired flag from being changed
    concurrently it still guarantees that reader can continue to use 'data'.

  • Refactor mlx5e_tc_query_route_vport() function to use new
    mlx5…

Source: OSV.dev (Open Source Vulnerabilities) NVD OSV

Paquets affectés

Linux Kernel
[{"type":"ECOSYSTEM","events":[{"introduced":"5.15.0"},{"fixed":"5.15.115"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.31"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.3.5"}]}]

État des correctifs par distribution

Paquets corrigés publiés par chaque distribution pour cette CVE

Références

Nous utilisons des cookies pour l'analyse d'audience et la mesure publicitaire. Ce réglage s'applique à tous les sites de Game co., Ltd. En savoir plus