Re: [PATCH v2] Add a document on rebasing and merging

2019-06-06 Thread Jani Nikula
On Tue, 04 Jun 2019, Jonathan Corbet wrote: > Every merge window seems to involve at least one episode where subsystem > maintainers don't manage their trees as Linus would like. Document the > expectations so that at least he has something to point people to. Good stuff. Some notes inline. BR,

[PATCH v3 0/2] ima/evm fixes for v5.2

2019-06-06 Thread Roberto Sassu
Previous versions included the patch 'ima: don't ignore INTEGRITY_UNKNOWN EVM status'. However, I realized that this patch cannot be accepted alone because IMA-Appraisal would deny access to new files created during the boot. With the current behavior, those files are accessible because they have a

[PATCH v3 1/2] evm: add option to set a random HMAC key at early boot

2019-06-06 Thread Roberto Sassu
Mutable files can be created before the HMAC key is unsealed, for example the dracut state and the systemd journal. Next accesses to those files will be denied if the new appraisal mode enforce-evm is selected (INTEGRITY_UNKNOWN returned by EVM is considered as an error). This patch solves this pr

[PATCH v3 2/2] ima: add enforce-evm and log-evm modes to strictly check EVM status

2019-06-06 Thread Roberto Sassu
IMA and EVM have been designed as two independent subsystems: the first for checking the integrity of file data; the second for checking file metadata. Making them independent allows users to adopt them incrementally. The point of intersection is in IMA-Appraisal, which calls evm_verifyxattr() to

Re: [PATCH v3 0/2] ima/evm fixes for v5.2

2019-06-06 Thread Roberto Sassu
On 6/6/2019 1:26 PM, Roberto Sassu wrote: Previous versions included the patch 'ima: don't ignore INTEGRITY_UNKNOWN EVM status'. However, I realized that this patch cannot be accepted alone because IMA-Appraisal would deny access to new files created during the boot. With the current behavior, th

RE: [PATCH v2 0/5] stm32-ddr-pmu driver creation

2019-06-06 Thread Gerald BAEZA
Dear all A gentle reminder to get your feedbacks on the series below. Best regards Gérald > -Original Message- > From: Gerald BAEZA > Sent: lundi 20 mai 2019 17:27 > To: will.dea...@arm.com; mark.rutl...@arm.com; robh...@kernel.org; > mcoquelin.st...@gmail.com; Alexandre TORGUE > ; c

Re: [char-misc-next 3/7] mei: docs: update mei documentation

2019-06-06 Thread Greg Kroah-Hartman
On Mon, Jun 03, 2019 at 12:14:02PM +0300, Tomas Winkler wrote: > The mei driver went via multiple changes, update > the documentation and fix formatting. > > Signed-off-by: Tomas Winkler > --- > Documentation/driver-api/mei/mei.rst | 96 ++-- > 1 file changed, 61 insertio

RE: [char-misc-next 3/7] mei: docs: update mei documentation

2019-06-06 Thread Winkler, Tomas
> -Original Message- > From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org] > Sent: Thursday, June 06, 2019 16:17 > To: Winkler, Tomas > Cc: Usyskin, Alexander ; linux- > ker...@vger.kernel.org; Jonathan Corbet ; linux- > d...@vger.kernel.org > Subject: Re: [char-misc-next 3/7]

[char-misc-next 3/7 RESEND] mei: docs: update mei documentation

2019-06-06 Thread Tomas Winkler
The mei driver went via multiple changes, update the documentation and fix formatting. Signed-off-by: Tomas Winkler --- Documentation/driver-api/mei/mei.rst | 96 ++-- 1 file changed, 61 insertions(+), 35 deletions(-) diff --git a/Documentation/driver-api/mei/mei.rst b/

Re: [PATCH 03/10] mfd / platform: cros_ec: Miscellaneous character device to talk with the EC

2019-06-06 Thread Ezequiel Garcia
On Tue, 2019-06-04 at 20:59 +0200, Greg Kroah-Hartman wrote: > On Tue, Jun 04, 2019 at 11:39:21AM -0700, Guenter Roeck wrote: > > On Tue, Jun 4, 2019 at 11:35 AM Greg Kroah-Hartman > > wrote: > > > On Tue, Jun 04, 2019 at 01:58:38PM -0300, Ezequiel Garcia wrote: > > > > Hey Greg, > > > > > > > >

