<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/mm, branch ng-7.1.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=ng-7.1.2</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=ng-7.1.2'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2019-07-18T22:08:32+00:00</updated>
<entry>
<title>mm/oom_kill: squashed reverts to a stable state</title>
<updated>2019-07-18T22:08:32+00:00</updated>
<author>
<name>Corinna Vinschen</name>
<email>xda@vinschen.de</email>
</author>
<published>2019-04-16T08:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=33c8b08c2bbe034fc01b346b1e6ce94913efb8ef'/>
<id>urn:sha1:33c8b08c2bbe034fc01b346b1e6ce94913efb8ef</id>
<content type='text'>
Revert "mm, oom: fix use-after-free in oom_kill_process"

This reverts commit e1bebdeedb497f03d426c85a89c3807c7e75268d.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm,oom: make oom_killer_disable() killable"

This reverts commit 65a7400a432639aa8d5e572f30687fbca204b6f8.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm: oom_kill: don't ignore oom score on exiting tasks"

This reverts commit d60dae46b27a8f381e4a7ad9dde870faa49fa5f1.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm/oom_kill.c: avoid attempting to kill init sharing same memory"

This reverts commit 10773c0325259d6640b93c0694b5598ddf84939f.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "CHROMIUM: DROP: mm/oom_kill: Double-check before killing a child in our place"

This reverts commit 2bdd9a2042a0e12d96c545773d9d8038c920f813.

Revert "mm/oom_kill: fix the wrong task-&gt;mm == mm checks in oom_kill_process()"

This reverts commit 419a313435b31821e4d045ca4b7ea1cc5fa02035.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm/oom_kill: cleanup the "kill sharing same memory" loop"

This reverts commit afda78c6de38f9f66eba0955153b380d540d8276.

Revert "mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process()"

This reverts commit acde9c2ace298b249c06ec5b0b971c333449dc09.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm, oom: remove task_lock protecting comm printing"

This reverts commit 9a9ca142d250ec9de1215284857f4528c6ddb080.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm/oom_kill.c: suppress unnecessary "sharing same memory" message"

This reverts commit 1aa2960f7c70d65b1481f805ac73b988faff6747.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm/oom_kill.c: reverse the order of setting TIF_MEMDIE and sending SIGKILL"

This reverts commit f028aedfcfd2e2bb98921b98d3ae183387ab8fed.

Revert "mm, oom: remove unnecessary variable"

This reverts commit 54b0b58224146d68a11bccb5e64683ab3029373a.

Revert "mm/oom_kill.c: print points as unsigned int"

This reverts commit 603f975a6d4f0b56c7f6df7889ef2a704eca94a3.

Signed-off-by: Corinna Vinschen &lt;xda@vinschen.de&gt;

Revert "mm: oom_kill: simplify OOM killer locking"

This reverts commit 7951a52ed35d162063fa08b27894e302fd716ccd.

Revert "mm: oom_kill: remove unnecessary locking in exit_oom_victim()"

This reverts commit f0739b25ac884682865d6aae7485e79489107bfb.

Revert "mm: oom_kill: generalize OOM progress waitqueue"

This reverts commit eb4b1243c72ba0b392bbe05dbf9f91959f70eb18.

Revert "mm: oom_kill: switch test-and-clear of known TIF_MEMDIE to clear"

This reverts commit e611f16275c3642cb8a6345ff2470926fef52110.

Revert "mm: oom_kill: clean up victim marking and exiting interfaces"

This reverts commit c6fada01b9370e3d7603b4ad8c26b56759174667.

Revert "mm: oom_kill: remove unnecessary locking in oom_enable()"

This reverts commit 5dd152d7351b3805f59b2b1f624722ab2f3c5fd8.

Revert "oom, PM: make OOM detection in the freezer path raceless"

