All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-backing-devc-fix-error-path-in-wb_init.patch added to -mm tree
@ 2016-02-09 20:40 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-02-09 20:40 UTC (permalink / raw)
  To: linux, hannes, mhocko, vdavydov, mm-commits


The patch titled
     Subject: mm/backing-dev.c: fix error path in wb_init()
has been added to the -mm tree.  Its filename is
     mm-backing-devc-fix-error-path-in-wb_init.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-backing-devc-fix-error-path-in-wb_init.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-backing-devc-fix-error-path-in-wb_init.patch

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/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: mm/backing-dev.c: fix error path in wb_init()

We need to use post-decrement to get percpu_counter_destroy() called on
&wb->stat[0].  Moreover, the pre-decremebt would cause infinite
out-of-bounds accesses if the setup code failed at i==0.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/backing-dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/backing-dev.c~mm-backing-devc-fix-error-path-in-wb_init mm/backing-dev.c
--- a/mm/backing-dev.c~mm-backing-devc-fix-error-path-in-wb_init
+++ a/mm/backing-dev.c
@@ -328,7 +328,7 @@ static int wb_init(struct bdi_writeback
 	return 0;
 
 out_destroy_stat:
-	while (--i)
+	while (i--)
 		percpu_counter_destroy(&wb->stat[i]);
 	fprop_local_destroy_percpu(&wb->completions);
 out_put_cong:
_

Patches currently in -mm which might be from linux@rasmusvillemoes.dk are

mm-backing-devc-fix-error-path-in-wb_init.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-09 20:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-09 20:40 + mm-backing-devc-fix-error-path-in-wb_init.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.