projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
520eccd
)
ovl: check snprintf return
author
Miklos Szeredi
<mszeredi@redhat.com>
Thu, 27 Jul 2017 19:54:05 +0000
(21:54 +0200)
committer
Miklos Szeredi
<mszeredi@redhat.com>
Thu, 27 Jul 2017 19:54:05 +0000
(21:54 +0200)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/overlayfs/inode.c
b/fs/overlayfs/inode.c
index 5bc71642b22605367ee319abdf8e45a0ec9adcde..aecaadc8f9e739a88d2d7ab978e99a7e2065efc6 100644
(file)
--- a/
fs/overlayfs/inode.c
+++ b/
fs/overlayfs/inode.c
@@
-498,6
+498,9
@@
static int ovl_set_nlink_common(struct dentry *dentry,
len = snprintf(buf, sizeof(buf), format,
(int) (inode->i_nlink - realinode->i_nlink));
+ if (WARN_ON(len >= sizeof(buf)))
+ return -EIO;
+
return ovl_do_setxattr(ovl_dentry_upper(dentry),
OVL_XATTR_NLINK, buf, len, 0);
}