+ mm-memcontrol-fix-use-after-free-in-mem_cgroup_iter-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/memcg: fix a -Wparentheses compilation warning
has been added to the -mm tree.  Its filename is
     mm-memcontrol-fix-use-after-free-in-mem_cgroup_iter-fix.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-fix-use-after-free-in-mem_cgroup_iter-fix.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-fix-use-after-free-in-mem_cgroup_iter-fix.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/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: Qian Cai <cai@xxxxxx>
Subject: mm/memcg: fix a -Wparentheses compilation warning

The linux-next commit ("mm/memcontrol.c: fix use after free in
mem_cgroup_iter()") [1] introduced a compilation warning,

mm/memcontrol.c:1160:17: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
        } while (memcg = parent_mem_cgroup(memcg));
                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
mm/memcontrol.c:1160:17: note: place parentheses around the assignment
to silence this warning
        } while (memcg = parent_mem_cgroup(memcg));
                       ^
                 (                               )
mm/memcontrol.c:1160:17: note: use '==' to turn this assignment into an
equality comparison
        } while (memcg = parent_mem_cgroup(memcg));
                       ^
                       ==

Fix it by adding a pair of parentheses.

[1] https://lore.kernel.org/linux-mm/20190730015729.4406-1-miles.chen@xxxxxxxxxxxx/

Link: http://lkml.kernel.org/r/1564580753-17531-1-git-send-email-cai@xxxxxx
Signed-off-by: Qian Cai <cai@xxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Cc: Miles Chen <miles.chen@xxxxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

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

--- a/mm/memcontrol.c~mm-memcontrol-fix-use-after-free-in-mem_cgroup_iter-fix
+++ a/mm/memcontrol.c
@@ -1156,7 +1156,7 @@ static void invalidate_reclaim_iterators
 	do {
 		__invalidate_reclaim_iterators(memcg, dead_memcg);
 		last = memcg;
-	} while (memcg = parent_mem_cgroup(memcg));
+	} while ((memcg = parent_mem_cgroup(memcg)));
 
 	/*
 	 * When cgruop1 non-hierarchy mode is used,
_

Patches currently in -mm which might be from cai@xxxxxx are

asm-generic-fix-wtype-limits-compiler-warnings.patch
asm-generic-fix-wtype-limits-compiler-warnings-v2.patch
mm-memcontrol-fix-use-after-free-in-mem_cgroup_iter-fix.patch
writeback-fix-wstringop-truncation-warnings.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux