Re: Rough notes from sys_membarrier() lightning BoF

2017-09-20 Thread Mathieu Desnoyers
- On Sep 20, 2017, at 2:18 PM, Andy Lutomirski l...@kernel.org wrote: > On Wed, Sep 20, 2017 at 11:13 AM, Mathieu Desnoyers > wrote: >> >> - On Sep 20, 2017, at 12:02 PM, Andy Lutomirski l...@kernel.org wrote: >> >> > On Sun, Sep 17, 2017 at 3:36 PM, Paul E. McKenney >> > wrote: >> >> He

Re: [RFC PATCH v5 3/6] i2c: add docs to clarify DMA handling

2017-09-20 Thread Mauro Carvalho Chehab
Em Wed, 20 Sep 2017 20:59:53 +0200 Wolfram Sang escreveu: > Signed-off-by: Wolfram Sang Documentation looks OK on my eyes. So: Reviewed-by: Mauro Carvalho Chehab > --- > Documentation/i2c/DMA-considerations | 58 > > 1 file changed, 58 insertions(+) >

[RESEND x2][PATCH 2/3] usb: dwc2: Error out of dwc2_hsotg_ep_disable() if we're in host mode

2017-09-20 Thread John Stultz
We've found that while in host mode, using Android, if one runs the command: stop adbd The existing usb devices being utilized in host mode are disconnected. This is most visible with usb networking devices. This seems to be due to adbd closing the file: /dev/usb-ffs/adb/ep0 Which calls ffs_e

[RESEND x2][PATCH 3/3] usb: dwc2: Fix UDC state tracking

2017-09-20 Thread John Stultz
It has been noticed that the dwc2 udc state reporting doesn't seem to work (at least on HiKey boards). Where after the initial setup, the sysfs /sys/class/udc/f72c.usb/state file would report "configured" no matter the state of the OTG port. This patch adds a call so that we report to the UDC

[RESEND x2][PATCH 0/3] dwc2 fixes for edge cases on hikey

2017-09-20 Thread John Stultz
So here are a few dwc2 fixes that I've been using with HiKey. I'm not totally sure these are all ideal, but they avoid edge case issues that we have been running into with switching between gadget mode and host mode. I'd guess the first two are potentially -stable material, and the last might be w

[RESEND x2][PATCH 1/3] usb: dwc2: Improve gadget state disconnection handling

2017-09-20 Thread John Stultz
In the earlier commit dad3f793f20f ("usb: dwc2: Make sure we disconnect the gadget state"), I was trying to fix up the fact that we somehow weren't disconnecting the gadget state, so that when the OTG port was plugged in the second time we would get warnings about the state tracking being wrong. T

[RESEND RFC PATCH 0/7] sun8i H3 HDMI glue driver for DW HDMI

2017-09-20 Thread Jernej Skrabec
[added media mailing list due to CEC question] This patch series adds a HDMI glue driver for Allwinner H3 SoC. For now, only video and CEC functionality is supported. Audio needs more tweaks. Series is based on the H3 DE2 patch series available on mailing list: http://lists.infradead.org/pipermai

[RESEND RFC PATCH 1/7] drm: bridge: Enable polling hpd event in dw_hdmi

2017-09-20 Thread Jernej Skrabec
Some custom phys don't support hpd interrupts. Add support for polling such events. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/br

[RESEND RFC PATCH 6/7] ARM: sun8i: h3: Add DesignWare HDMI controller node

2017-09-20 Thread Jernej Skrabec
From: Icenowy Zheng The H3 SoC has a DesignWare HDMI controller with some Allwinner-specific glue and custom PHY. Since H3 and H5 have same HDMI controller, add related device node in shared dtsi file. Signed-off-by: Icenowy Zheng Signed-off-by: Jernej Skrabec --- arch/arm/boot/dts/sun8i-h3.

[RESEND RFC PATCH 5/7] drm: sun4i: Add a glue for the DesignWare HDMI controller in H3

2017-09-20 Thread Jernej Skrabec
Allwinner H3 features DesignWare HDMI Transmitter paired with custom PHY. Add a glue driver for it. For now, only video and CEC are supported. Audio will be supported at a later time. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/Kconfig | 9 + drivers/gpu/drm/sun4i/Makefil

[RESEND RFC PATCH 7/7] ARM: sun8i: h3: Enable HDMI output on H3 boards

2017-09-20 Thread Jernej Skrabec
Enable HDMI output on all boards which include HDMI connector. Signed-off-by: Jernej Skrabec --- arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts | 33 + arch/arm/boot/dts/sun8i-h3-beelink-x2.dts | 33 + arch/arm/boot/dts/sun8i-h3-nanopi-m1.dt

[RESEND RFC PATCH 3/7] clk: sunxi: Add CLK_SET_RATE_PARENT flag for H3 HDMI clock

