[dm-devel] [PATCH 3/3] multipathd: avoid io_err_stat ABBA deadlock

2021-01-12 Thread Benjamin Marzinski
When the checker thread enqueues paths for the io_err_stat thread to check, it calls enqueue_io_err_stat_by_path() with the vecs lock held. start_io_err_stat_thread() is also called with the vecs lock held. These two functions both lock io_err_pathvec_lock. When the io_err_stat thread updates the p

[dm-devel] [PATCH 2/3] multipathd: avoid io_err_stat crash during shutdown

2021-01-12 Thread Benjamin Marzinski
The checker thread is reponsible for enqueueing paths for the io_err_stat thread to check. During shutdown, the io_err_stat thread is shut down and cleaned up before the checker thread. There is no code to make sure that the checker thread isn't accessing the io_err_stat pathvec or its mutex while

[dm-devel] [PATCH 0/3] Multipath io_err_stat fixes

2021-01-12 Thread Benjamin Marzinski
I found an ABBA deadlock in the io_err_stat marginal path code, and in the process of fixing it, noticed a potential crash on shutdown. This patchset addresses both of the issues. Benjamin Marzinski (3): libmultipath: make find_err_path_by_dev() static multipathd: avoid io_err_stat crash durin

[dm-devel] [PATCH 1/3] libmultipath: make find_err_path_by_dev() static

2021-01-12 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- libmultipath/io_err_stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 5363049d..2e48ee81 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -88,7 +

Re: [dm-devel] [PATCH v2 2/2] IMA: Add test for dm-crypt measurement

2021-01-12 Thread Petr Vorel
Hi Tushar, ... > +++ b/testcases/kernel/security/integrity/ima/tests/ima_dm_crypt.sh > @@ -0,0 +1,60 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0-or-later > +# Copyright (c) 2020 Microsoft Corporation > +# Author: Tushar Sugandhi > +# > +# Verify that DM target dm-crypt are measured corr

Re: [dm-devel] dm-integrity: fix the maximum number of arguments

2021-01-12 Thread Mikulas Patocka
On Tue, 12 Jan 2021, Mike Snitzer wrote: > On Tue, Jan 12 2021 at 2:54pm -0500, > Mikulas Patocka wrote: > > > Advance the maximum number of arguments to 15. > > > > Signed-off-by: Mikulas Patocka > > Cc: sta...@vger.kernel.org # v4.19+ > > > > --- > > drivers/md/dm-integrity.c |2 +

Re: [dm-devel] dm-integrity: fix the maximum number of arguments

2021-01-12 Thread Mike Snitzer
On Tue, Jan 12 2021 at 2:54pm -0500, Mikulas Patocka wrote: > Advance the maximum number of arguments to 15. > > Signed-off-by: Mikulas Patocka > Cc: sta...@vger.kernel.org# v4.19+ > > --- > drivers/md/dm-integrity.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index:

[dm-devel] [PATCH] dm-integrity: fix the maximum number of arguments

2021-01-12 Thread Mikulas Patocka
Advance the maximum number of arguments to 15. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org # v4.19+ --- drivers/md/dm-integrity.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6/drivers/md/dm-integrity.c =

Re: [dm-devel] [PATCH v10 8/8] selinux: include a consumer of the new IMA critical data hook

2021-01-12 Thread Paul Moore
On Thu, Jan 7, 2021 at 11:07 PM Tushar Sugandhi wrote: > From: Lakshmi Ramasubramanian > > SELinux stores the active policy in memory, so the changes to this data > at runtime would have an impact on the security guarantees provided > by SELinux. Measuring in-memory SELinux policy through IMA su

Re: [dm-devel] [PATCH RFC 6/7] block: track cookies of split bios for bio-based device

2021-01-12 Thread Mike Snitzer
On Tue, Jan 12 2021 at 12:46am -0500, JeffleXu wrote: > > > On 1/9/21 1:26 AM, Mike Snitzer wrote: > > On Thu, Jan 07 2021 at 10:08pm -0500, > > JeffleXu wrote: > > > >> Thanks for reviewing. > >> > >> > >> On 1/8/21 6:18 AM, Mike Snitzer wrote: > >>> On Wed, Dec 23 2020 at 6:26am -0500, > >

Re: [dm-devel] [PATCH RFC 6/7] block: track cookies of split bios for bio-based device

2021-01-12 Thread JeffleXu
Actually I'm thinking why the first RFC version [1] I implemented can't work. Indeed iterating all hw queues of all target devices may not work well as for performance. Then since we have an array of struct blk_mq_hw_ctx * in struct dm_table now, we can also maintain a bitmap or something to track

Re: [dm-devel] [PATCH RFC 6/7] block: track cookies of split bios for bio-based device

2021-01-12 Thread JeffleXu
On 1/9/21 1:26 AM, Mike Snitzer wrote: > On Thu, Jan 07 2021 at 10:08pm -0500, > JeffleXu wrote: > >> Thanks for reviewing. >> >> >> On 1/8/21 6:18 AM, Mike Snitzer wrote: >>> On Wed, Dec 23 2020 at 6:26am -0500, >>> Jeffle Xu wrote: >>> This is actuaaly the core when supporting iopoll

[dm-devel] [PATCH] dm: cleanup of front padding calculation

2021-01-12 Thread Jeffle Xu
Add two helper macros calculating the offset of bio in struct dm_io and struct dm_target_io respectively. Besides, simplify the front padding calculation in dm_alloc_md_mempools(). Signed-off-by: Jeffle Xu --- drivers/md/dm.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(

[dm-devel] [PATCH][next] dm integrity: fix spelling mistake "flusing" -> "flushing"

2021-01-12 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dm_integrity_io_error error message. Fix it. Signed-off-by: Colin Ian King --- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 11c7c53