Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp463443pxb; Thu, 9 Sep 2021 05:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4jSU2TfERBSoPmpj+rLAIBgbDgtrQgva/DYOtDEz0DvC12zGLOLJVWQ3ee+l3dUGmD3Xu X-Received: by 2002:a17:906:4892:: with SMTP id v18mr2962392ejq.541.1631189404967; Thu, 09 Sep 2021 05:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631189404; cv=none; d=google.com; s=arc-20160816; b=XAFTtzU9zkHK8Yby0cP5GLKNJWz7dyT9e6G73oNEz3LEGBLt22BIuRH5SfKw3NdXR6 9fHkbM9NDj9SNyJRsv+RKfFSh07QP9MAowDQ1k1JBlHbMs4tN39/OAHOw7eEWeZgVszo WEbYBL3QuKFa3x/cqCNK6dhXCR4W8ncgPb+Q6kdowaC/Z32ycDDJgTtwYN1xOJff0BBz W1GbJGg+C3ujEGR2BQZuCWuIOkirGCE06dCqmh6jjzaaxSzHTM4sjStqqssBcmM9nkXi Rnia9Up3NTkKhe9T+dnZ/duFMr0DmjxNVtM8N039DQNKSCDe/wyMx8m/BiulTDRjUPbF rP0Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pLy7tAXgCm7t9rRjEa38zqJ3QTGQ3Ix0YoejidKpFT0=; b=lv+Fjoh4dG3BX5thbLOGS3X7HVG17IQec3v4356mGwAxWd3L5TQn7heiFaKBJ4gF60 P6a8kIzUiKELzz67Nme3SVSpeaL9Pl5ykp2xdGip9f/pao6ppTsVJ3WgDG5zx6rWrkb4 iCQQulev98uOhWNe0zPuPDXyvu+aASTOTOMs57jVRmMSmAYotJHyN9AA9Fi99fg51AZr fClvH+SkLNm5L/qV5l/KPFysg4FfgNSQ//1/nNt63fs9/Eh/M7liVKQby87Y+bY+f7KS kxH5aXHPaKI7OshbRxA9Msm/verfcjn7S+zAqJuMV73k4cK0LAijzjsHkArbNG81Vqi8 S7bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BNIJvHB6; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 18si1700862ejy.624.2021.09.09.05.09.37; Thu, 09 Sep 2021 05:10:04 -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=@kernel.org header.s=k20201202 header.b=BNIJvHB6; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344462AbhIIMHB (ORCPT + 99 others); Thu, 9 Sep 2021 08:07:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:41250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245640AbhIIMBW (ORCPT ); Thu, 9 Sep 2021 08:01:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BCCBF61222; Thu, 9 Sep 2021 11:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187984; bh=RgyEE/gxv2+PbwT+Twl7+jMwQK+Cn83YUGhdVMiZbVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BNIJvHB6ZUd/fVq8ngTeDvk3bILJTASO6uO4lzppBaifgcCDQ5qPj5VAkiZFf6opv 6GFGf0/gop1ESVZmrDeiDLsRbEVZe7KFNmTQzOd/Od7ne5AWCWSAd3VtPvkDQ0HUzS epzWa3ZZYxqw4MeALNF/N4REDgB+SO4t4+mJKrKNjGZV5lwuhZw8EcGorfIsHfbHvf spjvXg72vTACvcLI9S+o7ySMHq7LmVNjO9hwQBphfaGtjxthrWqw1pvJ3nZ8HV6EnG D5227dP6dEkA3+GYsvrUlQybhK2cefnuDCEwAl1i+h6BBKzUJXrHJTmBLRrqml1wZZ ZQnaiAKnil4aw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chengfeng Ye , Alexei Starovoitov , Sasha Levin , linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 245/252] selftests/bpf: Fix potential unreleased lock Date: Thu, 9 Sep 2021 07:40:59 -0400 Message-Id: <20210909114106.141462-245-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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