[PATCH 4.14 29/50] dm: eliminate potential source of excessive kernel log noise

From: Greg Kroah-Hartman
Date: Fri Jan 22 2021 - 14:06:01 EST

From: Mike Snitzer <snitzer@xxxxxxxxxx>

commit 0378c625afe80eb3f212adae42cc33c9f6f31abf upstream.

There wasn't ever a real need to log an error in the kernel log for
ioctls issued with insufficient permissions. Simply return an error
and if an admin/user is sufficiently motivated they can enable DM's
dynamic debugging to see an explanation for why the ioctls were

Reported-by: Nir Soffer <nsoffer@xxxxxxxxxx>
Fixes: e980f62353c6 ("dm: don't allow ioctls to targets that don't map to whole devices")
Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

drivers/md/dm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -472,7 +472,7 @@ static int dm_blk_ioctl(struct block_dev
* subset of the parent bdev; require extra privileges.
if (!capable(CAP_SYS_RAWIO)) {
"%s: sending ioctl %x to DM device without required privilege.",
current->comm, cmd);