From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753555AbdCAWj4 (ORCPT ); Wed, 1 Mar 2017 17:39:56 -0500 Received: from smtp-sh2.infomaniak.ch ([128.65.195.6]:51642 "EHLO smtp-sh2.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbdCAWjS (ORCPT ); Wed, 1 Mar 2017 17:39:18 -0500 Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() To: James Morris References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> Date: Wed, 1 Mar 2017 23:20:54 +0100 User-Agent: MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH" X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: multipart/mixed; boundary="JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx"; protected-headers="v1" From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: James Morris Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> In-Reply-To: --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/03/2017 10:32, James Morris wrote: > On Wed, 22 Feb 2017, Micka=C3=ABl Sala=C3=BCn wrote: >=20 >> Add an eBPF function bpf_handle_fs_get_mode(handle_fs) to get the mode= >> of a an abstract object wrapping either a file, a dentry, a path, or a= n >> inode. >> >> Changes since v4: >> * use a file abstraction (handle) to wrap inode, dentry, path and file= >> structs >=20 > Good to see these abstractions. As discussed at LPC, we need to ensure= =20 > that we don't couple the Landlock API too closely with the LSM API, as = the=20 > former is an ABI exposed to userland -- we don't want to lose the abili= ty=20 > to change LSM internally due to breaking Landlock policies. Right, it is the case now, especially with the Landlock events. >=20 >> @@ -82,6 +87,8 @@ enum bpf_arg_type { >> =20 >> ARG_PTR_TO_CTX, /* pointer to context */ >> ARG_ANYTHING, /* any (initialized) argument is ok */ >> + >> + ARG_CONST_PTR_TO_HANDLE_FS, /* pointer to an abstract FS struct */ >> }; >=20 > Extraneous whitespace? It is on purpose, following the same rules as used for this enum. Micka=C3=ABl --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx-- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUysCyY8er9Axt7hqIt7+33O9apUFAli3SUYACgkQIt7+33O9 apXajgf/RL4nqWHXKhhoSP0o88+vfZZSrLSEdzEQSYZtpJETj3S0/Hh/A92lyVzD uTZ2Bdo1GXwS7gszX+T0behdkpK1/zJEzL0duAHKlZkt5L6lEgxXxvS1GKoAWayR mPB9lf7Lmw8I/PakZ3quXZgc+Lr+YtlSXqqT/Ei5T9nltVtH27KXbQvEPmUtNQBU 8CXfwAdOt2L8+wSnzdo0J/dwRrATvQ2eWIth+KmvLO0MG9QN8qrHC4EfwTi/FKP1 Br2HFdtEMT/gXpdGoIwpoEZ2nIhgl6GGrAMzBqVzSBmZdAFs2JcD2J0pnuqIUuag RO3O8yTKISg9iPG6ZDsFoGf0FEWNiA== =tR1Z -----END PGP SIGNATURE----- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() Date: Wed, 1 Mar 2017 23:20:54 +0100 Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH" Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , To: James Morris Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: List-Id: netdev.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: multipart/mixed; boundary="JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx"; protected-headers="v1" From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: James Morris Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> In-Reply-To: --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/03/2017 10:32, James Morris wrote: > On Wed, 22 Feb 2017, Micka=C3=ABl Sala=C3=BCn wrote: >=20 >> Add an eBPF function bpf_handle_fs_get_mode(handle_fs) to get the mode= >> of a an abstract object wrapping either a file, a dentry, a path, or a= n >> inode. >> >> Changes since v4: >> * use a file abstraction (handle) to wrap inode, dentry, path and file= >> structs >=20 > Good to see these abstractions. As discussed at LPC, we need to ensure= =20 > that we don't couple the Landlock API too closely with the LSM API, as = the=20 > former is an ABI exposed to userland -- we don't want to lose the abili= ty=20 > to change LSM internally due to breaking Landlock policies. Right, it is the case now, especially with the Landlock events. >=20 >> @@ -82,6 +87,8 @@ enum bpf_arg_type { >> =20 >> ARG_PTR_TO_CTX, /* pointer to context */ >> ARG_ANYTHING, /* any (initialized) argument is ok */ >> + >> + ARG_CONST_PTR_TO_HANDLE_FS, /* pointer to an abstract FS struct */ >> }; >=20 > Extraneous whitespace? It is on purpose, following the same rules as used for this enum. Micka=C3=ABl --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx-- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUysCyY8er9Axt7hqIt7+33O9apUFAli3SUYACgkQIt7+33O9 apXajgf/RL4nqWHXKhhoSP0o88+vfZZSrLSEdzEQSYZtpJETj3S0/Hh/A92lyVzD uTZ2Bdo1GXwS7gszX+T0behdkpK1/zJEzL0duAHKlZkt5L6lEgxXxvS1GKoAWayR mPB9lf7Lmw8I/PakZ3quXZgc+Lr+YtlSXqqT/Ei5T9nltVtH27KXbQvEPmUtNQBU 8CXfwAdOt2L8+wSnzdo0J/dwRrATvQ2eWIth+KmvLO0MG9QN8qrHC4EfwTi/FKP1 Br2HFdtEMT/gXpdGoIwpoEZ2nIhgl6GGrAMzBqVzSBmZdAFs2JcD2J0pnuqIUuag RO3O8yTKISg9iPG6ZDsFoGf0FEWNiA== =tR1Z -----END PGP SIGNATURE----- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() Date: Wed, 1 Mar 2017 23:20:54 +0100 Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH" Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: To: James Morris Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf List-Id: linux-api@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: multipart/mixed; boundary="JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx"; protected-headers="v1" From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: James Morris Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> In-Reply-To: --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/03/2017 10:32, James Morris wrote: > On Wed, 22 Feb 2017, Micka=C3=ABl Sala=C3=BCn wrote: >=20 >> Add an eBPF function bpf_handle_fs_get_mode(handle_fs) to get the mode= >> of a an abstract object wrapping either a file, a dentry, a path, or a= n >> inode. >> >> Changes since v4: >> * use a file abstraction (handle) to wrap inode, dentry, path and file= >> structs >=20 > Good to see these abstractions. As discussed at LPC, we need to ensure= =20 > that we don't couple the Landlock API too closely with the LSM API, as = the=20 > former is an ABI exposed to userland -- we don't want to lose the abili= ty=20 > to change LSM internally due to breaking Landlock policies. Right, it is the case now, especially with the Landlock events. >=20 >> @@ -82,6 +87,8 @@ enum bpf_arg_type { >> =20 >> ARG_PTR_TO_CTX, /* pointer to context */ >> ARG_ANYTHING, /* any (initialized) argument is ok */ >> + >> + ARG_CONST_PTR_TO_HANDLE_FS, /* pointer to an abstract FS struct */ >> }; >=20 > Extraneous whitespace? It is on purpose, following the same rules as used for this enum. Micka=C3=ABl --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx-- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUysCyY8er9Axt7hqIt7+33O9apUFAli3SUYACgkQIt7+33O9 apXajgf/RL4nqWHXKhhoSP0o88+vfZZSrLSEdzEQSYZtpJETj3S0/Hh/A92lyVzD uTZ2Bdo1GXwS7gszX+T0behdkpK1/zJEzL0duAHKlZkt5L6lEgxXxvS1GKoAWayR mPB9lf7Lmw8I/PakZ3quXZgc+Lr+YtlSXqqT/Ei5T9nltVtH27KXbQvEPmUtNQBU 8CXfwAdOt2L8+wSnzdo0J/dwRrATvQ2eWIth+KmvLO0MG9QN8qrHC4EfwTi/FKP1 Br2HFdtEMT/gXpdGoIwpoEZ2nIhgl6GGrAMzBqVzSBmZdAFs2JcD2J0pnuqIUuag RO3O8yTKISg9iPG6ZDsFoGf0FEWNiA== =tR1Z -----END PGP SIGNATURE----- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH-- From mboxrd@z Thu Jan 1 00:00:00 1970 References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> Date: Wed, 1 Mar 2017 23:20:54 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH" Subject: [kernel-hardening] Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() To: James Morris Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: multipart/mixed; boundary="JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx"; protected-headers="v1" From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: James Morris Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org Message-ID: <3e3d2c43-9d67-2b1e-174a-1656708139f2@digikod.net> Subject: Re: [PATCH v5 03/10] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode() References: <20170222012632.4196-1-mic@digikod.net> <20170222012632.4196-4-mic@digikod.net> In-Reply-To: --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/03/2017 10:32, James Morris wrote: > On Wed, 22 Feb 2017, Micka=C3=ABl Sala=C3=BCn wrote: >=20 >> Add an eBPF function bpf_handle_fs_get_mode(handle_fs) to get the mode= >> of a an abstract object wrapping either a file, a dentry, a path, or a= n >> inode. >> >> Changes since v4: >> * use a file abstraction (handle) to wrap inode, dentry, path and file= >> structs >=20 > Good to see these abstractions. As discussed at LPC, we need to ensure= =20 > that we don't couple the Landlock API too closely with the LSM API, as = the=20 > former is an ABI exposed to userland -- we don't want to lose the abili= ty=20 > to change LSM internally due to breaking Landlock policies. Right, it is the case now, especially with the Landlock events. >=20 >> @@ -82,6 +87,8 @@ enum bpf_arg_type { >> =20 >> ARG_PTR_TO_CTX, /* pointer to context */ >> ARG_ANYTHING, /* any (initialized) argument is ok */ >> + >> + ARG_CONST_PTR_TO_HANDLE_FS, /* pointer to an abstract FS struct */ >> }; >=20 > Extraneous whitespace? It is on purpose, following the same rules as used for this enum. Micka=C3=ABl --JMpC7mQfwQ8p6g4KisXHXKcl6voV6BVbx-- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUysCyY8er9Axt7hqIt7+33O9apUFAli3SUYACgkQIt7+33O9 apXajgf/RL4nqWHXKhhoSP0o88+vfZZSrLSEdzEQSYZtpJETj3S0/Hh/A92lyVzD uTZ2Bdo1GXwS7gszX+T0behdkpK1/zJEzL0duAHKlZkt5L6lEgxXxvS1GKoAWayR mPB9lf7Lmw8I/PakZ3quXZgc+Lr+YtlSXqqT/Ei5T9nltVtH27KXbQvEPmUtNQBU 8CXfwAdOt2L8+wSnzdo0J/dwRrATvQ2eWIth+KmvLO0MG9QN8qrHC4EfwTi/FKP1 Br2HFdtEMT/gXpdGoIwpoEZ2nIhgl6GGrAMzBqVzSBmZdAFs2JcD2J0pnuqIUuag RO3O8yTKISg9iPG6ZDsFoGf0FEWNiA== =tR1Z -----END PGP SIGNATURE----- --sCqXnFWdagRw80FSU1TSRGigwJKSrhoGH--