[ovs-dev] [PATCH 08/23] datapath: don't unlock mutex when changing the user_features fails

Tonghao Zhang xiangxia.m.yue at gmail.com
Tue Aug 25 03:58:43 UTC 2020


On Fri, Aug 21, 2020 at 6:50 AM Greg Rose <gvrose8192 at gmail.com> wrote:
>
> From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
>
> Upstream commit:
>     commit 4c76bf696a608ea5cc555fe97ec59a9033236604
>     Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
>     Date:   Fri Nov 1 22:23:53 2019 +0800
>
>     net: openvswitch: don't unlock mutex when changing the user_features fails
>
>     Unlocking of a not locked mutex is not allowed.
>     Other kernel thread may be in critical section while
>     we unlock it because of setting user_feature fail.
>
>     Fixes: 95a7233c4 ("net: openvswitch: Set OvS recirc_id from tc chain index")
>     Cc: Paul Blakey <paulb at mellanox.com>
>     Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
>     Tested-by: Greg Rose <gvrose8192 at gmail.com>
>     Acked-by: William Tu <u9012063 at gmail.com>
>     Acked-by: Pravin B Shelar <pshelar at ovn.org>
>     Signed-off-by: David S. Miller <davem at davemloft.net>
>
> Cc: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Reviewed-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> ---
>  datapath/datapath.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/datapath/datapath.c b/datapath/datapath.c
> index 1235c4e..c222ef8 100644
> --- a/datapath/datapath.c
> +++ b/datapath/datapath.c
> @@ -1746,6 +1746,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
>                                 ovs_dp_reset_user_features(skb, info);
>                 }
>
> +               ovs_unlock();
>                 goto err_destroy_meters;
>         }
>
> @@ -1762,7 +1763,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
>         return 0;
>
>  err_destroy_meters:
> -       ovs_unlock();
>         ovs_meters_exit(dp);
>  err_destroy_ports_array:
>         kfree(dp->ports);
> --
> 1.8.3.1
>


-- 
Best regards, Tonghao


More information about the dev mailing list