From: Wenwen Wang <wang6495(a)umn.edu>
In trace_pid_write(), the buffer for trace parser is allocated through
kmalloc() in trace_parser_get_init(). Later on, after the buffer is used,
it is then freed through kfree() in trace_parser_put(). However, it is
possible that trace_pid_write() is terminated due to unexpected errors,
e.g., ENOMEM. In that case, the allocated buffer will not be freed, which
is a memory leak bug.
To fix this issue, free the allocated buffer when an error is encountered.
Link: http://lkml.kernel.org/r/1555726979-15633-1-git-send-email-wang6495@umn.edu
Fixes: f4d34a87e9c10 ("tracing: Use pid bitmap instead of a pid array for set_event_pid")
Cc: stable(a)vger.kernel.org
Signed-off-by: Wenwen Wang <wang6495(a)umn.edu>
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
---
kernel/trace/trace.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0cfa13a60086..46f68fad6373 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -496,8 +496,10 @@ int trace_pid_write(struct trace_pid_list *filtered_pids,
* not modified.
*/
pid_list = kmalloc(sizeof(*pid_list), GFP_KERNEL);
- if (!pid_list)
+ if (!pid_list) {
+ trace_parser_put(&parser);
return -ENOMEM;
+ }
pid_list->pid_max = READ_ONCE(pid_max);
@@ -507,6 +509,7 @@ int trace_pid_write(struct trace_pid_list *filtered_pids,
pid_list->pids = vzalloc((pid_list->pid_max + 7) >> 3);
if (!pid_list->pids) {
+ trace_parser_put(&parser);
kfree(pid_list);
return -ENOMEM;
}
--
2.20.1
From: Jann Horn <jannh(a)google.com>
This fixes multiple issues in buffer_pipe_buf_ops:
- The ->steal() handler must not return zero unless the pipe buffer has
the only reference to the page. But generic_pipe_buf_steal() assumes
that every reference to the pipe is tracked by the page's refcount,
which isn't true for these buffers - buffer_pipe_buf_get(), which
duplicates a buffer, doesn't touch the page's refcount.
Fix it by using generic_pipe_buf_nosteal(), which refuses every
attempted theft. It should be easy to actually support ->steal, but the
only current users of pipe_buf_steal() are the virtio console and FUSE,
and they also only use it as an optimization. So it's probably not worth
the effort.
- The ->get() and ->release() handlers can be invoked concurrently on pipe
buffers backed by the same struct buffer_ref. Make them safe against
concurrency by using refcount_t.
- The pointers stored in ->private were only zeroed out when the last
reference to the buffer_ref was dropped. As far as I know, this
shouldn't be necessary anyway, but if we do it, let's always do it.
Link: http://lkml.kernel.org/r/20190404215925.253531-1-jannh@google.com
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: Masami Hiramatsu <mhiramat(a)kernel.org>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: stable(a)vger.kernel.org
Fixes: 73a757e63114d ("ring-buffer: Return reader page back into existing ring buffer")
Signed-off-by: Jann Horn <jannh(a)google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
---
fs/splice.c | 4 ++--
include/linux/pipe_fs_i.h | 1 +
kernel/trace/trace.c | 28 ++++++++++++++--------------
3 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/fs/splice.c b/fs/splice.c
index 3ee7e82df48f..e75807380caa 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -330,8 +330,8 @@ const struct pipe_buf_operations default_pipe_buf_ops = {
.get = generic_pipe_buf_get,
};
-static int generic_pipe_buf_nosteal(struct pipe_inode_info *pipe,
- struct pipe_buffer *buf)
+int generic_pipe_buf_nosteal(struct pipe_inode_info *pipe,
+ struct pipe_buffer *buf)
{
return 1;
}
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 787d224ff43e..a830e9a00eb9 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -174,6 +174,7 @@ void free_pipe_info(struct pipe_inode_info *);
void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
+int generic_pipe_buf_nosteal(struct pipe_inode_info *, struct pipe_buffer *);
void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
void pipe_buf_mark_unmergeable(struct pipe_buffer *buf);
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 21153e64bf1c..0cfa13a60086 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -7025,19 +7025,23 @@ struct buffer_ref {
struct ring_buffer *buffer;
void *page;
int cpu;
- int ref;
+ refcount_t refcount;
};
+static void buffer_ref_release(struct buffer_ref *ref)
+{
+ if (!refcount_dec_and_test(&ref->refcount))
+ return;
+ ring_buffer_free_read_page(ref->buffer, ref->cpu, ref->page);
+ kfree(ref);
+}
+
static void buffer_pipe_buf_release(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
struct buffer_ref *ref = (struct buffer_ref *)buf->private;
- if (--ref->ref)
- return;
-
- ring_buffer_free_read_page(ref->buffer, ref->cpu, ref->page);
- kfree(ref);
+ buffer_ref_release(ref);
buf->private = 0;
}
@@ -7046,14 +7050,14 @@ static void buffer_pipe_buf_get(struct pipe_inode_info *pipe,
{
struct buffer_ref *ref = (struct buffer_ref *)buf->private;
- ref->ref++;
+ refcount_inc(&ref->refcount);
}
/* Pipe buffer operations for a buffer. */
static const struct pipe_buf_operations buffer_pipe_buf_ops = {
.confirm = generic_pipe_buf_confirm,
.release = buffer_pipe_buf_release,
- .steal = generic_pipe_buf_steal,
+ .steal = generic_pipe_buf_nosteal,
.get = buffer_pipe_buf_get,
};
@@ -7066,11 +7070,7 @@ static void buffer_spd_release(struct splice_pipe_desc *spd, unsigned int i)
struct buffer_ref *ref =
(struct buffer_ref *)spd->partial[i].private;
- if (--ref->ref)
- return;
-
- ring_buffer_free_read_page(ref->buffer, ref->cpu, ref->page);
- kfree(ref);
+ buffer_ref_release(ref);
spd->partial[i].private = 0;
}
@@ -7125,7 +7125,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
break;
}
- ref->ref = 1;
+ refcount_set(&ref->refcount, 1);
ref->buffer = iter->trace_buffer->buffer;
ref->page = ring_buffer_alloc_read_page(ref->buffer, iter->cpu_file);
if (IS_ERR(ref->page)) {
--
2.20.1
In megasas_get_target_prop(), driver is incorrectly calculating the
target ID for devices with channel 1 and 3.
Due to this, firmware will either fail the command (if there is no
device with the target id sent from driver) or could return the
properties for a target which was not intended.
Devices could end up with the wrong queue depth due to this.
Fix target id calculation for channel 1 and 3.
Cc: stable(a)vger.kernel.org
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara(a)broadcom.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index f677a84f6bc8..d2714fc833ae 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6165,7 +6165,8 @@ megasas_get_target_prop(struct megasas_instance *instance,
int ret;
struct megasas_cmd *cmd;
struct megasas_dcmd_frame *dcmd;
- u16 targetId = (sdev->channel % 2) + sdev->id;
+ u16 targetId = ((sdev->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) +
+ sdev->id;
cmd = megasas_get_cmd(instance);
--
2.16.1
The patch titled
Subject: mm: add /sys/kernel/slab/cache/cache_dma32
has been added to the -mm tree. Its filename is
mm-add-sys-kernel-slab-cache-cache_dma32.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-add-sys-kernel-slab-cache-cache…
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-add-sys-kernel-slab-cache-cache…
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Nicolas Boichat <drinkcat(a)chromium.org>
Subject: mm: add /sys/kernel/slab/cache/cache_dma32
A previous patch in this series adds support for SLAB_CACHE_DMA32 kmem
caches. This adds the corresponding /sys/kernel/slab/cache/cache_dma32
entries, and fixes slabinfo tool.
Link: http://lkml.kernel.org/r/20181210011504.122604-4-drinkcat@chromium.org
Signed-off-by: Nicolas Boichat <drinkcat(a)chromium.org>
Cc: Christoph Hellwig <hch(a)infradead.org>
Cc: Christoph Lameter <cl(a)linux.com>
Cc: David Rientjes <rientjes(a)google.com>
Cc: Hsin-Yi Wang <hsinyi(a)chromium.org>
Cc: Huaisheng Ye <yehs1(a)lenovo.com>
Cc: Joerg Roedel <joro(a)8bytes.org>
Cc: Joonsoo Kim <iamjoonsoo.kim(a)lge.com>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: Matthias Brugger <matthias.bgg(a)gmail.com>
Cc: Mel Gorman <mgorman(a)techsingularity.net>
Cc: Michal Hocko <mhocko(a)suse.com>
Cc: Mike Rapoport <rppt(a)linux.vnet.ibm.com>
Cc: Pekka Enberg <penberg(a)kernel.org>
Cc: Robin Murphy <robin.murphy(a)arm.com>
Cc: Sasha Levin <Alexander.Levin(a)microsoft.com>
Cc: Tomasz Figa <tfiga(a)google.com>
Cc: Vlastimil Babka <vbabka(a)suse.cz>
Cc: Will Deacon <will.deacon(a)arm.com>
Cc: Yingjoe Chen <yingjoe.chen(a)mediatek.com>
Cc: Yong Wu <yong.wu(a)mediatek.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
Documentation/ABI/testing/sysfs-kernel-slab | 9 +++++++++
mm/slub.c | 11 +++++++++++
tools/vm/slabinfo.c | 7 ++++++-
3 files changed, 26 insertions(+), 1 deletion(-)
--- a/Documentation/ABI/testing/sysfs-kernel-slab~mm-add-sys-kernel-slab-cache-cache_dma32
+++ a/Documentation/ABI/testing/sysfs-kernel-slab
@@ -106,6 +106,15 @@ Description:
are from ZONE_DMA.
Available when CONFIG_ZONE_DMA is enabled.
+What: /sys/kernel/slab/cache/cache_dma32
+Date: December 2018
+KernelVersion: 4.21
+Contact: Nicolas Boichat <drinkcat(a)chromium.org>
+Description:
+ The cache_dma32 file is read-only and specifies whether objects
+ are from ZONE_DMA32.
+ Available when CONFIG_ZONE_DMA32 is enabled.
+
What: /sys/kernel/slab/cache/cpu_slabs
Date: May 2007
KernelVersion: 2.6.22
--- a/mm/slub.c~mm-add-sys-kernel-slab-cache-cache_dma32
+++ a/mm/slub.c
@@ -5112,6 +5112,14 @@ static ssize_t cache_dma_show(struct kme
SLAB_ATTR_RO(cache_dma);
#endif
+#ifdef CONFIG_ZONE_DMA32
+static ssize_t cache_dma32_show(struct kmem_cache *s, char *buf)
+{
+ return sprintf(buf, "%d\n", !!(s->flags & SLAB_CACHE_DMA32));
+}
+SLAB_ATTR_RO(cache_dma32);
+#endif
+
static ssize_t usersize_show(struct kmem_cache *s, char *buf)
{
return sprintf(buf, "%u\n", s->usersize);
@@ -5452,6 +5460,9 @@ static struct attribute *slab_attrs[] =
#ifdef CONFIG_ZONE_DMA
&cache_dma_attr.attr,
#endif
+#ifdef CONFIG_ZONE_DMA32
+ &cache_dma32_attr.attr,
+#endif
#ifdef CONFIG_NUMA
&remote_node_defrag_ratio_attr.attr,
#endif
--- a/tools/vm/slabinfo.c~mm-add-sys-kernel-slab-cache-cache_dma32
+++ a/tools/vm/slabinfo.c
@@ -29,7 +29,7 @@ struct slabinfo {
char *name;
int alias;
int refs;
- int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu;
+ int aliases, align, cache_dma, cache_dma32, cpu_slabs, destroy_by_rcu;
unsigned int hwcache_align, object_size, objs_per_slab;
unsigned int sanity_checks, slab_size, store_user, trace;
int order, poison, reclaim_account, red_zone;
@@ -534,6 +534,8 @@ static void report(struct slabinfo *s)
printf("** Hardware cacheline aligned\n");
if (s->cache_dma)
printf("** Memory is allocated in a special DMA zone\n");
+ if (s->cache_dma32)
+ printf("** Memory is allocated in a special DMA32 zone\n");
if (s->destroy_by_rcu)
printf("** Slabs are destroyed via RCU\n");
if (s->reclaim_account)
@@ -602,6 +604,8 @@ static void slabcache(struct slabinfo *s
*p++ = '*';
if (s->cache_dma)
*p++ = 'd';
+ if (s->cache_dma32)
+ *p++ = 'D';
if (s->hwcache_align)
*p++ = 'A';
if (s->poison)
@@ -1208,6 +1212,7 @@ static void read_slab_dir(void)
slab->aliases = get_obj("aliases");
slab->align = get_obj("align");
slab->cache_dma = get_obj("cache_dma");
+ slab->cache_dma32 = get_obj("cache_dma32");
slab->cpu_slabs = get_obj("cpu_slabs");
slab->destroy_by_rcu = get_obj("destroy_by_rcu");
slab->hwcache_align = get_obj("hwcache_align");
_
Patches currently in -mm which might be from drinkcat(a)chromium.org are
mm-add-support-for-kmem-caches-in-dma32-zone.patch
iommu-io-pgtable-arm-v7s-request-dma32-memory-and-improve-debugging.patch
mm-add-sys-kernel-slab-cache-cache_dma32.patch
From: Mel Gorman <mgorman(a)techsingularity.net>
Subject: mm: do not boost watermarks to avoid fragmentation for the DISCONTIG memory model
Mikulas Patocka reported that 1c30844d2dfe ("mm: reclaim small amounts of
memory when an external fragmentation event occurs") "broke" memory
management on parisc. The machine is not NUMA but the DISCONTIG model
creates three pgdats even though it's a UMA machine for the following
ranges
0) Start 0x0000000000000000 End 0x000000003fffffff Size 1024 MB
1) Start 0x0000000100000000 End 0x00000001bfdfffff Size 3070 MB
2) Start 0x0000004040000000 End 0x00000040ffffffff Size 3072 MB
Mikulas reported:
With the patch 1c30844d2, the kernel will incorrectly reclaim the
first zone when it fills up, ignoring the fact that there are two
completely free zones. Basiscally, it limits cache size to 1GiB.
For example, if I run:
# dd if=/dev/sda of=/dev/null bs=1M count=2048
- with the proper kernel, there should be "Buffers - 2GiB"
when this command finishes. With the patch 1c30844d2, buffers
will consume just 1GiB or slightly more, because the kernel was
incorrectly reclaiming them.
The page allocator and reclaim makes assumptions that pgdats really
represent NUMA nodes and zones represent ranges and makes decisions on
that basis. Watermark boosting for small pgdats leads to unexpected
results even though this would have behaved reasonably on SPARSEMEM.
DISCONTIG is essentially deprecated and even parisc plans to move to
SPARSEMEM so there is no need to be fancy, this patch simply disables
watermark boosting by default on DISCONTIGMEM.
Link: http://lkml.kernel.org/r/20190419094335.GJ18914@techsingularity.net
Fixes: 1c30844d2dfe ("mm: reclaim small amounts of memory when an external fragmentation event occurs")
Signed-off-by: Mel Gorman <mgorman(a)techsingularity.net>
Reported-by: Mikulas Patocka <mpatocka(a)redhat.com>
Tested-by: Mikulas Patocka <mpatocka(a)redhat.com>
Acked-by: Vlastimil Babka <vbabka(a)suse.cz>
Cc: James Bottomley <James.Bottomley(a)hansenpartnership.com>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
Documentation/sysctl/vm.txt | 16 ++++++++--------
mm/page_alloc.c | 13 +++++++++++++
2 files changed, 21 insertions(+), 8 deletions(-)
--- a/Documentation/sysctl/vm.txt~mm-do-not-boost-watermarks-to-avoid-fragmentation-for-the-discontig-memory-model
+++ a/Documentation/sysctl/vm.txt
@@ -866,14 +866,14 @@ The intent is that compaction has less w
increase the success rate of future high-order allocations such as SLUB
allocations, THP and hugetlbfs pages.
-To make it sensible with respect to the watermark_scale_factor parameter,
-the unit is in fractions of 10,000. The default value of 15,000 means
-that up to 150% of the high watermark will be reclaimed in the event of
-a pageblock being mixed due to fragmentation. The level of reclaim is
-determined by the number of fragmentation events that occurred in the
-recent past. If this value is smaller than a pageblock then a pageblocks
-worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor
-of 0 will disable the feature.
+To make it sensible with respect to the watermark_scale_factor
+parameter, the unit is in fractions of 10,000. The default value of
+15,000 on !DISCONTIGMEM configurations means that up to 150% of the high
+watermark will be reclaimed in the event of a pageblock being mixed due
+to fragmentation. The level of reclaim is determined by the number of
+fragmentation events that occurred in the recent past. If this value is
+smaller than a pageblock then a pageblocks worth of pages will be reclaimed
+(e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature.
=============================================================
--- a/mm/page_alloc.c~mm-do-not-boost-watermarks-to-avoid-fragmentation-for-the-discontig-memory-model
+++ a/mm/page_alloc.c
@@ -266,7 +266,20 @@ compound_page_dtor * const compound_page
int min_free_kbytes = 1024;
int user_min_free_kbytes = -1;
+#ifdef CONFIG_DISCONTIGMEM
+/*
+ * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges
+ * are not on separate NUMA nodes. Functionally this works but with
+ * watermark_boost_factor, it can reclaim prematurely as the ranges can be
+ * quite small. By default, do not boost watermarks on discontigmem as in
+ * many cases very high-order allocations like THP are likely to be
+ * unsupported and the premature reclaim offsets the advantage of long-term
+ * fragmentation avoidance.
+ */
+int watermark_boost_factor __read_mostly;
+#else
int watermark_boost_factor __read_mostly = 15000;
+#endif
int watermark_scale_factor = 10;
static unsigned long nr_kernel_pages __initdata;
_
From: YueHaibing <yuehaibing(a)huawei.com>
Subject: lib/Kconfig.debug: fix build error without CONFIG_BLOCK
If CONFIG_TEST_KMOD is set to M, while CONFIG_BLOCK is not set, XFS and
BTRFS can not be compiled successly.
Link: http://lkml.kernel.org/r/20190410075434.35220-1-yuehaibing@huawei.com
Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the module loader")
Signed-off-by: YueHaibing <yuehaibing(a)huawei.com>
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Reviewed-by: Kees Cook <keescook(a)chromium.org>
Cc: Masahiro Yamada <yamada.masahiro(a)socionext.com>
Cc: Petr Mladek <pmladek(a)suse.com>
Cc: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: Joe Lawrence <joe.lawrence(a)redhat.com>
Cc: Robin Murphy <robin.murphy(a)arm.com>
Cc: Luis Chamberlain <mcgrof(a)kernel.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
lib/Kconfig.debug | 1 +
1 file changed, 1 insertion(+)
--- a/lib/Kconfig.debug~lib-kconfigdebug-fix-build-error-without-config_block
+++ a/lib/Kconfig.debug
@@ -1929,6 +1929,7 @@ config TEST_KMOD
depends on m
depends on BLOCK && (64BIT || LBDAF) # for XFS, BTRFS
depends on NETDEVICES && NET_CORE && INET # for TUN
+ depends on BLOCK
select TEST_LKM
select XFS_FS
select TUN
_
From: Jérôme Glisse <jglisse(a)redhat.com>
Subject: zram: pass down the bvec we need to read into in the work struct
When scheduling work item to read page we need to pass down the proper
bvec struct which points to the page to read into. Before this patch it
uses a randomly initialized bvec (only if PAGE_SIZE != 4096) which is
wrong.
Note that without this patch on arch/kernel where PAGE_SIZE != 4096
userspace could read random memory through a zram block device (thought
userspace probably would have no control on the address being read).
Link: http://lkml.kernel.org/r/20190408183219.26377-1-jglisse@redhat.com
Signed-off-by: Jérôme Glisse <jglisse(a)redhat.com>
Reviewed-by: Andrew Morton <akpm(a)linux-foundation.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
Acked-by: Minchan Kim <minchan(a)kernel.org>
Cc: Nitin Gupta <ngupta(a)vflare.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
drivers/block/zram/zram_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/block/zram/zram_drv.c~zram-pass-down-the-bvec-we-need-to-read-into-in-the-work-struct
+++ a/drivers/block/zram/zram_drv.c
@@ -774,18 +774,18 @@ struct zram_work {
struct zram *zram;
unsigned long entry;
struct bio *bio;
+ struct bio_vec bvec;
};
#if PAGE_SIZE != 4096
static void zram_sync_read(struct work_struct *work)
{
- struct bio_vec bvec;
struct zram_work *zw = container_of(work, struct zram_work, work);
struct zram *zram = zw->zram;
unsigned long entry = zw->entry;
struct bio *bio = zw->bio;
- read_from_bdev_async(zram, &bvec, entry, bio);
+ read_from_bdev_async(zram, &zw->bvec, entry, bio);
}
/*
@@ -798,6 +798,7 @@ static int read_from_bdev_sync(struct zr
{
struct zram_work work;
+ work.bvec = *bvec;
work.zram = zram;
work.entry = entry;
work.bio = bio;
_
This is a note to let you know that I've just added the patch titled
mm/memory_hotplug: Do not unlock when fails to take the
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-next branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release
during the merge window.
If you have any questions about this process, please let me know.
>From d2ab99403ee00d8014e651728a4702ea1ae5e52c Mon Sep 17 00:00:00 2001
From: zhong jiang <zhongjiang(a)huawei.com>
Date: Mon, 8 Apr 2019 12:07:17 +0800
Subject: mm/memory_hotplug: Do not unlock when fails to take the
device_hotplug_lock
When adding the memory by probing memory block in sysfs interface, there is an
obvious issue that we will unlock the device_hotplug_lock when fails to takes it.
That issue was introduced in Commit 8df1d0e4a265
("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")
We should drop out in time when fails to take the device_hotplug_lock.
Fixes: 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")
Reported-by: Yang yingliang <yangyingliang(a)huawei.com>
Signed-off-by: zhong jiang <zhongjiang(a)huawei.com>
Reviewed-by: Oscar Salvador <osalvador(a)suse.de>
Reviewed-by: David Hildenbrand <david(a)redhat.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/base/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index cb8347500ce2..e49028a60429 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -506,7 +506,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr,
ret = lock_device_hotplug_sysfs();
if (ret)
- goto out;
+ return ret;
nid = memory_add_physaddr_to_nid(phys_addr);
ret = __add_memory(nid, phys_addr,
--
2.21.0
This is the start of the stable review cycle for the 4.9.171 release.
There are 44 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri 26 Apr 2019 05:07:31 PM UTC.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.171-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.171-rc1
Linus Torvalds <torvalds(a)linux-foundation.org>
i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array
Matteo Croce <mcroce(a)redhat.com>
percpu: stop printing kernel addresses
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix racy addition/deletion of nodes
Konstantin Khlebnikov <khlebnikov(a)yandex-team.ru>
mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n
Jann Horn <jannh(a)google.com>
device_cgroup: fix RCU imbalance in error case
Phil Auld <pauld(a)redhat.com>
sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup
Matthias Kaehlcke <mka(a)chromium.org>
Revert "kbuild: use -Oz instead of -Os when using clang"
Kim Phillips <kim.phillips(a)amd.com>
perf/x86/amd: Add event map for AMD Family 17h
Felix Fietkau <nbd(a)nbd.name>
mac80211: do not call driver wake_tx_queue op during reconfig
Vijayakumar Durai <vijayakumar.durai1(a)vivint.com>
rt2x00: do not increment sequence number while re-transmitting
Masami Hiramatsu <mhiramat(a)kernel.org>
kprobes: Fix error check when reusing optimized probes
Masami Hiramatsu <mhiramat(a)kernel.org>
kprobes: Mark ftrace mcount handler functions nokprobe
Masami Hiramatsu <mhiramat(a)kernel.org>
x86/kprobes: Verify stack frame on kretprobe
Nathan Chancellor <natechancellor(a)gmail.com>
arm64: futex: Restore oldval initialization to work around buggy compilers
Eric Biggers <ebiggers(a)google.com>
crypto: x86/poly1305 - fix overflow during partial reduction
Suthikulpanit, Suravee <Suravee.Suthikulpanit(a)amd.com>
Revert "svm: Fix AVIC incomplete IPI emulation"
Saurav Kashyap <skashyap(a)marvell.com>
Revert "scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO"
Takashi Iwai <tiwai(a)suse.de>
ALSA: core: Fix card races between register and disconnect
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_buf
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: ni_usb6501: Fix use of uninitialized mutex
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf
Ian Abbott <abbotti(a)mev.co.uk>
staging: comedi: vmk80xx: Fix use of uninitialized semaphore
he, bo <bo.he(a)intel.com>
io: accel: kxcjk1013: restore the range after resume.
Georg Ottinger <g.ottinger(a)abatec.at>
iio: adc: at91: disable adc channel interrupt in timeout case
Dragos Bogdan <dragos.bogdan(a)analog.com>
iio: ad_sigma_delta: select channel when reading register
Mike Looijmans <mike.looijmans(a)topic.nl>
iio/gyro/bmg160: Use millidegrees for temperature scale
Mircea Caprioru <mircea.caprioru(a)analog.com>
staging: iio: ad7192: Fix ad7193 channel address
Sean Christopherson <sean.j.christopherson(a)intel.com>
KVM: x86: Don't clear EFER during SMM transitions for 32-bit vCPU
Aurelien Aptel <aaptel(a)suse.com>
CIFS: keep FileInfo handle live during oplock break
Jarkko Sakkinen <jarkko.sakkinen(a)linux.intel.com>
tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete
Masahiro Yamada <yamada.masahiro(a)socionext.com>
modpost: file2alias: check prototype of handler
Masahiro Yamada <yamada.masahiro(a)socionext.com>
modpost: file2alias: go back to simple devtable lookup
Adrian Hunter <adrian.hunter(a)intel.com>
mmc: sdhci: Fix data command CRC error handling
Christian Lamparter <chunkeey(a)gmail.com>
crypto: crypto4xx - properly set IV after de- and encrypt
Eric Dumazet <edumazet(a)google.com>
ipv4: ensure rcu_read_lock() in ipv4_link_failure()
Stephen Suryaputra <ssuryaextr(a)gmail.com>
ipv4: recompile ip options in ipv4_link_failure
Jason Wang <jasowang(a)redhat.com>
vhost: reject zero size iova range
Hangbin Liu <liuhangbin(a)gmail.com>
team: set slave to promisc if team is already in promisc mode
Eric Dumazet <edumazet(a)google.com>
tcp: tcp_grow_window() needs to respect tcp_space()
Lorenzo Bianconi <lorenzo.bianconi(a)redhat.com>
net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
net: bridge: multicast: use rcu to access port list from br_multicast_start_querier
Nikolay Aleksandrov <nikolay(a)cumulusnetworks.com>
net: bridge: fix per-port af_packet sockets
Gustavo A. R. Silva <gustavo(a)embeddedor.com>
net: atm: Fix potential Spectre v1 vulnerabilities
Sabrina Dubroca <sd(a)queasysnail.net>
bonding: fix event handling for stacked bonds
-------------
Diffstat:
Makefile | 7 +-
arch/arm64/include/asm/futex.h | 2 +-
arch/x86/crypto/poly1305-avx2-x86_64.S | 14 ++-
arch/x86/crypto/poly1305-sse2-x86_64.S | 22 ++--
arch/x86/events/amd/core.c | 35 ++++--
arch/x86/kernel/kprobes/core.c | 26 +++++
arch/x86/kvm/emulate.c | 21 ++--
arch/x86/kvm/svm.c | 19 ++-
crypto/testmgr.h | 44 ++++++-
drivers/char/tpm/tpm_i2c_atmel.c | 10 +-
drivers/crypto/amcc/crypto4xx_alg.c | 3 +-
drivers/crypto/amcc/crypto4xx_core.c | 9 ++
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 3 +-
drivers/iio/accel/kxcjk-1013.c | 2 +
drivers/iio/adc/ad_sigma_delta.c | 1 +
drivers/iio/adc/at91_adc.c | 28 +++--
drivers/iio/gyro/bmg160_core.c | 6 +-
drivers/mmc/host/sdhci.c | 40 +++----
drivers/net/bonding/bond_main.c | 6 +-
drivers/net/team/team.c | 26 +++++
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 -
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 10 --
drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 15 ++-
drivers/scsi/libfc/fc_rport.c | 1 -
drivers/staging/comedi/drivers/ni_usb6501.c | 10 +-
drivers/staging/comedi/drivers/vmk80xx.c | 8 +-
drivers/staging/iio/adc/ad7192.c | 8 +-
drivers/vhost/vhost.c | 6 +-
fs/cifs/cifsglob.h | 2 +
fs/cifs/file.c | 30 ++++-
fs/cifs/misc.c | 25 +++-
fs/cifs/smb2misc.c | 6 +-
include/linux/kprobes.h | 1 +
kernel/kprobes.c | 6 +-
kernel/sched/fair.c | 25 ++++
kernel/trace/ftrace.c | 6 +-
mm/percpu.c | 8 +-
mm/vmstat.c | 5 -
net/atm/lec.c | 6 +-
net/bridge/br_input.c | 23 ++--
net/bridge/br_multicast.c | 4 +-
net/ipv4/fou.c | 4 +-
net/ipv4/route.c | 16 ++-
net/ipv4/tcp_input.c | 10 +-
net/mac80211/driver-ops.h | 3 +
scripts/mod/file2alias.c | 141 ++++++++---------------
security/device_cgroup.c | 2 +-
sound/core/info.c | 12 +-
sound/core/init.c | 18 +--
49 files changed, 470 insertions(+), 266 deletions(-)