Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1540038pxb; Thu, 16 Sep 2021 09:31:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrl4a/rVnsAwfNpt/uCL7e7lep1XhwoW5VyE3O/o2t9d8/xuYPcvMIL0fUGSMExHYvjSSF X-Received: by 2002:a05:6e02:6c9:: with SMTP id p9mr4828584ils.198.1631809882071; Thu, 16 Sep 2021 09:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809882; cv=none; d=google.com; s=arc-20160816; b=Ctq8BONRcZrhTt+r0nWmvPukr25QXxPrH9vrP+7SyKNHd0DU5Jp77a9E8MGz2jXpuY 6fHlvgREPq3O5io/xv/R6XqwAlJ6NZNyRij8nOu5vMI/XEwSi7SdujqfBTKnQFzn5DGY 6ax9YrroGSI83by+m7F/DOyV7AGlhV8WykXAacSHzcTRL9xb+Fb90vRVllLFFhD/pj0R 9VsxCztcnCkI2scm5vzC+cEhf2cw5k5daZzN/IlK44WMCTiKVP1kSGQVGJprBooouDBc 5jdDETV/zw378423q5vEYH3eT+z0m9DySca1LOFhnPKxa8uz1DdjXQiLDT4ZfvmmEggb vDMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pLy7tAXgCm7t9rRjEa38zqJ3QTGQ3Ix0YoejidKpFT0=; b=CmcKock9KS6SiNzXff79rdbF/EQWv65rcPTFHWy1gocVYs9gen1vcdTVaEwC+gzWFk p2MG6mgAjZf7/JN9ih4p8m3XeRj0grUZByqJgn8nuQrZOPcyono1q4/oGTXIAPp+ZSVC hTFaVX2q9B5u/AWYBHpNpE1UEJwoyWO9G3MEnFWmibSnEi0wmrqS90CURsYFEua8URQ/ /xPmcLDeFBCzIwG20bmxo/8Y4QIyaYS+MjcUVTgxn+949M+xbhRgzkC0LbQHwNOlbr2Y /TKkKjM14SqOI+MB3dXYQehgB2+eQeCHZv1SU8M7D7QQjv37X7ncAtBJ8RKgvnHZQ0mX rNPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uoTpH8WC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si3107856ioq.76.2021.09.16.09.31.09; Thu, 16 Sep 2021 09:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uoTpH8WC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242294AbhIPQaz (ORCPT + 99 others); Thu, 16 Sep 2021 12:30:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:59350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241607AbhIPQWB (ORCPT ); Thu, 16 Sep 2021 12:22:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0B5D461409; Thu, 16 Sep 2021 16:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808918; bh=RgyEE/gxv2+PbwT+Twl7+jMwQK+Cn83YUGhdVMiZbVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uoTpH8WCbha7Lken38wgbLQBqHu0meJzCNTq7UC23M5gw/9h6XYXuBs08M04ulFXv 1Vr0+FY0NdOTZ7n6B7jBvfbSTdlBvwvbS0+LHiCtUJN9D9Sdt5daL0TUpt4EhSGMWL 6chtCMt20BK6Q6ySB/ngPPsLFlRKXmu9RYXxJCdc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chengfeng Ye , Alexei Starovoitov , Sasha Levin Subject: [PATCH 5.10 270/306] selftests/bpf: Fix potential unreleased lock Date: Thu, 16 Sep 2021 18:00:15 +0200 Message-Id: <20210916155803.273406806@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengfeng Ye [ Upstream commit 47bb27a20d6ea22cd092c1fc2bb4fcecac374838 ] This lock is not released if the program return at the patched branch. Signed-off-by: Chengfeng Ye Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20210827074140.118671-1-cyeaa@connect.ust.hk Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c b/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c index ec281b0363b8..86f97681ad89 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c +++ b/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c @@ -195,8 +195,10 @@ static void run_test(int cgroup_fd) pthread_mutex_lock(&server_started_mtx); if (CHECK_FAIL(pthread_create(&tid, NULL, server_thread, - (void *)&server_fd))) + (void *)&server_fd))) { + pthread_mutex_unlock(&server_started_mtx); goto close_server_fd; + } pthread_cond_wait(&server_started, &server_started_mtx); pthread_mutex_unlock(&server_started_mtx); -- 2.30.2