10 #include <linux/audit.h>
11 #include <linux/capability.h>
13 #include <linux/export.h>
18 #include <asm/uaccess.h>
30 static int __init file_caps_disable(
char *
str)
35 __setup(
"no_file_caps", file_caps_disable);
43 static void warn_legacy_capability_use(
void)
50 " (legacy support in use)\n",
72 static void warn_deprecated_v2(
void)
80 " capabilities in a way that may be insecure.\n",
99 warn_legacy_capability_use();
103 warn_deprecated_v2();
131 if (pid && (pid != task_pid_vnr(
current))) {
165 ret = cap_validate_magic(header, &tocopy);
166 if ((dataptr ==
NULL) || (ret != 0))
175 ret = cap_get_target_pid(pid, &pE, &pI, &pP);
180 for (i = 0; i < tocopy; i++) {
235 unsigned i, tocopy, copybytes;
241 ret = cap_validate_magic(header, &tocopy);
249 if (pid != 0 && pid != task_pid_vnr(
current))
253 if (copybytes >
sizeof(kdata))
259 for (i = 0; i < tocopy; i++) {
264 while (i < _KERNEL_CAPABILITY_U32S) {
265 effective.
cap[
i] = 0;
266 permitted.
cap[
i] = 0;
267 inheritable.
cap[
i] = 0;
276 &effective, &inheritable, &permitted);