Skip to content

Commit 51f0659

Browse files
ColinIanKingMikulas Patocka
authored andcommitted
dm ioctl: rate limit a couple of ioctl based error messages
It is possible to spam the kernel log with a misbehaving user process that is passing incorrect dm ioctls to /dev/mapper/control. Use a rate limit on these error messages to reduce the noise. These errors were hit when running the stress-ng's device test. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Acked-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent b0e6210 commit 51f0659

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/dm-ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ static int check_version(unsigned int cmd, struct dm_ioctl __user *user,
19121912

19131913
if ((kernel_params->version[0] != DM_VERSION_MAJOR) ||
19141914
(kernel_params->version[1] > DM_VERSION_MINOR)) {
1915-
DMERR("ioctl interface mismatch: kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)",
1915+
DMERR_LIMIT("ioctl interface mismatch: kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)",
19161916
DM_VERSION_MAJOR, DM_VERSION_MINOR,
19171917
DM_VERSION_PATCHLEVEL,
19181918
kernel_params->version[0],
@@ -1961,7 +1961,7 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern
19611961

19621962
if (unlikely(param_kernel->data_size < minimum_data_size) ||
19631963
unlikely(param_kernel->data_size > DM_MAX_TARGETS * DM_MAX_TARGET_PARAMS)) {
1964-
DMERR("Invalid data size in the ioctl structure: %u",
1964+
DMERR_LIMIT("Invalid data size in the ioctl structure: %u",
19651965
param_kernel->data_size);
19661966
return -EINVAL;
19671967
}

0 commit comments

Comments
 (0)