<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/mm/mmap.c, branch linux-5.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-02-28T16:23:37Z</updated>
<entry>
<title>mm: Avoid creating virtual address aliases in brk()/mmap()/mremap()</title>
<updated>2020-02-28T16:23:37Z</updated>
<author>
<name>Catalin Marinas</name>
</author>
<published>2020-02-19T12:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1947a09073350073f73e7024bda4cfdc240dc8f'/>
<id>urn:sha1:c1947a09073350073f73e7024bda4cfdc240dc8f</id>
<content type='text'>
commit dcde237319e626d1ec3c9d8b7613032f0fd4663a upstream.

Currently the arm64 kernel ignores the top address byte passed to brk(),
mmap() and mremap(). When the user is not aware of the 56-bit address
limit or relies on the kernel to return an error, untagging such
pointers has the potential to create address aliases in user-space.
Passing a tagged address to munmap(), madvise() is permitted since the
tagged pointer is expected to be inside an existing mapping.

The current behaviour breaks the existing glibc malloc() implementation
which relies on brk() with an address beyond 56-bit to be rejected by
the kernel.

Remove untagging in the above functions by partially reverting commit
ce18d171cb73 ("mm: untag user pointers in mmap/munmap/mremap/brk"). In
addition, update the arm64 tagged-address-abi.rst document accordingly.

Link: https://bugzilla.redhat.com/1797052
Fixes: ce18d171cb73 ("mm: untag user pointers in mmap/munmap/mremap/brk")
Cc: &lt;stable@vger.kernel.org&gt; # 5.4.x-
Cc: Florian Weimer &lt;fweimer@redhat.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Reported-by: Victor Stinner &lt;vstinner@redhat.com&gt;
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Acked-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>arm64: Revert support for execute-only user mappings</title>
<updated>2020-01-06T18:10:07Z</updated>
<author>
<name>Catalin Marinas</name>
</author>
<published>2020-01-06T14:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24cecc37746393432d994c0dbc251fb9ac7c5d72'/>
<id>urn:sha1:24cecc37746393432d994c0dbc251fb9ac7c5d72</id>
<content type='text'>
The ARMv8 64-bit architecture supports execute-only user permissions by
clearing the PTE_USER and PTE_UXN bits, practically making it a mostly
privileged mapping but from which user running at EL0 can still execute.

The downside, however, is that the kernel at EL1 inadvertently reading
such mapping would not trip over the PAN (privileged access never)
protection.