Re: [PATCH v3 0/2] ima/evm fixes for v5.2

2019-06-06 Thread Mimi Zohar
On Thu, 2019-06-06 at 13:43 +0200, Roberto Sassu wrote: > On 6/6/2019 1:26 PM, Roberto Sassu wrote: > > Previous versions included the patch 'ima: don't ignore INTEGRITY_UNKNOWN > > EVM status'. However, I realized that this patch cannot be accepted alone > > because IMA-Appraisal would deny access

Re: [PATCH 03/10] mfd / platform: cros_ec: Miscellaneous character device to talk with the EC

2019-06-06 Thread Greg Kroah-Hartman
On Thu, Jun 06, 2019 at 11:01:17AM -0300, Ezequiel Garcia wrote: > On Tue, 2019-06-04 at 20:59 +0200, Greg Kroah-Hartman wrote: > > On Tue, Jun 04, 2019 at 11:39:21AM -0700, Guenter Roeck wrote: > > > On Tue, Jun 4, 2019 at 11:35 AM Greg Kroah-Hartman > > > wrote: > > > > On Tue, Jun 04, 2019 at 0

Re: [char-misc-next 3/7 RESEND] mei: docs: update mei documentation

2019-06-06 Thread Greg Kroah-Hartman
On Thu, Jun 06, 2019 at 04:31:08PM +0300, Tomas Winkler wrote: > The mei driver went via multiple changes, update > the documentation and fix formatting. > > Signed-off-by: Tomas Winkler > --- > Documentation/driver-api/mei/mei.rst | 96 ++-- > 1 file changed, 61 insertio

Re: [PATCH 03/10] mfd / platform: cros_ec: Miscellaneous character device to talk with the EC

2019-06-06 Thread Ezequiel Garcia
On Thu, 2019-06-06 at 16:51 +0200, Greg Kroah-Hartman wrote: > On Thu, Jun 06, 2019 at 11:01:17AM -0300, Ezequiel Garcia wrote: > > On Tue, 2019-06-04 at 20:59 +0200, Greg Kroah-Hartman wrote: > > > On Tue, Jun 04, 2019 at 11:39:21AM -0700, Guenter Roeck wrote: > > > > On Tue, Jun 4, 2019 at 11:35

Re: [PATCH v3 0/2] ima/evm fixes for v5.2

2019-06-06 Thread Roberto Sassu
On 6/6/2019 4:49 PM, Mimi Zohar wrote: On Thu, 2019-06-06 at 13:43 +0200, Roberto Sassu wrote: On 6/6/2019 1:26 PM, Roberto Sassu wrote: Previous versions included the patch 'ima: don't ignore INTEGRITY_UNKNOWN EVM status'. However, I realized that this patch cannot be accepted alone because IM

Re: [PATCH] docs: filesystems: vfs: Render method descriptions

2019-06-06 Thread Jonathan Corbet
On Tue, 4 Jun 2019 10:26:56 +1000 "Tobin C. Harding" wrote: > Currently vfs.rst does not render well into HTML the method descriptions > for VFS data structures. We can improve the HTML output by putting the > description string on a new line following the method name. > > Suggested-by: Jonath

Re: [PATCH v1] docs/core-api: Add string helpers API to the list

2019-06-06 Thread Jonathan Corbet
On Wed, 5 Jun 2019 19:39:44 +0300 Andy Shevchenko wrote: > Some times string helpers are needed, but there is nothing about them > in the generated documentation. > > Fill the gap by adding a reference to string_helpers.c exported functions. > > Signed-off-by: Andy Shevchenko So I've applied

Re: [PATCH v2 2/2] Docs: hwmon: pmbus: Add PXE1610 driver

2019-06-06 Thread Vijay Khemka
On 6/5/19, 1:48 PM, "Guenter Roeck" wrote: On Thu, May 30, 2019 at 04:11:57PM -0700, Vijay Khemka wrote: > Added support for Infenion PXE1610 driver > Applied, after fixing s/Infenion/Infineon/ s/Infinion/Infineon/ Thanks Guenter > Signed-off-

Re: [PATCH v2 1/2] hwmon: pmbus: Add Infineon PXE1610 VR driver

