arm64: dts: rockchip: add reset unit in saradc for rk3399
[firefly-linux-kernel-4.4.55.git] / fs / namei.c
index 209ca7737cb2207ef020e90d159ae8f605c7de0a..0b0acba72a715aaa4ba22c6241c2ed3b10183121 100644 (file)
@@ -887,6 +887,7 @@ static inline int may_follow_link(struct nameidata *nd)
 {
        const struct inode *inode;
        const struct inode *parent;
+       kuid_t puid;
 
        if (!sysctl_protected_symlinks)
                return 0;
@@ -902,7 +903,8 @@ static inline int may_follow_link(struct nameidata *nd)
                return 0;
 
        /* Allowed if parent directory and link owner match. */
-       if (uid_eq(parent->i_uid, inode->i_uid))
+       puid = parent->i_uid;
+       if (uid_valid(puid) && uid_eq(puid, inode->i_uid))
                return 0;
 
        if (nd->flags & LOOKUP_RCU)