This reverts commit 5fc5b1ddee5404a7629dd7045f54eaf8941bc11c.
</content>
</entry>
<entry>
<title>mm: Add notifier framework for showing memory</title>
<updated>2019-07-18T22:01:34+00:00</updated>
<author>
<name>Laura Abbott</name>
<email>lauraa@codeaurora.org</email>
</author>
<published>2014-09-22T20:26:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=23a81af2839a25b6a48484b261661a17132b72d2'/>
<id>urn:sha1:23a81af2839a25b6a48484b261661a17132b72d2</id>
<content type='text'>
There are many drivers in the kernel which can hold on
to lots of memory. It can be useful to dump out all those
drivers at key points in the kernel. Introduct a notifier
framework for dumping this information. When the notifiers
are called, drivers can dump out the state of any memory
they may be using.

Change-Id: Ifb2946964bf5d072552dd56d8d6dfdd794af6d84
Signed-off-by: Laura Abbott &lt;lauraa@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>memcg: Allow non-root users permission to control memory</title>
<updated>2019-07-18T22:01:24+00:00</updated>
<author>
<name>Chintan Pandya</name>
<email>cpandya@codeaurora.org</email>
</author>
<published>2014-07-17T14:17:04+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=a8492fe290916d2fc464f5772f48dbf412eaf9d6'/>
<id>urn:sha1:a8492fe290916d2fc464f5772f48dbf412eaf9d6</id>
<content type='text'>
In a system like Android, a process with SYS_ADMIN rights
controls the system for things like moving process from
one cgroup to another. The native cgroup capabilities
are only allowed to execute by root user and not system.
While adding a new cgroup sub-system, one may override
and relax the permission so that 'system' can also control
cgroup. Here, memcg is one such cgroup sub system which
requires system level control for that.

Allow non-root processes to add arbitrary into 'memory'
cgroups if it has 'CAP_SYS_ADMIN' capability set.

Change-Id: I43d4468186f142c176cb5b5f060751bb1b160344
Signed-off-by: Chintan Pandya &lt;cpandya@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>mm/mincore.c: make mincore() more conservative</title>
<updated>2019-07-18T18:49:11+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2019-05-14T22:41:38+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=da6767e62517b81bd741aff95ed9cae279449e9f'/>
<id>urn:sha1:da6767e62517b81bd741aff95ed9cae279449e9f</id>
<content type='text'>
commit 134fca9063ad4851de767d1768180e5dede9a881 upstream.

The semantics of what mincore() considers to be resident is not
completely clear, but Linux has always (since 2.3.52, which is when
mincore() was initially done) treated it as "page is available in page
cache".

That's potentially a problem, as that [in]directly exposes
meta-information about pagecache / memory mapping state even about
memory not strictly belonging to the process executing the syscall,
opening possibilities for sidechannel attacks.

Change the semantics of mincore() so that it only reveals pagecache
information for non-anonymous mappings that belog to files that the
calling process could (if it tried to) successfully open for writing;
otherwise we'd be including shared non-exclusive mappings, which

 - is the sidechannel

 - is not the usecase for mincore(), as that's primarily used for data,
   not (shared) text

[jkosina@suse.cz: v2]
  Link: http://lkml.kernel.org/r/20190312141708.6652-2-vbabka@suse.cz
[mhocko@suse.com: restructure can_do_mincore() conditions]
Link: http://lkml.kernel.org/r/nycvar.YFH.7.76.1903062342020.19912@cbobk.fhfr.pm
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Acked-by: Josh Snyder &lt;joshs@netflix.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Originally-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Originally-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Cc: Kevin Easton &lt;kevin@guarana.org&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Cyril Hrubis &lt;chrubis@suse.cz&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Kirill A. Shutemov &lt;kirill@shutemov.name&gt;
Cc: Daniel Gruss &lt;daniel@gruss.cc&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;

