projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
UPSTREAM: drm/edid: detect SCDC support in HF-VSDB
[firefly-linux-kernel-4.4.55.git]
/
kernel
/
cred.c
diff --git
a/kernel/cred.c
b/kernel/cred.c
index 71179a09c1d6a3240fd9c1a4ead58d89646da24e..ff8606f77d901d4ed1201d35d35feaa5066821e3 100644
(file)
--- a/
kernel/cred.c
+++ b/
kernel/cred.c
@@
-689,6
+689,8
@@
EXPORT_SYMBOL(set_security_override_from_ctx);
*/
int set_create_files_as(struct cred *new, struct inode *inode)
{
*/
int set_create_files_as(struct cred *new, struct inode *inode)
{
+ if (!uid_valid(inode->i_uid) || !gid_valid(inode->i_gid))
+ return -EINVAL;
new->fsuid = inode->i_uid;
new->fsgid = inode->i_gid;
return security_kernel_create_files_as(new, inode);
new->fsuid = inode->i_uid;
new->fsgid = inode->i_gid;
return security_kernel_create_files_as(new, inode);