mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Add better sanity checking to the logic that handles ioctl processing
for nfsclient and nfs4client in order to prevent local root users from panicing the system. PR: kern/77463 Submitted by: Wojciech A. Koszek Reviewed by: cel, rees MFC after: 2 weeks Security: Local root users can panic the system at will
This commit is contained in:
parent
ace86f3f27
commit
5f396e80f0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158505
1 changed files with 7 additions and 4 deletions
|
@ -152,7 +152,8 @@ nfs4dev_reply(caddr_t addr)
|
|||
return EINVAL;
|
||||
}
|
||||
|
||||
if (m->msg_len == 0 || m->msg_len > NFS4DEV_MSG_MAX_DATALEN) {
|
||||
if (m->msg_len < sizeof(*m) - NFS4DEV_MSG_MAX_DATALEN ||
|
||||
m->msg_len > NFS4DEV_MSG_MAX_DATALEN) {
|
||||
NFS4DEV_DEBUG("bad message length\n");
|
||||
return EINVAL;
|
||||
}
|
||||
|
@ -197,8 +198,10 @@ nfs4dev_reply(caddr_t addr)
|
|||
|
||||
return 0;
|
||||
bad:
|
||||
if (u) {
|
||||
u->up_error = error;
|
||||
wakeup(u);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue