mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Truncate read request rather than returning EIO if the request is
larger than MAXPHYS + 1. This fixes a problem with cat(1) when it uses a large I/O buffer. Reported by: Fernando Apesteguía Suggested by: jilles Reviewed by: des Approved by: trasz (mentor)
This commit is contained in:
parent
663fdad84b
commit
e48fbf26e8
1 changed files with 2 additions and 4 deletions
|
|
@ -637,10 +637,8 @@ pfs_read(struct vop_read_args *va)
|
|||
error = EINVAL;
|
||||
goto ret;
|
||||
}
|
||||
if (buflen > MAXPHYS + 1) {
|
||||
error = EIO;
|
||||
goto ret;
|
||||
}
|
||||
if (buflen > MAXPHYS + 1)
|
||||
buflen = MAXPHYS + 1;
|
||||
|
||||
sb = sbuf_new(sb, NULL, buflen, 0);
|
||||
if (sb == NULL) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue