FreeBSD Bugzilla – Attachment 203274 Details for
Bug 236836
Kernel panic from calling mq_open("/.", ...) as root
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Reject /. and /.. with EINVAL
mq_reserved_EINVAL.patch (text/plain), 806 bytes, created by
Torbjørn Birch Moltu
on 2019-03-31 16:23:07 UTC
(
hide
)
Description:
Reject /. and /.. with EINVAL
Filename:
MIME Type:
Creator:
Torbjørn Birch Moltu
Created:
2019-03-31 16:23:07 UTC
Size:
806 bytes
patch
obsolete
>--- sys/kern/uipc_mqueue.c >+++ sys/kern/uipc_mqueue.c >@@ -2042,6 +2042,9 @@ kern_kmq_open(struct thread *td, const char *upath, int flags, mode_t mode, > len = strlen(path); > if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) > return (EINVAL); >+ /* "." and ".." are directories and cannot be opened as queues */ >+ if (!strcmp(path, "/.") || !strcmp(path, "/..")) >+ return (EINVAL); > AUDIT_ARG_UPATH1_CANON(path); > > error = falloc(td, &fp, &fd, O_CLOEXEC); >@@ -2142,6 +2145,8 @@ sys_kmq_unlink(struct thread *td, struct kmq_unlink_args *uap) > len = strlen(path); > if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) > return (EINVAL); >+ if (!strcmp(path, "/.") || !strcmp(path, "/..")) >+ return (EINVAL); > AUDIT_ARG_UPATH1_CANON(path); > > sx_xlock(&mqfs_data.mi_lock);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236836
:
203197
| 203274