Re: [dm-devel] don't use ->bd_inode to access the block device size

2021-10-13 Thread Anand Jain
On 13/10/2021 13:10, Christoph Hellwig wrote: Hi Jens, various drivers currently poke directy at the block device inode, which is a bit of a mess. This series cleans up the places that read the block device size to use the proper helpers. I have separate patches for many of the other bd_inode

[dm-devel] [PATCH v4] loop: don't print warnings if the underlying filesystem doesn't support discard

2021-10-13 Thread Mikulas Patocka
Hi Here I'm sending version 4 of the patch. It adds #include to cifs and overlayfs to fix the bugs found out by the kernel test robot. Mikulas From: Mikulas Patocka The loop driver checks for the fallocate method and if it is present, it assumes that the filesystem can do FALLOC_FL_ZERO_R

Re: [dm-devel] [PATCH 11/29] btrfs: use bdev_nr_sectors instead of open coding it

2021-10-13 Thread Anand Jain
On 13/10/2021 13:10, Christoph Hellwig wrote: Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Anand Jain -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 23/29] block: use bdev_nr_sectors instead of open coding it in blkdev_fallocate

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:36, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR

Re: [dm-devel] [PATCH 28/29] reiserfs: use sb_bdev_nr_blocks

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:41, Christoph Hellwig wrote: > Use the sb_bdev_nr_blocks helper instead of open coding it. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE La

Re: [dm-devel] [PATCH 25/29] ext4: use sb_bdev_nr_blocks

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:38, Christoph Hellwig wrote: > Use the sb_bdev_nr_blocks helper instead of open coding it. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE L

Re: [dm-devel] [PATCH 29/29] udf: use sb_bdev_nr_blocks

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:42, Christoph Hellwig wrote: > Use the sb_bdev_nr_blocks helper instead of open coding it. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE L

Re: [dm-devel] [PATCH 21/29] reiserfs: use bdev_nr_sectors instead of open coding it

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:34, Christoph Hellwig wrote: > Use the proper helper to read the block device size and remove two > cargo culted checks that can't be false. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara

Re: [dm-devel] [PATCH 08/29] fs: use bdev_nr_sectors instead of open coding it in blkdev_max_block

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:21, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR

Re: [dm-devel] [PATCH 09/29] fs: simplify init_page_buffers

2021-10-13 Thread Jan Kara
On Wed 13-10-21 07:10:22, Christoph Hellwig wrote: > No need to convert from bdev to inode and back. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR -- d

Re: [dm-devel] [PATCH 25/29] ext4: use sb_bdev_nr_blocks

2021-10-13 Thread Theodore Ts'o
On Wed, Oct 13, 2021 at 07:10:38AM +0200, Christoph Hellwig wrote: > Use the sb_bdev_nr_blocks helper instead of open coding it. > > Signed-off-by: Christoph Hellwig Acked-by: Theodore Ts'o -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 03/29] dm: use bdev_nr_sectors instead of open coding it

2021-10-13 Thread Mike Snitzer
On Wed, Oct 13 2021 at 1:10P -0400, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] simplify I/O size calculation helpers v2

2021-10-13 Thread Christoph Hellwig
Hi Jens, this series calculates various I/O size calculations. Changes since v1: - rename chunk_size_left to blk_chunk_sectors_left - split a patch into two Diffstat: block/blk-merge.c | 28 drivers/md/dm.c| 18 ++ include/linux/bl

[dm-devel] [PATCH 3/6] block: only call blk_queue_get_max_sectors once in blk_rq_get_max_sectors

2021-10-13 Thread Christoph Hellwig
Consolidate the two calls to blk_rq_get_max_sectors into one using a local variable. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 14ce19607cd8a..8ed50952e93ad 100644 -

[dm-devel] [PATCH 1/6] block: factor out a chunk_size_left helper

2021-10-13 Thread Christoph Hellwig
Factor out a helper from blk_max_size_offset so that it can be reused independently. Signed-off-by: Christoph Hellwig --- include/linux/blkdev.h | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 17705c9

[dm-devel] [PATCH 2/6] dm: open code blk_max_size_offset in max_io_len

2021-10-13 Thread Christoph Hellwig
max_io_len always passed in an explicit, non-zero chunk_sectors into blk_max_size_offset. That means much of blk_max_size_offset is not needed and open coding it simplifies the code. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 18 ++ 1 file changed, 6 insertions(+), 1

[dm-devel] [PATCH 4/6] block: open code blk_max_size_offset in blk_rq_get_max_sectors

