]> git.proxmox.com Git - mirror_ovs.git/commit
dpif-netdev: Prevent unsafe access when retrieving meter stats.
authorJustin Pettit <jpettit@ovn.org>
Wed, 29 Aug 2018 00:38:25 +0000 (17:38 -0700)
committerJustin Pettit <jpettit@ovn.org>
Tue, 4 Sep 2018 20:36:37 +0000 (13:36 -0700)
commit866bc7567ac5f6cf6ee52f6e3aa1253766898cf6
tree13790f3dedcceeb7e1af13165f76907b712a0f85
parentd0db81eac89e0b0304c6e468c9c4d590414181d8
dpif-netdev: Prevent unsafe access when retrieving meter stats.

dpif_netdev_meter_get() retrieved a pointer to a meter entry without
holding a lock.  It's possible that another thread could have deleted
that entry between retrieving the pointer and dereferencing the pointer.
This makes the function hold the lock the entire time the meter entry is
needed.

Found by inspection.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
lib/dpif-netdev.c