From patchwork Tue Jun 21 01:28:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KP Singh X-Patchwork-Id: 12888629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FBF8C43334 for ; Tue, 21 Jun 2022 01:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243355AbiFUB23 (ORCPT ); Mon, 20 Jun 2022 21:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240120AbiFUB2T (ORCPT ); Mon, 20 Jun 2022 21:28:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D240E1928B for ; Mon, 20 Jun 2022 18:28:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91467B811BD for ; Tue, 21 Jun 2022 01:28:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16421C3411B; Tue, 21 Jun 2022 01:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655774896; bh=K0oOL0RFKKNWM96RrEqfv2xaxnbCY547USrJijlDyVw=; h=From:To:Cc:Subject:Date:From; b=d0iwgInzVihIYVhK4dY1VUIPHJygEYP96THXjf74ADAW1icV52LlL/GHeJkUYUNba ZHD04X/HJ+O/8JwfQUWkQPf/nSkBagmJCQBxBgojGl5vW5/zd1+IYVA3K0h5N3vKPD jU6Y53ZZgsVN3z5V6ypVdqI/T2iTvchiuoZKzQFfyv+xdiJk4tsjgmkhQjbp47a32/ I0GVY6S8wTGUxB5pZfg81BrUDbCK7lEXyrCnJFPoTavcbazaUHu62fWcZHHK8xZ4Cx ShBRbPes5q1MZzeDmSrS6xlMIzJGZMyvDSkp6MVLEDY1ljHXHhJjO0i/M5HqSgAoQK oARyJTyLAHzuQ== From: KP Singh To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Benjamin Tissoires , Yosry Ahmed Subject: [PATCH v2 bpf-next 0/5] Add bpf_getxattr Date: Tue, 21 Jun 2022 01:28:06 +0000 Message-Id: <20220621012811.2683313-1-kpsingh@kernel.org> X-Mailer: git-send-email 2.37.0.rc0.104.g0611611a94-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net v1 -> v2 - Used kfuncs as suggested by Alexei - Used Benjamin Tissoires' patch from the HID v4 series to add a sleepable kfunc set (I sent the patch as a part of this series as it seems to have been dropped from v5) and acked it. Hope this is okay. - Added support for verifying string constants to kfuncs Foundation for building more complex security policies using the BPF LSM as presented in LSF/MM/BPF: http://vger.kernel.org/bpfconf2022_material/lsfmmbpf2022-xattr.pdf Benjamin Tissoires (1): btf: Add a new kfunc set which allows to mark a function to be sleepable KP Singh (4): bpf: kfunc support for ARG_PTR_TO_CONST_STR bpf: Allow kfuncs to be used in LSM programs bpf: Add a bpf_getxattr kfunc bpf/selftests: Add a selftest for bpf_getxattr include/linux/bpf_verifier.h | 2 + include/linux/btf.h | 2 + kernel/bpf/btf.c | 42 ++++++++- kernel/bpf/verifier.c | 85 +++++++++++-------- kernel/trace/bpf_trace.c | 36 ++++++++ .../testing/selftests/bpf/prog_tests/xattr.c | 58 +++++++++++++ tools/testing/selftests/bpf/progs/xattr.c | 37 ++++++++ 7 files changed, 223 insertions(+), 39 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/xattr.c create mode 100644 tools/testing/selftests/bpf/progs/xattr.c