Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp13096ybh; Tue, 10 Mar 2020 18:12:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsCbp27aomhgKOSJMj7xMnPNfr3yUStEpfEo5TURqMOKMjB/4ZVnzMsjcs6G2kORAoc2tkC X-Received: by 2002:a9d:7d0c:: with SMTP id v12mr416456otn.171.1583889124807; Tue, 10 Mar 2020 18:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583889124; cv=none; d=google.com; s=arc-20160816; b=ITfRWrNbbg4SL+cXsru0uZwDyA03MiIXHSW8n8hVoQ4mxIowJGVcwF2EqYPVm7JERt hCjqnF5V1CA4y/C7NB43dhUNQZUeigNJaX78w9RsBHaReIg3u+FUuVQYpIbyi0L40xWa xcKPggKR/0E6RmEEtuowu0rbOA98k7LJ72ODMSMPCCGhtfuWc8jOhSZs7fyqD5tG4BxB V+eWTfyn94mVBL/UwKCZuKWlPqkmOthBjv2DN326kdjSX09Ki7CjZnIyHZ+3L+cKDB6w z+6JgozegzykPuqm2p20IrViBgmF0BNTeYZAbf0W4u4zwm0OUsj4zMzVHQIIJJJjY4ox zq1Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s3SzbnYdZVe4q+XUx8QQoIEDKuVKKcXtBja4UTxQRV0=; b=mgAKG6GoRTNKvMqTahCowwaojMiRmChkWHt9Al6mMz9RrfLmBN+k28i5bv17APL46Q e52q0K5HgXIFw6+2WFvqcv4bsHXFxSS7YHYRdIjO59USg7rO35XhgRx0tMTHgSdJ+CH4 yXcLlWhTtCCKpiL83nm3aXU3J1oFdwIDkVv+S5znApBzpwQ8omz7wly4ADtRG5VMXaoq NylxTx+QhyGpTvufBzuDMy12Lu5dVgfmhIKqhdAYLe0EkJMEuuLMjTDLf+aFAaNL5GuV UfAJV6/pk6YuhSB9uoba+O7nxhanNnMDYwVD3Tqc7GYpRzem3s5s9WB0xj+hS3odZUa2 iGRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rp6AhCQP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si218547otq.223.2020.03.10.18.11.52; Tue, 10 Mar 2020 18:12:04 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=Rp6AhCQP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727916AbgCKBJ2 (ORCPT + 99 others); Tue, 10 Mar 2020 21:09:28 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51029 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbgCKBJ2 (ORCPT ); Tue, 10 Mar 2020 21:09:28 -0400 Received: by mail-wm1-f68.google.com with SMTP id a5so298546wmb.0; Tue, 10 Mar 2020 18:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s3SzbnYdZVe4q+XUx8QQoIEDKuVKKcXtBja4UTxQRV0=; b=Rp6AhCQPw6Q9uSi5FnFtArlq9SF2DJXKfWE6xjdcm4quRXLBO7TMo4/Xb3vsNDfwlm /5+g5yC5BuV65BZ/DW2YRxffwP67uGD2cqIFS5dgiCmJdKUnMV9PE+0SlnGMGHVAgjTw 2XuorM3JJf241UPzWyYvqi0Tt6i/2fcDHyI53sCJl7tYYDPw6Jj1mrbfbCnkOKOZTInq rFyRHoV8zNSDfsPioOsmWuKOWZdWbLUVH/uXUyVRUNBKs2xmnlhgzkonN7ySFUge/dTv D7HTRoKRlkpkAB11fGLhK4vLhRgj0ZFyOSUIbMrHdUd5VDi2Qmxnxfr72LPiQ5boS9CA G8+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s3SzbnYdZVe4q+XUx8QQoIEDKuVKKcXtBja4UTxQRV0=; b=W+VZCifMOoGzeFnMZdQ+vv+tGqVRjXIcZvOrf7gzGsGZ59JyFuZU3ijLYDc+KJvti2 alMGD4RFsdOecsie0pzPguLHEv5uNXLVKxTVkjl4+J99uXvg4wXds6hlPMxhhq9yn1T2 Rz3UoBv7WeDT2ku3qCOfvVseSBPlnltE5MSCVU/bcnErGsHJ3m0ErGD/CFtxUpYBktKZ 0hfruKjqNR0CmgZQ/KYIw515EJsOwuhzbb/sFU3k53X3nnrFnJhR2xMGT2M1+zE+zDFZ xWm+5DBfV9O0Ib2QoFynk36eBwMjpncXL5jlytwMUMRvFIu9W6/PfkAG2kDTZO8rB+Hw tJ5g== X-Gm-Message-State: ANhLgQ2NI77Z9wa0dExkYlWd0PRBLf6nJWzBsGIOy3VfaTF90grd1d7F mW2M6mPO/DhyktmaqFdMZw== X-Received: by 2002:a1c:f606:: with SMTP id w6mr409287wmc.109.1583888965751; Tue, 10 Mar 2020 18:09:25 -0700 (PDT) Received: from ninjahost.lan (host-2-102-15-144.as13285.net. [2.102.15.144]) by smtp.googlemail.com with ESMTPSA id i6sm36658097wra.42.2020.03.10.18.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 18:09:25 -0700 (PDT) From: Jules Irenge To: boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko Subject: [PATCH 1/8] bpf: Add missing annotations for __bpf_prog_enter() and __bpf_prog_exit() Date: Wed, 11 Mar 2020 01:09:01 +0000 Message-Id: <20200311010908.42366-2-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200311010908.42366-1-jbi.octave@gmail.com> References: <0/8> <20200311010908.42366-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse reports a warning at __bpf_prog_enter() and __bpf_prog_exit() warning: context imbalance in __bpf_prog_enter() - wrong count at exit warning: context imbalance in __bpf_prog_exit() - unexpected unlock The root cause is the missing annotation at __bpf_prog_enter() and __bpf_prog_exit() Add the missing __acquires(RCU) annotation Add the missing __releases(RCU) annotation Signed-off-by: Jules Irenge --- kernel/bpf/trampoline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c index 6b264a92064b..09bce10ad1cc 100644 --- a/kernel/bpf/trampoline.c +++ b/kernel/bpf/trampoline.c @@ -374,6 +374,7 @@ void bpf_trampoline_put(struct bpf_trampoline *tr) * call __bpf_prog_exit */ u64 notrace __bpf_prog_enter(void) + __acquires(RCU) { u64 start = 0; @@ -385,6 +386,7 @@ u64 notrace __bpf_prog_enter(void) } void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start) + __releases(RCU) { struct bpf_prog_stats *stats; -- 2.24.1