2019-06-06 Thread Vijay Khemka
On 6/5/19, 1:47 PM, "Guenter Roeck" wrote: On Thu, May 30, 2019 at 04:11:56PM -0700, Vijay Khemka wrote: > Added pmbus driver for the new device Infineon pxe1610 > voltage regulator. It also supports similar family device > PXE1110 and PXM1310. > > Signed-off-by: Vijay

[PATCH v7 06/27] x86/cet: Add control protection exception handler

2019-06-06 Thread Yu-cheng Yu
A control protection exception is triggered when a control flow transfer attempt violated shadow stack or indirect branch tracking constraints. For example, the return address for a RET instruction differs from the safe copy on the shadow stack; or a JMP instruction arrives at a non- ENDBR instruct

[PATCH v7 18/27] mm: Introduce do_mmap_locked()

2019-06-06 Thread Yu-cheng Yu
There are a few places that need do_mmap() with mm->mmap_sem held. Create an in-line function for that. Signed-off-by: Yu-cheng Yu --- include/linux/mm.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 398f1e1c35e5..7cf0146048

[PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file

2019-06-06 Thread Yu-cheng Yu
An ELF file's .note.gnu.property indicates features the executable file can support. For example, the property GNU_PROPERTY_X86_FEATURE_1_AND indicates the file supports GNU_PROPERTY_X86_FEATURE_1_IBT and/or GNU_PROPERTY_X86_FEATURE_1_SHSTK. With this patch, if an arch needs to setup features fro

[PATCH v7 09/27] mm/mmap: Prevent Shadow Stack VMA merges

2019-06-06 Thread Yu-cheng Yu
To prevent function call/return spills into the next shadow stack area, do not merge shadow stack areas. Signed-off-by: Yu-cheng Yu --- mm/mmap.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 7e8c3e8ae75f..b1a921c0de63 100644 --- a/mm/mmap.c +++ b/mm/mmap.

[PATCH v7 19/27] x86/cet/shstk: User-mode shadow stack support

2019-06-06 Thread Yu-cheng Yu
This patch adds basic shadow stack enabling/disabling routines. A task's shadow stack is allocated from memory with VM_SHSTK flag set and read-only protection. It has a fixed size of RLIMIT_STACK. Signed-off-by: Yu-cheng Yu --- arch/x86/include/asm/cet.h| 34 + arch/x86

[PATCH v7 01/27] Documentation/x86: Add CET description

2019-06-06 Thread Yu-cheng Yu
Explain how CET works and the no_cet_shstk/no_cet_ibt kernel parameters. Signed-off-by: Yu-cheng Yu --- .../admin-guide/kernel-parameters.txt | 6 + Documentation/x86/index.rst | 1 + Documentation/x86/intel_cet.rst | 268 ++ 3 files ch

[PATCH v7 00/27] Control-flow Enforcement: Shadow Stack

2019-06-06 Thread Yu-cheng Yu
Intel has published Control-flow Enforcement (CET) in the Architecture Instruction Set Extensions Programming Reference: https://software.intel.com/en-us/download/intel-architecture-instruction-set- extensions-programming-reference The previous version (v6) of CET Shadow Stack patches is here

[PATCH v7 16/27] mm: Handle THP/HugeTLB shadow stack page fault

2019-06-06 Thread Yu-cheng Yu
This patch implements THP shadow stack (SHSTK) copying in the same way as in the previous patch for regular PTE. In copy_huge_pmd(), clear the dirty bit from the PMD to cause a page fault upon the next SHSTK access to the PMD. At that time, fix the PMD and copy/re-use the page. Signed-off-by: Yu

[PATCH v7 10/27] x86/mm: Change _PAGE_DIRTY to _PAGE_DIRTY_HW

2019-06-06 Thread Yu-cheng Yu
Before introducing _PAGE_DIRTY_SW for non-hardware, memory management purposes in the next patch, rename _PAGE_DIRTY to _PAGE_DIRTY_HW and _PAGE_BIT_DIRTY to _PAGE_BIT_DIRTY_HW to make these PTE dirty bits more clear. There are no functional changes in this patch. Signed-off-by: Yu-cheng Yu ---

[PATCH v7 03/27] x86/fpu/xstate: Change names to separate XSAVES system and user states

2019-06-06 Thread Yu-cheng Yu
Control-flow Enforcement (CET) MSR contents are XSAVES system states. To support CET, introduce XSAVES system states first. XSAVES is a "supervisor" instruction and, comparing to XSAVE, saves additional "supervisor" states that can be modified only from CPL 0. However, these states are per-task an

[PATCH v7 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-06-06 Thread Yu-cheng Yu
Control-flow Enforcement (CET) MSR contents are XSAVES system states. To support CET, introduce XSAVES system states first. Signed-off-by: Yu-cheng Yu --- arch/x86/include/asm/fpu/internal.h | 21 ++- arch/x86/include/asm/fpu/xstate.h | 4 +- arch/x86/kernel/fpu/core.c | 26 +

[PATCH v7 15/27] mm: Handle shadow stack page fault

2019-06-06 Thread Yu-cheng Yu
When a task does fork(), its shadow stack (SHSTK) must be duplicated for the child. This patch implements a flow similar to copy-on-write of an anonymous page, but for SHSTK. A SHSTK PTE must be RO and dirty. This dirty bit requirement is used to effect the copying. In copy_one_pte(), clear the

[PATCH v7 24/27] x86/cet/shstk: Handle thread shadow stack

2019-06-06 Thread Yu-cheng Yu
The shadow stack for clone/fork is handled as the following: (1) If ((clone_flags & (CLONE_VFORK | CLONE_VM)) == CLONE_VM), the kernel allocates (and frees on thread exit) a new SHSTK for the child. It is possible for the kernel to complete the clone syscall and set the child's SH

[PATCH v7 26/27] x86/cet/shstk: Add arch_prctl functions for Shadow Stack

2019-06-06 Thread Yu-cheng Yu
arch_prctl(ARCH_X86_CET_STATUS, unsigned long *addr) Return CET feature status. The parameter 'addr' is a pointer to a user buffer. On returning to the caller, the kernel fills the following information: *addr = SHSTK/IBT status *(addr + 1) = SHSTK base address *(addr

[PATCH v7 25/27] mm/mmap: Add Shadow stack pages to memory accounting

2019-06-06 Thread Yu-cheng Yu
Add shadow stack pages to memory accounting. Signed-off-by: Yu-cheng Yu --- mm/mmap.c | 5 + 1 file changed, 5 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index b1a921c0de63..3b643ace2c49 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1703,6 +1703,9 @@ static inline int accountable_mapping

[PATCH v7 23/27] x86/cet/shstk: ELF header parsing of Shadow Stack

2019-06-06 Thread Yu-cheng Yu
Look in .note.gnu.property of an ELF file and check if Shadow Stack needs to be enabled for the task. Signed-off-by: H.J. Lu Signed-off-by: Yu-cheng Yu --- arch/x86/Kconfig | 1 + arch/x86/kernel/process_64.c | 24 2 files changed, 25 insertions(+) diff --

[PATCH v7 21/27] x86/cet/shstk: Handle signals for shadow stack

2019-06-06 Thread Yu-cheng Yu
When setting up a signal, the kernel creates a shadow stack restore token at the current SHSTK address and then stores the token's address in the signal frame, right after the FPU state. Before restoring a signal, the kernel verifies and then uses the restore token to set the SHSTK pointer. Signe

[PATCH v7 17/27] mm: Update can_follow_write_pte/pmd for shadow stack

2019-06-06 Thread Yu-cheng Yu
can_follow_write_pte/pmd look for the (RO & DIRTY) PTE/PMD to verify an exclusive RO page still exists after a broken COW. A shadow stack PTE is RO & PAGE_DIRTY_SW when it is shared, otherwise RO & PAGE_DIRTY_HW. Introduce pte_exclusive() and pmd_exclusive() to also verify a shadow stack PTE is e

[PATCH v7 27/27] x86/cet/shstk: Add Shadow Stack instructions to opcode map

2019-06-06 Thread Yu-cheng Yu
Add the following shadow stack management instructions. INCSSP: Increment shadow stack pointer by the steps specified. RDSSP: Read SSP register into a GPR. SAVEPREVSSP: Use "prev ssp" token at top of current shadow stack to create a "restore token" on previous shadow stack. RSTO

[PATCH v7 20/27] x86/cet/shstk: Introduce WRUSS instruction

2019-06-06 Thread Yu-cheng Yu
WRUSS is a new kernel-mode instruction but writes directly to user shadow stack memory. This is used to construct a return address on the shadow stack for the signal handler. This instruction can fault if the user shadow stack is invalid shadow stack memory. In that case, the kernel does a fixup

[PATCH v7 14/27] x86/mm: Shadow stack page fault error checking

2019-06-06 Thread Yu-cheng Yu
If a page fault is triggered by a shadow stack access (e.g. call/ret) or shadow stack management instructions (e.g. wrussq), then bit[6] of the page fault error code is set. In access_error(), verify a shadow stack page fault is within a shadow stack memory area. It is always an error otherwise.

[PATCH v7 13/27] x86/mm: Modify ptep_set_wrprotect and pmdp_set_wrprotect for _PAGE_DIRTY_SW

2019-06-06 Thread Yu-cheng Yu
When Shadow Stack is enabled, the [R/O + PAGE_DIRTY_HW] setting is reserved only for the Shadow Stack. Non-Shadow Stack R/O PTEs use [R/O + PAGE_DIRTY_SW]. When a PTE goes from [R/W + PAGE_DIRTY_HW] to [R/O + PAGE_DIRTY_SW], it could become a transient Shadow Stack PTE in two cases. The first ca

[PATCH v7 07/27] x86/cet/shstk: Add Kconfig option for user-mode shadow stack

2019-06-06 Thread Yu-cheng Yu
Introduce Kconfig option X86_INTEL_SHADOW_STACK_USER. An application has shadow stack protection when all the following are true: (1) The kernel has X86_INTEL_SHADOW_STACK_USER enabled, (2) The running processor supports the shadow stack, (3) The application is built with shadow stack enabl

[PATCH v7 12/27] drm/i915/gvt: Update _PAGE_DIRTY to _PAGE_DIRTY_BITS

2019-06-06 Thread Yu-cheng Yu
Update _PAGE_DIRTY to _PAGE_DIRTY_BITS in split_2MB_gtt_entry(). In order to support Control-flow Enforcement (CET), _PAGE_DIRTY is now _PAGE_DIRTY_HW or _PAGE_DIRTY_SW. Signed-off-by: Yu-cheng Yu --- drivers/gpu/drm/i915/gvt/gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH v7 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-06-06 Thread Yu-cheng Yu
A RO and dirty PTE exists in the following cases: (a) A page is modified and then shared with a fork()'ed child; (b) A R/O page that has been COW'ed; (c) A SHSTK page. The processor does not read the dirty bit for (a) and (b), but checks the dirty bit for (c). To prevent the use of non-SHSTK mem

[PATCH v7 05/27] x86/fpu/xstate: Add XSAVES system states for shadow stack

2019-06-06 Thread Yu-cheng Yu
Intel Control-flow Enforcement Technology (CET) introduces the following MSRs. MSR_IA32_U_CET (user-mode CET settings), MSR_IA32_PL3_SSP (user-mode shadow stack), MSR_IA32_PL0_SSP (kernel-mode shadow stack), MSR_IA32_PL1_SSP (Privilege Level 1 shadow stack), MSR_IA32_PL2_SSP (P

[PATCH v7 08/27] mm: Introduce VM_SHSTK for shadow stack memory

2019-06-06 Thread Yu-cheng Yu
VM_SHSTK indicates a shadow stack memory area. The shadow stack is implemented only for the 64-bit kernel. Signed-off-by: Yu-cheng Yu --- fs/proc/task_mmu.c | 3 +++ include/linux/mm.h | 8 2 files changed, 11 insertions(+) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 01d

[PATCH v7 07/14] x86/cet/ibt: Add arch_prctl functions for IBT

2019-06-06 Thread Yu-cheng Yu
Update ARCH_X86_CET_STATUS and ARCH_X86_CET_DISABLE to include Indirect Branch Tracking features. Introduce: arch_prctl(ARCH_X86_CET_SET_LEGACY_BITMAP, unsigned long *addr) Enable the Indirect Branch Tracking legacy code bitmap. The parameter 'addr' is a pointer to a user buffer that has

[PATCH v7 09/14] x86/vdso: Insert endbr32/endbr64 to vDSO

2019-06-06 Thread Yu-cheng Yu
From: "H.J. Lu" When Intel indirect branch tracking is enabled, functions in vDSO which may be called indirectly must have endbr32 or endbr64 as the first instruction. Compiler must support -fcf-protection=branch so that it can be used to compile vDSO. Signed-off-by: H.J. Lu --- arch/x86/entr

[PATCH v7 01/14] x86/cet/ibt: Add Kconfig option for user-mode Indirect Branch Tracking

2019-06-06 Thread Yu-cheng Yu
The user-mode indirect branch tracking support is done mostly by GCC to insert ENDBR64/ENDBR32 instructions at branch targets. The kernel provides CPUID enumeration and feature setup. Signed-off-by: Yu-cheng Yu --- arch/x86/Kconfig | 16 arch/x86/Makefile | 7 +++ 2 files

[PATCH v7 00/14] Control-flow Enforcement: Branch Tracking, PTRACE

2019-06-06 Thread Yu-cheng Yu
The previous version of CET Branch Tracking/PTRACE patches is here: https://lkml.org/lkml/2018/11/20/203 Summary of changes from v6: Rebase to v5.2-rc3. Add Branch Tracking in the signal handling routines. Fix Branch Tracking (and Shadow Stack) for vsyscall (patch #12): This patch

[PATCH v7 04/14] x86/cet/ibt: Handle signals for IBT

2019-06-06 Thread Yu-cheng Yu
Setup/Restore Indirect Branch Tracking for signals. Signed-off-by: Yu-cheng Yu --- arch/x86/kernel/cet.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/x86/kernel/cet.c b/arch/x86/kernel/cet.c index e0ef996d3148..e1ab7e722637 100644 --- a/arch/x86/kernel/cet.c +++ b

[PATCH v7 13/14] x86/cet: Add PTRACE interface for CET

2019-06-06 Thread Yu-cheng Yu
Add REGSET_CET64/REGSET_CET32 to get/set CET MSRs: IA32_U_CET (user-mode CET settings) and IA32_PL3_SSP (user-mode shadow stack) Signed-off-by: Yu-cheng Yu --- arch/x86/include/asm/fpu/regset.h | 7 +++--- arch/x86/kernel/fpu/regset.c | 41 +++ arch/x86

[PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function

2019-06-06 Thread Yu-cheng Yu
Indirect Branch Tracking (IBT) provides an optional legacy code bitmap that allows execution of legacy, non-IBT compatible library by an IBT-enabled application. When set, each bit in the bitmap indicates one page of legacy code. The bitmap is allocated and setup from the application. Signed-off

[PATCH v7 14/14] x86: Discard .note.gnu.property sections

2019-06-06 Thread Yu-cheng Yu
From: "H.J. Lu" With the command-line option, -mx86-used-note=yes, the x86 assembler in binutils 2.32 and above generates a program property note in a note section, .note.gnu.property, to encode used x86 ISAs and features. To exclude .note.gnu.property sections from NOTE segment in x86 kernel lin

[PATCH v7 02/14] x86/cet/ibt: User-mode indirect branch tracking support

2019-06-06 Thread Yu-cheng Yu
Add user-mode indirect branch tracking enabling/disabling and supporting routines. Signed-off-by: H.J. Lu Signed-off-by: Yu-cheng Yu --- arch/x86/include/asm/cet.h| 7 arch/x86/include/asm/disabled-features.h | 8 - arch/x86/kernel/cet.c

[PATCH v7 11/14] x86/vsyscall/64: Add ENDBR64 to vsyscall entry points

2019-06-06 Thread Yu-cheng Yu
From: "H.J. Lu" Add ENDBR64 to vsyscall entry points. Signed-off-by: H.J. Lu Acked-by: Andy Lutomirski --- arch/x86/entry/vsyscall/vsyscall_emu_64.S | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/x86/entry/vsyscall/vsyscall_emu_64.S b/arch/x86/entry/vsyscall/vsyscall_emu_6

[PATCH v7 06/14] x86/cet/ibt: ELF header parsing for IBT

2019-06-06 Thread Yu-cheng Yu
Look in .note.gnu.property of an ELF file and check if Indirect Branch Tracking needs to be enabled for the task. Signed-off-by: Yu-cheng Yu --- arch/x86/kernel/process_64.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c inde

[PATCH v7 12/14] x86/vsyscall/64: Fixup shadow stack and branch tracking for vsyscall

2019-06-06 Thread Yu-cheng Yu
When emulating a RET, also unwind the task's shadow stack and cancel the current branch tracking status. Signed-off-by: Yu-cheng Yu --- arch/x86/entry/vsyscall/vsyscall_64.c | 28 +++ 1 file changed, 28 insertions(+) diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/

[PATCH v7 10/14] x86/vdso/32: Add ENDBR32 to __kernel_vsyscall entry point

2019-06-06 Thread Yu-cheng Yu
From: "H.J. Lu" Add ENDBR32 to __kernel_vsyscall entry point. Signed-off-by: H.J. Lu --- arch/x86/entry/vdso/vdso32/system_call.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/entry/vdso/vdso32/system_call.S b/arch/x86/entry/vdso/vdso32/system_call.S index 263d7433dea8..2fc8

[PATCH v7 08/14] x86/cet/ibt: Add ENDBR to op-code-map

2019-06-06 Thread Yu-cheng Yu
Add control transfer terminating instructions: ENDBR64/ENDBR32: Mark a valid 64/32-bit control transfer endpoint. Signed-off-by: Yu-cheng Yu --- arch/x86/lib/x86-opcode-map.txt | 13 +++-- tools/objtool/arch/x86/lib/x86-opcode-map.txt | 13 +++-- 2 files change

[PATCH v7 05/14] mm/mmap: Add IBT bitmap size to address space limit check

2019-06-06 Thread Yu-cheng Yu
The indirect branch tracking legacy bitmap takes a large address space. This causes may_expand_vm() failure on the address limit check. For a IBT-enabled task, add the bitmap size to the address limit. Signed-off-by: Yu-cheng Yu --- arch/x86/include/asm/mmu_context.h | 10 ++ mm/mmap.c

[PATCH v7 02/27] x86/cpufeatures: Add CET CPU feature flags for Control-flow Enforcement Technology (CET)

2019-06-06 Thread Yu-cheng Yu
Add CPU feature flags for Control-flow Enforcement Technology (CET). CPUID.(EAX=7,ECX=0):ECX[bit 7] Shadow stack CPUID.(EAX=7,ECX=0):EDX[bit 20] Indirect branch tracking Signed-off-by: Yu-cheng Yu Reviewed-by: Borislav Petkov --- arch/x86/include/asm/cpufeatures.h | 2 ++ arch/x86/kernel/cpu/c

Re: [PATCH v7 10/14] x86/vdso/32: Add ENDBR32 to __kernel_vsyscall entry point

2019-06-06 Thread Andy Lutomirski
On Thu, Jun 6, 2019 at 1:17 PM Yu-cheng Yu wrote: > > From: "H.J. Lu" > > Add ENDBR32 to __kernel_vsyscall entry point. > Acked-by: Andy Lutomirski However, you forgot your own Signed-off-by. > Signed-off-by: H.J. Lu --Andy

Re: [PATCH v7 09/14] x86/vdso: Insert endbr32/endbr64 to vDSO

2019-06-06 Thread Andy Lutomirski
On Thu, Jun 6, 2019 at 1:17 PM Yu-cheng Yu wrote: > > From: "H.J. Lu" > > When Intel indirect branch tracking is enabled, functions in vDSO which > may be called indirectly must have endbr32 or endbr64 as the first > instruction. Compiler must support -fcf-protection=branch so that it > can be u

Re: [PATCH v7 12/14] x86/vsyscall/64: Fixup shadow stack and branch tracking for vsyscall

2019-06-06 Thread Andy Lutomirski
On Thu, Jun 6, 2019 at 1:17 PM Yu-cheng Yu wrote: > > When emulating a RET, also unwind the task's shadow stack and cancel > the current branch tracking status. > > Signed-off-by: Yu-cheng Yu > --- > arch/x86/entry/vsyscall/vsyscall_64.c | 28 +++ > 1 file changed, 28 ins

Re: [PATCH v7 11/14] x86/vsyscall/64: Add ENDBR64 to vsyscall entry points

2019-06-06 Thread Andy Lutomirski
On Thu, Jun 6, 2019 at 1:17 PM Yu-cheng Yu wrote: > > From: "H.J. Lu" > > Add ENDBR64 to vsyscall entry points. I'm still okay with this patch, but this is rather silly. If anyone actually executes this code, they're doing it wrong. --Andy

Re: [PATCH 03/10] mfd / platform: cros_ec: Miscellaneous character device to talk with the EC

2019-06-06 Thread Randy Dunlap
On 6/6/19 8:12 AM, Ezequiel Garcia wrote: > On Thu, 2019-06-06 at 16:51 +0200, Greg Kroah-Hartman wrote: >> On Thu, Jun 06, 2019 at 11:01:17AM -0300, Ezequiel Garcia wrote: >>> On Tue, 2019-06-04 at 20:59 +0200, Greg Kroah-Hartman wrote: On Tue, Jun 04, 2019 at 11:39:21AM -0700, Guenter Roeck

Re: [PATCH v7 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-06-06 Thread Dave Hansen
> +/* > + * Helpers for changing XSAVES system states. > + */ > +static inline void modify_fpu_regs_begin(void) > +{ > + fpregs_lock(); > + if (test_thread_flag(TIF_NEED_FPU_LOAD)) > + __fpregs_load_activate(); > +} > + > +static inline void modify_fpu_regs_end(void) > +{ > +

Re: [PATCH v7 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-06-06 Thread Andy Lutomirski
On Jun 6, 2019, at 2:18 PM, Dave Hansen wrote: >> +/* >> + * Helpers for changing XSAVES system states. >> + */ >> +static inline void modify_fpu_regs_begin(void) >> +{ >> +fpregs_lock(); >> +if (test_thread_flag(TIF_NEED_FPU_LOAD)) >> +__fpregs_load_activate(); >> +} >> + >> +

Re: [PATCH v7 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-06-06 Thread Dave Hansen
On 6/6/19 3:04 PM, Andy Lutomirski wrote: >> But, that seems broken. If we have supervisor state, we can't >> always defer the load until return to userspace, so we'll never?? >> have TIF_NEED_FPU_LOAD. That would certainly be true for >> cet_kernel_state. > > Ugh. I was sort of imagining

Re: [PATCH v7 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-06-06 Thread Yu-cheng Yu
On Thu, 2019-06-06 at 15:08 -0700, Dave Hansen wrote: > > On 6/6/19 3:04 PM, Andy Lutomirski wrote: > > > But, that seems broken. If we have supervisor state, we can't > > > always defer the load until return to userspace, so we'll never?? > > > have TIF_NEED_FPU_LOAD. That would certainly be

Re: [v3 PATCH] RISC-V: Add a PE/COFF compliant Image header.

2019-06-06 Thread Atish Patra
On 6/5/19 9:26 AM, Mark Rutland wrote: On Thu, May 23, 2019 at 11:35:16AM -0700, Atish Patra wrote: Currently, last stage boot loaders such as U-Boot can accept only uImage which is an unnecessary additional step in automating boot flows. Add a PE/COFF compliant image header that boot loaders c

[PATCH v4] RISC-V: Add an Image header that boot loader can parse.

2019-06-06 Thread Atish Patra
Currently, the last stage boot loaders such as U-Boot can accept only uImage which is an unnecessary additional step in automating boot process. Add an image header that boot loader understands and boot Linux from flat Image directly. This header is based on ARM64 boot image header and provides a

Re: [PATCH v7 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-06-06 Thread Andy Lutomirski
> On Jun 6, 2019, at 3:08 PM, Dave Hansen wrote: > > > > On 6/6/19 3:04 PM, Andy Lutomirski wrote: >>> But, that seems broken. If we have supervisor state, we can't >>> always defer the load until return to userspace, so we'll never?? >>> have TIF_NEED_FPU_LOAD. That would certainly be t

[PATCH] linux: README: reduced README size by 1 byte by removing unnecessary space character

2019-06-06 Thread Alex
From: Aaron A Montoya On line 9 of the README there is an unnecessary extra space character, after the period, that adds 1 byte of size to the file. By removing the unnecessary space, Linux downloads will be 1 byte smaller and therefor be faster to download and take up less space on a user's s