diff --git a/net/socket.c b/net/socket.c index b05f7280fa7d..ea5cce8200b4 100644 --- a/net/socket.c +++ b/net/socket.c @@ -525,7 +525,7 @@ int sockfs_setattr(struct dentry *dentry, struct iattr *iattr) { int err = simple_setattr(dentry, iattr); - if (!err) { + if (!err && (iattr->ia_valid & ATTR_UID)) { struct socket *sock = SOCKET_I(dentry->d_inode); sock->sk->sk_uid = iattr->ia_uid;