qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/2] 9pfs: fix O_PATH build break with older


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 1/2] 9pfs: fix O_PATH build break with older glibc versions
Date: Mon, 6 Mar 2017 10:18:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 03/06/2017 02:29 AM, Greg Kurz wrote:
> 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.

May be worth adding:

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 <address@hidden>
> ---
>  hw/9pfs/9p-util.h |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]