Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp693480lqt; Fri, 19 Apr 2024 07:49:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxitvUcQNogbUdNfGoRR1wY39Z2H0rO7U9hE3YdQcz9f48T+PI28iZlEXRIybkn5DH2A4L1eEJujWT6I9kHlFzEVQG5XyY8UtsrlZuXw== X-Google-Smtp-Source: AGHT+IEEE+Q54MYTI+dfbgY2MfM1e0zurc/21NybfcYO72yjQhGtR1tnKbYUienvy9l0W5JMehPA X-Received: by 2002:a05:6a20:da89:b0:1a7:2e17:efd3 with SMTP id iy9-20020a056a20da8900b001a72e17efd3mr3346668pzb.5.1713538153151; Fri, 19 Apr 2024 07:49:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713538153; cv=pass; d=google.com; s=arc-20160816; b=R/TW1cCHKLFlSbTDAIwyr51k975u0ltYSGySuF92kHyjjswlIwuXRG46lxcpX+VXFk 0OgnrfxDCFdguwcZV0esmnIMEG6uSpDuUGsRG8CJ6DWHjedXi1psjphRo51KhGitdVX4 Gm+kpU1zLFFTp+e0MfJOJQXuWImztX+w8d7XzoW9opn5SwqllL8yLsHJXGEZFAkilZQT BkVkYmHJ2XqhNXq5Hl9TlbjccHR46uCvnR9KvQy1UCOqirZoQo9nZ8I+qrNmbxQb1B7i M0jMaWHSpQXnwJcZvxH+i0AaFA3bKX/xsmgozWfJucrfznNa8BJZ7axjyMhmkxq217G5 xzng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=dYc1JyqJtElzECndp95aqH3zWxprPPLbX2WAr6ujyUw=; fh=ECceH2dayNfnvmqOepwt3462Sc1jlGs79NtdtkTNamk=; b=OzyOgYAPqI7OjP85lXnEf1GNvHoUUWT/rXzdB7/N7FuY6REzao5Ni31aAu76bJD+yJ M9n+nymuB43B9xUi/rg0WZymG5+iG3RpCTIL9iitYqBK+e4VZS5wUBpLJY6xMDgRmaTN Tmsyt3R3wX+EjYejxQE3OJky2wshcNBvwFfd3AfJtMdAkMv+K3FCkahWKaBrhqikvXnC 6vHySBzmsJLZyeKHAw2phsxwup7CWnHxfQAY76IvthVleWWqoSYFJdpBBy5aUw+5YCVL OzCNkNZna00oi9+BIl+RZ94kq6vETK8ewuQz0OOeDOSSmiWeGagZ1K5DCxNpglkYqhiN QVZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lwtJx5lc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151603-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s22-20020a056a00195600b006edced072bdsi3538934pfk.58.2024.04.19.07.49.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 07:49:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151603-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lwtJx5lc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151603-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A281285ED4 for ; Fri, 19 Apr 2024 14:48:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85A2A12FB23; Fri, 19 Apr 2024 14:48:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lwtJx5lc" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3DDB12F5AD; Fri, 19 Apr 2024 14:48:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713538082; cv=none; b=YT91r6yc/8gWV/Mj4dwwGMSaONH+myNcliOXrsAx2mt7b1Q3KohEYAWF59gXoE5tAy9cdwngWObnY6n5m/cJ90MnKzCZifumm6jVmyMkv2ck2tzOyFSYqbCG89Pgwq6NA3K/xM+YIlm298WIPBmSbf2CVysQ+JCc0mRPVKFqom8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713538082; c=relaxed/simple; bh=cKfQYZQ7OTCZtL8yoh2ygg4+ioUaBLuR99Mk6YEFOhw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TdixRodkXn/Z35PwLuvmSeVnpz26Z3gAH2hJsTJPRmxjl8BaZZz6hlVhwwGg+TrjuMXpROZ3hbiZDrzBXTkZKoRTguOpAuludV/LwPgH++7ytVFce/iWVLuFePFfvmKjYbzqJ0F7/726Wb8A0M4obO0SB1s2sMrXD4v1eGpm65I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lwtJx5lc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3A53C072AA; Fri, 19 Apr 2024 14:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713538082; bh=cKfQYZQ7OTCZtL8yoh2ygg4+ioUaBLuR99Mk6YEFOhw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lwtJx5lct1z/v7GandOVBhe3JX4czq6eIptu5ZuurO7kxie94CcbRVNHp7zc8iMct 7U3mbi77qdT621CLaSt5cpBmqK1qAhZFRo1m7DCfuOVOGvjLvDoxRBwO7L4vvKnEBx 6xPDbDj+tHmMQwfyah9kxoMTwtxvk1TG6+6s6VtmXuYYMNooMEbcclucYepSj3qNnU UHNLx3hfooVl0ZdN+GfRGM3ZsEO27hVajUFTz1TbC5UFhfNMN6LYYOi6JWBD4n/cfA cV1pYI3HJAXP2S7YayDW2CvHrly5NuQW/aOnZoOsgEXNPKn4JEGqna/cVD9OtMECIH OJ8lVs5Ncr5AA== From: Benjamin Tissoires Date: Fri, 19 Apr 2024 16:47:52 +0200 Subject: [PATCH 2/3] HID: bpf: fix return value of entrypoints_*__attach() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240419-hid_bpf_lazy_skel-v1-2-9210bcd4b61c@kernel.org> References: <20240419-hid_bpf_lazy_skel-v1-0-9210bcd4b61c@kernel.org> In-Reply-To: <20240419-hid_bpf_lazy_skel-v1-0-9210bcd4b61c@kernel.org> To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713538077; l=967; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=cKfQYZQ7OTCZtL8yoh2ygg4+ioUaBLuR99Mk6YEFOhw=; b=k7MsPc8/YlVUzmV6a9ykWMJAwR3F/9Qa9SPGvai0abv0lViHFSR+8hELbHVHpQu7lVbtMi/bq WGVUtChmZKeBcPUKp/xp3EpTQwndBkF7svqX3nDvUzpDdnBPMtljzwZ X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= Turns out that this function returns the attached fd, so a positive or null value. Given that we were having no other fds before, we were receiving 0, and the test passed. Cc: stable@vger.kernel.org Fixes: f5c27da4e3c8 ("HID: initial BPF implementation") Signed-off-by: Benjamin Tissoires --- drivers/hid/bpf/hid_bpf_jmp_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/bpf/hid_bpf_jmp_table.c b/drivers/hid/bpf/hid_bpf_jmp_table.c index 89496aabbe15..301ac79db241 100644 --- a/drivers/hid/bpf/hid_bpf_jmp_table.c +++ b/drivers/hid/bpf/hid_bpf_jmp_table.c @@ -521,7 +521,7 @@ void hid_bpf_free_links_and_skel(void) #define ATTACH_AND_STORE_LINK(__name) do { \ err = entrypoints_bpf__##__name##__attach(skel); \ - if (err) \ + if (err < 0) \ goto out; \ \ links[idx] = bpf_link_get_from_fd(skel->links.__name##_fd); \ -- 2.44.0