Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp684156ybv; Thu, 13 Feb 2020 07:43:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxYVu/hIDAV/cTwaAQzoIkKX7iVXbGaJrJWt/ngFROoz01hzkMXXpQkZJkdfhdUIUxGBSE0 X-Received: by 2002:a05:6830:12d5:: with SMTP id a21mr14054605otq.296.1581608618363; Thu, 13 Feb 2020 07:43:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608618; cv=none; d=google.com; s=arc-20160816; b=dwTs1TvnSUsfjrszsdQqo647vEZOidsObo76MaRMwi9/Tn6sQvKOK3xvrRWbYb1ESu go4goj95JfwaxBSEnvfJqly1sfP2S3xVUgNCW40xIivF1Q4TFwwQcQG7puFmeMpFSaxQ IHl0vrAntkvwWjhOG7Ma/N0bu+fQPqYg0BiQeOvCcmPrcBMU2gGv+3RkpxIaFisakhWV cfGIbclUDdkIqJRrHajehiSMlSLoRK9NIr85u5XN8JHRfRXlN5g2PV5+McYSvDB08hlY IQgcI7r7iX9AqF9gdEDg+YQrx79+79hqltwO1Zvj4rfZWSU+cnFuae9qrWJSdVGgRI/X QEWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wW1Ei3IIGelz5PAh6o1cBe3mWEzWAZksaP8ta16vA7s=; b=CdUPXeq/Kj3bMmyWi1YtTR0F0JCbkBCsWMvLSKMyegWPZ4lRwMvIJESSw464t2XiHa 3tc3A6MF2snUUm2PunHyokkMsR3SuRfBMVJdBT65oCK6KEW8gwJ6felRnSWbI58+SMgh bEeeraHtTMJyXrtb9v7Nw4/fNCJaWA37+nfJTAUJAzVrADj+Md/F5TlF+bvwSq2fqVE4 75h+EDwgshtRcvO03v2PpB3iJeAMzc4lWikPXyY6EXooASEpDxZUxDw/mt09bQyuPGu4 No+s03f7WdKR6IvjFRbFbjX6ssKAgqPlawwoB1rbIa+5fVnVDjPbiPxqeffQ9l0uWqL7 A1bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PVv+oi8r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w207si1241691oie.111.2020.02.13.07.43.26; Thu, 13 Feb 2020 07:43:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PVv+oi8r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387795AbgBMPnW (ORCPT + 99 others); Thu, 13 Feb 2020 10:43:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:53522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729517AbgBMP14 (ORCPT ); Thu, 13 Feb 2020 10:27:56 -0500 Received: from localhost (unknown [104.132.1.104]) (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 6146C24682; Thu, 13 Feb 2020 15:27:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607676; bh=sOWt88WVkaqu6GMzTtpvWwwMB224frFvtLxOEicCWVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PVv+oi8rqt6DzVDNwHuqXb3hDTS1JNbrnHBd7lGHt/gstofCw+F8qoMusYHMJMDTw IinhxOBM1EVFfqpf4gDOLCarCNcRGycfrcfIBjaY35jQsOq+3Pqqw5Ygb8kRgICsje O0xWBRq5rjpABJTYRU/Pn1YkMBDxeo1eUDZcyy2E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolai Stange , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 95/96] libertas: dont exit from lbs_ibss_join_existing() with RCU read lock held Date: Thu, 13 Feb 2020 07:21:42 -0800 Message-Id: <20200213151914.499399051@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolai Stange [ Upstream commit c7bf1fb7ddca331780b9a733ae308737b39f1ad4 ] Commit e5e884b42639 ("libertas: Fix two buffer overflows at parsing bss descriptor") introduced a bounds check on the number of supplied rates to lbs_ibss_join_existing(). Unfortunately, it introduced a return path from within a RCU read side critical section without a corresponding rcu_read_unlock(). Fix this. Fixes: e5e884b42639 ("libertas: Fix two buffer overflows at parsing bss descriptor") Signed-off-by: Nicolai Stange Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/marvell/libertas/cfg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c index c9401c121a14e..68985d7663491 100644 --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c @@ -1785,6 +1785,7 @@ static int lbs_ibss_join_existing(struct lbs_private *priv, rates_max = rates_eid[1]; if (rates_max > MAX_RATES) { lbs_deb_join("invalid rates"); + rcu_read_unlock(); goto out; } rates = cmd.bss.rates; -- 2.20.1