mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-12 17:49:16 +00:00
lpfc_debugfs: get rid of pointless access_ok()
No, you do NOT need to "protect copy from user" that way. Incidentally, your userland ABI stinks. I understand that you wanted to accept "reset" and "reset\n" as equivalent, but I suspect that accepting "reset this, you !@^!@!" had been an accident. Nothing to do about that now - it is a userland ABI... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
d2659e583e
commit
e6c0433e27
1 changed files with 0 additions and 12 deletions
|
@ -2166,10 +2166,6 @@ lpfc_debugfs_lockstat_write(struct file *file, const char __user *buf,
|
||||||
char *pbuf;
|
char *pbuf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Protect copy from user */
|
|
||||||
if (!access_ok(buf, nbytes))
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
memset(mybuf, 0, sizeof(mybuf));
|
memset(mybuf, 0, sizeof(mybuf));
|
||||||
|
|
||||||
if (copy_from_user(mybuf, buf, nbytes))
|
if (copy_from_user(mybuf, buf, nbytes))
|
||||||
|
@ -2621,10 +2617,6 @@ lpfc_debugfs_multixripools_write(struct file *file, const char __user *buf,
|
||||||
if (nbytes > 64)
|
if (nbytes > 64)
|
||||||
nbytes = 64;
|
nbytes = 64;
|
||||||
|
|
||||||
/* Protect copy from user */
|
|
||||||
if (!access_ok(buf, nbytes))
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
memset(mybuf, 0, sizeof(mybuf));
|
memset(mybuf, 0, sizeof(mybuf));
|
||||||
|
|
||||||
if (copy_from_user(mybuf, buf, nbytes))
|
if (copy_from_user(mybuf, buf, nbytes))
|
||||||
|
@ -2787,10 +2779,6 @@ lpfc_debugfs_scsistat_write(struct file *file, const char __user *buf,
|
||||||
char mybuf[6] = {0};
|
char mybuf[6] = {0};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Protect copy from user */
|
|
||||||
if (!access_ok(buf, nbytes))
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
if (copy_from_user(mybuf, buf, (nbytes >= sizeof(mybuf)) ?
|
if (copy_from_user(mybuf, buf, (nbytes >= sizeof(mybuf)) ?
|
||||||
(sizeof(mybuf) - 1) : nbytes))
|
(sizeof(mybuf) - 1) : nbytes))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue