lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b589f80b-98ac-8323-fa0d-f91b681b5f09@de.ibm.com>
Date:   Mon, 15 Jun 2020 15:24:12 +0200
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     stable@...r.kernel.org
Cc:     Vlastimil Babka <vbabka@...e.cz>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Fwd: [merged]
 usercopy-mark-dma-kmalloc-caches-as-usercopy-caches.patch removed from -mm
 tree

stable team,
please consider 

commit 49f2d2419d60a103752e5fbaf158cf8d07c0d884
    usercopy: mark dma-kmalloc caches as usercopy caches
for stable.

-------- Forwarded Message --------
Subject: [merged] usercopy-mark-dma-kmalloc-caches-as-usercopy-caches.patch removed from -mm tree
Date: Tue, 02 Jun 2020 14:37:44 -0700
From: akpm@...ux-foundation.org
To: borntraeger@...ibm.com, christoffer.dall@...aro.org, cl@...ux.com, dave.kleikamp@...cle.com, dave@...lcore.net, davem@...emloft.net, hch@...radead.org, iamjoonsoo.kim@....com, jack@...e.cz, jannh@...gle.com, jslaby@...e.cz, jwi@...ux.ibm.com, labbott@...hat.com, luisbg@...nel.org, luto@...nel.org, marc.zyngier@....com, mark.rutland@....com, martin.petersen@...cle.com, mjg59@...gle.com, mkubecek@...e.cz, mm-commits@...r.kernel.org, pbonzini@...hat.com, penberg@...nel.org, riel@...riel.com, rientjes@...gle.com, torvalds@...ux-foundation.org, ubraun@...ux.ibm.com, vbabka@...e.cz, viro@...iv.linux.org.uk


The patch titled
     Subject: usercopy: mark dma-kmalloc caches as usercopy caches
has been removed from the -mm tree.  Its filename was
     usercopy-mark-dma-kmalloc-caches-as-usercopy-caches.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Vlastimil Babka <vbabka@...e.cz>
Subject: usercopy: mark dma-kmalloc caches as usercopy caches

We have seen a "usercopy: Kernel memory overwrite attempt detected to SLUB
object 'dma-kmalloc-1 k' (offset 0, size 11)!" error on s390x, as IUCV
uses kmalloc() with __GFP_DMA because of memory address restrictions.  The
issue has been discussed [2] and it has been noted that if all the kmalloc
caches are marked as usercopy, there's little reason not to mark
dma-kmalloc caches too.  The 'dma' part merely means that __GFP_DMA is
used to restrict memory address range.

As Jann Horn put it [3]:

"I think dma-kmalloc slabs should be handled the same way as normal
kmalloc slabs.  When a dma-kmalloc allocation is freshly created, it is
just normal kernel memory - even if it might later be used for DMA -, and
it should be perfectly fine to copy_from_user() into such allocations at
that point, and to copy_to_user() out of them at the end.  If you look at
the places where such allocations are created, you can see things like
kmemdup(), memcpy() and so on - all normal operations that shouldn't
conceptually be different from usercopy in any relevant way."

Thus this patch marks the dma-kmalloc-* caches as usercopy.

[1] https://bugzilla.suse.com/show_bug.cgi?id=1156053
[2] https://lore.kernel.org/kernel-hardening/bfca96db-bbd0-d958-7732-76e36c667c68@suse.cz/
[3] https://lore.kernel.org/kernel-hardening/CAG48ez1a4waGk9kB0WLaSbs4muSoK0AYAVk8=XYaKj4_+6e6Hg@mail.gmail.com/

Link: http://lkml.kernel.org/r/7d810f6d-8085-ea2f-7805-47ba3842dc50@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
Acked-by: Christian Borntraeger <borntraeger@...ibm.com>
Acked-by: Jiri Slaby <jslaby@...e.cz>
Cc: Jann Horn <jannh@...gle.com>
Cc: Christoph Hellwig <hch@...radead.org>
Cc: Christopher Lameter <cl@...ux.com>
Cc: Julian Wiedmann <jwi@...ux.ibm.com>
Cc: Ursula Braun <ubraun@...ux.ibm.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: David Windsor <dave@...lcore.net>
Cc: Pekka Enberg <penberg@...nel.org>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Laura Abbott <labbott@...hat.com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Christoffer Dall <christoffer.dall@...aro.org>
Cc: Dave Kleikamp <dave.kleikamp@...cle.com>
Cc: Jan Kara <jack@...e.cz>
Cc: Luis de Bethencourt <luisbg@...nel.org>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: Rik van Riel <riel@...riel.com>
Cc: Matthew Garrett <mjg59@...gle.com>
Cc: Michal Kubecek <mkubecek@...e.cz>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 mm/slab_common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/slab_common.c~usercopy-mark-dma-kmalloc-caches-as-usercopy-caches
+++ a/mm/slab_common.c
@@ -1303,7 +1303,8 @@ void __init create_kmalloc_caches(slab_f
 			kmalloc_caches[KMALLOC_DMA][i] = create_kmalloc_cache(
 				kmalloc_info[i].name[KMALLOC_DMA],
 				kmalloc_info[i].size,
-				SLAB_CACHE_DMA | flags, 0, 0);
+				SLAB_CACHE_DMA | flags, 0,
+				kmalloc_info[i].size);
 		}
 	}
 #endif
_

Patches currently in -mm which might be from vbabka@...e.cz are

kernel-sysctl-support-setting-sysctl-parameters-from-kernel-command-line.patch
kernel-sysctl-support-handling-command-line-aliases.patch
kernel-hung_task-convert-hung_task_panic-boot-parameter-to-sysctl.patch
tools-testing-selftests-sysctl-sysctlsh-support-config_test_sysctl=y.patch
lib-test_sysctl-support-testing-of-sysctl-boot-parameter.patch
lib-test_sysctl-support-testing-of-sysctl-boot-parameter-fix.patch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