Change-Id: I683073478cd809cdbc21f852b959eba070ce0141
</content>
</entry>
<entry>
<title>mm: introduce vma_is_anonymous(vma) helper</title>
<updated>2019-07-18T18:48:31+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2015-09-08T21:58:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=4e55757f8febf883f1d42aeeb441ef2dbb577d20'/>
<id>urn:sha1:4e55757f8febf883f1d42aeeb441ef2dbb577d20</id>
<content type='text'>
commit b5330628546616af14ff23075fbf8d4ad91f6e25 upstream.

special_mapping_fault() is absolutely broken.  It seems it was always
wrong, but this didn't matter until vdso/vvar started to use more than
one page.

And after this change vma_is_anonymous() becomes really trivial, it
simply checks vm_ops == NULL.  However, I do think the helper makes
sense.  There are a lot of -&gt;vm_ops != NULL checks, the helper makes the
caller's code more understandable (self-documented) and this is more
grep-friendly.

This patch (of 3):

Preparation.  Add the new simple helper, vma_is_anonymous(vma), and change
handle_pte_fault() to use it.  It will have more users.

The name is not accurate, say a hpet_mmap()'ed vma is not anonymous.
Perhaps it should be named vma_has_fault() instead.  But it matches the
logic in mmap.c/memory.c (see next changes).  "True" just means that a
page fault will use do_anonymous_page().

