Skip to content

Commit e6c0433

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent d2659e5 commit e6c0433

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/scsi/lpfc/lpfc_debugfs.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,10 +2166,6 @@ lpfc_debugfs_lockstat_write(struct file *file, const char __user *buf,
21662166
char *pbuf;
21672167
int i;
21682168

2169-
/* Protect copy from user */
2170-
if (!access_ok(buf, nbytes))
2171-
return -EFAULT;
2172-
21732169
memset(mybuf, 0, sizeof(mybuf));
21742170

21752171
if (copy_from_user(mybuf, buf, nbytes))
@@ -2621,10 +2617,6 @@ lpfc_debugfs_multixripools_write(struct file *file, const char __user *buf,
26212617
if (nbytes > 64)
26222618
nbytes = 64;
26232619

2624-
/* Protect copy from user */
2625-
if (!access_ok(buf, nbytes))
2626-
return -EFAULT;
2627-
26282620
memset(mybuf, 0, sizeof(mybuf));
26292621

26302622
if (copy_from_user(mybuf, buf, nbytes))
@@ -2787,10 +2779,6 @@ lpfc_debugfs_scsistat_write(struct file *file, const char __user *buf,
27872779
char mybuf[6] = {0};
27882780
int i;
27892781

2790-
/* Protect copy from user */
2791-
if (!access_ok(buf, nbytes))
2792-
return -EFAULT;
2793-
27942782
if (copy_from_user(mybuf, buf, (nbytes >= sizeof(mybuf)) ?
27952783
(sizeof(mybuf) - 1) : nbytes))
27962784
return -EFAULT;

0 commit comments

Comments
 (0)