Further improve prctl(2) debug.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26916
This commit is contained in:
Edward Tomasz Napierala 2020-10-24 14:23:44 +00:00
parent eb65cde4f5
commit 62b1382ff3
2 changed files with 15 additions and 0 deletions

View File

@ -1949,6 +1949,10 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args)
(void *)(register_t)args->arg2,
sizeof(pdeath_signal)));
break;
case LINUX_PR_SET_DUMPABLE:
linux_msg(td, "unsupported prctl PR_SET_DUMPABLE");
error = EINVAL;
break;
case LINUX_PR_GET_KEEPCAPS:
/*
* Indicate that we always clear the effective and
@ -2008,6 +2012,14 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args)
*/
error = EINVAL;
break;
case LINUX_PR_SET_NO_NEW_PRIVS:
linux_msg(td, "unsupported prctl PR_SET_NO_NEW_PRIVS");
error = EINVAL;
break;
case LINUX_PR_SET_PTRACER:
linux_msg(td, "unsupported prctl PR_SET_PTRACER");
error = EINVAL;
break;
default:
linux_msg(td, "unsupported prctl option %d", args->option);
error = EINVAL;

View File

@ -50,12 +50,15 @@
* Second arg is a ptr to return the
* signal.
*/
#define LINUX_PR_SET_DUMPABLE 4
#define LINUX_PR_GET_KEEPCAPS 7 /* Get drop capabilities on setuid */
#define LINUX_PR_SET_KEEPCAPS 8 /* Set drop capabilities on setuid */
#define LINUX_PR_SET_NAME 15 /* Set process name. */
#define LINUX_PR_GET_NAME 16 /* Get process name. */
#define LINUX_PR_GET_SECCOMP 21
#define LINUX_PR_SET_SECCOMP 22
#define LINUX_PR_SET_NO_NEW_PRIVS 38
#define LINUX_PR_SET_PTRACER 1499557217
#define LINUX_MAX_COMM_LEN 16 /* Maximum length of the process name. */