summaryrefslogtreecommitdiff
path: root/target/linux/generic
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2016-09-16 10:17:27 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2016-09-16 10:17:27 +0200
commit41eab9048b5c1cd58ed1397d25e691d66d8e215b (patch)
tree007e06c7e99a6756b319cb132c0d38fb7c4fe4ae /target/linux/generic
parenta530196f8de4cc532ace01910f505d8c4cc88cc6 (diff)
downloadmtk-20170518-41eab9048b5c1cd58ed1397d25e691d66d8e215b.zip
mtk-20170518-41eab9048b5c1cd58ed1397d25e691d66d8e215b.tar.gz
mtk-20170518-41eab9048b5c1cd58ed1397d25e691d66d8e215b.tar.bz2
kernel: update kernel 4.4 to version 4.4.21
Refresh patches for all targets that support kernel 4.4. Compile-tested on brcm2708 only. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch10
-rw-r--r--target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch73
-rw-r--r--target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch49
-rw-r--r--target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch53
-rw-r--r--target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch35
-rw-r--r--target/linux/generic/patches-4.4/903-debloat_direct_io.patch4
6 files changed, 7 insertions, 217 deletions
diff --git a/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch b/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
index 8a7d00a..77ceadf 100644
--- a/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
+++ b/target/linux/generic/patches-4.4/051-0002-ovl-override-creds-with-the-ones-from-the-superblock.patch
@@ -58,7 +58,7 @@ Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
-@@ -303,7 +303,6 @@ int ovl_copy_up_one(struct dentry *paren
+@@ -305,7 +305,6 @@ int ovl_copy_up_one(struct dentry *paren
struct dentry *upperdir;
struct dentry *upperdentry;
const struct cred *old_cred;
@@ -66,7 +66,7 @@ Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
char *link = NULL;
if (WARN_ON(!workdir))
-@@ -322,28 +321,7 @@ int ovl_copy_up_one(struct dentry *paren
+@@ -324,28 +323,7 @@ int ovl_copy_up_one(struct dentry *paren
return PTR_ERR(link);
}
@@ -96,7 +96,7 @@ Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
err = -EIO;
if (lock_rename(workdir, upperdir) != NULL) {
-@@ -366,9 +344,7 @@ int ovl_copy_up_one(struct dentry *paren
+@@ -368,9 +346,7 @@ int ovl_copy_up_one(struct dentry *paren
out_unlock:
unlock_rename(workdir, upperdir);
revert_creds(old_cred);
@@ -309,7 +309,7 @@ Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
kfree(ufs);
}
-@@ -1068,10 +1078,14 @@ static int ovl_fill_super(struct super_b
+@@ -1087,10 +1097,14 @@ static int ovl_fill_super(struct super_b
else
sb->s_d_op = &ovl_dentry_operations;
@@ -325,7 +325,7 @@ Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
root_dentry = d_make_root(ovl_new_inode(sb, S_IFDIR, oe));
if (!root_dentry)
-@@ -1104,6 +1118,8 @@ static int ovl_fill_super(struct super_b
+@@ -1123,6 +1137,8 @@ static int ovl_fill_super(struct super_b
out_free_oe:
kfree(oe);
diff --git a/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch b/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch
deleted file mode 100644
index da9e380..0000000
--- a/target/linux/generic/patches-4.4/051-0003-ovl-don-t-copy-up-opaqueness.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 0956254a2d5b9e2141385514553aeef694dfe3b5 Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi@redhat.com>
-Date: Mon, 8 Aug 2016 15:08:49 +0200
-Subject: [PATCH] ovl: don't copy up opaqueness
-
-When a copy up of a directory occurs which has the opaque xattr set, the
-xattr remains in the upper directory. The immediate behavior with overlayfs
-is that the upper directory is not treated as opaque, however after a
-remount the opaque flag is used and upper directory is treated as opaque.
-This causes files created in the lower layer to be hidden when using
-multiple lower directories.
-
-Fix by not copying up the opaque flag.
-
-To reproduce:
-
- ----8<---------8<---------8<---------8<---------8<---------8<----
-mkdir -p l/d/s u v w mnt
-mount -t overlay overlay -olowerdir=l,upperdir=u,workdir=w mnt
-rm -rf mnt/d/
-mkdir -p mnt/d/n
-umount mnt
-mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
-touch mnt/d/foo
-umount mnt
-mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
-ls mnt/d
- ----8<---------8<---------8<---------8<---------8<---------8<----
-
-output should be: "foo n"
-
-Reported-by: Derek McGowan <dmcg@drizz.net>
-Link: https://bugzilla.kernel.org/show_bug.cgi?id=151291
-Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-Cc: <stable@vger.kernel.org>
----
- fs/overlayfs/copy_up.c | 2 ++
- fs/overlayfs/inode.c | 2 +-
- fs/overlayfs/overlayfs.h | 1 +
- 3 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/fs/overlayfs/copy_up.c
-+++ b/fs/overlayfs/copy_up.c
-@@ -48,6 +48,8 @@ int ovl_copy_xattr(struct dentry *old, s
- }
-
- for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
-+ if (ovl_is_private_xattr(name))
-+ continue;
- retry:
- size = vfs_getxattr(old, name, value, value_size);
- if (size == -ERANGE)
---- a/fs/overlayfs/inode.c
-+++ b/fs/overlayfs/inode.c
-@@ -219,7 +219,7 @@ static int ovl_readlink(struct dentry *d
- }
-
-
--static bool ovl_is_private_xattr(const char *name)
-+bool ovl_is_private_xattr(const char *name)
- {
- return strncmp(name, OVL_XATTR_PRE_NAME, OVL_XATTR_PRE_LEN) == 0;
- }
---- a/fs/overlayfs/overlayfs.h
-+++ b/fs/overlayfs/overlayfs.h
-@@ -175,6 +175,7 @@ ssize_t ovl_getxattr(struct dentry *dent
- ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size);
- int ovl_removexattr(struct dentry *dentry, const char *name);
- struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags);
-+bool ovl_is_private_xattr(const char *name);
-
- struct inode *ovl_new_inode(struct super_block *sb, umode_t mode,
- struct ovl_entry *oe);
diff --git a/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch b/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch
deleted file mode 100644
index 1785c9a..0000000
--- a/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c11b9fdd6a612f376a5e886505f1c54c16d8c380 Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi@redhat.com>
-Date: Thu, 1 Sep 2016 11:11:59 +0200
-Subject: [PATCH] ovl: remove posix_acl_default from workdir
-
-Clear out posix acl xattrs on workdir and also reset the mode after
-creation so that an inherited sgid bit is cleared.
-
-Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-Cc: <stable@vger.kernel.org>
----
- fs/overlayfs/super.c | 19 +++++++++++++++++++
- 1 file changed, 19 insertions(+)
-
---- a/fs/overlayfs/super.c
-+++ b/fs/overlayfs/super.c
-@@ -773,6 +773,10 @@ retry:
- struct kstat stat = {
- .mode = S_IFDIR | 0,
- };
-+ struct iattr attr = {
-+ .ia_valid = ATTR_MODE,
-+ .ia_mode = stat.mode,
-+ };
-
- if (work->d_inode) {
- err = -EEXIST;
-@@ -788,6 +792,21 @@ retry:
- err = ovl_create_real(dir, work, &stat, NULL, NULL, true);
- if (err)
- goto out_dput;
-+
-+ err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
-+ if (err && err != -ENODATA)
-+ goto out_dput;
-+
-+ err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
-+ if (err && err != -ENODATA)
-+ goto out_dput;
-+
-+ /* Clear any inherited mode bits */
-+ mutex_lock(&work->d_inode->i_mutex);
-+ err = notify_change(work, &attr, NULL);
-+ mutex_unlock(&work->d_inode->i_mutex);
-+ if (err)
-+ goto out_dput;
- }
- out_unlock:
- mutex_unlock(&dir->i_mutex);
diff --git a/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch b/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch
deleted file mode 100644
index 82ad20d..0000000
--- a/target/linux/generic/patches-4.4/051-0006-ovl-listxattr-use-strnlen.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 7cb35119d067191ce9ebc380a599db0b03cbd9d9 Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi@redhat.com>
-Date: Thu, 1 Sep 2016 11:12:00 +0200
-Subject: [PATCH] ovl: listxattr: use strnlen()
-
-Be defensive about what underlying fs provides us in the returned xattr
-list buffer. If it's not properly null terminated, bail out with a warning
-insead of BUG.
-
-Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-Cc: <stable@vger.kernel.org>
----
- fs/overlayfs/inode.c | 17 ++++++++++-------
- 1 file changed, 10 insertions(+), 7 deletions(-)
-
---- a/fs/overlayfs/inode.c
-+++ b/fs/overlayfs/inode.c
-@@ -277,7 +277,8 @@ ssize_t ovl_listxattr(struct dentry *den
- struct path realpath;
- enum ovl_path_type type = ovl_path_real(dentry, &realpath);
- ssize_t res;
-- int off;
-+ size_t len;
-+ char *s;
-
- res = vfs_listxattr(realpath.dentry, list, size);
- if (res <= 0 || size == 0)
-@@ -287,17 +288,19 @@ ssize_t ovl_listxattr(struct dentry *den
- return res;
-
- /* filter out private xattrs */
-- for (off = 0; off < res;) {
-- char *s = list + off;
-- size_t slen = strlen(s) + 1;
-+ for (s = list, len = res; len;) {
-+ size_t slen = strnlen(s, len) + 1;
-
-- BUG_ON(off + slen > res);
-+ /* underlying fs providing us with an broken xattr list? */
-+ if (WARN_ON(slen > len))
-+ return -EIO;
-
-+ len -= slen;
- if (ovl_is_private_xattr(s)) {
- res -= slen;
-- memmove(s, s + slen, res - off);
-+ memmove(s, s + slen, len);
- } else {
-- off += slen;
-+ s += slen;
- }
- }
-
diff --git a/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch b/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch
deleted file mode 100644
index 1f50170..0000000
--- a/target/linux/generic/patches-4.4/051-0007-ovl-fix-workdir-creation.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From e1ff3dd1ae52cef5b5373c8cc4ad949c2c25a71c Mon Sep 17 00:00:00 2001
-From: Miklos Szeredi <mszeredi@redhat.com>
-Date: Mon, 5 Sep 2016 13:55:20 +0200
-Subject: [PATCH] ovl: fix workdir creation
-
-Workdir creation fails in latest kernel.
-
-Fix by allowing EOPNOTSUPP as a valid return value from
-vfs_removexattr(XATTR_NAME_POSIX_ACL_*). Upper filesystem may not support
-ACL and still be perfectly able to support overlayfs.
-
-Reported-by: Martin Ziegler <ziegler@uni-freiburg.de>
-Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-Fixes: c11b9fdd6a61 ("ovl: remove posix_acl_default from workdir")
-Cc: <stable@vger.kernel.org>
----
- fs/overlayfs/super.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/fs/overlayfs/super.c
-+++ b/fs/overlayfs/super.c
-@@ -794,11 +794,11 @@ retry:
- goto out_dput;
-
- err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT);
-- if (err && err != -ENODATA)
-+ if (err && err != -ENODATA && err != -EOPNOTSUPP)
- goto out_dput;
-
- err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS);
-- if (err && err != -ENODATA)
-+ if (err && err != -ENODATA && err != -EOPNOTSUPP)
- goto out_dput;
-
- /* Clear any inherited mode bits */
diff --git a/target/linux/generic/patches-4.4/903-debloat_direct_io.patch b/target/linux/generic/patches-4.4/903-debloat_direct_io.patch
index 460da1d..afdc48b 100644
--- a/target/linux/generic/patches-4.4/903-debloat_direct_io.patch
+++ b/target/linux/generic/patches-4.4/903-debloat_direct_io.patch
@@ -26,7 +26,7 @@
endif
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -2691,6 +2691,7 @@ enum {
+@@ -2716,6 +2716,7 @@ enum {
DIO_SKIP_DIO_COUNT = 0x08,
};
@@ -34,7 +34,7 @@
void dio_end_io(struct bio *bio, int error);
ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
-@@ -2698,6 +2699,18 @@ ssize_t __blockdev_direct_IO(struct kioc
+@@ -2723,6 +2724,18 @@ ssize_t __blockdev_direct_IO(struct kioc
loff_t offset, get_block_t get_block,
dio_iodone_t end_io, dio_submit_t submit_io,
int flags);