Re: [PATCH v3 1/3] scsi: BusLogic remove bus_to_virt

2022-06-24 Thread Khalid Aziz
mment about the lack of a bus_to_virt() replacement. A better fix would likely involve changing out the entire descriptor allocation for a simpler one, but that would be much more invasive. Cc: Maciej W. Rozycki Cc: Matt Wang Tested-by: Khalid Aziz Reviewed-by: Robin Murphy Reviewed-by: Hannes Reinecke

Re: [PATCH v2 2/3] scsi: BusLogic remove bus_to_virt

2022-06-24 Thread Khalid Aziz
On 6/23/22 08:47, Arnd Bergmann wrote: Can you test it again with this patch on top? diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index d057abfcdd5c..9e67f2ee25ee 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -2554,8 +2554,14 @@ static void

Re: [PATCH v2 2/3] scsi: BusLogic remove bus_to_virt

2022-06-21 Thread Khalid Aziz
mment about the lack of a bus_to_virt() replacement. A better fix would likely involve changing out the entire descriptor allocation for a simpler one, but that would be much more invasive. Cc: Maciej W. Rozycki Cc: Matt Wang Cc: Khalid Aziz Signed-off-by: Arnd Bergmann --- drivers/

Re: [PATCH 5/6] scsi: remove stale BusLogic driver

2022-06-06 Thread Khalid Aziz
cki Cc: Matt Wang Cc: Khalid Aziz Signed-off-by: Arnd Bergmann --- Documentation/scsi/BusLogic.rst | 581 --- Documentation/scsi/FlashPoint.rst | 176 - MAINTAINERS |7 - drivers/scsi/BusLogic.c | 3727 -- drivers/scsi/BusLogic.h |

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-05-01 Thread Khalid Aziz
On 5/1/19 8:49 AM, Waiman Long wrote: > On Wed, Apr 03, 2019 at 11:34:04AM -0600, Khalid Aziz wrote: >> diff --git a/Documentation/admin-guide/kernel-parameters.txt > b/Documentation/admin-guide/kernel-parameters.txt > >> index 858b6c0b9a15..9b36da94760e 100644 >> ---

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-22 Thread Khalid Aziz
On 4/18/19 8:34 AM, Khalid Aziz wrote: > On 4/17/19 11:41 PM, Kees Cook wrote: >> On Wed, Apr 17, 2019 at 11:41 PM Andy Lutomirski wrote: >>> I don't think this type of NX goof was ever the argument for XPFO. >>> The main argument I've heard is that a malicious us

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-18 Thread Khalid Aziz
On 4/17/19 11:41 PM, Kees Cook wrote: > On Wed, Apr 17, 2019 at 11:41 PM Andy Lutomirski wrote: >> I don't think this type of NX goof was ever the argument for XPFO. >> The main argument I've heard is that a malicious user program writes a >> ROP payload into user memory (regular anonymous user

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-17 Thread Khalid Aziz
On 4/17/19 1:49 PM, Andy Lutomirski wrote: > On Wed, Apr 17, 2019 at 10:33 AM Khalid Aziz wrote: >> >> On 4/17/19 11:09 AM, Ingo Molnar wrote: >>> >>> * Khalid Aziz wrote: >>> >>>>> I.e. the original motivation of the XPFO patches

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-17 Thread Khalid Aziz
On 4/17/19 11:09 AM, Ingo Molnar wrote: > > * Khalid Aziz wrote: > >>> I.e. the original motivation of the XPFO patches was to prevent execution >>> of direct kernel mappings. Is this motivation still present if those >>> mappings are non-executable? &

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-17 Thread Khalid Aziz
On 4/17/19 10:15 AM, Ingo Molnar wrote: > > [ Sorry, had to trim the Cc: list from hell. Tried to keep all the > mailing lists and all x86 developers. ] > > * Khalid Aziz wrote: > >> From: Juerg Haefliger >> >> This patch adds basic support in

Re: [RFC PATCH v9 12/13] xpfo, mm: Defer TLB flushes for non-current CPUs (x86 only)

2019-04-05 Thread Khalid Aziz
On 4/5/19 10:27 AM, Andy Lutomirski wrote: > At the risk of asking stupid questions: we already have a mechanism for this: > highmem. Can we enable highmem on x86_64, maybe with some heuristics to make > it work well? > I proposed using highmem infrastructure for xpfo in my cover letter as

Re: [RFC PATCH v9 12/13] xpfo, mm: Defer TLB flushes for non-current CPUs (x86 only)

2019-04-05 Thread Khalid Aziz
On 4/5/19 9:24 AM, Andy Lutomirski wrote: > > >> On Apr 5, 2019, at 8:44 AM, Dave Hansen wrote: >> >> On 4/5/19 12:17 AM, Thomas Gleixner wrote: process. Is that an acceptable trade-off? >>> You are not seriously asking whether creating a user controllable ret2dir >>> attack window is a

Re: [RFC PATCH v9 12/13] xpfo, mm: Defer TLB flushes for non-current CPUs (x86 only)

2019-04-05 Thread Khalid Aziz
On 4/5/19 8:44 AM, Dave Hansen wrote: > On 4/5/19 12:17 AM, Thomas Gleixner wrote: >>> process. Is that an acceptable trade-off? >> You are not seriously asking whether creating a user controllable ret2dir >> attack window is a acceptable trade-off? April 1st was a few days ago. > > Well, let's

Re: [RFC PATCH v9 12/13] xpfo, mm: Defer TLB flushes for non-current CPUs (x86 only)

2019-04-04 Thread Khalid Aziz
On 4/3/19 10:10 PM, Andy Lutomirski wrote: > On Wed, Apr 3, 2019 at 10:36 AM Khalid Aziz wrote: >> >> XPFO flushes kernel space TLB entries for pages that are now mapped >> in userspace on not only the current CPU but also all other CPUs >> synchronously. Processes on

Re: [RFC PATCH v9 11/13] xpfo, mm: optimize spinlock usage in xpfo_kunmap

2019-04-04 Thread Khalid Aziz
On 4/4/19 1:56 AM, Peter Zijlstra wrote: > On Wed, Apr 03, 2019 at 11:34:12AM -0600, Khalid Aziz wrote: >> From: Julian Stecklina >> >> Only the xpfo_kunmap call that needs to actually unmap the page >> needs to be serialized. We need to be careful to handle the case

Re: [RFC PATCH v9 04/13] xpfo, x86: Add support for XPFO for x86-64

2019-04-04 Thread Khalid Aziz
[trimmed To: and Cc: It was too large] On 4/4/19 1:52 AM, Peter Zijlstra wrote: > On Wed, Apr 03, 2019 at 11:34:05AM -0600, Khalid Aziz wrote: >> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h >> index 2779ace16d23..5c0e1581fa56 100644 >> --- a

Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-04 Thread Khalid Aziz
On 4/4/19 1:43 AM, Peter Zijlstra wrote: > > You must be so glad I no longer use kmap_atomic from NMI context :-) > > On Wed, Apr 03, 2019 at 11:34:04AM -0600, Khalid Aziz wrote: >> +static inline void xpfo_kmap(void *kaddr, struct page *page) >> +{ >

[RFC PATCH v9 04/13] xpfo, x86: Add support for XPFO for x86-64

2019-04-03 Thread Khalid Aziz
Andersen Signed-off-by: Marco Benatto Signed-off-by: Julian Stecklina Signed-off-by: Khalid Aziz Cc: Khalid Aziz --- .../admin-guide/kernel-parameters.txt | 10 +- arch/x86/Kconfig | 1 + arch/x86/include/asm/pgtable.h| 26 arch

[RFC PATCH v9 05/13] mm: add a user_virt_to_phys symbol

2019-04-03 Thread Khalid Aziz
-by: Tycho Andersen Tested-by: Marco Benatto Signed-off-by: Khalid Aziz Cc: Khalid Aziz --- v7: * make user_virt_to_phys a GPL symbol v6: * add a definition of user_virt_to_phys in the !CONFIG_XPFO case arch/x86/mm/xpfo.c | 57 include/linux/xpfo.h

[RFC PATCH v9 01/13] mm: add MAP_HUGETLB support to vm_mmap

2019-04-03 Thread Khalid Aziz
From: Tycho Andersen vm_mmap is exported, which means kernel modules can use it. In particular, for testing XPFO support, we want to use it with the MAP_HUGETLB flag, so let's support it via vm_mmap. Signed-off-by: Tycho Andersen Tested-by: Marco Benatto Tested-by: Khalid Aziz Cc: Khalid

[RFC PATCH v9 07/13] arm64/mm: Add support for XPFO

2019-04-03 Thread Khalid Aziz
on. Thanks to Laura Abbot for the simplification from v5, and Mark Rutland for pointing out we need NO_CONT_MAPPINGS too. CC: linux-arm-ker...@lists.infradead.org Signed-off-by: Juerg Haefliger Signed-off-by: Tycho Andersen Signed-off-by: Khalid Aziz Cc: Khalid Aziz --- .../admin-guide/kernel

[RFC PATCH v9 13/13] xpfo, mm: Optimize XPFO TLB flushes by batching them together

2019-04-03 Thread Khalid Aziz
make -j4 all 5.0 610.642s 5.0+XPFO+Deferred flush+Batch update773.075s1.27x Signed-off-by: Khalid Aziz Cc: Khalid Aziz Signed-off-by: Tycho Andersen --- v9: - Do not map a page freed by userspace back into kernel. Mark

[RFC PATCH v9 11/13] xpfo, mm: optimize spinlock usage in xpfo_kunmap

2019-04-03 Thread Khalid Aziz
table. Model-checked with up to 4 concurrent callers with Spin. Signed-off-by: Julian Stecklina Signed-off-by: Khalid Aziz Cc: Khalid Aziz Cc: x...@kernel.org Cc: kernel-harden...@lists.openwall.com Cc: Vasileios P. Kemerlis Cc: Juerg Haefliger Cc: Tycho Andersen Cc: Marco Benatto Cc

[RFC PATCH v9 09/13] xpfo: add primitives for mapping underlying memory

2019-04-03 Thread Khalid Aziz
-by: Khalid Aziz Cc: Khalid Aziz --- include/linux/xpfo.h | 21 + mm/xpfo.c| 30 ++ 2 files changed, 51 insertions(+) diff --git a/include/linux/xpfo.h b/include/linux/xpfo.h index 5d8d06e4b796..2318c7eb5fb7 100644 --- a/include/linux

[RFC PATCH v9 08/13] swiotlb: Map the buffer if it was unmapped by XPFO

2019-04-03 Thread Khalid Aziz
From: Juerg Haefliger XPFO can unmap a bounce buffer. Check for this and map it back in if needed. Signed-off-by: Juerg Haefliger Signed-off-by: Tycho Andersen Signed-off-by: Khalid Aziz Cc: Khalid Aziz Reviewed-by: Konrad Rzeszutek Wilk --- v9: * Added a generic check for whether a page

[RFC PATCH v9 10/13] arm64/mm, xpfo: temporarily map dcache regions

2019-04-03 Thread Khalid Aziz
From: Juerg Haefliger If the page is unmapped by XPFO, a data cache flush results in a fatal page fault, so let's temporarily map the region, flush the cache, and then unmap it. CC: linux-arm-ker...@lists.infradead.org Signed-off-by: Juerg Haefliger Signed-off-by: Tycho Andersen --- v6:

[RFC PATCH v9 06/13] lkdtm: Add test for XPFO

2019-04-03 Thread Khalid Aziz
accidentally by other CPUs. Signed-off-by: Juerg Haefliger Signed-off-by: Tycho Andersen Tested-by: Marco Benatto [jstec...@amazon.de: rebased from v4.13 to v4.19] Signed-off-by: Julian Stecklina Tested-by: Khalid Aziz Cc: Khalid Aziz --- drivers/misc/lkdtm/Makefile | 1 + drivers/misc

[RFC PATCH v9 12/13] xpfo, mm: Defer TLB flushes for non-current CPUs (x86 only)

2019-04-03 Thread Khalid Aziz
4.20+XPFO+Deferred flush803.989s1.32x This same code should be implemented for other architectures as well once finalized. Signed-off-by: Khalid Aziz Cc: Khalid Aziz --- arch/x86/include/asm/tlbflush.h | 1 + arch/x86/mm/tlb.c | 52 +

[RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-04-03 Thread Khalid Aziz
XPFO info in struct page] Signed-off-by: Julian Stecklina Signed-off-by: Khalid Aziz Cc: Khalid Aziz --- v9: * Do not use page extensions. Encode all xpfo information in struct page (Julian Stecklina). * Split architecture specific code into its own separate patch * Move kmap

[RFC PATCH v9 00/13] Add support for eXclusive Page Frame Ownership

2019-04-03 Thread Khalid Aziz
mm, xpfo: temporarily map dcache regions Julian Stecklina (1): xpfo, mm: optimize spinlock usage in xpfo_kunmap Khalid Aziz (2): xpfo, mm: Defer TLB flushes for non-current CPUs (x86 only) xpfo, mm: Optimize XPFO TLB flushes by batching them together Tycho Andersen (4): mm: add MAP_HUGE

[RFC PATCH v9 02/13] x86: always set IF before oopsing from page fault

2019-04-03 Thread Khalid Aziz
is in kernel space which has been triggered by XPFO. Signed-off-by: Tycho Andersen CC: x...@kernel.org Tested-by: Khalid Aziz Cc: Khalid Aziz --- arch/x86/mm/fault.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9d5c75f02295