Revert the relevant bits from commit cab15ce604e5 ("arm64: Introduce
execute-only page access permissions") so that PROT_EXEC implies
PROT_READ (and therefore PTE_USER) until the architecture gains proper
support for execute-only user mappings.

Fixes: cab15ce604e5 ("arm64: Introduce execute-only page access permissions")
Cc: &lt;stable@vger.kernel.org&gt; # 4.9.x-
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/mmap.c: make vma_merge() comment more easy to understand</title>
<updated>2019-12-01T20:59:09Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2019-12-01T01:57:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d42ab293f5181609ea18f1f2ab85cd4cfc8efb2'/>
<id>urn:sha1:5d42ab293f5181609ea18f1f2ab85cd4cfc8efb2</id>
<content type='text'>
Case 1/6, 2/7 and 3/8 have the same pattern and we handle them in the
same logic.

Rearrange the comment to make it a little easy for audience to
understand.

Link: http://lkml.kernel.org/r/20191030012445.16944-1-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang &lt;richardw.yang@linux.intel.com&gt;
Cc: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Jann Horn &lt;jannh@google.com&gt;
Cc: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Cc: Steve Capper &lt;steve.capper@arm.com&gt;
Cc: Michel Lespinasse &lt;walken@google.com&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Yangtao Li &lt;tiny.windzz@gmail.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>
<entry>
<title>mm/mmap.c: use IS_ERR_VALUE to check return value of get_unmapped_area</title>
<updated>2019-12-01T14:29:19Z</updated>
<author>
<name>Gaowei Pu</name>
</author>
<published>2019-12-01T01:51:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff68dac6d65cd1347dad5d780dd8c90f29dc1b0b'/>
<id>urn:sha1:ff68dac6d65cd1347dad5d780dd8c90f29dc1b0b</id>
<content type='text'>
get_unmapped_area() returns an address or -errno on failure.  Historically
we have checked for the failure by offset_in_page() which is correct but
quite hard to read.  Newer code started using IS_ERR_VALUE which is much
easier to read.  Convert remaining users of offset_in_page as well.

[mhocko@suse.com: rewrite changelog]
[mhocko@kernel.org: fix mremap.c and uprobes.c sites also]
Link: http://lkml.kernel.org/r/20191012102512.28051-1-pugaowei@gmail.com
Signed-off-by: Gaowei Pu &lt;pugaowei@gmail.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Wei Yang &lt;richardw.yang@linux.intel.com&gt;
Cc: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: "Jérôme Glisse" &lt;jglisse@redhat.com&gt;
Cc: Mike Kravetz &lt;mike.kravetz@oracle.com&gt;
Cc: Rik van Riel &lt;riel@surriel.com&gt;
Cc: Qian Cai &lt;cai@lca.pw&gt;
Cc: Shakeel Butt &lt;shakeelb@google.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>
<entry>
<title>mm/mmap.c: rb_parent is not necessary in __vma_link_list()</title>
<updated>2019-12-01T14:29:19Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2019-12-01T01:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aba6dfb75fe15650991442efd137c32fbf2e2b85'/>
<id>urn:sha1:aba6dfb75fe15650991442efd137c32fbf2e2b85</id>
<content type='text'>
Now we use rb_parent to get next, while this is not necessary.

When prev is NULL, this means vma should be the first element in the list.
Then next should be current first one (mm-&gt;mmap), no matter whether we
have parent or not.

After removing it, the code shows the beauty of symmetry.

Link: http://lkml.kernel.org/r/20190813032656.16625-1-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang &lt;richardw.yang@linux.intel.com&gt;
Acked-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Matthew Wilcox &lt;willy@infradead.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/mmap.c: extract __vma_unlink_list() as counterpart for __vma_link_list()</title>
<updated>2019-12-01T14:29:19Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2019-12-01T01:50:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b9fc5b24fa2e7c0e67778cda77ac231fb4bcac7'/>
<id>urn:sha1:1b9fc5b24fa2e7c0e67778cda77ac231fb4bcac7</id>
<content type='text'>
Just make the code a little easier to read.

Link: http://lkml.kernel.org/r/20191006012636.31521-3-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang &lt;richardw.yang@linux.intel.com&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: Oscar Salvador &lt;osalvador@suse.de&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&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/mmap.c: __vma_unlink_prev() is not necessary now</title>
<updated>2019-12-01T14:29:19Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2019-12-01T01:50:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d81fbe09a5669acf28fccd4f51f00b43534a0c9'/>
<id>urn:sha1:9d81fbe09a5669acf28fccd4f51f00b43534a0c9</id>
<content type='text'>
The third parameter of __vma_unlink_common() could differentiate these two
types.  __vma_unlink_prev() is not necessary now.

Link: http://lkml.kernel.org/r/20191006012636.31521-2-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang &lt;richardw.yang@linux.intel.com&gt;

Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: Oscar Salvador &lt;osalvador@suse.de&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&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/mmap.c: prev could be retrieved from vma-&gt;vm_prev</title>
<updated>2019-12-01T14:29:19Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2019-12-01T01:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93b343ab2d2fc9a22767f6eeb95c78420bfedf4a'/>
<id>urn:sha1:93b343ab2d2fc9a22767f6eeb95c78420bfedf4a</id>
<content type='text'>
Currently __vma_unlink_common handles two cases:

  * has_prev
  * or not

When has_prev is false, it is obvious prev is calculated from
vma-&gt;vm_prev in __vma_unlink_common.

When has_prev is true, the prev is passed through from __vma_unlink_prev
in __vma_adjust for non-case 8.  And at the beginning next is calculated
from vma-&gt;vm_next, which implies vma is next-&gt;vm_prev.

The above statement sounds a little complicated, while to think in
another point of view, no matter whether vma and next is swapped, the
mmap link list still preserves its property.  It is proper to access
vma-&gt;vm_prev.

Link: http://lkml.kernel.org/r/20191006012636.31521-1-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang &lt;richardw.yang@linux.intel.com&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Oscar Salvador &lt;osalvador@suse.de&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Matthew Wilcox (Oracle) &lt;willy@infradead.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/mmap.c: remove a never-triggered warning in __vma_adjust()</title>
<updated>2019-12-01T14:29:18Z</updated>
<author>
<name>Wei Yang</name>
</author>
<published>2019-12-01T01:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=408a60eddd206134fd306dfbc53bbde093b8deb0'/>
<id>urn:sha1:408a60eddd206134fd306dfbc53bbde093b8deb0</id>
<content type='text'>
The upper level of "if" makes sure (end &gt;= next-&gt;vm_end), which means
there are only two possibilities:

   1) end == next-&gt;vm_end
   2) end &gt; next-&gt;vm_end

remove_next is assigned to be (1 + end &gt; next-&gt;vm_end).  This means if
remove_next is 1, end must equal to next-&gt;vm_end.

The VM_WARN_ON will never trigger.

Link: http://lkml.kernel.org/r/20190912063126.13250-1-richardw.yang@linux.intel.com
Signed-off-by: Wei Yang &lt;richardw.yang@linux.intel.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Yang Shi &lt;yang.shi@linux.alibaba.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>
<entry>
<title>mm: untag user pointers in mmap/munmap/mremap/brk</title>
<updated>2019-09-26T00:51:41Z</updated>
<author>
<name>Catalin Marinas</name>
</author>
<published>2019-09-25T23:49:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce18d171cb7368557e6498a3ce111d7d3dc03e4d'/>
<id>urn:sha1:ce18d171cb7368557e6498a3ce111d7d3dc03e4d</id>
<content type='text'>
There isn't a good reason to differentiate between the user address space
layout modification syscalls and the other memory permission/attributes
ones (e.g.  mprotect, madvise) w.r.t.  the tagged address ABI.  Untag the
user addresses on entry to these functions.

Link: http://lkml.kernel.org/r/20190821164730.47450-2-catalin.marinas@arm.com
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Acked-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Cc: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;
Cc: Szabolcs Nagy &lt;szabolcs.nagy@arm.com&gt;
Cc: Kevin Brodsky &lt;kevin.brodsky@arm.com&gt;
Cc: Dave P Martin &lt;Dave.Martin@arm.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.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>
