mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
vn_open_cred(): disallow O_CREAT | O_EMPTY_PATH
This combination does not make sense, and cannot be satisfied by lookup. In particular, lookup cannot supply dvp, it only can directly return vp. Reported and reviewed by: markj using syzkaller Sponsored by: The FreeBSD Foundation MFC after: 3 days
This commit is contained in:
parent
529ab5a759
commit
6de3cf14c4
1 changed files with 2 additions and 1 deletions
|
|
@ -233,7 +233,8 @@ restart:
|
|||
first_open = false;
|
||||
fmode = *flagp;
|
||||
if ((fmode & (O_CREAT | O_EXCL | O_DIRECTORY)) == (O_CREAT |
|
||||
O_EXCL | O_DIRECTORY))
|
||||
O_EXCL | O_DIRECTORY) ||
|
||||
(fmode & (O_CREAT | O_EMPTY_PATH)) == (O_CREAT | O_EMPTY_PATH))
|
||||
return (EINVAL);
|
||||
else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) {
|
||||
ndp->ni_cnd.cn_nameiop = CREATE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue