From patchwork Tue Oct 27 13:46:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 312814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF4B7C64E7C for ; Tue, 27 Oct 2020 14:52:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E6822225E for ; Tue, 27 Oct 2020 14:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810360; bh=NOz+Rc/zYTz16d+7g7w8zTb3992X5oy1n5Ouw5KLapM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YHLDv585rxSXzmSCj6AvI4ubtq6OKBiIwao4ToC1BJJQUm1jMTEnfx2unAwBXZEks OSJdAcVxLFYlu1Tn8d5VFAuvsOn09wu9HXxfWTbk77G2+6FCp+GJ7L1iWgU9Kt/bur IRLur+OHt+8QzQqyvNC232QHclKG09eRowfzirG0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1775175AbgJ0Owe (ORCPT ); Tue, 27 Oct 2020 10:52:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:49894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1770190AbgJ0Otx (ORCPT ); Tue, 27 Oct 2020 10:49:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B9E820709; Tue, 27 Oct 2020 14:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810193; bh=NOz+Rc/zYTz16d+7g7w8zTb3992X5oy1n5Ouw5KLapM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WVd084CrEBgFKmQ7CHdINxsiWgm0P5EDza22YcPDGY/Fpz9vEnQ8xa7qWjeKFeQrW i+bGFmo5IkxPW5RJldII7X1WhviAYG2FhxMRab43v7MuRtS0EQV+8uU9+kINsEG7FX lR08wt/EiS60Q45DjD2ibOPr49p0LQQKW18oQQLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Nault , Cong Wang , Jakub Kicinski Subject: [PATCH 5.8 054/633] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action() Date: Tue, 27 Oct 2020 14:46:37 +0100 Message-Id: <20201027135525.238226269@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Guillaume Nault [ Upstream commit b130762161374b1ef31549bef8ebd4abeb998d94 ] We need to jump to the "err_out_locked" label when tcf_gate_get_entries() fails. Otherwise, tc_setup_flow_action() exits with ->tcfa_lock still held. Fixes: d29bdd69ecdd ("net: schedule: add action gate offloading") Signed-off-by: Guillaume Nault Acked-by: Cong Wang Link: https://lore.kernel.org/r/12f60e385584c52c22863701c0185e40ab08a7a7.1603207948.git.gnault@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/sched/cls_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -3707,7 +3707,7 @@ int tc_setup_flow_action(struct flow_act entry->gate.num_entries = tcf_gate_num_entries(act); err = tcf_gate_get_entries(entry, act); if (err) - goto err_out; + goto err_out_locked; } else { err = -EOPNOTSUPP; goto err_out_locked;