Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

more upstream fixes for CVE-2016-9602 #2

Open
wants to merge 2 commits into
base: 2.4.1-template
Choose a base branch
from

Commits on Apr 7, 2017

  1. 9pfs: fix O_PATH build break with older glibc versions

    When O_PATH is used with O_DIRECTORY, it only acts as an optimization: the
    openat() syscall simply finds the name in the VFS, and doesn't trigger the
    underlying filesystem.
    
    On systems that don't define O_PATH, because they have glibc version 2.13
    or older for example, we can safely omit it. We don't want to deactivate
    O_PATH globally though, in case it is used without O_DIRECTORY. The is done
    with a dedicated macro.
    
    Systems without O_PATH may thus fail to resolve names that involve
    unreadable directories, compared to newer systems succeeding, but such
    corner case failure is our only option on those older systems to avoid
    the security hole of chasing symlinks inappropriately.
    
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    (added last paragraph to changelog as suggested by Eric Blake)
    Signed-off-by: Greg Kurz <groug@kaod.org>
    
    (cherry picked from commit 918112c)
    Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    gkurz authored and bergwolf committed Apr 7, 2017
    Configuration menu
    Copy the full SHA
    765f98d View commit details
    Browse the repository at this point in the history
  2. 9pfs: fix vulnerability in openat_dir() and local_unlinkat_common()

    We should pass O_NOFOLLOW otherwise openat() will follow symlinks and make
    QEMU vulnerable.
    
    While here, we also fix local_unlinkat_common() to use openat_dir() for
    the same reasons (it was a leftover in the original patchset actually).
    
    This fixes CVE-2016-9602.
    
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    (cherry picked from commit b003fc0)
    Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    gkurz authored and bergwolf committed Apr 7, 2017
    Configuration menu
    Copy the full SHA
    b42cf51 View commit details
    Browse the repository at this point in the history