Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1571331rdb; Wed, 31 Jan 2024 02:47:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQlxDQGg8SKiE9kbOw1W/RxQTboNDggsrK+UcBKb1qK+aE+E6xJptpYrnsgNzB1cL42gO9 X-Received: by 2002:a2e:99c6:0:b0:2cd:8f26:a1e9 with SMTP id l6-20020a2e99c6000000b002cd8f26a1e9mr850008ljj.37.1706698048761; Wed, 31 Jan 2024 02:47:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706698048; cv=pass; d=google.com; s=arc-20160816; b=bbK+cE4y/XPkk7NEtA6kWEvwoguQKZc1Cw6V48/iHGl36mRqVYuR/i4H74d8S1bHdi Omc3mj4y2YLBp3tEmctiOw0d/hQnscdb6dGm2+EyiHL3YcJq6dIkqKOcz3bz/++kdpDP Zas2w3Vm1P2ZD00EvMqw8THCYLFQPiNBdMgJoWC7zFdd9lh1YEwBFCDhQ+ACjssVO3+w g9ocPzoCDvJf8Fyju4Zduhh7pklKJJuWVgPhl4PtrbLeY/JNKTEaoRhxdi+0XZP0wdHh z74OxhV9MkltmS2DxCH0Hvd2T5tJ+26J0QL/eHhI1HPXFbvyJtpl5FkCZaS9oRoRkrUL RqMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from:dkim-signature; bh=69YroK0e3f7NS3cAEaM5e2L3aKt4ZJ30N5NeZPZ0fz0=; fh=FHeNUPvSv2SWO+Z9PhvCeqnpfX5nM2ZjTfTU2ickVE8=; b=P3qqlWLJIV7g+aY78zULPUAQAKXdZ5qUYs5QEA3ipnOyB9Tu1RWr5S856eUNw4FuDZ ROorLfmEnqouDacL4kPKzWulBm6R7CEPW97eqv07IOYy+uk99U24Apub+ovvJ7gWEzi6 DuZhsi31da69gVl2Z7axVAS0rA+a2eA389DaDByzaFJBdcd82o9yCN04NiHXIL1/qXhd WNkrenqy4snKCNMXnxJbSRmg898XN1o0VXC/y7oSEPp2j9bbjwG70QJC1BUClN07Xeyt Ix58XfFRRfScNEyC3Nt1L/OekFze/91SSfkgW3PpBkQagi1YHT0/sceNm3S2NwpDVZYO nPjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fac5OTkB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-46243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUJi/yHHFAsVy1aBLyWfQ7X23XEUxypAzNh1Smu6kwUWW+3Y5sNcz40DIWFEMmfH0tH25Fk2BcugQt00k4jxgJcsqXpqx79AbsY3g4Inw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j24-20020aa7ca58000000b0055f4210be05si1558450edt.319.2024.01.31.02.47.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:47:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fac5OTkB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-46243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46243-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 43F311F30AC9 for ; Wed, 31 Jan 2024 10:38:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E25C69D05; Wed, 31 Jan 2024 10:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fac5OTkB" 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 7939F69D0B; Wed, 31 Jan 2024 10:38:27 +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=1706697507; cv=none; b=nwszzqrUdQpJMOj/Nh4mutYbdYykB4aN+oxC9yXHueO/JWbZdB5qiGJo0DHiC7l9oWbSlhhTHkZACPbxaJ75BIXpT1j2mhiz3y6EJmOFE4R5GFlGpcztAWwsNSHlf51wThuNye2nUk6lYN3HdRH4rxs+jUSOouO0W3rMkDUO9/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706697507; c=relaxed/simple; bh=G1xb+7GcuqoR3Hpne3zc8YgCg5SYmrqCTtVXVrZG2fU=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=GKVi2uzth66Y48lpOrs2HhSlpdmCLeGeO/E3piEg4NeH5SzPfDaywY6hCdTitxM7eHBjBFjyJnXm6n5k8wNVdrh8yLuKHI50QmIo3LJt2C+ne9yVCG8w46ISX28ybzloZuWBEgd8GhoL+O5dSbPzyi+USLPyspP5lMC0Pa1XXKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fac5OTkB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 098B5C433F1; Wed, 31 Jan 2024 10:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706697507; bh=G1xb+7GcuqoR3Hpne3zc8YgCg5SYmrqCTtVXVrZG2fU=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=Fac5OTkBkRLA1DX3YIghuHVctzb5epHMKkDNS7/diRvKR/BH9srNwyhkx0/srNYGG 9PxW0AupX9Wa5lwUZegOvAvz0y1h+cBbPBhwlbu2IwX+jJP8Z0tJd/OYvqmnKiPYHc t5/vCrZgAtB1guCN76Xw2MJrnkhUT55lUamWj8yu0kRBhYTA01ylcq8iRqBoj5n6ey M/sqzrRKCNXO45Dpv/aCKTjpNE3KALzNxY5Ec/LT2G4GiXX2gNOMHFkmltEYVLoJBb 5YcUmaFEs+Ls3Z1X6UIsxeBx0VXk1cceWkYjUUsZ9UC/fy7vgLCBsVcrMESA/0liT5 T+8wXiqUCuxWw== From: Benjamin Tissoires To: Jiri Kosina , Benjamin Tissoires , Dan Carpenter , Daniel Borkmann , Andrii Nakryiko , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org In-Reply-To: <20240124-b4-hid-bpf-fixes-v2-0-052520b1e5e6@kernel.org> References: <20240124-b4-hid-bpf-fixes-v2-0-052520b1e5e6@kernel.org> Subject: Re: [PATCH v2 0/3] HID: bpf: couple of upstream fixes Message-Id: <170669750476.304575.17277174965193688582.b4-ty@kernel.org> Date: Wed, 31 Jan 2024 11:38:24 +0100 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 X-Mailer: b4 0.12.4 On Wed, 24 Jan 2024 12:26:56 +0100, Benjamin Tissoires wrote: > This is the v2 of this series of HID-BPF fixes. > I have forgotten to include a Fixes tag in the first patch > and got a review from Andrii on patch 2. > > And this first patch made me realize that something was fishy > in the refcount of the hid devices. I was not crashing the system > even if I accessed the struct hid_device after hid_destroy_device() > was called, which was suspicious to say the least. So after some > debugging I found the culprit and realized that I had a pretty > nice memleak as soon as one HID-BPF program was attached to a HID > device. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-6.8/upstream-fixes), thanks! [1/3] HID: bpf: remove double fdget() https://git.kernel.org/hid/hid/c/7cdd2108903a [2/3] HID: bpf: actually free hdev memory after attaching a HID-BPF program https://git.kernel.org/hid/hid/c/89be8aa5b0ec [3/3] HID: bpf: use __bpf_kfunc instead of noinline https://git.kernel.org/hid/hid/c/764ad6b02777 Cheers, -- Benjamin Tissoires