Change-Id: I024c69016c5125b6f40e990a2f63c6630f641b28
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
[bwh: Backported to 3.16 as dependency of "mm/mincore.c: make mincore() more
 conservative"; adjusted context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
(cherry picked from commit e3bcb8e29b639d822175be5cb1b8e6b124edf98e)
</content>
</entry>
<entry>
<title>mm, oom: fix use-after-free in oom_kill_process</title>
<updated>2019-07-08T12:08:56+00:00</updated>
<author>
<name>Shakeel Butt</name>
<email>shakeelb@google.com</email>
</author>
<published>2019-02-01T22:20:54+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=5bc7da4337710b61c5186f7bdb9e0e3610a51821'/>
<id>urn:sha1:5bc7da4337710b61c5186f7bdb9e0e3610a51821</id>
<content type='text'>
commit cefc7ef3c87d02fc9307835868ff721ea12cc597 upstream.

Syzbot instance running on upstream kernel found a use-after-free bug in
oom_kill_process.  On further inspection it seems like the process
selected to be oom-killed has exited even before reaching
read_lock(&amp;tasklist_lock) in oom_kill_process().  More specifically the
tsk-&gt;usage is 1 which is due to get_task_struct() in oom_evaluate_task()
and the put_task_struct within for_each_thread() frees the tsk and
for_each_thread() tries to access the tsk.  The easiest fix is to do
get/put across the for_each_thread() on the selected task.

Now the next question is should we continue with the oom-kill as the
previously selected task has exited? However before adding more
complexity and heuristics, let's answer why we even look at the children
of oom-kill selected task? The select_bad_process() has already selected
the worst process in the system/memcg.  Due to race, the selected
process might not be the worst at the kill time but does that matter?
The userspace can use the oom_score_adj interface to prefer children to
be killed before the parent.  I looked at the history but it seems like
this is there before git history.

Change-Id: Ie6b01d64139c7ff44709569168ef868f372c2b6d
Link: http://lkml.kernel.org/r/20190121215850.221745-1-shakeelb@google.com
Reported-by: syzbot+7fbbfa368521945f0e3d@syzkaller.appspotmail.com
Fixes: 6b0c81b3be11 ("mm, oom: reduce dependency on tasklist_lock")
Signed-off-by: Shakeel Butt &lt;shakeelb@google.com&gt;
Reviewed-by: Roman Gushchin &lt;guro@fb.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@i-love.sakura.ne.jp&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mm,oom: make oom_killer_disable() killable</title>
<updated>2019-07-08T12:08:56+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2016-03-17T21:20:45+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=e42592f4fa5a643b81e6163243adf70fe45bd645'/>
<id>urn:sha1:e42592f4fa5a643b81e6163243adf70fe45bd645</id>
<content type='text'>
While oom_killer_disable() is called by freeze_processes() after all
user threads except the current thread are frozen, it is possible that
kernel threads invoke the OOM killer and sends SIGKILL to the current
thread due to sharing the thawed victim's memory.  Therefore, checking
for SIGKILL is preferable than TIF_MEMDIE.

Change-Id: I0ff3858a7ed4a808b8b21bd3382847d3150735e3
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Michal Hocko &lt;mhocko@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/oom_kill.c: avoid attempting to kill init sharing same memory</title>
<updated>2019-07-08T12:08:56+00:00</updated>
<author>
<name>Chen Jie</name>
<email>chenjie6@huawei.com</email>
</author>
<published>2015-12-11T21:41:00+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=51b11d9d1b816c8b6fd0a3195b07c287b06d9d31'/>
<id>urn:sha1:51b11d9d1b816c8b6fd0a3195b07c287b06d9d31</id>
<content type='text'>
It's possible that an oom killed victim shares an -&gt;mm with the init
process and thus oom_kill_process() would end up trying to kill init as
well.

This has been shown in practice:

	Out of memory: Kill process 9134 (init) score 3 or sacrifice child
	Killed process 9134 (init) total-vm:1868kB, anon-rss:84kB, file-rss:572kB
	Kill process 1 (init) sharing same memory
	...
	Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009

And this will result in a kernel panic.

If a process is forked by init and selected for oom kill while still
sharing init_mm, then it's likely this system is in a recoverable state.
However, it's better not to try to kill init and allow the machine to
panic due to unkillable processes.

[rientjes@google.com: rewrote changelog]
[akpm@linux-foundation.org: fix inverted test, per Ben]
Signed-off-by: Chen Jie &lt;chenjie6@huawei.com&gt;
Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Acked-by: Hillf Danton &lt;hillf.zj@alibaba-inc.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;

Change-Id: I5b573781c077173b3a472ba8282357a31b193557
</content>
</entry>
<entry>
<title>mm/oom_kill: fix the wrong task-&gt;mm == mm checks in oom_kill_process()</title>
<updated>2019-07-08T12:08:55+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2015-11-06T02:48:26+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=7379d8cca92948b8e4e01388d30412936685c823'/>
<id>urn:sha1:7379d8cca92948b8e4e01388d30412936685c823</id>
<content type='text'>
Both "child-&gt;mm == mm" and "p-&gt;mm != mm" checks in oom_kill_process() are
wrong.  task-&gt;mm can be NULL if the task is the exited group leader.  This
means in particular that "kill sharing same memory" loop can miss a
process with a zombie leader which uses the same -&gt;mm.

Note: the process_has_mm(child, p-&gt;mm) check is still not 100% correct,
p-&gt;mm can be NULL too.  This is minor, but probably deserves a fix or a
comment anyway.

[akpm@linux-foundation.org: document process_shares_mm() a bit]
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: Kyle Walker &lt;kwalker@redhat.com&gt;
Cc: Stanislav Kozina &lt;skozina@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;

Change-Id: I88d95c6ea31359de6cb50834e6ddce87d3afd1d8
</content>
</entry>
<entry>
<title>mm/oom_kill: cleanup the "kill sharing same memory" loop</title>
<updated>2019-07-08T12:08:55+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2015-11-06T02:48:23+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=afda78c6de38f9f66eba0955153b380d540d8276'/>
<id>urn:sha1:afda78c6de38f9f66eba0955153b380d540d8276</id>
<content type='text'>
Purely cosmetic, but the complex "if" condition looks annoying to me.
Especially because it is not consistent with OOM_SCORE_ADJ_MIN check
which adds another if/continue.

Change-Id: I72998fd97f3562849fae56d151e867d7cde1326c
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Acked-by: Hillf Danton &lt;hillf.zj@alibaba-inc.com&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: Kyle Walker &lt;kwalker@redhat.com&gt;
Cc: Stanislav Kozina &lt;skozina@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
