{"id":"CVE-2026-99843","aliases":["CVE-2026-99843"],"related":[],"kind":"vulnerability","state":"published","title":"userns: don't drop the exec securebits","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nuserns: don't drop the exec securebits\n\nSECBIT_EXEC_RESTRICT_FILE and SECBIT_EXEC_DENY_INTERACTIVE tell script\ninterpreters to only run what AT_EXECVE_CHECK allows and to refuse\ninteractive input. A service manager sets them together with their lock\nbits so that nothing below it can turn them off again.\n\nBut set_cred_user_ns() resets all securebits to SECUREBITS_DEFAULT. So\nany task that can create a user namespace sheds the locked exec bits\nwith a single unshare(CLONE_NEWUSER) and joining one with setns() does\nthe same. The lock is pointless if anyone who may create a user\nnamespace can drop it, and that is pretty much everyone.\n\nResetting the other bits is fine. They are about how capabilities are\ncomputed and a new user namespace starts out with a full set of\ncapabilities anyway. The exec bits grant nothing though. They are\nrestrictions a task placed on itself, just like no_new_privs which a\nuser namespace doesn't touch either. So keep them and their locks.\n\nReproducer:\n\n  // SPDX-License-Identifier: GPL-2.0\n  /* Lock the exec securebits, then create a user namespace and look at them again. */\n  #define _GNU_SOURCE\n  #include <sched.h>\n  #include <stdio.h>\n  #include <sys/prctl.h>\n\n  #define SECBIT_EXEC_RESTRICT_FILE\t\t(1 << 8)\n  #define SECBIT_EXEC_RESTRICT_FILE_LOCKED\t(1 << 9)\n  #define SECBIT_EXEC_DENY_INTERACTIVE\t\t(1 << 10)\n  #define SECBIT_EXEC_DENY_INTERACTIVE_LOCKED\t(1 << 11)\n\n  int main(void)\n  {\n  \tint bits = SECBIT_EXEC_RESTRICT_FILE | SECBIT_EXEC_RESTRICT_FILE_LOCKED |\n  \t\t   SECBIT_EXEC_DENY_INTERACTIVE | SECBIT_EXEC_DENY_INTERACTIVE_LOCKED;\n\n  \tif (prctl(PR_SET_SECUREBITS, bits, 0, 0, 0)) {\n  \t\tperror(\"PR_SET_SECUREBITS\");\n  \t\treturn 1;\n  \t}\n  \tprintf(\"before: 0x%x\\n\", prctl(PR_GET_SECUREBITS, 0, 0, 0, 0));\n  \tprintf(\"clear locked bits: %s\\n\", prctl(PR_SET_SECUREBITS, 0, 0, 0, 0) ? \"refused\" : \"ALLOWED\");\n\n  \tif (unshare(CLONE_NEWUSER)) {\n  \t\tperror(\"unshare(CLONE_NEWUSER)\");\n  \t\treturn 1;\n  \t}\n  \tprintf(\"after unshare(CLONE_NEWUSER): 0x%x\\n\", prctl(PR_GET_SECUREBITS, 0, 0, 0, 0));\n  \treturn 0;\n  }\n\nOn v7.1 this prints \"before: 0xf00\", \"clear locked bits: refused\" and\n\"after unshare(CLONE_NEWUSER): 0x0\". With this patch the last line\nreads 0xf00 as well.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nuserns: don't drop the exec securebits\n\nSECBIT_EXEC_RESTRICT_FILE and SECBIT_EXEC_DENY_INTERACTIVE tell script\ninterpreters to only run what AT_EXECVE_CHECK allows and to refuse\ninteractive input. A service manager sets them together with their lock\nbits so that nothing below it can turn them off again.\n\nBut set_cred_user_ns() resets all securebits to SECUREBITS_DEFAULT. So\nany task that can create a user namespace sheds the locked exec bits\nwith a single unshare(CLONE_NEWUSER) and joining one with setns() does\nthe same. The lock is pointless if anyone who may create a user\nnamespace can drop it, and that is pretty much everyone.\n\nResetting the other bits is fine. They are about how capabilities are\ncomputed and a new user namespace starts out with a full set of\ncapabilities anyway. The exec bits grant nothing though. They are\nrestrictions a task placed on itself, just like no_new_privs which a\nuser namespace doesn't touch either. So keep them and their locks.\n\nReproducer:\n\n  // SPDX-License-Identifier: GPL-2.0\n  /* Lock the exec securebits, then create a user namespace and look at them again. */\n  #define _GNU_SOURCE\n  #include <sched.h>\n  #include <stdio.h>\n  #include <sys/prctl.h>\n\n  #define SECBIT_EXEC_RESTRICT_FILE\t\t(1 << 8)\n  #define SECBIT_EXEC_RESTRICT_FILE_LOCKED\t(1 << 9)\n  #define SECBIT_EXEC_DENY_INTERACTIVE\t\t(1 << 10)\n  #define SECBIT_EXEC_DENY_INTERACTIVE_LOCKED\t(1 << 11)\n\n  int main(void)\n  {\n  \tint bits = SECBIT_EXEC_RESTRICT_FILE | SECBIT_EXEC_RESTRICT_FILE_LOCKED |\n  \t\t   SECBIT_EXEC_DENY_INTERACTIVE | SECBIT_EXEC_DENY_INTERACTIVE_LOCKED;\n\n  \tif (prctl(PR_SET_SECUREBITS, bits, 0, 0, 0)) {\n  \t\tperror(\"PR_SET_SECUREBITS\");\n  \t\treturn 1;\n  \t}\n  \tprintf(\"before: 0x%x\\n\", prctl(PR_GET_SECUREBITS, 0, 0, 0, 0));\n  \tprintf(\"clear locked bits: %s\\n\", prctl(PR_SET_SECUREBITS, 0, 0, 0, 0) ? \"refused\" : \"ALLOWED\");\n\n  \tif (unshare(CLONE_NEWUSER)) {\n  \t\tperror(\"unshare(CLONE_NEWUSER)\");\n  \t\treturn 1;\n  \t}\n  \tprintf(\"after unshare(CLONE_NEWUSER): 0x%x\\n\", prctl(PR_GET_SECUREBITS, 0, 0, 0, 0));\n  \treturn 0;\n  }\n\nOn v7.1 this prints \"before: 0xf00\", \"clear locked bits: refused\" and\n\"after unshare(CLONE_NEWUSER): 0x0\". With this patch the last line\nreads 0xf00 as well.","source":"cvelist"}],"published":"2026-11-30T13:17:34.423Z","modified":"2026-11-30T14:20:17.527Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"a0623b2a1d595341971c189b90a6b06f42cd209d","fixed":"24705093eeb28c70f56ea509d9110e802435b1b8","status":"affected"},{"type":"git","introduced":"a0623b2a1d595341971c189b90a6b06f42cd209d","fixed":"a0da1ee51f1dfa7c3ddac48bdb04858264b56539","status":"affected"},{"type":"git","introduced":"a0623b2a1d595341971c189b90a6b06f42cd209d","fixed":"bf5ba73c9bdd5e872eb35e801e429a3b526f8f04","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/24705093eeb28c70f56ea509d9110e802435b1b8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a0da1ee51f1dfa7c3ddac48bdb04858264b56539","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bf5ba73c9bdd5e872eb35e801e429a3b526f8f04","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99843","url":"https://www.cve.org/CVERecord?id=CVE-2026-99843","licence":"CVE Terms of Use","modified":"2026-11-30T13:17:34.423Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99843","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99843","licence":"Public domain","modified":"2026-11-30T14:20:17.527Z"}],"updatedAt":"2026-11-30T14:33:43.009Z","epss":{"score":0.00206,"percentile":0.11343,"date":"2026-12-01T12:00:22.000Z"}}