2021-10-13 Thread Christoph Hellwig
blk_rq_get_max_sectors always uses q->limits.chunk_sectors as the chunk_sectors argument, and already checks for max_sectors through the call to blk_queue_get_max_sectors. That means much of blk_max_size_offset is not needed and open coding it simplifies the code. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 5/6] block: fold blk_max_size_offset into get_max_io_size

2021-10-13 Thread Christoph Hellwig
Fold blk_max_size_offset into the only remaining user. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 15 ++- include/linux/blkdev.h | 19 --- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 3

[dm-devel] [PATCH 6/6] block: pass the start sector to get_max_io_size

2021-10-13 Thread Christoph Hellwig
Pass the start sector instead of the whole bio. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 87ea3e7b8ad28..7498f570aa302 100644 --- a/block/blk-merge.c +++ b/block/blk

[dm-devel] [RFC PATCH v7 06/16] uapi|audit: add trust audit message definitions

2021-10-13 Thread deven . desai
From: Deven Bowers Introduce new definitions to audit.h centered around trust decisions and policy loading and activation, as an extension of the mandatory access control fields. Signed-off-by: Deven Bowers --- Relevant changes since v6: * Change audit records to MAC region (14XX) from I

[dm-devel] [RFC PATCH v7 12/16] fsverity|security: add security hooks to fsverity digest and signature

2021-10-13 Thread deven . desai
From: Fan Wu Add security_inode_setsecurity to fsverity signature verification. This can let LSMs save the signature data and digest hashes provided by fsverity. Also changes the implementaion inside the hook function to let multiple LSMs can add hooks. Signed-off-by: Fan Wu Signed-off-by: Dev

[dm-devel] [RFC PATCH v7 00/16] Integrity Policy Enforcement (IPE)

2021-10-13 Thread deven . desai
From: Deven Bowers Overview: - IPE is a Linux Security Module which takes a complimentary approach to access control. Whereas existing systems approach use labels or paths which control access to a resource, IPE controls access to a resource based on the system's trust of said resource.

[dm-devel] [RFC PATCH v7 02/16] ipe: add policy parser

2021-10-13 Thread deven . desai
From: Deven Bowers IPE's interpretation of the what the user trusts is accomplished through its policy. IPE's design is to not provide support for a single trust provider, but to support multiple providers to enable the end-user to choose the best one to seek their needs. This requires the polic

[dm-devel] [RFC PATCH v7 13/16] ipe: enable support for fs-verity as a trust provider

2021-10-13 Thread deven . desai
From: Fan Wu Enable IPE policy authors to indicate trust for a singular fsverity file, identified by the digest information, through "fsverity_digest" and all fsverity signed by a key via "fsverity_signature". Signed-off-by: Fan Wu Signed-off-by: Deven Bowers --- Relevant changes since v6:

[dm-devel] [RFC PATCH v7 14/16] scripts: add boot policy generation program

2021-10-13 Thread deven . desai
From: Deven Bowers Enables an IPE policy to be enforced from kernel start, enabling access control based on trust from kernel startup. This is accomplished by transforming an IPE policy indicated by CONFIG_IPE_BOOT_POLICY into a c-string literal that is parsed at kernel startup as an unsigned pol

[dm-devel] [RFC PATCH v7 10/16] fs|dm-verity: add block_dev LSM blob and submit dm-verity data

2021-10-13 Thread deven . desai
From: Deven Bowers dm-verity operates on the block_device level. In order to allow IPE to determine if a file is sourced from a dm-verity volume, and how that dm-verity volume was created, create an LSM blob with the signature data and roothash information, allowing IPE to make decisions about co

[dm-devel] [RFC PATCH v7 03/16] ipe: add evaluation loop

2021-10-13 Thread deven . desai
From: Deven Bowers IPE must have a centralized function to evaluate incoming callers against IPE's policy. This iteration of the policy for against the rules for that specific caller is known as the evaluation loop. Signed-off-by: Deven Bowers --- Relevant changes since v6: * Refactor patch

[dm-devel] [RFC PATCH v7 01/16] security: add ipe lsm & initial context creation

2021-10-13 Thread deven . desai
From: Deven Bowers Integrity Policy Enforcement (IPE) is an LSM that provides an complimentary approach to Mandatory Access Control than existing LSMs today. Existing LSMs have centered around the concept of access to a resource should be controlled by the current user's credentials. IPE's appro

[dm-devel] [RFC PATCH v7 04/16] ipe: add userspace interface

2021-10-13 Thread deven . desai
From: Deven Bowers As is typical with LSMs, IPE uses securityfs as its interface with userspace. for a complete list of the interfaces and the respective inputs/outputs, please see the documentation under admin-guide/LSM/ipe.rst Signed-off-by: Deven Bowers --- Relevant changes since v6: * Re

