Skip to contentSkip to conversation

crypto: qat: ratelimit invalid ioctl message and print the invalid cmd

PATCH In review Colin King 3 participants 3 messages Jun 22, 2021 – Jun 28, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 crypto: qat: ratelimit invalid ioctl message and print the invalid cmd

From: Colin Ian King <[email protected]>

Currently incorrect QAT ioctls can spam the kernel log with error messages of the form "QAT: Invalid ioctl" if a userspace program uses the wrong ioctl command. Quench the messages by ratelimiting them and also print the invalid command being used as that is useful to know.

---
 drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/qat/qat_common/adf_ctl_drv.c +1 -1
index 96b437bfe3de..6f64aa693146 100644
@@ -406,7 +406,7 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
 		ret = adf_ctl_ioctl_get_status(fp, cmd, arg);
 		break;
 	default:
-		pr_err("QAT: Invalid ioctl\n");
+		pr_err_ratelimited("QAT: Invalid ioctl %d\n", cmd);
 		ret = -EFAULT;
 		break;
 	}
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

Currently incorrect QAT ioctls can spam the kernel log with error messages of the form "QAT: Invalid ioctl" if a userspace program uses the wrong ioctl command. Quench the messages by ratelimiting them and also print the invalid command being used as that is useful to know.

Just a minor comment on the commit message:
crypto: qat: ratelimit invalid ioctl message and print

           ^

Patches to the qat driver have the following headline:
crypto: qat -
not
crypto: qat:

Apart from that

Regards,

Signature · 1 line
Giovanni
maintainer
#2 lore raw
In reply to Colin King
Quoted 11 lines · Colin King

From: Colin Ian King <[email protected]>

Currently incorrect QAT ioctls can spam the kernel log with error messages of the form "QAT: Invalid ioctl" if a userspace program uses the wrong ioctl command. Quench the messages by ratelimiting them and also print the invalid command being used as that is useful to know.

---
 drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt