[RFC PATCH 3/6] bpf: keep bpf.h in sync with tools/

2019-06-21 Thread Brian Vazquez
Adds bpf_attr.dump structure to libbpf. Suggested-by: Stanislav Fomichev Signed-off-by: Brian Vazquez --- tools/include/uapi/linux/bpf.h | 9 + 1 file changed, 9 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index b077507efa3f3..1d753958874d

[RFC PATCH 6/6] selftests/bpf: add test to measure performance of BPF_MAP_DUMP

2019-06-21 Thread Brian Vazquez
This tests compares the amount of time that takes to read an entire table of 100K elements on a bpf hashmap using both BPF_MAP_DUMP and BPF_MAP_GET_NEXT_KEY + BPF_MAP_LOOKUP_ELEM. Signed-off-by: Brian Vazquez --- tools/testing/selftests/bpf/test_maps.c | 71 + 1 file chan

Re: [PATCH v6] Documentation: Add section about CPU vulnerabilities for Spectre

2019-06-21 Thread Randy Dunlap
On 6/20/19 4:10 PM, Tim Chen wrote: > Add documentation for Spectre vulnerability and the mitigation mechanisms: > > - Explain the problem and risks > - Document the mitigation mechanisms > - Document the command line controls > - Document the sysfs files > > Co-developed-by: Andi Kleen > Signed

Re: [PATCH v3 0/6] mm: Further memory block device cleanups

2019-06-21 Thread Andrew Morton
On Fri, 21 Jun 2019 20:24:59 +0200 David Hildenbrand wrote: > @Qian Cai, unfortunately I can't reproduce. > > If you get the chance, it would be great if you could retry with > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > index 972c5336bebf..742f99ddd148 100644 > --- a/drivers

Re: Steam is broken on new kernels

2019-06-21 Thread Josh Hunt
On Fri, Jun 21, 2019 at 4:07 PM Pierre-Loup A. Griffais wrote: > > > > On 6/21/19 3:38 PM, Eric Dumazet wrote: > > Please look at my recent patch. > > Sorry I am travelling > > > > On Fri, Jun 21, 2019, 6:19 PM Linus Torvalds > > mailto:torva...@linux-foundation.org>> > > wrote: > > > >

Re: [kernel/isolation] c427534e48: BUG:kernel_NULL_pointer_dereference,address

2019-06-21 Thread Nicholas Piggin
kernel test robot's on June 21, 2019 6:20 pm: > FYI, we noticed the following commit (built with gcc-7): > > commit: c427534e48381727924529455ddfa67e2985686d ("kernel/isolation: Asset > that a housekeeping CPU comes up at boot time") > https://git.kernel.org/cgit/linux/kernel/git/peterz/queue.git

Re: [PATCH] time/tick-broadcast: Fix tick_broadcast_offline() lockdep complaint

2019-06-21 Thread Paul E. McKenney
On Fri, Jun 21, 2019 at 10:50:27AM -0700, Paul E. McKenney wrote: > On Fri, Jun 21, 2019 at 10:41:04AM -0700, Paul E. McKenney wrote: > > On Fri, Jun 21, 2019 at 06:34:14AM -0700, Paul E. McKenney wrote: > > > On Fri, Jun 21, 2019 at 02:29:27PM +0200, Peter Zijlstra wrote: > > > > On Fri, Jun 21, 2

Re: [PATCH v1] scsi: Don't select SCSI_PROC_FS by default

2019-06-21 Thread Finn Thain
On Fri, 21 Jun 2019, Marc Gonzalez wrote: > On 21/06/2019 01:43, Finn Thain wrote: > > > On Thu, 20 Jun 2019, Marc Gonzalez wrote: > > > >> How likely is it that distro kernels would *not* enable CHR_DEV_SG? > >> (Distros tend to enable everything, and then some.) > > > > How likely is it that

Re: Steam is broken on new kernels

2019-06-21 Thread Linus Torvalds
Eric is talking about this patch, I think: https://patchwork.ozlabs.org/patch/1120222/ I guess I'll ask people on the github thread to test that too. Linus On Fri, Jun 21, 2019 at 3:38 PM Eric Dumazet wrote: > > Please look at my recent patch. > Sorry I am travelling

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-21 Thread Nicholas Piggin
Christoph Hellwig's on June 21, 2019 6:15 pm: > On Thu, Jun 20, 2019 at 10:21:46AM -0700, Linus Torvalds wrote: >> Hmm. Honestly, I've never seen anything like that in any kernel profiles. >> >> Compared to the problems I _do_ see (which is usually the obvious >> cache misses, and locking), it mus

Re: [PATCH 3/3] tools: memory-model: Improve data-race detection

2019-06-21 Thread Paul E. McKenney
On Fri, Jun 21, 2019 at 10:25:23AM -0400, Alan Stern wrote: > On Fri, 21 Jun 2019, Andrea Parri wrote: > > > On Thu, Jun 20, 2019 at 11:55:58AM -0400, Alan Stern wrote: > > > Herbert Xu recently reported a problem concerning RCU and compiler > > > barriers. In the course of discussing the problem

[RFC V1 RESEND 0/6] Introduce dynamic allocation/freeing of MSI-X vectors

2019-06-21 Thread Megha Dey
Currently, MSI-X vector enabling and allocation for a PCIe device is static i.e. a device driver gets only one chance to enable a specific number of MSI-X vectors, usually during device probe. Also, in many cases, drivers usually reserve more than required number of vectors anticipating their use,

[RFC V1 RESEND 2/6] PCI/MSI: Dynamic allocation of MSI-X vectors by group

2019-06-21 Thread Megha Dey
Currently, MSI-X vector enabling and allocation for a PCIe device is static i.e. a device driver gets only one chance to enable a specific number of MSI-X vectors, usually during device probe. Also, in many cases, drivers usually reserve more than required number of vectors anticipating their use,

[PATCH v2 0/4] vfs: clean up SETFLAGS and FSSETXATTR option processing

2019-06-21 Thread Darrick J. Wong
Hi all, The FS_IOC_SETFLAGS and FS_IOC_FSSETXATTR ioctls were promoted from ext4 and XFS, respectively, into the VFS. However, we didn't promote any of the parameter checking code from those filesystems, which lead to a mess where each filesystem open-codes whatever parameter checks they want and

[RFC V1 RESEND 3/6] x86: Introduce the dynamic teardown function

2019-06-21 Thread Megha Dey
This is a preparatory patch to introduce disabling of MSI-X vectors belonging to a particular group. In this patch, we introduce a x86 specific mechanism to teardown the IRQ vectors belonging to a particular group. Cc: Jacob Pan Cc: Ashok Raj Signed-off-by: Megha Dey --- arch/x86/include/asm/x

[RFC V1 RESEND 4/6] PCI/MSI: Introduce new structure to manage MSI-x entries

2019-06-21 Thread Megha Dey
This is a preparatory patch to introduce disabling of MSI-X vectors belonging to a particular group. In this patch, we introduce a new structure msix_sysfs, which manages sysfs entries for dynamically allocated MSI-X vectors belonging to a particular group. Cc: Jacob Pan Cc: Ashok Raj Signed-off

[PATCH 2/4] vfs: create a generic checking function for FS_IOC_FSSETXATTR

2019-06-21 Thread Darrick J. Wong
From: Darrick J. Wong Create a generic checking function for the incoming FS_IOC_FSSETXATTR fsxattr values so that we can standardize some of the implementation behaviors. Signed-off-by: Darrick J. Wong Reviewed-by: Jan Kara --- fs/btrfs/ioctl.c | 21 +--- fs/ext4/ioctl.c|

[RFC V1 RESEND 6/6] Documentation: PCI/MSI: Document dynamic MSI-X infrastructure

2019-06-21 Thread Megha Dey
Add Documentation for the newly introduced dynamic allocation and deallocation of MSI-X vectors. Cc: Jacob Pan Cc: Ashok Raj Signed-off-by: Megha Dey --- Documentation/PCI/MSI-HOWTO.txt | 38 ++ 1 file changed, 38 insertions(+) diff --git a/Documentation/PC

[RFC V1 RESEND 5/6] PCI/MSI: Free MSI-X resources by group

2019-06-21 Thread Megha Dey
Currently, the pci_free_irq_vectors() frees all the allocated resources associated with a PCIe device when the device is being shut down. With the introduction of dynamic allocation of MSI-X vectors by group ID, there should exist an API which can free the resources allocated only to a particular g

[RFC V1 RESEND 1/6] PCI/MSI: New structures/macros for dynamic MSI-X allocation

2019-06-21 Thread Megha Dey
This is a preparatory patch to introduce the dynamic allocation of MSI-X vectors. In this patch, we add new structure members and macros which will be consumed by the API that will dynamically allocate MSI-X vectors. Cc: Jacob Pan Cc: Ashok Raj Signed-off-by: Megha Dey --- include/linux/device

[PATCH 1/7] mm/fs: don't allow writes to immutable files

2019-06-21 Thread Darrick J. Wong
From: Darrick J. Wong The chattr manpage has this to say about immutable files: "A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file, most of the file's metadata can not be modified, and the file can not be opened in write mode."

RE: [PATCH v2] PCI: hv: Fix a use-after-free bug in hv_eject_device_work()

2019-06-21 Thread Michael Kelley
From: Dexuan Cui Sent: Friday, June 21, 2019 4:45 PM > > The commit 05f151a73ec2 itself is correct, but it exposes this > use-after-free bug, which is caught by some memory debug options. > > Add a Fixes tag to indicate the dependency. > > Fixes: 05f151a73ec2 ("PCI: hv: Fix a memory leak in hv_

[PATCH v4 0/7] vfs: make immutable files actually immutable

2019-06-21 Thread Darrick J. Wong
Hi all, The chattr(1) manpage has this to say about the immutable bit that system administrators can set on files: "A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file, most of the file's metadata can not be modified, and the file

[PATCH 3/7] vfs: flush and wait for io when setting the immutable flag via FSSETXATTR

2019-06-21 Thread Darrick J. Wong
From: Darrick J. Wong When we're using FS_IOC_FSSETXATTR to set the immutable flag on a file, we need to ensure that userspace can't continue to write the file after the file becomes immutable. To make that happen, we have to flush all the dirty pagecache pages to disk to ensure that we can fail

Re: [RFC PATCH RT 4/4] rcutorture: Avoid problematic critical section nesting

2019-06-21 Thread Paul E. McKenney
On Fri, Jun 21, 2019 at 06:38:21PM +0200, Sebastian Andrzej Siewior wrote: > On 2019-06-20 14:18:26 [-0700], Paul E. McKenney wrote: > > > Example #1: > > > > > > 1. preempt_disable() > > > 2. local_bh_disable() > > > 3. preempt_enable() > > > 4. local_bh_enable() > > > > > > Example #2: > > > >

[PATCH v5 5/5] uprobe: collapse THP pmd after removing all uprobes

2019-06-21 Thread Song Liu
After all uprobes are removed from the huge page (with PTE pgtable), it is possible to collapse the pmd and benefit from THP again. This patch does the collapse. An issue on earlier version was discovered by kbuild test robot. Reported-by: kbuild test robot Signed-off-by: Song Liu --- include/

[PATCH v5 3/5] mm, thp: introduce FOLL_SPLIT_PMD

2019-06-21 Thread Song Liu
This patches introduces a new foll_flag: FOLL_SPLIT_PMD. As the name says FOLL_SPLIT_PMD splits huge pmd for given mm_struct, the underlining huge page stays as-is. FOLL_SPLIT_PMD is useful for cases where we need to use regular pages, but would switch back to huge page and huge pmd on. One of suc

[PATCH v5 0/5] THP aware uprobe

2019-06-21 Thread Song Liu
This set makes uprobe aware of THPs. Currently, when uprobe is attached to text on THP, the page is split by FOLL_SPLIT. As a result, uprobe eliminates the performance benefit of THP. This set makes uprobe THP-aware. Instead of FOLL_SPLIT, we introduces FOLL_SPLIT_PMD, which only split PMD for up

[PATCH v5 1/5] mm: move memcmp_pages() and pages_identical()

2019-06-21 Thread Song Liu
This patch moves memcmp_pages() to mm/util.c and pages_identical() to mm.h, so that we can use them in other files. Signed-off-by: Song Liu --- include/linux/mm.h | 7 +++ mm/ksm.c | 18 -- mm/util.c | 13 + 3 files changed, 20 insertions(+), 1

[PATCH v5 4/5] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT

2019-06-21 Thread Song Liu
This patches uses newly added FOLL_SPLIT_PMD in uprobe. This enables easy regroup of huge pmd after the uprobe is disabled (in next patch). Signed-off-by: Song Liu --- kernel/events/uprobes.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/events/uprobes.c b/kern

[PATCH v5 2/5] uprobe: use original page when all uprobes are removed

2019-06-21 Thread Song Liu
Currently, uprobe swaps the target page with a anonymous page in both install_breakpoint() and remove_breakpoint(). When all uprobes on a page are removed, the given mm is still using an anonymous page (not the original page). This patch allows uprobe to use original page when possible (all uprobe

[PATCH V34 00/29] Lockdown as an LSM

2019-06-21 Thread Matthew Garrett
Minor updates over V33 - security_is_locked_down renamed to security_locked_down, return value of security_locked_down is returned in most cases, one unnecessary patch was dropped, couple of minor nits fixed.

[PATCH V34 02/29] security: Add a "locked down" LSM hook

2019-06-21 Thread Matthew Garrett
Add a mechanism to allow LSMs to make a policy decision around whether kernel functionality that would allow tampering with or examining the runtime state of the kernel should be permitted. Signed-off-by: Matthew Garrett --- include/linux/lsm_hooks.h | 2 ++ include/linux/security.h | 11 +

[PATCH V34 01/29] security: Support early LSMs

2019-06-21 Thread Matthew Garrett
The lockdown module is intended to allow for kernels to be locked down early in boot - sufficiently early that we don't have the ability to kmalloc() yet. Add support for early initialisation of some LSMs, and then add them to the list of names when we do full initialisation later. Early LSMs are i

[PATCH V34 03/29] security: Add a static lockdown policy LSM

2019-06-21 Thread Matthew Garrett
While existing LSMs can be extended to handle lockdown policy, distributions generally want to be able to apply a straightforward static policy. This patch adds a simple LSM that can be configured to reject either integrity or all lockdown queries, and can be configured at runtime (through security

[PATCH V34 04/29] Enforce module signatures if the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: David Howells If the kernel is locked down, require that all modules have valid signatures that we can verify. I have adjusted the errors generated: (1) If there's no signature (ENODATA) or we can't check it (ENOPKG, ENOKEY), then: (a) If signatures are enforced then EKEYREJEC

[PATCH V34 05/29] Restrict /dev/{mem,kmem,port} when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Matthew Garrett Allowing users to read and write to core kernel memory makes it possible for the kernel to be subverted, avoiding module loading restrictions, and also to steal cryptographic information. Disallow /dev/mem and /dev/kmem from being opened this when the kernel has been locked

[PATCH V34 17/29] Prohibit PCMCIA CIS storage when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: David Howells Prohibit replacement of the PCMCIA Card Information Structure when the kernel is locked down. Suggested-by: Dominik Brodowski Signed-off-by: David Howells Signed-off-by: Matthew Garrett --- drivers/pcmcia/cistpl.c | 5 + include/linux/security.h | 1 + securi

[PATCH V34 25/29] kexec: Allow kexec_file() with appropriate IMA policy when locked down

2019-06-21 Thread Matthew Garrett
Systems in lockdown mode should block the kexec of untrusted kernels. For x86 and ARM we can ensure that a kernel is trustworthy by validating a PE signature, but this isn't possible on other architectures. On those platforms we can use IMA digital signatures instead. Add a function to determine wh

[PATCH V34 21/29] Lock down /proc/kcore

2019-06-21 Thread Matthew Garrett
From: David Howells Disallow access to /proc/kcore when the kernel is locked down to prevent access to cryptographic data. This is limited to lockdown confidentiality mode and is still permitted in integrity mode. Signed-off-by: David Howells Signed-off-by: Matthew Garrett --- fs/proc/kcore.c

[PATCH V34 20/29] x86/mmiotrace: Lock down the testmmiotrace module

2019-06-21 Thread Matthew Garrett
From: David Howells The testmmiotrace module shouldn't be permitted when the kernel is locked down as it can be used to arbitrarily read and write MMIO space. This is a runtime check rather than buildtime in order to allow configurations where the same kernel may be run in both locked down or per

[PATCH V34 18/29] Lock down TIOCSSERIAL

2019-06-21 Thread Matthew Garrett
From: David Howells Lock down TIOCSSERIAL as that can be used to change the ioport and irq settings on a serial port. This only appears to be an issue for the serial drivers that use the core serial code. All other drivers seem to either ignore attempts to change port/irq or give an error. Rep

[PATCH V34 24/29] Lock down perf when in confidentiality mode

2019-06-21 Thread Matthew Garrett
From: David Howells Disallow the use of certain perf facilities that might allow userspace to access kernel data. Signed-off-by: David Howells Signed-off-by: Matthew Garrett Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo --- include/linux/security.h | 1 + kernel/event

[PATCH V34 08/29] kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE

2019-06-21 Thread Matthew Garrett
From: Jiri Bohac This is a preparatory patch for kexec_file_load() lockdown. A locked down kernel needs to prevent unsigned kernel images from being loaded with kexec_file_load(). Currently, the only way to force the signature verification is compiling with KEXEC_VERIFY_SIG. This prevents load

[PATCH V34 23/29] bpf: Restrict bpf when kernel lockdown is in confidentiality mode

2019-06-21 Thread Matthew Garrett
From: David Howells There are some bpf functions can be used to read kernel memory: bpf_probe_read, bpf_probe_write_user and bpf_trace_printk. These allow private keys in kernel memory (e.g. the hibernation image signing key) to be read by an eBPF program and kernel memory to be altered without

[PATCH V34 11/29] PCI: Lock down BAR access when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Matthew Garrett Any hardware that can potentially generate DMA has to be locked down in order to avoid it being possible for an attacker to modify kernel code, allowing them to circumvent disabled module loading or module signing. Default to paranoid - in future we can potentially relax thi

[PATCH V34 10/29] hibernate: Disable when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Josh Boyer There is currently no way to verify the resume image when returning from hibernate. This might compromise the signed modules trust model, so until we can work with signed hibernate images we disable it when the kernel is locked down. Signed-off-by: Josh Boyer Signed-off-by: Da

[PATCH V34 15/29] acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down

2019-06-21 Thread Matthew Garrett
From: Josh Boyer This option allows userspace to pass the RSDP address to the kernel, which makes it possible for a user to modify the workings of hardware . Reject the option when the kernel is locked down. Signed-off-by: Josh Boyer Signed-off-by: David Howells Signed-off-by: Matthew Garrett

[PATCH V34 12/29] x86: Lock down IO port access when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Matthew Garrett IO port access would permit users to gain access to PCI configuration registers, which in turn (on a lot of hardware) give access to MMIO register space. This would potentially permit root to trigger arbitrary DMA, so lock it down by default. This also implicitly locks down

[PATCH V34 06/29] kexec_load: Disable at runtime if the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Matthew Garrett The kexec_load() syscall permits the loading and execution of arbitrary code in ring 0, which is something that lock-down is meant to prevent. It makes sense to disable kexec_load() in this situation. This does not affect kexec_file_load() syscall which can check for a sign

[PATCH V34 28/29] efi: Restrict efivar_ssdt_load when the kernel is locked down

2019-06-21 Thread Matthew Garrett
efivar_ssdt_load allows the kernel to import arbitrary ACPI code from an EFI variable, which gives arbitrary code execution in ring 0. Prevent that when the kernel is locked down. Signed-off-by: Matthew Garrett Cc: Ard Biesheuvel Cc: linux-...@vger.kernel.org --- drivers/firmware/efi/efi.c | 6

[PATCH V34 26/29] debugfs: Restrict debugfs when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: David Howells Disallow opening of debugfs files that might be used to muck around when the kernel is locked down as various drivers give raw access to hardware through debugfs. Given the effort of auditing all 2000 or so files and manually fixing each one as necessary, I've chosen to apply

[PATCH v6 1/6] filemap: check compound_head(page)->mapping in filemap_fault()

2019-06-21 Thread Song Liu
Currently, filemap_fault() avoids trace condition with truncate by checking page->mapping == mapping. This does not work for compound pages. This patch let it check compound_head(page)->mapping instead. Acked-by: Rik van Riel Signed-off-by: Song Liu --- mm/filemap.c | 2 +- 1 file changed, 1 in

[PATCH V34 29/29] lockdown: Print current->comm in restriction messages

2019-06-21 Thread Matthew Garrett
Print the content of current->comm in messages generated by lockdown to indicate a restriction that was hit. This makes it a bit easier to find out what caused the message. The message now patterned something like: Lockdown: : is restricted; see man kernel_lockdown.7 Signed-off-by: Dav

[PATCH v6 0/6] Enable THP for text section of non-shmem files

2019-06-21 Thread Song Liu
Changes v5 => v6: 1. Improve THP stats in 3/6, (Kirill). Changes v4 => v5: 1. Move the logic to drop THP from pagecache to open() path (Rik). 2. Revise description of CONFIG_READ_ONLY_THP_FOR_FS. Changes v3 => v4: 1. Put the logic to drop THP from pagecache in a separate function (Rik). 2. Move t

[PATCH v6 2/6] filemap: update offset check in filemap_fault()

2019-06-21 Thread Song Liu
With THP, current check of offset: VM_BUG_ON_PAGE(page->index != offset, page); is no longer accurate. Update it to: VM_BUG_ON_PAGE(page_to_pgoff(page) != offset, page); Acked-by: Rik van Riel Signed-off-by: Song Liu --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH V34 27/29] tracefs: Restrict tracefs when the kernel is locked down

2019-06-21 Thread Matthew Garrett
Tracefs may release more information about the kernel than desirable, so restrict it when the kernel is locked down in confidentiality mode by preventing open(). Signed-off-by: Matthew Garrett Cc: Steven Rostedt --- fs/tracefs/inode.c | 43 +++- include

[PATCH v6 6/6] mm,thp: avoid writes to file with THP in pagecache

2019-06-21 Thread Song Liu
In previous patch, an application could put part of its text section in THP via madvise(). These THPs will be protected from writes when the application is still running (TXTBSY). However, after the application exits, the file is available for writes. This patch avoids writes to file THP by droppi

[PATCH v6 5/6] mm,thp: add read-only THP support for (non-shmem) FS

2019-06-21 Thread Song Liu
This patch is (hopefully) the first step to enable THP for non-shmem filesystems. This patch enables an application to put part of its text sections to THP via madvise, for example: madvise((void *)0x60, 0x20, MADV_HUGEPAGE); We tried to reuse the logic for THP on tmpfs. Currently,

[PATCH v6 4/6] khugepaged: rename collapse_shmem() and khugepaged_scan_shmem()

2019-06-21 Thread Song Liu
Next patch will add khugepaged support of non-shmem files. This patch renames these two functions to reflect the new functionality: collapse_shmem()=> collapse_file() khugepaged_scan_shmem() => khugepaged_scan_file() Acked-by: Rik van Riel Signed-off-by: Song Liu --- mm/khuge

[PATCH V34 22/29] Lock down tracing and perf kprobes when in confidentiality mode

2019-06-21 Thread Matthew Garrett
From: David Howells Disallow the creation of perf and ftrace kprobes when the kernel is locked down in confidentiality mode by preventing their registration. This prevents kprobes from being used to access kernel memory to steal crypto data, but continues to allow the use of kprobes from signed m

[PATCH v6 3/6] mm,thp: stats for file backed THP

2019-06-21 Thread Song Liu
In preparation for non-shmem THP, this patch adds a few stats and exposes them in /proc/meminfo, /sys/bus/node/devices//meminfo, and /proc//task//smaps. This patch is mostly a rewrite of Kirill A. Shutemov's earlier version: https://lkml.org/lkml/2017/1/26/284. Acked-by: Rik van Riel Signed-off-

[PATCH V34 13/29] x86/msr: Restrict MSR access when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Matthew Garrett Writing to MSRs should not be allowed if the kernel is locked down, since it could lead to execution of arbitrary code in kernel mode. Based on a patch by Kees Cook. Signed-off-by: Matthew Garrett Signed-off-by: David Howells Acked-by: Kees Cook Reviewed-by: Thomas Glei

[PATCH V34 14/29] ACPI: Limit access to custom_method when the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Matthew Garrett custom_method effectively allows arbitrary access to system memory, making it possible for an attacker to circumvent restrictions on module loading. Disable it if the kernel is locked down. Signed-off-by: Matthew Garrett Signed-off-by: David Howells cc: linux-a...@vger.ke

[PATCH V34 16/29] acpi: Disable ACPI table override if the kernel is locked down

2019-06-21 Thread Matthew Garrett
From: Linn Crosetto >From the kernel documentation (initrd_table_override.txt): If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible to override nearly any ACPI table provided by the BIOS with an instrumented, modified one. When lockdown is enabled, the kernel should d

[PATCH V34 19/29] Lock down module params that specify hardware parameters (eg. ioport)

2019-06-21 Thread Matthew Garrett
From: David Howells Provided an annotation for module parameters that specify hardware parameters (such as io ports, iomem addresses, irqs, dma channels, fixed dma buffers and other types). Suggested-by: Alan Cox Signed-off-by: David Howells Signed-off-by: Matthew Garrett --- include/linux/s

Re: Steam is broken on new kernels

2019-06-21 Thread Eric Dumazet
On Fri, Jun 21, 2019 at 7:54 PM Linus Torvalds wrote: > > Eric is talking about this patch, I think: > >https://patchwork.ozlabs.org/patch/1120222/ > That is correct. I am about to take a flight from Boston to Paris, so I can not really follow discussions/tests for the following hours. Tha

[v2 PATCH 2/2] mm: mempolicy: handle vma with unmovable pages mapped correctly in mbind

2019-06-21 Thread Yang Shi
When running syzkaller internally, we ran into the below bug on 4.9.x kernel: kernel BUG at mm/huge_memory.c:2124! invalid opcode: [#1] SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 1518 Comm: syz-executor107 Not tainted 4.9.168+ #2 Hardware name: QE

[v2 PATCH 1/2] mm: mempolicy: make the behavior consistent when MPOL_MF_MOVE* and MPOL_MF_STRICT were specified

2019-06-21 Thread Yang Shi
When both MPOL_MF_MOVE* and MPOL_MF_STRICT was specified, mbind() should try best to migrate misplaced pages, if some of the pages could not be migrated, then return -EIO. There are three different sub-cases: 1. vma is not migratable 2. vma is migratable, but there are unmovable pages 3. vma is mi

[v2 PATCH 0/2] mm: mempolicy: fix mbind()'s inconsistent behavior for unmovable pages

2019-06-21 Thread Yang Shi
Changelog v2: * Fixed the inconsistent behavior by not aborting !vma_migratable() immediately by a separate patch (patch 1/2), and this is also the preparation for patch 2/2. For the details please see the commit log. Per Vlastimil. * Not abort immediately if unmovable page

Re: [RFC PATCH RT 3/4] rcu: unlock special: Treat irq and preempt disabled the same

2019-06-21 Thread Paul E. McKenney
On Thu, Jun 20, 2019 at 06:08:19PM -0500, Scott Wood wrote: > On Thu, 2019-06-20 at 15:25 -0700, Paul E. McKenney wrote: > > On Thu, Jun 20, 2019 at 04:59:30PM -0500, Scott Wood wrote: > > > On Thu, 2019-06-20 at 14:10 -0700, Paul E. McKenney wrote: > > > > On Tue, Jun 18, 2019 at 08:19:07PM -0500,

Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver

2019-06-21 Thread Troy Benjegerdes
> On Jun 21, 2019, at 4:59 PM, Atish Patra wrote: > > On Fri, 2019-06-21 at 14:46 -0700, Atish Patra wrote: >> On Fri, 2019-06-21 at 14:18 -0500, Troy Benjegerdes wrote: >>> Can you post the fsbl and other images you used to boot/test this? >>> >> > > Resending it without the attachment. Ob

[PATCH v1 2/3] OPP: Add function to look up required OPP's for a given OPP

2019-06-21 Thread Saravana Kannan
Add a function that allows looking up required OPPs given a source OPP table, destination OPP table and the source OPP. Signed-off-by: Saravana Kannan --- drivers/opp/core.c | 54 ++ include/linux/pm_opp.h | 11 + 2 files changed, 65 insertions

[PATCH v1 1/3] OPP: Allow required-opps even if the device doesn't have power-domains

2019-06-21 Thread Saravana Kannan
A Device-A can have a (minimum) performance requirement on another Device-B to be able to function correctly. This performance requirement on Device-B can also change based on the current performance level of Device-A. The existing required-opps feature fits well to describe this need. So, instead

[PATCH v1 3/3] PM / devfreq: Add required OPPs support to passive governor

2019-06-21 Thread Saravana Kannan
Look at the required OPPs of the "parent" device to determine the OPP that is required from the slave device managed by the passive governor. This allows having mappings between a parent device and a slave device even when they don't have the same number of OPPs. Signed-off-by: Saravana Kannan --

[PATCH v1 0/3] Add required-opps support to devfreq passive gov

2019-06-21 Thread Saravana Kannan
The devfreq passive governor scales the frequency of a "child" device based on the current frequency of a "parent" device (not parent/child in the sense of device hierarchy). As of today, the passive governor requires one of the following to work correctly: 1. The parent and child device have the s

Re: [PATCH 4.4 00/84] 4.4.183-stable review

2019-06-21 Thread Guenter Roeck
On 6/20/19 10:55 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 4.4.183 release. There are 84 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made

Re: [PATCH 4.9 000/117] 4.9.183-stable review

2019-06-21 Thread Guenter Roeck
On 6/20/19 10:55 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 4.9.183 release. There are 117 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be mad

Re: [PATCH 4.14 00/45] 4.14.129-stable review

2019-06-21 Thread Guenter Roeck
On 6/20/19 10:57 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 4.14.129 release. There are 45 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be mad

Re: [PATCH 4.19 00/61] 4.19.54-stable review

2019-06-21 Thread Guenter Roeck
On 6/20/19 10:56 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 4.19.54 release. There are 61 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made

Re: [PATCH 5.1 00/98] 5.1.13-stable review

2019-06-21 Thread Guenter Roeck
On 6/20/19 10:56 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 5.1.13 release. There are 98 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made

[PATCH] platform/chrome: cros_ec_lpc: fix stream_open.cocci warnings

2019-06-21 Thread kbuild test robot
From: kbuild test robot drivers/platform/chrome/wilco_ec/event.c:270:1-17: WARNING: event_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open. Generated by: scripts/coccinelle/api/stream_open.cocci Fixes: 22c040fa21b6 ("platform/chrome: cros_ec_lpc: Choose Microch

[PATCH] platform/chrome: cros_ec_lpc: fix semicolon.cocci warnings

2019-06-21 Thread kbuild test robot
From: kbuild test robot drivers/platform/chrome/wilco_ec/event.c:161:3-4: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 22c040fa21b6 ("platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime") Signed-off-by: kbuild test robot

Re: Steam is broken on new kernels

2019-06-21 Thread Pierre-Loup A. Griffais
On 6/21/19 5:19 PM, Eric Dumazet wrote: On Fri, Jun 21, 2019 at 7:54 PM Linus Torvalds wrote: Eric is talking about this patch, I think: https://patchwork.ozlabs.org/patch/1120222/ That is correct. I am about to take a flight from Boston to Paris, so I can not really follow discus

Re: [PATCH 2/4] null_blk: add zone open, close, and finish support

2019-06-21 Thread Damien Le Moal
On 2019/06/21 22:07, Matias Bjørling wrote: > From: Ajay Joshi > > Implement REQ_OP_ZONE_OPEN, REQ_OP_ZONE_CLOSE and REQ_OP_ZONE_FINISH > support to allow explicit control of zone states. > > Signed-off-by: Ajay Joshi > Signed-off-by: Matias Bjørling > --- > drivers/block/null_blk.h |

[Linux-kernel-mentees] [PATCH v4 RESEND] Media: Radio: Change devm_k*alloc to k*alloc

2019-06-21 Thread Luke Nowakowski-Krijger
Change devm_k*alloc to k*alloc to manually allocate memory The manual allocation and freeing of memory is necessary because when the USB radio is disconnected, the memory associated with devm_k*alloc is freed. Meaning if we still have unresolved references to the radio device, then we get use-aft

[GIT] Networking

2019-06-21 Thread David Miller
1) Fix leak of unqueued fragments in ipv6 nf_defrag, from Guillaume Nault. 2) Don't access the DDM interface unless the transceiver implements it in bnx2x, from Mauro S. M. Rodrigues. 3) Don't double fetch 'len' from userspace in sock_getsockopt(), from JingYi Hou. 4) Sign extension o

[PATCH 1/2] soc: qcom: mdt_loader: Support loading non-split images

2019-06-21 Thread Bjorn Andersson
In some software releases the firmware images are not split up with each loadable segment in it's own file. Check the size of the loaded firmware to see if it still contains each segment to be loaded, before falling back to the split-out segments. Signed-off-by: Bjorn Andersson --- drivers/soc/q

[PATCH 0/2] soc: qcom: mdt_loader: Support loading non-split firmware

2019-06-21 Thread Bjorn Andersson
Typically the firmware files for the various remoteprocs is split in a number of files. But in some releases these files are available in their unsplit form. Extend the mdt loader to detect the unsplit firmware and load it transparently. Also expose the function that compose the metadata header f

[PATCH 2/2] remoteproc: qcom: q6v5-mss: Support loading non-split images

2019-06-21 Thread Bjorn Andersson
In some software releases the firmware images are not split up with each loadable segment in it's own file. Check the size of the loaded firmware to see if it still contains each segment to be loaded, before falling back to the split-out segments. Signed-off-by: Bjorn Andersson --- drivers/remot

Re: [PATCH] ARM: dts: msm8974-FP2: add reboot-mode node

2019-06-21 Thread Brian Masney
On Fri, Jun 21, 2019 at 09:25:17PM +0200, Luca Weiss wrote: > On Freitag, 21. Juni 2019 02:01:22 CEST you wrote: > > I think that it makes sense to put this snippet in qcom-msm8974.dtsi > > with a status of disabled, and then enable it in > > qcom-msm8974-fairphone-fp2.dts like so: > > > > imem@fe

Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver

2019-06-21 Thread Troy Benjegerdes
> On Jun 21, 2019, at 7:33 PM, Troy Benjegerdes > wrote: > > > >> On Jun 21, 2019, at 4:59 PM, Atish Patra wrote: >> >> On Fri, 2019-06-21 at 14:46 -0700, Atish Patra wrote: >>> On Fri, 2019-06-21 at 14:18 -0500, Troy Benjegerdes wrote: Can you post the fsbl and other images you used

Re: [PATCH-next] mm, memcg: Add ":deact" tag for reparented kmem caches in memcg_slabinfo

2019-06-21 Thread Shakeel Butt
On Fri, Jun 21, 2019 at 10:30 AM Waiman Long wrote: > > With Roman's kmem cache reparent patch, multiple kmem caches of the same > type can be seen attached to the same memcg id. All of them, except > maybe one, are reparent'ed kmem caches. It can be useful to tag those > reparented caches by addi

RE: [PATCH v3 0/5] net: macb: cover letter

2019-06-21 Thread Parshuram Raju Thombare
Hi Andrew, >On Fri, Jun 21, 2019 at 09:33:57AM +0100, Parshuram Thombare wrote: >> Hello ! >> >> 2. 0002-net-macb-add-support-for-sgmii-MAC-PHY-interface.patch >>This patch add support for SGMII mode. > >Hi Parshuram > >What PHYs are using to test this? You mention TI PHY DP83867, but that see

Re: [PATCH 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-21 Thread Joe Perches
On Fri, 2019-06-21 at 23:50 +0900, Masami Hiramatsu wrote: > On Tue, 18 Jun 2019 20:17:06 +0530 > "Naveen N. Rao" wrote: trivia: > > diff --git a/arch/powerpc/kernel/kprobes-ftrace.c > > b/arch/powerpc/kernel/kprobes-ftrace.c [] > > @@ -57,6 +82,11 @@ NOKPROBE_SYMBOL(kprobe_ftrace_handler); > >

Re: [PATCH] cpuidle/drivers/mobile: Add new governor for mobile/embedded systems

2019-06-21 Thread kbuild test robot
Hi Daniel, I love your patch! Perhaps something to improve: [auto build test WARNING on pm/linux-next] [also build test WARNING on v5.2-rc5 next-20190621] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [PATCH v5 0/2] Two-stagged initial page table setup

2019-06-21 Thread Anup Patel
On Fri, Jun 7, 2019 at 11:31 AM Anup Patel wrote: > > This patchset implements two-stagged initial page table setup using fixmap > to avoid mapping non-existent RAM and also reduce high_memory consumed by > initial page tables. > > The patchset is based on Linux-5.2-rc3 and tested on SiFive Unleas

[PATCH v2] tomoyo: Don't check open/getattr permission on sockets.

2019-06-21 Thread Tetsuo Handa
On 2019/06/19 5:49, Al Viro wrote: > On Sun, Jun 16, 2019 at 03:49:00PM +0900, Tetsuo Handa wrote: >> Hello, Al. >> >> Q1: Do you agree that we should fix TOMOYO side rather than SOCKET_I()->sk >> management. > > You do realize that sockets are not unique in that respect, right? > All kinds of

Re: [PATCH v6 4/6] khugepaged: rename collapse_shmem() and khugepaged_scan_shmem()

2019-06-21 Thread Song Liu
> On Jun 21, 2019, at 8:11 PM, Hillf Danton wrote: > > > Hello > > On Fri, 21 Jun 2019 17:05:10 -0700 Song Liu wrote: >> Next patch will add khugepaged support of non-shmem files. This patch >> renames these two functions to reflect the new functionality: >> >>collapse_shmem()=

[PATCH v3 2/2][v4.9.y] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping

2019-06-21 Thread Ajay Kaher
This patch is the extension of following upstream commit to fix the race condition between get_task_mm() and core dumping for IB->mlx4 and IB->mlx5 drivers: commit 04f5866e41fb ("coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping")' Thanks to Jason for pointing t

  1   2   3   4   5   6   7   8   9   >