2017-09-20 Thread Jernej Skrabec
When setting the HDMI clock of H3, the PLL_VIDEO clock needs to be set. Add CLK_SET_RATE_PARENT flag for H3 HDMI clock. Signed-off-by: Jernej Skrabec Signed-off-by: Icenowy Zheng --- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[RESEND RFC PATCH 4/7] dt-bindings: Document Allwinner DWC HDMI TX node

2017-09-20 Thread Jernej Skrabec
Add documentation about Allwinner DWC HDMI TX node, found in H3 SoC. Signed-off-by: Jernej Skrabec --- .../bindings/display/sunxi/sun4i-drm.txt | 158 - 1 file changed, 157 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/sunxi/su

[RESEND RFC PATCH 2/7] drm: bridge: Enable workaround in dw_hdmi for v1.32a

2017-09-20 Thread Jernej Skrabec
Allwinner SoCs have dw hdmi controller v1.32a which exhibits same magenta line issue as i.MX6Q and i.MX6DL. Enable workaround for it. Allwinner never released any kind of dw hdmi or errata documentation, so it is not clear how many iterations need to be executed. One iteration seems to be enough.

Re: [PATCH] gpio: Wakeup gpio controller when it is used as IRQ controller

2017-09-20 Thread Grygorii Strashko
On 09/20/2017 02:14 AM, Michal Simek wrote: > From: Borsodi Petr > > There is a problem with GPIO driver when used as IRQ controller. > It is not working because the module is sleeping (clock is disabled). > The patch enables clocks when IP is used as IRQ controller. I think, it should be solv

RE: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275

2017-09-20 Thread Mario.Limonciello
> -Original Message- > From: Jérôme de Bretagne [mailto:jerome.debreta...@gmail.com] > Sent: Monday, September 18, 2017 5:41 PM > To: Limonciello, Mario > Cc: platform-driver-...@vger.kernel.org; Darren Hart ; > LKML ; ACPI Devel Maling List a...@vger.kernel.org>; Rafael J. Wysocki ; Andy

Re: Vibrations in input vs. LED was Re: [PATCH v2 0/3] led: ledtrig-transient: add support for hrtimer

2017-09-20 Thread Jacek Anaszewski
On 09/20/2017 01:29 PM, Pavel Machek wrote: > I'd leave the decision to the user. We could add a note to the > Documentation/leds/ledtrig-transient.txt that force feedback interface > should be preferable choice for driving vibrate devices. > However only if following conditions are

Re: [PATCH RFC V1 net-next 0/6] Time based packet transmission

2017-09-20 Thread Richard Cochran
On Wed, Sep 20, 2017 at 11:35:33AM -0600, levipear...@gmail.com wrote: > Anyway, I am wholly in favor of this proposal--in fact, it is very similar to > a patch set I shared with Eric Mann and others at Intel in early Dec 2016 with > the intention to get some early feedback before submitting here.

Re: [RFC][PATCH v2 0/7] printk/ia64/ppc64/parisc64: let's deprecate %pF/%pf printk specifiers

2017-09-20 Thread Helge Deller
On 20.09.2017 18:29, Sergey Senozhatsky wrote: This patch set attempts to move ia64/ppc64/parisc64 C function pointer ABI details out of printk() to arch code. Function dereference code now checks if a pointer belongs to a .opd ELF section and dereferences that pointer only if it does. T

[PATCH v9 11/12] arm64/kasan: use kasan_map_populate()

2017-09-20 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/arm64/mm/kasan_init.c | 12 ++-

[PATCH v9 12/12] mm: stop zeroing memory during allocation in vmemmap

2017-09-20 Thread Pavel Tatashin
vmemmap_alloc_block() will no longer zero the block, so zero memory at its call sites for everything except struct pages. Struct page memory is zero'd by struct page initialization. Replace allocators in sprase-vmemmap to use the non-zeroing version. So, we will get the performance improvement by

[PATCH v9 06/12] mm: zero struct pages during initialization

2017-09-20 Thread Pavel Tatashin
Add struct page zeroing as a part of initialization of other fields in __init_single_page(). This single thread performance collected on: Intel(R) Xeon(R) CPU E7-8895 v3 @ 2.60GHz with 1T of memory (268400646 pages in 8 nodes): BASEFIX sparse_init 11.244671

[PATCH v9 05/12] mm: defining memblock_virt_alloc_try_nid_raw

2017-09-20 Thread Pavel Tatashin
* A new variant of memblock_virt_alloc_* allocations: memblock_virt_alloc_try_nid_raw() - Does not zero the allocated memory - Does not panic if request cannot be satisfied * optimize early system hash allocations Clients can call alloc_large_system_hash() with flag: HASH_ZERO to specify

[PATCH v9 04/12] sparc64: simplify vmemmap_populate

2017-09-20 Thread Pavel Tatashin
Remove duplicating code by using common functions vmemmap_pud_populate and vmemmap_pgd_populate. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/mm/init_64.c | 23 ++- 1 f

[PATCH v9 08/12] mm: zero reserved and unavailable struct pages

2017-09-20 Thread Pavel Tatashin
Some memory is reserved but unavailable: not present in memblock.memory (because not backed by physical pages), but present in memblock.reserved. Such memory has backing struct pages, but they are not initialized by going through __init_single_page(). In some cases these struct pages are accessed

