Message ID | ZD0ArKpwnDBJZsrE@gofer.mess.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1966541vqo; Mon, 17 Apr 2023 01:35:54 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5yNP8LE2uc8s63cfBKxPuDFpRwRs+0ooNsYfMCiqPqP+hHFzfRyhmxhWrfgmJvwZ6hkf4 X-Received: by 2002:a17:903:2308:b0:1a2:7462:d674 with SMTP id d8-20020a170903230800b001a27462d674mr13850299plh.24.1681720554477; Mon, 17 Apr 2023 01:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681720554; cv=none; d=google.com; s=arc-20160816; b=DW7B0zDPKyPn1m7340PtIxE45zth8nB87DD4zXPl7WZEy+TJceUpXkZ6f2beIvdCG6 ygBvF/upS0ZNROWuQlx68/6zUgW3DeOLGoAXXAGDGj+zbuGLEw9jmZGDZT5J7fJZbWKx lYDHM7OA+61SKja+QFvFKy+kr1Lp5JyfAnbxtWyjmqx2jN5l3Sq5JwzQ8VhBcYhUQZns CL5abD7KlqxEm096YizBm6bN7iG9mjTik5X1bJ9EupCwiB8vFnfuIdpCJgBcJF3HMFvY Hqlcc+CZya2UO6yAB3w1+mVKEpwSOOxhQpQVYSclUOSw71PAYcn1PhZRvIBQEBTdFcj9 RQTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=eEndvb/RLNpnFEoMCBVZBGG09Hjk+a+r0n6qcUD6oos=; b=HbVRdRb7ZP+HtteZDAPEi+xPXvBrOIm5iViBoh4ROliIyV9uHNsxBe1H9fK9qAVTCC Ox8jB/s/bexDk6Ecq9GiEfOF8Wu88A+vC9lWbjDvvHdr5sPrJEpXPRxlg8h5xLt5Wlmw 0GFs1Zsl4MN74TLf4AKfx4vXssxMZy5zyl4pI6zxLFIJVi9KKJ5OgLyQ1U1Wqt2QzmBk 0G8A3Hlb+xsWOSA749hOXfynHfeOdaHSLOXOw4vTIzb31g3qXNyfg4el3fBqj+GESTJH NAiYo91piFNQwcfIRfyvXjEao857ZD1KogqK4G6qXzmWB2YX5P+dK8hWX/TiraWHMn1U 5rRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mess.org header.s=2020 header.b=jnAgdxob; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mess.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a170902ee5300b001a6400e8c22si10581970plo.543.2023.04.17.01.35.40; Mon, 17 Apr 2023 01:35:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mess.org header.s=2020 header.b=jnAgdxob; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mess.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbjDQIR6 (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Mon, 17 Apr 2023 04:17:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjDQIRw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Apr 2023 04:17:52 -0400 Received: from gofer.mess.org (gofer.mess.org [88.97.38.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 765F526B2; Mon, 17 Apr 2023 01:17:51 -0700 (PDT) Received: by gofer.mess.org (Postfix, from userid 1000) id E7D8610006B; Mon, 17 Apr 2023 09:17:48 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mess.org; s=2020; t=1681719468; bh=7vrhf8jHivfnFCYmFG2HbdBI1KmJjq7kYoSAnAQyO6E=; h=Date:From:To:Subject:From; b=jnAgdxobsyQiBO+mf1lTUJ1l5zVhvTjnfE96jSjMen+Ig9xVjqbgI/Ubnlck59ZXp vzKJEYsWBTXyQrm5bN3Xnvl6okOHiX7XO9BPX1staWHeOTQ0DSyu2PX0FU1KgyG5qg d/qAe9ZCVFPKSMmKRObAIK2YwGHRDOkJEjYRSZ99Y2RwPSExY+DdGi3S4KNP4EyOC+ nbytIPrORFxBMRkD81whgTUHLjBTzLCZXXPC55rw8iSf2kuRwfQBntSnREQqQxTxkN 5hMMWES2xojiQ2CKHMZ0U+GKLRwcjOLzhK7eJpEgd7fejBMwz4CFDAzBTY+3SVv99s OvK3PIULkQP9A== Date: Mon, 17 Apr 2023 09:17:48 +0100 From: Sean Young <sean@mess.org> To: Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>, Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2] bpf: lirc program type should not require SYS_CAP_ADMIN Message-ID: <ZD0ArKpwnDBJZsrE@gofer.mess.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763411811845997379?= X-GMAIL-MSGID: =?utf-8?q?1763411811845997379?= |
Series |
[v2] bpf: lirc program type should not require SYS_CAP_ADMIN
|
|
Commit Message
Sean Young
April 17, 2023, 8:17 a.m. UTC
Make it possible to load lirc program type with just CAP_BPF. There is
nothing exceptional about lirc programs that means they require
SYS_CAP_ADMIN.
In order to attach or detach a lirc program type you need permission to
open /dev/lirc0; if you have permission to do that, you can alter all
sorts of lirc receiving options. Changing the IR protocol decoder is no
different.
Right now on a typical distribution /dev/lirc devices are only
read/write by root. Ideally we would make them group read/write like
other devices so that local users can use them without becoming root.
Signed-off-by: Sean Young <sean@mess.org>
---
kernel/bpf/syscall.c | 1 -
1 file changed, 1 deletion(-)
v2: improved commit message
Comments
Hello: This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <ast@kernel.org>: On Mon, 17 Apr 2023 09:17:48 +0100 you wrote: > Make it possible to load lirc program type with just CAP_BPF. There is > nothing exceptional about lirc programs that means they require > SYS_CAP_ADMIN. > > In order to attach or detach a lirc program type you need permission to > open /dev/lirc0; if you have permission to do that, you can alter all > sorts of lirc receiving options. Changing the IR protocol decoder is no > different. > > [...] Here is the summary with links: - [v2] bpf: lirc program type should not require SYS_CAP_ADMIN https://git.kernel.org/bpf/bpf-next/c/69a8c792cd95 You are awesome, thank you!
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 6d575505f89c..822ebc742a6a 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2463,7 +2463,6 @@ static bool is_net_admin_prog_type(enum bpf_prog_type prog_type) case BPF_PROG_TYPE_LWT_SEG6LOCAL: case BPF_PROG_TYPE_SK_SKB: case BPF_PROG_TYPE_SK_MSG: - case BPF_PROG_TYPE_LIRC_MODE2: case BPF_PROG_TYPE_FLOW_DISSECTOR: case BPF_PROG_TYPE_CGROUP_DEVICE: case BPF_PROG_TYPE_CGROUP_SOCK: