From: Greg Kroah-Hartman Date: Mon, 7 Jul 2014 23:12:03 +0000 (-0700) Subject: delete some 3.14 patches: X-Git-Tag: v3.4.98~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1469d0228268249c21a9b27789c709f3889123fb;p=thirdparty%2Fkernel%2Fstable-queue.git delete some 3.14 patches: fs-seq_file-fallback-to-vmalloc-allocation.patch nick-kvfree-from-apparmor.patch --- diff --git a/queue-3.14/fs-seq_file-fallback-to-vmalloc-allocation.patch b/queue-3.14/fs-seq_file-fallback-to-vmalloc-allocation.patch deleted file mode 100644 index 991e8e1cac7..00000000000 --- a/queue-3.14/fs-seq_file-fallback-to-vmalloc-allocation.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 058504edd02667eef8fac9be27ab3ea74332e9b4 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Wed, 2 Jul 2014 15:22:37 -0700 -Subject: fs/seq_file: fallback to vmalloc allocation - -From: Heiko Carstens - -commit 058504edd02667eef8fac9be27ab3ea74332e9b4 upstream. - -There are a couple of seq_files which use the single_open() interface. -This interface requires that the whole output must fit into a single -buffer. - -E.g. for /proc/stat allocation failures have been observed because an -order-4 memory allocation failed due to memory fragmentation. In such -situations reading /proc/stat is not possible anymore. - -Therefore change the seq_file code to fallback to vmalloc allocations -which will usually result in a couple of order-0 allocations and hence -also work if memory is fragmented. - -For reference a call trace where reading from /proc/stat failed: - - sadc: page allocation failure: order:4, mode:0x1040d0 - CPU: 1 PID: 192063 Comm: sadc Not tainted 3.10.0-123.el7.s390x #1 - [...] - Call Trace: - show_stack+0x6c/0xe8 - warn_alloc_failed+0xd6/0x138 - __alloc_pages_nodemask+0x9da/0xb68 - __get_free_pages+0x2e/0x58 - kmalloc_order_trace+0x44/0xc0 - stat_open+0x5a/0xd8 - proc_reg_open+0x8a/0x140 - do_dentry_open+0x1bc/0x2c8 - finish_open+0x46/0x60 - do_last+0x382/0x10d0 - path_openat+0xc8/0x4f8 - do_filp_open+0x46/0xa8 - do_sys_open+0x114/0x1f0 - sysc_tracego+0x14/0x1a - -Signed-off-by: Heiko Carstens -Tested-by: David Rientjes -Cc: Ian Kent -Cc: Hendrik Brueckner -Cc: Thorsten Diehl -Cc: Andrea Righi -Cc: Christoph Hellwig -Cc: Al Viro -Cc: Stefan Bader -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - ---- - fs/seq_file.c | 30 +++++++++++++++++++++--------- - 1 file changed, 21 insertions(+), 9 deletions(-) - ---- a/fs/seq_file.c -+++ b/fs/seq_file.c -@@ -8,8 +8,10 @@ - #include - #include - #include -+#include - #include - #include -+#include - - #include - #include -@@ -30,6 +32,16 @@ static void seq_set_overflow(struct seq_ - m->count = m->size; - } - -+static void *seq_buf_alloc(unsigned long size) -+{ -+ void *buf; -+ -+ buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); -+ if (!buf && size > PAGE_SIZE) -+ buf = vmalloc(size); -+ return buf; -+} -+ - /** - * seq_open - initialize sequential file - * @file: file we initialize -@@ -96,7 +108,7 @@ static int traverse(struct seq_file *m, - return 0; - } - if (!m->buf) { -- m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL); -+ m->buf = seq_buf_alloc(m->size = PAGE_SIZE); - if (!m->buf) - return -ENOMEM; - } -@@ -135,9 +147,9 @@ static int traverse(struct seq_file *m, - - Eoverflow: - m->op->stop(m, p); -- kfree(m->buf); -+ kvfree(m->buf); - m->count = 0; -- m->buf = kmalloc(m->size <<= 1, GFP_KERNEL); -+ m->buf = seq_buf_alloc(m->size <<= 1); - return !m->buf ? -ENOMEM : -EAGAIN; - } - -@@ -192,7 +204,7 @@ ssize_t seq_read(struct file *file, char - - /* grab buffer if we didn't have one */ - if (!m->buf) { -- m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL); -+ m->buf = seq_buf_alloc(m->size = PAGE_SIZE); - if (!m->buf) - goto Enomem; - } -@@ -232,9 +244,9 @@ ssize_t seq_read(struct file *file, char - if (m->count < m->size) - goto Fill; - m->op->stop(m, p); -- kfree(m->buf); -+ kvfree(m->buf); - m->count = 0; -- m->buf = kmalloc(m->size <<= 1, GFP_KERNEL); -+ m->buf = seq_buf_alloc(m->size <<= 1); - if (!m->buf) - goto Enomem; - m->version = 0; -@@ -350,7 +362,7 @@ EXPORT_SYMBOL(seq_lseek); - int seq_release(struct inode *inode, struct file *file) - { - struct seq_file *m = file->private_data; -- kfree(m->buf); -+ kvfree(m->buf); - kfree(m); - return 0; - } -@@ -605,13 +617,13 @@ EXPORT_SYMBOL(single_open); - int single_open_size(struct file *file, int (*show)(struct seq_file *, void *), - void *data, size_t size) - { -- char *buf = kmalloc(size, GFP_KERNEL); -+ char *buf = seq_buf_alloc(size); - int ret; - if (!buf) - return -ENOMEM; - ret = single_open(file, show, data); - if (ret) { -- kfree(buf); -+ kvfree(buf); - return ret; - } - ((struct seq_file *)file->private_data)->buf = buf; diff --git a/queue-3.14/nick-kvfree-from-apparmor.patch b/queue-3.14/nick-kvfree-from-apparmor.patch deleted file mode 100644 index e66aa8bd47e..00000000000 --- a/queue-3.14/nick-kvfree-from-apparmor.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 39f1f78d53b9bcbca91967380c5f0f2305a5c55f Mon Sep 17 00:00:00 2001 -From: Al Viro -Date: Tue, 6 May 2014 14:02:53 -0400 -Subject: nick kvfree() from apparmor - -From: Al Viro - -commit 39f1f78d53b9bcbca91967380c5f0f2305a5c55f upstream. - -too many places open-code it - -Signed-off-by: Al Viro -Signed-off-by: Greg Kroah-Hartman - ---- - include/linux/mm.h | 2 ++ - mm/util.c | 10 ++++++++++ - security/apparmor/include/apparmor.h | 1 - - security/apparmor/lib.c | 14 -------------- - 4 files changed, 12 insertions(+), 15 deletions(-) - ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -362,6 +362,8 @@ static inline int is_vmalloc_or_module_a - } - #endif - -+extern void kvfree(const void *addr); -+ - static inline void compound_lock(struct page *page) - { - #ifdef CONFIG_TRANSPARENT_HUGEPAGE ---- a/mm/util.c -+++ b/mm/util.c -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include - - #include - -@@ -386,6 +387,15 @@ unsigned long vm_mmap(struct file *file, - } - EXPORT_SYMBOL(vm_mmap); - -+void kvfree(const void *addr) -+{ -+ if (is_vmalloc_addr(addr)) -+ vfree(addr); -+ else -+ kfree(addr); -+} -+EXPORT_SYMBOL(kvfree); -+ - struct address_space *page_mapping(struct page *page) - { - struct address_space *mapping = page->mapping; ---- a/security/apparmor/include/apparmor.h -+++ b/security/apparmor/include/apparmor.h -@@ -66,7 +66,6 @@ extern int apparmor_initialized __initda - char *aa_split_fqname(char *args, char **ns_name); - void aa_info_message(const char *str); - void *__aa_kvmalloc(size_t size, gfp_t flags); --void kvfree(void *buffer); - - static inline void *kvmalloc(size_t size) - { ---- a/security/apparmor/lib.c -+++ b/security/apparmor/lib.c -@@ -104,17 +104,3 @@ void *__aa_kvmalloc(size_t size, gfp_t f - } - return buffer; - } -- --/** -- * kvfree - free an allocation do by kvmalloc -- * @buffer: buffer to free (MAYBE_NULL) -- * -- * Free a buffer allocated by kvmalloc -- */ --void kvfree(void *buffer) --{ -- if (is_vmalloc_addr(buffer)) -- vfree(buffer); -- else -- kfree(buffer); --} diff --git a/queue-3.14/series b/queue-3.14/series index 30885606fad..996f6ae1aca 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -63,8 +63,6 @@ cifs-fix-mount-failure-with-broken-pathnames-when-smb3-mount-with-mapchars-optio blkcg-fix-use-after-free-in-__blkg_release_rcu-by-making-blkcg_gq-refcnt-an-atomic_t.patch ext4-fix-buffer-double-free-in-ext4_alloc_branch.patch ext4-fix-hole-punching-for-files-with-indirect-blocks.patch -nick-kvfree-from-apparmor.patch -fs-seq_file-fallback-to-vmalloc-allocation.patch kvm-x86-increase-the-number-of-fixed-mtrr-regs-to-10.patch kvm-x86-preserve-the-high-32-bits-of-the-pat-register.patch kvm-fix-wrong-address-when-writing-hyper-v-tsc-page.patch