[PATCH v9 01/12] x86/mm: setting fields in deferred pages

2017-09-20 Thread Pavel Tatashin
Without deferred struct page feature (CONFIG_DEFERRED_STRUCT_PAGE_INIT), flags and other fields in "struct page"es are never changed prior to first initializing struct pages by going through __init_single_page(). With deferred struct page feature enabled, however, we set fields in register_page_bo

Re: [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates

2017-09-20 Thread Franklin S Cooper Jr
Hi Wenyou, On 09/17/2017 10:47 PM, Yang, Wenyou wrote: > > > On 2017/9/14 13:06, Sekhar Nori wrote: >> On Thursday 14 September 2017 03:28 AM, Franklin S Cooper Jr wrote: >>> >>> On 08/18/2017 02:39 PM, Franklin S Cooper Jr wrote: During test transmitting using CAN-FD at high bitrates (4 Mb

[PATCH v9 03/12] mm: deferred_init_memmap improvements

2017-09-20 Thread Pavel Tatashin
This patch fixes two issues in deferred_init_memmap = In deferred_init_memmap() where all deferred struct pages are initialized we have a check like this: if (page->flags) { VM_BUG_ON(page_zone(page) != zone); goto free_range; } This way we are checking if the current deferre

[PATCH v9 00/12] complete deferred page initialization

2017-09-20 Thread Pavel Tatashin
Changelog: v9 - v8 - Addressed comments raised by Mark Rutland and Ard Biesheuvel: changed kasan implementation. Added a new function: kasan_map_populate() that zeroes the allocated and mapped memory v8 - v7 - Added Acked-by's from Dave Miller for SPARC changes - Fixed a minor compiling issue

[PATCH v9 10/12] x86/kasan: use kasan_map_populate()

2017-09-20 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/x86/mm/kasan_init_64.c | 8 1

[PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-09-20 Thread Pavel Tatashin
During early boot, kasan uses vmemmap_populate() to establish its shadow memory. But, that interface is intended for struct pages use. Because of the current project, vmemmap won't be zeroed during allocation, but kasan expects that memory to be zeroed. We are adding a new kasan_map_populate() fun

[PATCH v9 07/12] sparc64: optimized struct page zeroing

2017-09-20 Thread Pavel Tatashin
Add an optimized mm_zero_struct_page(), so struct page's are zeroed without calling memset(). We do eight to ten regular stores based on the size of struct page. Compiler optimizes out the conditions of switch() statement. SPARC-M6 with 15T of memory, single thread performance:

[PATCH v9 02/12] sparc64/mm: setting fields in deferred pages

2017-09-20 Thread Pavel Tatashin
Without deferred struct page feature (CONFIG_DEFERRED_STRUCT_PAGE_INIT), flags and other fields in "struct page"es are never changed prior to first initializing struct pages by going through __init_single_page(). With deferred struct page feature enabled there is a case where we set some fields pr

Re: [PATCH v3] platform/chrome: Use proper protocol transfer function

2017-09-20 Thread Shawn N
On Tue, Sep 19, 2017 at 11:13 PM, Brian Norris wrote: > Hi, > > On Tue, Sep 19, 2017 at 11:05:38PM -0700, Shawn N wrote: >> This is failing because our EC_CMD_GET_PROTOCOL_INFO host command is >> getting messed up, or the reply buffer is getting corrupted somehow. >> >>ec_dev->prot

Re: [RFC] sched/fair: Use wake_q length as a hint for wake_wide

2017-09-20 Thread Joel Fernandes
On Wed, Sep 20, 2017 at 2:33 AM, Brendan Jackman wrote: > > On Wed, Sep 20 2017 at 05:06, Joel Fernandes wrote: >>> On Tue, Sep 19, 2017 at 3:05 AM, Brendan Jackman >>> wrote: On Mon, Sep 18 2017 at 22:15, Joel Fernandes wrote: >> [..] >> IIUC, if wake_affine() behaves correctly this tri

[PATCH V2] PM / OPP: Call notifier without holding opp_table->lock

2017-09-20 Thread Viresh Kumar
The notifier callbacks may want to call some OPP helper routines which may try to take the same opp_table->lock again and cause a deadlock. One such usecase was reported by Chanwoo Choi, where calling dev_pm_opp_disable() leads us to the devfreq's OPP notifier handler, which further calls dev_pm_op

Re: [PATCH 1/7] PM / OPP: Add platform specific set_clk function

2017-09-20 Thread Viresh Kumar
On 20-09-17, 15:03, Dong Aisheng wrote: > I've been thinking of that before. > Actually IMX already does some similar thing for MX5 (no for MX6). > See: clk_cpu_set_rate() in drivers/clk/imx/clk-cpu.c. > > After some diggings, it seems MX7ULP is a bit more complicated than before > mainly due to t

Re: [PATCH v4 02/13] xen/pvcalls: implement frontend disconnect

2017-09-20 Thread Boris Ostrovsky
> + > +struct pvcalls_bedata { > + struct xen_pvcalls_front_ring ring; > + grant_ref_t ref; > + int irq; > + > + struct list_head socket_mappings; > + struct list_head socketpass_mappings; > + spinlock_t socket_lock; > + > + wait_queue_head_t inflight_req; > + struc

Re: [PATCH] ARM: unaligned.h: Use an arch-specific version

2017-09-20 Thread Arnd Bergmann
On Wed, Sep 20, 2017 at 5:26 PM, Ard Biesheuvel wrote: > On 20 September 2017 at 08:18, Romain Izard > wrote: >> Add an arch-specific header to ARM, to retain other optimizations that >> rely on HAVE_EFFICIENT_UNALIGNED_ACCESS, while making sure that access >> that explicitly rely on the unalign

Re: [PATCH 03/10] coda: honor AT_STATX_DONT_SYNC

2017-09-20 Thread Jan Harkes
On Wed, Sep 20, 2017 at 10:39:58AM +0200, Miklos Szeredi wrote: > The description of this flag says "Don't sync attributes with the server". > In other words: always use the attributes cached in the kernel and don't > send network or local messages to refresh the attributes. What is the use case f

Re: [PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-20 Thread David Rientjes
On Thu, 21 Sep 2017, Yang Shi wrote: > diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c > index b9d34b3..9673190 100644 > --- a/tools/vm/slabinfo.c > +++ b/tools/vm/slabinfo.c > @@ -83,6 +83,7 @@ struct aliasinfo { > int sort_loss; > int extended_totals; > int show_bytes; > +int unreclaim

[PATCH v3 00/31] Hardened usercopy whitelisting

2017-09-20 Thread Kees Cook
v3: - added LKDTM update patch - downgrade BUGs to WARNs and fail closed - add Acks/Reviews from v2 v2: - added tracing of allocation and usage - refactored solutions for task_struct - split up network patches for readability I intend for this to land via my usercopy hardening tree, so Acks, Revi

[PATCH v3 06/31] vfs: Copy struct mount.mnt_id to userspace using put_user()

2017-09-20 Thread Kees Cook
From: David Windsor The mnt_id field can be copied with put_user(), so there is no need to use copy_to_user(). In both cases, hardened usercopy is being bypassed since the size is constant, and not open to runtime manipulation. This patch is verbatim from Brad Spengler/PaX Team's PAX_USERCOPY wh

[PATCH v3 16/31] cifs: Define usercopy region in cifs_request slab cache

2017-09-20 Thread Kees Cook
From: David Windsor CIFS request buffers, stored in the cifs_request slab cache, need to be copied to/from userspace. cache object allocation: fs/cifs/cifsfs.c: cifs_init_request_bufs(): ... cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,

[PATCH v3 20/31] caif: Define usercopy region in caif proto slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The CAIF channel connection request parameters need to be copied to/from userspace. In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. example usage trace: net/caif/caif_socket.c:

[PATCH v3 14/31] vxfs: Define usercopy region in vxfs_inode slab cache

2017-09-20 Thread Kees Cook
From: David Windsor vxfs symlink pathnames, stored in struct vxfs_inode_info field vii_immed.vi_immed and therefore contained in the vxfs_inode slab cache, need to be copied to/from userspace. cache object allocation: fs/freevxfs/vxfs_super.c: vxfs_alloc_inode(...): ...

[PATCH v3 22/31] sctp: Copy struct sctp_sock.autoclose to userspace using put_user()

2017-09-20 Thread Kees Cook
From: David Windsor The autoclose field can be copied with put_user(), so there is no need to use copy_to_user(). In both cases, hardened usercopy is being bypassed since the size is constant, and not open to runtime manipulation. This patch is verbatim from Brad Spengler/PaX Team's PAX_USERCOPY

[PATCH v3 30/31] usercopy: Restrict non-usercopy caches to size 0

2017-09-20 Thread Kees Cook
With all known usercopied cache whitelists now defined in the kernel, switch the default usercopy region of kmem_cache_create() to size 0. Any new caches with usercopy regions will now need to use kmem_cache_create_usercopy() instead of kmem_cache_create(). This patch is modified from Brad Spengle

[PATCH v3 13/31] ufs: Define usercopy region in ufs_inode_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The ufs symlink pathnames, stored in struct ufs_inode_info.i_u1.i_symlink and therefore contained in the ufs_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/ufs/super.c: ufs_alloc_inode(...): ... ei

[PATCH v3 11/31] exofs: Define usercopy region in exofs_inode_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The exofs short symlink names, stored in struct exofs_i_info.i_data and therefore contained in the exofs_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/exofs/super.c: exofs_alloc_inode(...): ... oi

[PATCH v3 12/31] orangefs: Define usercopy region in orangefs_inode_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor orangefs symlink pathnames, stored in struct orangefs_inode_s.link_target and therefore contained in the orangefs_inode_cache, need to be copied to/from userspace. cache object allocation: fs/orangefs/super.c: orangefs_alloc_inode(...): ...

[PATCH v3 10/31] befs: Define usercopy region in befs_inode_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor befs symlink pathnames, stored in struct befs_inode_info.i_data.symlink and therefore contained in the befs_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/befs/linuxvfs.c: befs_alloc_inode(...): ...

[PATCH v3 09/31] jfs: Define usercopy region in jfs_ip slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The jfs symlink pathnames, stored in struct jfs_inode_info.i_inline and therefore contained in the jfs_ip slab cache, need to be copied to/from userspace. cache object allocation: fs/jfs/super.c: jfs_alloc_inode(...): ... jfs_inode = kmem_c

[PATCH v3 05/31] vfs: Define usercopy region in names_cache slab caches

2017-09-20 Thread Kees Cook
From: David Windsor VFS pathnames are stored in the names_cache slab cache, either inline or across an entire allocation entry (when approaching PATH_MAX). These are copied to/from userspace, so they must be entirely whitelisted. cache object allocation: include/linux/fs.h: #define _

[PATCH] arm64: Always use REFCOUNT_FULL

2017-09-20 Thread Kees Cook
As discussed at the Linux Security Summit, arm64 prefers to use REFCOUNT_FULL by default. This enables it for the architecture. Cc: Ard Biesheuvel Cc: hw.li...@huawei.com Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm64/Kconf

[PATCH v3 08/31] ext2: Define usercopy region in ext2_inode_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The ext2 symlink pathnames, stored in struct ext2_inode_info.i_data and therefore contained in the ext2_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/ext2/super.c: ext2_alloc_inode(...): struct ext2_inode_info

[PATCH v3 07/31] ext4: Define usercopy region in ext4_inode_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The ext4 symlink pathnames, stored in struct ext4_inode_info.i_data and therefore contained in the ext4_inode_cache slab cache, need to be copied to/from userspace. cache object allocation: fs/ext4/super.c: ext4_alloc_inode(...): struct ext4_inode_info

[PATCH v3 02/31] usercopy: Enforce slab cache usercopy region boundaries

2017-09-20 Thread Kees Cook
From: David Windsor This patch adds the enforcement component of usercopy cache whitelisting, and is modified from Brad Spengler/PaX Team's PAX_USERCOPY whitelisting code in the last public patch of grsecurity/PaX based on my understanding of the code. Changes or omissions from the original code

[PATCH v3 01/31] usercopy: Prepare for usercopy whitelisting

2017-09-20 Thread Kees Cook
From: David Windsor This patch prepares the slab allocator to handle caches having annotations (useroffset and usersize) defining usercopy regions. This patch is modified from Brad Spengler/PaX Team's PAX_USERCOPY whitelisting code in the last public patch of grsecurity/PaX based on my understan

Re: [PATCH] dt-bindings: RTC: Add sirf,prima2-sysrtc bindings

2017-09-20 Thread Rob Herring
On Fri, Sep 15, 2017 at 02:20:35AM +0200, Alexandre Belloni wrote: > Add device tree bindings for the SiRFSoC Real Time Clock. Would be useful to note this is already in use and was undocumented. > > Signed-off-by: Alexandre Belloni > --- > .../devicetree/bindings/rtc/sirf,prima2-sysrtc.txt

[PATCH v3 28/31] arm64: Implement thread_struct whitelist for hardened usercopy

2017-09-20 Thread Kees Cook
This whitelists the FPU register state portion of the thread_struct for copying to userspace, instead of the default entire structure. Cc: Catalin Marinas Cc: Will Deacon Cc: Christian Borntraeger Cc: Ingo Molnar Cc: James Morse Cc: "Peter Zijlstra (Intel)" Cc: Dave Martin Cc: zijun_hu Cc:

Re: [PATCH v2 5/5] dt: watchdog: Document compatibility with JZ4780

2017-09-20 Thread Rob Herring
On Fri, Sep 15, 2017 at 09:20:40PM +0200, Mathieu Malaterre wrote: > Suggested-by: Zubair Lutfullah Kakakhel > Signed-off-by: Mathieu Malaterre > --- > Changes in v2: > * Document the new compatible string > > Documentation/devicetree/bindings/watchdog/ingenic,jz4740-wdt.txt | 4 ++-- > 1 file

[PATCH v3 26/31] fork: Provide usercopy whitelisting for task_struct

2017-09-20 Thread Kees Cook
While the blocked and saved_sigmask fields of task_struct are copied to userspace (via sigmask_to_save() and setup_rt_frame()), it is always copied with a static length (i.e. sizeof(sigset_t)), so they are implictly whitelisted. The only portion of task_struct that is potentially dynamically sized

[PATCH v3 18/31] net: Define usercopy region in struct proto slab cache

2017-09-20 Thread Kees Cook
From: David Windsor In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. Some protocols need to copy objects to/from userspace, and they can declare the region via their proto structure with the new usersize a

Re: [PATCH 3/3] dt-bindings: Add KINGDISPLAY KD097D04 panel bindings

2017-09-20 Thread Rob Herring
On Mon, Sep 18, 2017 at 04:43:50PM +0800, Nickey Yang wrote: > The KINGDISPLAY KD097D04 is a 9.7" panel with a 1536x2048 > resolution and connected to DSI using 8 lanes. > > Signed-off-by: Nickey Yang > --- > .../display/panel/kingdisplay,kd097d04.txt | 22 > ++ > 1

Re: [PATCH 1/3] of: Add vendor prefix for kingdisplay

2017-09-20 Thread Rob Herring
On Mon, Sep 18, 2017 at 04:36:53PM +0800, Nickey Yang wrote: > Kingdisplay Technology Co., Ltd, established in > China Shenzhen in 2006, is a national high-tech > enterprise specializing in the R&D, manufacturing > and marketing of TFT-LCM and touch panel. > > Signed-off-by: Nickey Yang > --- >

[PATCH v3 25/31] fork: Define usercopy region in thread_stack slab caches

2017-09-20 Thread Kees Cook
From: David Windsor In support of usercopy hardening, this patch defines a region in the thread_stack slab caches in which userspace copy operations are allowed. Since the entire thread_stack needs to be available to userspace, the entire slab contents are whitelisted. Note that the slab-based th

Re: [PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer interface

2017-09-20 Thread Rob Herring
On Sat, Sep 16, 2017 at 01:42:20PM +0300, Serge Semin wrote: > The driver used to be developed with legacy GPIO API support. It's > better to use descriptor-based interface for several reasons. First > of all the legacy API doesn't support the ACTIVE_LOW/HIGH flag of dts > nodes, which is essential

Re: [PATCH v4 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys

2017-09-20 Thread Rob Herring
On Sun, Sep 17, 2017 at 04:00:49PM +0800, Chen Zhong wrote: > This patch adds the device tree binding documentation for the MediaTek > pmic keys found on PMIC MT6397/MT6323. > > Signed-off-by: Chen Zhong > --- > .../devicetree/bindings/input/mtk-pmic-keys.txt| 41 > >

Re: [PATCH v2 06/10] arm64: allwinner: a64: Add devicetree binding for DMA controller

2017-09-20 Thread Rob Herring
On Sun, Sep 17, 2017 at 05:19:52AM +0200, Stefan Brüns wrote: > The A64 is register compatible with the H3, but has a different number > of dma channels and request ports. > > Attach additional properties to the node to allow future reuse of the > compatible for controllers with different number o

Re: [RFC RESEND 3/3] arm: dts: add Hi3521A dts

2017-09-20 Thread Rob Herring
On Sun, Sep 17, 2017 at 03:23:27AM -0500, Marty E. Plummer wrote: > Add hi3521a.dtsi and hi3521a-rs-dm290e.dts for RaySharp CCTV systems, > marketed under the name Samsung SDR-B74301N > > Signed-off-by: Marty E. Plummer > --- > arch/arm/boot/dts/Makefile | 2 + > arch/arm/boot/dts

Re: [PATCH] init/version: include instead of

2017-09-20 Thread Paul Gortmaker
[[PATCH] init/version: include instead of ] On 21/09/2017 (Thu 00:23) Masahiro Yamada wrote: > init/version.c has nothing to do with module, so remove > the . > > Instead, include for EXPORT_SYMBOL_GPL. I checked and there weren't any __init lurking in that file which is the usual other requi

[PATCH v2] [media] staging: atomisp: use clock framework for camera clocks

2017-09-20 Thread Pierre-Louis Bossart
The Atom ISP driver initializes and configures PMC clocks which are already handled by the clock framework. Remove all legacy vlv2_platform_clock stuff and move to the clk API to avoid conflicts, e.g. with audio machine drivers enabling the MCLK for external codecs Fixes: a49d25364dfb ("staging/a

[PATCH v3 19/31] ip: Define usercopy region in IP proto slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The ICMP filters for IPv4 and IPv6 raw sockets need to be copied to/from userspace. In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. example usage trace: net/ipv4/raw.c: r

[PATCH v3 21/31] sctp: Define usercopy region in SCTP proto slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The SCTP socket event notification subscription information need to be copied to/from userspace. In support of usercopy hardening, this patch defines a region in the struct proto slab cache in which userspace copy operations are allowed. Additionally moves the usercopy fields

Re: [PATCH v3 14/31] vxfs: Define usercopy region in vxfs_inode slab cache

2017-09-20 Thread Christoph Hellwig
Hi Kees, I've only got this single email from you, which on it's own doesn't compile and seems to be part of a 31 patch series. So as-is NAK, doesn't work. Please make sure to always send every patch in a series to every developer you want to include.

Re: [PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support

2017-09-20 Thread Rob Herring
On Sat, Sep 16, 2017 at 01:42:19PM +0300, Serge Semin wrote: > This parameters may be varied in accordance with hardware specifics. > So lets add the corresponding settings to the usb251x driver dts > specification. > > Signed-off-by: Serge Semin > --- > Documentation/devicetree/bindings/usb/usb

[PATCH v3 15/31] xfs: Define usercopy region in xfs_inode slab cache

2017-09-20 Thread Kees Cook
From: David Windsor The XFS inline inode data, stored in struct xfs_inode_t field i_df.if_u2.if_inline_data and therefore contained in the xfs_inode slab cache, needs to be copied to/from userspace. cache object allocation: fs/xfs/xfs_icache.c: xfs_inode_alloc(...): ...

[PATCH v3 24/31] fork: Define usercopy region in mm_struct slab caches

2017-09-20 Thread Kees Cook
From: David Windsor In support of usercopy hardening, this patch defines a region in the mm_struct slab caches in which userspace copy operations are allowed. Only the auxv field is copied to userspace. cache object allocation: kernel/fork.c: #define allocate_mm() (kmem_cache_all

[PATCH v3 29/31] arm: Implement thread_struct whitelist for hardened usercopy

2017-09-20 Thread Kees Cook
ARM does not carry FPU state in the thread structure, so it can declare no usercopy whitelist at all. Cc: Russell King Cc: Ingo Molnar Cc: Christian Borntraeger Cc: "Peter Zijlstra (Intel)" Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm/Kconfig

[PATCH v3 23/31] net: Restrict unwhitelisted proto caches to size 0

2017-09-20 Thread Kees Cook
Now that protocols have been annotated (the copy of icsk_ca_ops->name is of an ops field from outside the slab cache): $ git grep 'copy_.*_user.*sk.*->' caif/caif_socket.c: copy_from_user(&cf_sk->conn_req.param.data, ov, ol)) { ipv4/raw.c: if (copy_from_user(&raw_sk(sk)->filter, optval, optlen))

[PATCH v3 17/31] scsi: Define usercopy region in scsi_sense_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor SCSI sense buffers, stored in struct scsi_cmnd.sense and therefore contained in the scsi_sense_cache slab cache, need to be copied to/from userspace. cache object allocation: drivers/scsi/scsi_lib.c: scsi_select_sense_cache(...): return ... ? scsi_sens

[PATCH v3 31/31] lkdtm: Update usercopy tests for whitelisting

2017-09-20 Thread Kees Cook
This updates the USERCOPY_HEAP_FLAG_* tests to USERCOPY_HEAP_WHITELIST_*, since the final form of usercopy whitelisting ended up using an offset/size window instead of the earlier proposed allocation flags. Signed-off-by: Kees Cook --- drivers/misc/lkdtm.h | 4 +- drivers/misc/lkdtm_co

Re: [PATCH v4 02/13] xen/pvcalls: implement frontend disconnect

2017-09-20 Thread Boris Ostrovsky
> > static int pvcalls_front_remove(struct xenbus_device *dev) > { > + struct pvcalls_bedata *bedata; > + struct sock_mapping *map = NULL, *n; > + > + bedata = dev_get_drvdata(&pvcalls_front_dev->dev); > + dev_set_drvdata(&dev->dev, NULL); > + pvcalls_front_dev = NULL; One

[PATCH v3 27/31] x86: Implement thread_struct whitelist for hardened usercopy

2017-09-20 Thread Kees Cook
This whitelists the FPU register state portion of the thread_struct for copying to userspace, instead of the default entire struct. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: Borislav Petkov Cc: Andy Lutomirski Cc: Mathias Krause Signed-off-by: Kees Cook

Re: [PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-20 Thread David Rientjes
On Thu, 21 Sep 2017, Yang Shi wrote: > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 99736e0..173c423 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -43,6 +43,7 @@ > > #include > #include "internal.h" > +#include "slab.h" > > #define CREATE_TRACE_POINTS > #include > @@ -427

Re: [PATCH v2 2/2] mmc: sdhci-msm: Enable delay circuit calibration clocks

2017-09-20 Thread Rob Herring
On Fri, Sep 15, 2017 at 04:35:24PM -0700, Bjorn Andersson wrote: > The delay circuit used to support HS400 is calibrated based on two > additional clocks. When these clocks are not available and > FF_CLK_SW_RST_DIS is not set in CORE_HC_MODE, reset might fail. But on > some platforms this doesn't w

Re: [PATCH] dt-bindings: RTC: merge ds1339 in ds1307 documentation

2017-09-20 Thread Rob Herring
On Fri, Sep 15, 2017 at 03:45:51AM +0200, Alexandre Belloni wrote: > Now that there is documentation for the ds1307 and compatible RTCs, merge > the ds1339 documentation in it. > > Signed-off-by: Alexandre Belloni > --- > .../devicetree/bindings/rtc/dallas,ds1339.txt | 18 > ---

Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support

2017-09-20 Thread Rob Herring
On Sat, Sep 16, 2017 at 02:31:09AM +0300, Serge Semin wrote: > USB2517i hubs are very like USB251xb devices series. They have almost > the same configuration registers space except number of ports, led > configurations and lack of battery settings. All these peculiarities > are reflected in this pa

Re: [PATCH v3 1/2] dt-bindings: spi: Add Spreadtrum ADI controller documentation

2017-09-20 Thread Rob Herring
On Fri, Sep 15, 2017 at 03:29:15PM +0800, Baolin Wang wrote: > This patch adds the binding documentation for Spreadtrum ADI > controller device. > > Signed-off-by: Baolin Wang > --- > Changes since v2: > - Add some documentation to describe how many hardware channels can be > configured. > - R

Re: [PATCH 1/3] RTC: rv3029: fix vendor string

2017-09-20 Thread Rob Herring
On Fri, Sep 15, 2017 at 04:00:02AM +0200, Alexandre Belloni wrote: > The vendor string for Microcrystal is microcrystal. > > Signed-off-by: Alexandre Belloni > --- > Documentation/devicetree/bindings/trivial-devices.txt | 2 +- > drivers/rtc/rtc-rv3029c2.c| 2 ++ > 2

[PATCH v3 04/31] dcache: Define usercopy region in dentry_cache slab cache

2017-09-20 Thread Kees Cook
From: David Windsor When a dentry name is short enough, it can be stored directly in the dentry itself (instead in a separate kmalloc allocation). These dentry short names, stored in struct dentry.d_iname and therefore contained in the dentry_cache slab cache, need to be coped to userspace. cach

[PATCH v3 03/31] usercopy: Mark kmalloc caches as usercopy caches

2017-09-20 Thread Kees Cook
From: David Windsor Mark the kmalloc slab caches as entirely whitelisted. These caches are frequently used to fulfill kernel allocations that contain data to be copied to/from userspace. Internal-only uses are also common, but are scattered in the kernel. For now, mark all the kmalloc caches as w

[PATCH 2/2] powerpc/pseries: fix parent_dn reference leak in add_dt_node()

2017-09-20 Thread Tyrel Datwyler
A reference to the parent device node is held by add_dt_node() for the node to be added. If the call to dlpar_configure_connector() fails add_dt_node() returns ENOENT and that reference is not freed. Add a call to of_node_put(parent_dn) prior to bailing out after a failed dlpar_configure_connector

[PATCH 1/2] powerpc/pseries: fix "OF: ERROR: Bad of_node_put() on /cpus" during DLPAR

2017-09-20 Thread Tyrel Datwyler
Commit 215ee763f8cb ("powerpc: pseries: remove dlpar_attach_node dependency on full path") reworked dlpar_attach_node() to no longer look up the parent node "/cpus", but instead to have the parent node passed by the caller in the function parameter list. As a result dlpar_attach_node() is no longer

Re: [PATCH 2/2] x86/asm: Fix inline asm call constraints for clang

2017-09-20 Thread Josh Poimboeuf
On Wed, Sep 20, 2017 at 08:01:02PM +0200, Dmitry Vyukov wrote: > On Wed, Sep 20, 2017 at 7:46 PM, H. Peter Anvin wrote: > > On 09/20/17 10:38, Dmitry Vyukov wrote: > >> > >> I think we need just the frame itself and RSP pointing below this > >> frame. If we don't have a frame, CALL instruction wil

Re: [PATCH v4 03/13] xen/pvcalls: connect to the backend

2017-09-20 Thread Boris Ostrovsky
On 09/15/2017 07:00 PM, Stefano Stabellini wrote: > Implement the probe function for the pvcalls frontend. Read the > supported versions, max-page-order and function-calls nodes from > xenstore. > > Only one frontend<->backend connection is supported at any given time > for a guest. Store the activ

Re: [PATCH net-next] net: dsa: lan9303: Add adjust_link() method

2017-09-20 Thread David Miller
From: Egil Hjelmeland Date: Tue, 19 Sep 2017 10:09:24 +0200 > Make the driver react to device tree "fixed-link" declaration on CPU port. > > - turn off autonegotiation > - force speed 10 or 100 mb/s > - force duplex mode > > Signed-off-by: Egil Hjelmeland Applied, thank you.

Re: [PATCH v4 2/5] dt-bindings: input: Add document bindings for mtk-pmic-keys

2017-09-20 Thread Dmitry Torokhov
On Wed, Sep 20, 2017 at 03:53:01PM -0500, Rob Herring wrote: > On Sun, Sep 17, 2017 at 04:00:49PM +0800, Chen Zhong wrote: > > This patch adds the device tree binding documentation for the MediaTek > > pmic keys found on PMIC MT6397/MT6323. > > > > Signed-off-by: Chen Zhong > > --- > > .../devic

Re: [PATCH 1/5] usb: usb251xb: Add USB2517/i hub support

2017-09-20 Thread Serge Semin
On Wed, Sep 20, 2017 at 03:52:35PM -0500, Rob Herring wrote: > On Sat, Sep 16, 2017 at 02:31:09AM +0300, Serge Semin wrote: > > USB2517i hubs are very like USB251xb devices series. They have almost > > the same configuration registers space except number of ports, led > > configurations and lack o

<    1   2   3   4   5   6   7   8   9   >