[dm-devel] [RFC PATCH v7 16/16] documentation: add ipe documentation

2021-10-13 Thread deven . desai
From: Deven Bowers Add IPE's admin and developer documentation to the kernel tree. Co-developed-by: Fan Wu Signed-off-by: Fan Wu Signed-off-by: Deven Bowers --- Relevant changes since v6: * Add additional developer-level documentation * Update admin-guide docs to reflect changes. * Dro

[dm-devel] [RFC PATCH v7 09/16] ipe: introduce 'boot_verified' as a trust provider

2021-10-13 Thread deven . desai
From: Deven Bowers IPE is designed to provide system level trust guarantees, this usually implies that trust starts from bootup with a hardware root of trust, which validates the bootloader. After this, the bootloader verifies the kernel and the initramfs. As there's no currently supported integ

[dm-devel] [RFC PATCH v7 11/16] ipe: add support for dm-verity as a trust provider

2021-10-13 Thread deven . desai
From: Deven Bowers Allows author of IPE policy to indicate trust for a singular dm-verity volume, identified by roothash, through "dmverity_roothash" and all signed dm-verity volumes, through "dmverity_signature". Signed-off-by: Deven Bowers --- Relevant changes since v6: * Squash patch 08/1

[dm-devel] [RFC PATCH v7 07/16] ipe: add auditing support

2021-10-13 Thread deven . desai
From: Deven Bowers Users of IPE require a way to identify when and why an operation fails, allowing them to both respond to violations of policy and be notified of potentially malicious actions on their systens with respect to IPE itself. Signed-off-by: Deven Bowers --- Relevant changes since

[dm-devel] [RFC PATCH v7 05/16] ipe: add LSM hooks on execution and kernel read

2021-10-13 Thread deven . desai
From: Deven Bowers IPE's initial goal is to control both execution and the loading of kernel modules based on the system's definition of trust. It accomplishes this by plugging into the security hooks for execve, mprotect, mmap, kernel_load_data and kernel_read_data. Signed-off-by: Deven Bowers

[dm-devel] [RFC PATCH v7 08/16] ipe: add permissive toggle

2021-10-13 Thread deven . desai
From: Deven Bowers IPE, like SELinux, supports a permissive mode. This mode allows policy authors to test and evaluate IPE policy without it effecting their programs. Signed-off-by: Deven Bowers --- Relevant changes since v6: * Refactor series to: 1. Support a context structure, enabli

[dm-devel] [RFC PATCH v7 15/16] ipe: kunit tests

2021-10-13 Thread deven . desai
From: Deven Bowers Add various happy/unhappy unit tests for both IPE's parser and evaluation loop, testing the core of IPE. The missing test gap remains the interface with userspace. Signed-off-by: Deven Bowers --- Relevant changes since v6: * Add Kunit tests (Introduced) --- security/ipe/

Re: [dm-devel] [RFC PATCH v7 12/16] fsverity|security: add security hooks to fsverity digest and signature

2021-10-13 Thread Eric Biggers
On Wed, Oct 13, 2021 at 12:06:31PM -0700, deven.de...@linux.microsoft.com wrote: > From: Fan Wu > > Add security_inode_setsecurity to fsverity signature verification. > This can let LSMs save the signature data and digest hashes provided > by fsverity. Can you elaborate on why LSMs need this inf

[dm-devel] [PATCH] multipathd: Add missing ctype include

2021-10-13 Thread Bastian Germann
In uxclnt.c, there are isspace calls. Add an explicit include. Signed-off-by: Bastian Germann --- multipathd/uxclnt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/multipathd/uxclnt.c b/multipathd/uxclnt.c index a76f8e29..f16a7309 100644 --- a/multipathd/uxclnt.c +++ b/multipathd/uxclnt.c

Re: [dm-devel] [RFC PATCH v7 07/16] ipe: add auditing support

2021-10-13 Thread Randy Dunlap
Hi, On 10/13/21 12:06 PM, deven.de...@linux.microsoft.com wrote: diff --git a/security/ipe/Kconfig b/security/ipe/Kconfig index c4503083e92d..ef556b66e674 100644 --- a/security/ipe/Kconfig +++ b/security/ipe/Kconfig @@ -17,3 +17,55 @@ menuconfig SECURITY_IPE requirements on the fly.

Re: [dm-devel] don't use ->bd_inode to access the block device size

2021-10-13 Thread Christoph Hellwig
On Wed, Oct 13, 2021 at 07:10:13AM +0200, Christoph Hellwig wrote: > I wondered about adding a helper for looking at the size in byte units > to avoid the SECTOR_SHIFT shifts in various places. But given that > I could not come up with a good name and block devices fundamentally > work in sector s