Re: [PATCH v1 1/1] intel_telemetry_debugfs: fix oops found while load/unload module test

2017-05-26 Thread Pavel Machek
Hi! > On Sat, May 27, 2017 at 08:17:39AM -0700, priyalee.kushw...@intel.com wrote: > > From: Priyalee Kushwaha > > > > This fix oops found while testing load/unload test of > > intel_telemetry_debugfs module. Module_init uses register_pm_notifier > > for PM callbacks, but unregister_pm_notifier

[PATCH 2/2] Input: pm8941-pwrkey: Introduce reboot mode support

2017-05-26 Thread Bjorn Andersson
In some Qualcomm platforms the magic for informing LK which mode to reboot into is stored in the PON_SOFT_RB_SPARE register. Register with the reboot mode helpers to expose this to the user. Signed-off-by: Bjorn Andersson --- drivers/input/misc/Kconfig | 1 + drivers/input/misc/pm8941-p

[PATCH 1/2] power: reset: reboot-mode: Make include file global

2017-05-26 Thread Bjorn Andersson
Move the reboot-mode.h include file into include/linux to allow drivers outside drivers/power/reset to implement reboot-mode. Signed-off-by: Bjorn Andersson --- drivers/power/reset/reboot-mode.c| 2 +- drivers/power/reset/syscon-reboot-mode.c | 2 +- {drivers/powe

Re: [PATCH] JFS: do not ignore return code from write_one_page()

2017-05-26 Thread Andrew Morton
On Fri, 26 May 2017 15:48:51 -0500 Dave Kleikamp wrote: > Andrew, > > Do you want to pick this up into akpm-current? I could push it through > the jfs tree, but without the change to write_one_page(), my version of > the patch would need a manual merge. It'd be a simple one, so maybe > that's n

[PATCH v2 1/3] firmware: qcom: scm: Expose secure IO service

2017-05-26 Thread Bjorn Andersson
The secure IO service provides operations for reading and writing secure memory from non-secure mode, expose this API through SCM. Signed-off-by: Bjorn Andersson --- Changes since v1: - Correct scm-call return value handling - Make scm_io_readl() return data by reference drivers/firmware/qcom_

[PATCH v2 2/3] firmware: qcom: scm: Expose download-mode control

2017-05-26 Thread Bjorn Andersson
In order to aid post-mortem debugging the Qualcomm platforms provides a "memory download mode", where the boot loader will provide an interface for custom tools to "download" the content of RAM to a host machine. The mode is triggered by writing a magic value somehwere in RAM, that is read in the

[PATCH v2 3/3] arm64: dts: qcom: Specify dload address for msm8916 and msm8996

2017-05-26 Thread Bjorn Andersson
On msm8916 and msm8996 boards a secure io-write is used to write the magic for selecting "download mode", specify this address in the DeviceTree. Note that qcom_scm.download_mode=1 must be specified on the kernel command line for the kernel to attempt selecting download mode. Signed-off-by: Bjorn

[PATCH 2/2] pinctrl: sprd: Add Spreadtrum pin control driver

2017-05-26 Thread Baolin Wang
This patch adds the pin control driver for Spreadtrum SC9860 platform. Signed-off-by: Baolin Wang --- drivers/pinctrl/Kconfig|1 + drivers/pinctrl/Makefile |1 + drivers/pinctrl/sprd/Kconfig | 17 + drivers/pinctrl/sprd/Makefile

[PATCH 1/2] DT: pinctrl: Add binding documentation for Spreadtrum pin controller

2017-05-26 Thread Baolin Wang
This patch adds the binding documentation for Spreadtrum SC9860 pin controller device. Signed-off-by: Baolin Wang --- .../devicetree/bindings/pinctrl/sprd,pinctrl.txt | 31 .../bindings/pinctrl/sprd,sc9860-pinctrl.txt | 26 2 files changed, 57 in

Re: [PATCH v1 1/1] intel_telemetry_debugfs: fix oops found while load/unload module test

2017-05-26 Thread Darren Hart
On Sat, May 27, 2017 at 08:17:39AM -0700, priyalee.kushw...@intel.com wrote: > From: Priyalee Kushwaha > > This fix oops found while testing load/unload test of > intel_telemetry_debugfs module. Module_init uses register_pm_notifier > for PM callbacks, but unregister_pm_notifier was missing from

Re: [PATCHv4] usb: typec: Add a sysfs node to manage port type

2017-05-26 Thread Greg Kroah-Hartman
On Fri, May 26, 2017 at 01:42:57PM -0700, Badhri Jagan Sridharan wrote: > User space applications in some cases have the need to enforce a > specific port type(DFP/UFP/DRP). This change allows userspace to > attempt setting the desired port type. Low level drivers can > however reject the request i

drivers/hwmon/aspeed-pwm-tacho.c:337:21: error: variable 'aspeed_pwm_tacho_regmap_config' has initializer but incomplete type

2017-05-26 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: c86daad2c25bfd4a33d48b7691afaa96d9c5ab46 commit: 2d7a548a3eff382da5cd743670693b7657327714 drivers: hwmon: Support for ASPEED PWM/Fan tach date: 7 weeks ago config: x86_64-randconfig-n0-05271314 (attached a

[PATCH 16/16] platform/x86: dell-wmi: Convert to the WMI bus infrastructure

2017-05-26 Thread Darren Hart
From: Andy Lutomirski Move some initialization out of _init and into _probe. Update signatures and logic to use the wmi bus and device structures. Signed-off-by: Andy Lutomirski [dvhart: drop deprecated sparse_keymap_free, order declarations, add commit msg] Cc: Andy Lutomirski Cc: Mario Limon

[PATCH 15/16] platform/x86: wmi-mof: New driver to expose embedded WMI MOF metadata

2017-05-26 Thread Darren Hart
From: Andy Lutomirski Quite a few laptops (and maybe servers?) have embedded WMI MOF metadata. I think that Samba has tools to interpret it, but there is currently no interface to get the data in the first place. In most cases, the MOF can be read out of the DSDT, but that is non-compliant and m

[PATCH 01/16] platform/x86: wmi: Drop "Mapper (un)loaded" messages

2017-05-26 Thread Darren Hart
From: Andy Lutomirski WMI is just a driver. There is no need to announce when it is loaded. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael Wysocki Cc: linux-kernel@vger.kernel.org Cc: platform-driver-...@vger.kernel.org Cc: linux-a...@vger

[PATCH 04/16] platform/x86: wmi: Track wmi devices per ACPI device

2017-05-26 Thread Darren Hart
From: Andy Lutomirski Currently we free all devices when we detach from any ACPI node. Instead, keep track of which node WMI devices are attached to and free them only as needed. While we are at it, match up notifications with the device they came from correctly. This will make our behavior more

[PATCH 05/16] platform/x86: wmi: Turn WMI into a bus driver

2017-05-26 Thread Darren Hart
From: Andy Lutomirski WMI is logically a bus: the WMI driver binds to an ACPI node (or more than one), and each instance of the WMI driver enumerates its children and hopes that drivers will attach to the children that are useful. This patch gives WMI a driver model bus type and the ability to m

[PATCH 06/16] platform/x86: wmi: Fix error handling when creating devices

2017-05-26 Thread Darren Hart
From: Andy Lutomirski We have two memory leaks. If guid_already_parsed returned true, we leak the wmi_block. If wmi_create_device failed, we leak the device. Simplify the logic and fix both of them. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc:

[PATCH 09/16] platform/x86: wmi: Instantiate all devices before adding them

2017-05-26 Thread Darren Hart
From: Andy Lutomirski At some point, we will want sub-drivers to get references to other devices on the same WMI bus. This change is needed to avoid races. This ends up simplifying the setup code and fixing some leaks, too. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limoncie

[PATCH 10/16] platform/x86: wmi: Incorporate acpi_install_notify_handler

2017-05-26 Thread Darren Hart
From: Andy Lutomirski As a platform driver, acpi_driver.notify will not be available, so use acpi_install_notify_handler as we will be converting to a platform driver. This gives event drivers a simple way to handle events. It also seems closer to what the Windows docs suggest that Windows does:

[PATCH 00/16] Convert WMI to a proper bus

2017-05-26 Thread Darren Hart
From: "Darren Hart (VMware)" This series is based on the original work of Andy Lutomirski [1]. I have made minor edits, and in one instance, squashed two patches in which the latter undid the former. This series converts WMI [2] into a proper bus, adds some useful information via sysfs, and exp

[PATCH 08/16] platform/x86: wmi: Probe data objects for read and write capabilities

2017-05-26 Thread Darren Hart
From: Andy Lutomirski The Dell XPS 13 9350 has one RW data object, one RO data object, and one totally inaccessible data object. Check for the existence of the accessor methods and report in sysfs. The docs also permit WQxx getters for single-instance objects to take no parameters. Probe for tha

[PATCH 11/16] platform/x86: wmi: Add a new interface to read block data

2017-05-26 Thread Darren Hart
From: Andy Lutomirski wmi_query_block is unnecessarily indirect. Add a straightforward method for wmi bus drivers to use to read block data. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael Wysocki Cc: linux-kernel@vger.kernel.org Cc: platfo

[PATCH 12/16] platform/x86: wmi: Bind the platform device, not the ACPI node

2017-05-26 Thread Darren Hart
From: Andy Lutomirski We already have the PNP glue to instantiate platform devices for the ACPI devices that WMI drives. WMI should therefore attach to the platform device, not the ACPI node. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael W

[PATCH 13/16] platform/x86: wmi: Add an interface for subdrivers to access sibling devices

2017-05-26 Thread Darren Hart
From: Andy Lutomirski Some subdrivers need to access sibling devices. This gives them a clean way to do so. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael Wysocki Cc: linux-kernel@vger.kernel.org Cc: platform-driver-...@vger.kernel.org Cc:

[PATCH 14/16] platform/x86: wmi: Require query for data blocks, rename writable to setable

2017-05-26 Thread Darren Hart
From: "Darren Hart (VMware)" The Microsoft WMI documentation requires all data blocks to implement the Query Control Method (WQxx). If we encounter a data block not implementing this control method, issue a warning, and ignore the data block. Remove the "readable" attribute as all data blocks mus

[PATCH 03/16] platform/x86: wmi: Clean up acpi_wmi_add

2017-05-26 Thread Darren Hart
From: Andy Lutomirski Rearrange acpi_wmi_add to use Linux's error handling conventions. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael Wysocki Cc: linux-kernel@vger.kernel.org Cc: platform-driver-...@vger.kernel.org Cc: linux-a...@vger.ker

[PATCH 07/16] platform/x86: wmi: Split devices into types and add basic sysfs attributes

2017-05-26 Thread Darren Hart
From: Andy Lutomirski Divide the "data", "method" and "event" types. All devices get "instance_count" and "expensive" attributes, data and method devices get "object_id" attributes, and event devices get "notify_id" attributes. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limon

[PATCH 02/16] platform/x86: wmi: Pass the acpi_device through to parse_wdg

2017-05-26 Thread Darren Hart
From: Andy Lutomirski We will need the device to convert to a bus architecture and bind WMI to the platform device. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael Wysocki Cc: linux-kernel@vger.kernel.org Cc: platform-driver-...@vger.kernel

[PATCH] platform/x86: dell-wmi: Add a comment explaining the 0xb2 magic number

2017-05-26 Thread Darren Hart
From: Andy Lutomirski The hotkey table is 0xb2, add a comment for clarity. Suggested-by: Darren Hart Signed-off-by: Andy Lutomirski Cc: Matthew Garrett Cc: "Pali Rohár" Cc: Andy Shevchenko Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/dell-wmi.c | 1 + 1 file changed, 1 ins

[PATCH] platform/x86: dell-rbtn: Improve explanation about DELLABC6

2017-05-26 Thread Darren Hart
From: Andy Lutomirski According to Mario at Dell, the DELLABC6 device should not be used on a Linux system. It also conflicts with Intel-HID and its interactions with Network Manager. Document that we are aware of the device, but that we are intentionally ignoring it. Signed-off-by: Andy Lutomir

[PATCH] platform/x86: dell-wmi: Add a better description for "stealth mode"

2017-05-26 Thread Darren Hart
From: Andy Lutomirski This is based on Mario's explanation and observation of my laptop. Suggested-by: "Pali Rohár" Signed-off-by: Andy Lutomirski Cc: Mario Limonciello Cc: Matthew Garrett Cc: Andy Shevchenko Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/dell-wmi.c | 7

[PATCH] staging/lustre/lov: remove set_fs() call from lov_getstripe()

2017-05-26 Thread Oleg Drokin
lov_getstripe() calls set_fs(KERNEL_DS) so that it can handle a struct lov_user_md pointer from user- or kernel-space. This changes the behavior of copy_from_user() on SPARC and may result in a misaligned access exception which in turn oopses the kernel. In fact the relevant argument to lov_getst

Re: [PATCH] genirq: Check irq disabled & masked states in irq_shutdown

2017-05-26 Thread jeffy
Hi Thomas, On 05/26/2017 09:20 PM, Thomas Gleixner wrote: On Fri, 26 May 2017, Jeffy Chen wrote: If irq is already disabled and masked, we would hit a unbalanced irq shutdown/disable/mask when freeing it. Errr? What exactly is unbalanced? None of the called functions has any counter or whate

[PATCH v2] genirq: Check irq disabled & masked states in irq_shutdown

2017-05-26 Thread Jeffy Chen
If a irq is already disabled & masked, free_irq may cause a unbalanced irq shutdown/disable/mask, for example: devm_request_irq->irq_startup->irq_enable disable_irq <-- disabled and masked devm_free_irq->irq_shutdown <-- try to disable it aga

[PATCH] dsa: mv88e6xxx: fix returnvar.cocci warnings

2017-05-26 Thread Julia Lawall
Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci CC: Andrew Lunn Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- It's a minor issue, but since there is no error, the code is a bit misleading. tree: https://git.kernel.org

Re: [PATCH 5/5] Add a sysrq option to exit secure boot mode

2017-05-26 Thread joeyli
Hi, On Wed, May 24, 2017 at 03:46:03PM +0100, David Howells wrote: > From: Kyle McMartin > > Make sysrq+x exit secure boot mode on x86_64, thereby allowing the running > kernel image to be modified. This lifts the lockdown. > > Signed-off-by: Kyle McMartin > Signed-off-by: David Howells > cc

Re: [RFC][PATCH] time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD

2017-05-26 Thread John Stultz
On Thu, May 25, 2017 at 5:03 AM, Paul Mackerras wrote: > On Mon, May 22, 2017 at 12:06:04PM -0700, John Stultz wrote: >> >> Basically long ago, timekeeping was handled (roughly) like: >> >> clock_gettime(): >> now = tk->clock->read() >> offset_ns = ((now - tk->cycle_last) * tk->clock->mult

Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized

2017-05-26 Thread Joe Perches
On Fri, 2017-05-26 at 20:20 -0700, Richard Narron wrote: > Under the /block/partitions directory the c programs have about 13 uses > of memcmp() and 6 uses of strcmp(). Nearly all of the memcmp uses with strings kernel wide use the equivalent of memcmp(foo, "bar", strlen("bar"));

Re: [PATCH v7 04/26] x86/mpx: Do not use SIB.index if its value is 100b and ModRM.mod is not 11b

2017-05-26 Thread Ricardo Neri
On Wed, 2017-05-24 at 15:37 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:02AM -0700, Ricardo Neri wrote: > > Section 2.2.1.2 of the Intel 64 and IA-32 Architectures Software > > Developer's Manual volume 2A states that when ModRM.mod !=11b and > > ModRM.rm = 100b indexed register-i

Re: [PATCH v7 00/26] x86: Enable User-Mode Instruction Prevention

2017-05-26 Thread Neri, Ricardo
Hi again Ingo, Thomas, On Wed, 2017-05-17 at 11:42 -0700, Ricardo Neri wrote: > Hi Ingo, Thomas, > > On Fri, 2017-05-05 at 11:16 -0700, Ricardo Neri wrote: > > This is v7 of this series. The six previous submissions can be found > > here [1], here [2], here[3], here[4], here[5] and here[6]. This >

Re: [RFC 2/3] of: reserved_mem: Accessor for acquiring reserved_mem

2017-05-26 Thread Andy Gross
On Sat, Apr 22, 2017 at 10:35:18AM -0700, Bjorn Andersson wrote: > In some cases drivers referencing a reserved-memory region might want to > remap the entire region, but when defining the reserved-memory by "size" > the client driver has no means to know the associated base address of > the reserv

Re: [PATCH v7 02/26] x86/mm: Relocate page fault error codes to traps.h

2017-05-26 Thread Ricardo Neri
On Sun, 2017-05-21 at 16:23 +0200, Borislav Petkov wrote: > On Fri, May 05, 2017 at 11:17:00AM -0700, Ricardo Neri wrote: > > Up to this point, only fault.c used the definitions of the page fault error > > codes. Thus, it made sense to keep them within such file. Other portions of > > code might be

[RFC][PATCH 3/4] arm64: vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW

2017-05-26 Thread John Stultz
From: Will Deacon Commit 45a7905fc48f ("arm64: vdso: defer shifting of nanosecond component of timespec") fixed sub-ns inaccuracies in our vDSO clock_gettime implementation by deferring the right-shift of the nanoseconds components until after the timespec addition, which operates on left-shifted

[RFC][PATCH 2/4] time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accounting

2017-05-26 Thread John Stultz
Due to how the MONOTONIC_RAW accumulation logic was handled, there is the potential for a 1ns discontinuity when we do accumulations. This small discontinuity has for the most part gone un-noticed, but since ARM64 enabled CLOCK_MONOTONIC_RAW in their vDSO clock_gettime implementation, we've seen fa

[RFC][PATCH 0/4] Fixes for two recently found timekeeping bugs

2017-05-26 Thread John Stultz
As part of the Linaro Linux Kernel Functional Test (LKFT) effort, test failures from kselftest/timer's inconsistency-check were reported connected to CLOCK_MONOTONIC_RAW, on the HiKey platform. Digging in I found that an old issue with how sub-ns accounting is handled with the RAW time which was f

[RFC][PATCH 1/4] time: Fix clock->read(clock) race around clocksource changes

2017-05-26 Thread John Stultz
In some testing on arm64 platforms, I was seeing null ptr crashes in the kselftest/timers clocksource-switch test. This was happening in a read function like: u64 clocksource_mmio_readl_down(struct clocksource *c) { return ~(u64)readl_relaxed(to_mmio_clksrc(c)->reg) & c->mask; } Where the cal

[RFC][PATCH 4/4] time: Clean up CLOCK_MONOTONIC_RAW time handling

2017-05-26 Thread John Stultz
Now that we fixed the sub-ns handling for CLOCK_MONOTONIC_RAW, remove the duplicitive tk->raw_time.tv_nsec, which can be stored in tk->tkr_raw.xtime_nsec (similarly to how its handled for monotonic time). Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit B

[PATCH] usb: dwc2: resume root hub to handle disconnect of device

2017-05-26 Thread William Wu
When handle disconnect of the hcd during bus_suspend, hcd needs to resume its root hub, otherwise the root hub will not disconnect the existing devices under its port. This issue always happens when connecting with usb devices which support auto-suspend function (e.g. usb hub). Signed-off-by: Wil

Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized

2017-05-26 Thread Richard Narron
On Fri, 26 May 2017, Joe Perches wrote: (please keep replies on the list) On Fri, 2017-05-26 at 18:33 -0700, Richard Narron wrote: On Fri, 26 May 2017, Joe Perches wrote: On Fri, 2017-05-26 at 16:30 -0700, Richard Narron wrote: On Fri, 26 May 2017, Joe Perches wrote: On Fri, 2017-05-26 at 0

Re: [PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-26 Thread Mike Christie
Thanks for the patch. On 05/26/2017 12:32 AM, Nicholas A. Bellinger wrote: > > - state = iscsi_target_sk_state_check(sk); > - write_unlock_bh(&sk->sk_callback_lock); > - > - pr_debug("iscsi_target_sk_state_change: state: %d\n", state); > + orig_state_change(sk); > > -

Re: [PATCH 2/6] mfd: hi6421-pmic: move hi6421_regmap_config definition to header file

2017-05-26 Thread Guodong Xu
On Fri, May 26, 2017 at 4:33 PM, Arnd Bergmann wrote: > On Fri, May 26, 2017 at 8:35 AM, Guodong Xu wrote: >> Move hi6421_regmap_config definition from c code to common header: >> - include/linux/mfd/hi6421-pmic.h >> >> This is to improve code re-use for upcoming hi6421 series of MFD driver. >>

[PATCH 1/5] ftrace: Fix memory leak in ftrace_graph_release()

2017-05-26 Thread Steven Rostedt
From: Luis Henriques ftrace_hash is being kfree'ed in ftrace_graph_release(), however the ->buckets field is not. This results in a memory leak that is easily captured by kmemleak: unreferenced object 0x880038afe000 (size 8192): comm "trace-cmd", pid 238, jiffies 4294916898 (age 9.736s)

[PATCH 4/5] x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range()

2017-05-26 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" With function tracing starting in early bootup and having its trampoline pages being read only, a bug triggered with the following: kernel BUG at arch/x86/mm/pageattr.c:189! invalid opcode: [#1] SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4

[PATCH 0/5] [GIT PULL] ftrace/kprobes/x86: Memory Fix Edition

2017-05-26 Thread Steven Rostedt
Linus, There's been a few memory issues found with ftrace. One was simply a memory leak where not all was being freed that should have been in releasing a file pointer on set_graph_function. Then Thomas found that the ftrace trampolines were marked for read/write as well as execute. To shrink t

[PATCH 3/5] selftests/ftrace: Add a testcase for many kprobe events

2017-05-26 Thread Steven Rostedt
From: Masami Hiramatsu Add a testcase to test kprobes via ftrace interface with many concurrent kprobe events. This tries to add many kprobe events (up to 256) on kernel functions. To avoid making ftrace-based kprobes (kprobes on fentry), it skips first N bytes (on x86 N=5, on ppc or arm N=4) of

[PATCH 5/5] x86/ftrace: Make sure that ftrace trampolines are not RWX

2017-05-26 Thread Steven Rostedt
From: Thomas Gleixner ftrace use module_alloc() to allocate trampoline pages. The mapping of module_alloc() is RWX, which makes sense as the memory is written to right after allocation. But nothing makes these pages RO after writing to them. Add proper set_memory_rw/ro() calls to protect the tra

[PATCH 2/5] kprobes/x86: Fix to set RWX bits correctly before releasing trampoline

2017-05-26 Thread Steven Rostedt
From: Masami Hiramatsu Fix kprobes to set(recover) RWX bits correctly on trampoline buffer before releasing it. Releasing readonly page to module_memfree() crash the kernel. Without this fix, if kprobes user register a bunch of kprobes in function body (since kprobes on function entry usually us

Re: [PATCH v4] usb: typec: Add a sysfs node to manage port type

2017-05-26 Thread Guenter Roeck
On 05/26/2017 04:07 PM, Badhri Jagan Sridharan wrote: User space applications in some cases have the need to enforce a specific port type(DFP/UFP/DRP). This change allows userspace to attempt setting the desired port type. Low level drivers can however reject the request if the specific port type

Re: [4.12 REGRESSION] pinctrl: rockchip: sleeping function called from atomic context

2017-05-26 Thread Brian Norris
Any thoughts? Revert the offending patch? I can spend a little more time next week trying to debug what's actually going on if needed. Brian On Wed, May 17, 2017 at 03:56:34PM -0700, Brian Norris wrote: > Hi, > > Looks like we've added a mutex in the ->bus_lock() callback for > Rockchip's pinctr

Re: [PATCH v5 28/32] x86/mm, kexec: Allow kexec to be used with SME

2017-05-26 Thread Dave Young
On 05/26/17 at 12:17pm, Xunlei Pang wrote: > On 04/19/2017 at 05:21 AM, Tom Lendacky wrote: > > Provide support so that kexec can be used to boot a kernel when SME is > > enabled. > > > > Support is needed to allocate pages for kexec without encryption. This > > is needed in order to be able to re

Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized

2017-05-26 Thread Joe Perches
(please keep replies on the list) On Fri, 2017-05-26 at 18:33 -0700, Richard Narron wrote: > On Fri, 26 May 2017, Joe Perches wrote: > > On Fri, 2017-05-26 at 16:30 -0700, Richard Narron wrote: > > > On Fri, 26 May 2017, Joe Perches wrote: > > > > On Fri, 2017-05-26 at 03:48 -0700, Richard Narron

Re: [PATCH] drivers/watchdog/Kconfig: Update CONFIG_WATCHDOG_RTAS dependencies

2017-05-26 Thread Guenter Roeck
On 05/26/2017 06:22 PM, Murilo Opsfelder Araujo wrote: drivers/watchdog/wdrtas.c uses symbols defined in arch/powerpc/kernel/rtas.c, which are exported iff CONFIG_PPC_RTAS is selected. Building wdrtas.c without setting CONFIG_PPC_RTAS throws the following errors: ERROR: ".rtas_token" [drive

[PATCH v2 01/20] NFS: Avoid cross-structure casting

2017-05-26 Thread Kees Cook
When the call to nfs_devname() fails, the error path attempts to retain the error via the mnt variable, but this requires a cast across very different types (char * to struct vfsmount *), which the upcoming structure layout randomization plugin flags as being potentially dangerous in the face of ra

[PATCH v2 03/20] compiler: Add __designated_init annotation

2017-05-26 Thread Kees Cook
This allows structure annotations for requiring designated initialization in GCC 5.1.0 and later: https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html The structure randomization layout plugin will be using this to help identify structures that need this form of initialization. Signed-off-by:

[PATCH v2 00/20] Introduce struct layout randomization plugin

2017-05-26 Thread Kees Cook
This series brings grsecurity's structure layout randomization plugin to upstream. The plugin randomizes the layout of selected structures at compile time, as a probabilistic defense against attacks that need to know the layout of structures within the kernel. This is most useful for "in-house" ker

[PATCH v2 04/20] gcc-plugins: Add the randstruct plugin

2017-05-26 Thread Kees Cook
This feature is ported from grsecurity. The implementation is almost entirely identical to the original code written by the PaX Team and Brad Spengler. The new plugin randomizes the layout of selected structures at compile time. This is a probabilistic defense against attacks that need to know the

[PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads cast

2017-05-26 Thread Kees Cook
The LSM initialization routines walk security_hook_heads as an array of struct list_head instead of via names to avoid a ton of needless source. Whitelist this to avoid the false positive warning from the plugin: security/security.c: In function ‘security_init’: security/security.c:59:20: note: fo

[PATCH v2 06/20] randstruct: Whitelist UNIXCB cast

2017-05-26 Thread Kees Cook
This is another false positive in bad cast detection: net/unix/af_unix.c: In function ‘unix_skb_scm_eq’: net/unix/af_unix.c:1621:31: note: found mismatched rhs struct pointer types: ‘struct unix_skb_parms’ and ‘char’ const struct unix_skb_parms *u = &UNIXCB(skb);

[PATCH v2 07/20] randstruct: Whitelist big_key path struct overloading

2017-05-26 Thread Kees Cook
The big_key payload structure intentionally stores a struct path in two void pointers to avoid header soup. Whitelist this case: security/keys/big_key.c: In function ‘big_key_read’: security/keys/big_key.c:293:16: note: found mismatched rhs struct pointer types: ‘struct path’ and ‘void *’ str

[PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading

2017-05-26 Thread Kees Cook
The NIU ethernet driver intentionally stores a page struct pointer on top of the "mapping" field. Whitelist this case: drivers/net/ethernet/sun/niu.c: In function ‘niu_rx_pkt_ignore’: drivers/net/ethernet/sun/niu.c:3402:10: note: found mismatched ssa struct pointer types: ‘struct page’ and ‘struc

[PATCH v2 09/20] randstruct: Mark various structs for randomization

2017-05-26 Thread Kees Cook
This marks many critical kernel structures for randomization. These are structures that have been targeted in the past in security exploits, or contain functions pointers, pointers to function pointer tables, lists, workqueues, ref-counters, credentials, permissions, or are otherwise sensitive. Thi

[PATCH v2 10/20] randstruct: opt-out externally exposed function pointer structs

2017-05-26 Thread Kees Cook
Some function pointer structures are used externally to the kernel, like the paravirt structures. These should never be randomized, so mark them as such. This set was extracted from grsecurity. Signed-off-by: Kees Cook --- arch/arm/include/asm/cacheflush.h | 2 +- arch/x86/include/asm/parav

[PATCH v2 12/20] sgi-xp: Use designated initializers

2017-05-26 Thread Kees Cook
Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity. To avoid casting, this implements dummy functions with

[PATCH v2 11/20] randstruct: Disable randomization of ACPICA structs

2017-05-26 Thread Kees Cook
Since the ACPICA source is maintained externally to the kernel, we can neither switch it to designated initializers nor mark it __no_randomize_layout. Until ACPICA-upstream changes[1] land to handle the designated initialization, explicitly skip it in the plugin. [1] https://github.com/acpica/acpi

Re: [PATCH v3 1/2] remoteproc: Introduce rproc_{start,stop}() functions

2017-05-26 Thread Bjorn Andersson
On Fri 26 May 16:51 PDT 2017, Sarangdhar Joshi wrote: > In the context of recovering from crash, rproc_trigger_recovery() does > rproc_shutdown() followed by rproc_boot(). The remoteproc resources are > cleaned up in rproc_shutdown() and immediately reallocated in > rproc_boot() which is an unnece

[PATCH v2 14/20] drm/amd/powerplay: Use designated initializers

2017-05-26 Thread Kees Cook
The randstruct plugin requires designated initializers for structures that are entirely function pointers. Cc: Christian König Cc: Eric Huang Cc: Alex Deucher Signed-off-by: Kees Cook --- .../gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 28 ++ 1 file changed, 18 insert

[PATCH v2 15/20] mtk-vcodec: Use designated initializers

2017-05-26 Thread Kees Cook
The randstruct plugin requires designated initializers for structures that are entirely function pointers. Cc: Wu-Cheng Li Cc: PC Chen Cc: Tiffany Lin Cc: Hans Verkuil Cc: Mauro Carvalho Chehab Signed-off-by: Kees Cook --- drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c | 8

[PATCH v2 13/20] drm/amdgpu: Use designated initializers

2017-05-26 Thread Kees Cook
The randstruct plugin requires structures that are entirely function pointers be initialized using designated initializers. Cc: Alex Deucher Cc: Christian König Signed-off-by: Kees Cook --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 10 +- 1 file changed, 5 insertions(+), 5 deletio

[PATCH v2 16/20] ntfs: Use ERR_CAST() to avoid cross-structure cast

2017-05-26 Thread Kees Cook
When trying to propagate an error result, the error return path attempts to retain the error, but does this with an open cast across very different types, which the upcoming structure layout randomization plugin flags as being potentially dangerous in the face of randomization. This is a false posi

[PATCH v2 17/20] ocfs2: Use ERR_CAST() to avoid cross-structure cast

2017-05-26 Thread Kees Cook
When trying to propagate an error result, the error return path attempts to retain the error, but does this with an open cast across very different types, which the upcoming structure layout randomization plugin flags as being potentially dangerous in the face of randomization. This is a false posi

[PATCH v2 19/20] [RFC] task_struct: Allow randomized layout

2017-05-26 Thread Kees Cook
This marks most of the layout of task_struct as randomizable, but leaves thread_info and scheduler state untouched at the start, and thread_struct untouched at the end. Other parts of the kernel use unnamed structures, but the 0-day builder using gcc-4.4 blows up on static initializers. Officially

[PATCH v2 20/20] ACPICA: Use designated initializers

2017-05-26 Thread Kees Cook
The struct layout randomization plugin detects and randomizes any structs that contain only function pointers. Once layout is randomized, all initialization must be designated or the compiler will misalign the assignments. This switches all the ACPICA function pointer struct to use designated initi

Re: [PATCH] misc: ad525x_dpot_spi: Add device tree support

2017-05-26 Thread Arnd Bergmann
On Fri, May 26, 2017 at 8:17 PM, Roshni Shah wrote: > @@ -81,14 +82,26 @@ static const struct ad_dpot_bus_ops bops = { > +static const struct of_device_id ad_dpot_spi_of_match[] = { > + { > + .compatible = "ad,ad5160", > + .name = "ad5160", > +

[PATCH 0/4] Add DT support for davinci remoteproc driver

2017-05-26 Thread Suman Anna
Hi, The following series adds the device tree support to the Davinci remoteproc driver. The TI Davinci family has boards booting both in legacy mode and DT mode, so both modes are still supported by this driver. Patches are baselined on 4.12-rc1 + the "Davinci remoteproc cleanups/fixes" series [1]

[PATCH 4/4] remoteproc/davinci: Add device tree support for OMAP-L138 DSP

2017-05-26 Thread Suman Anna
The Davinci remoteproc driver currently supports the DSP remoteproc device created in legacy-style on OMAP-L13x SoCs. The driver has been enhanced to support the DSP remoteproc device created through Device Tree now. The current DT support handles the C674x DSP processor subsystem on OMAP-L138 SoCs

[PATCH 3/4] Documentation: dt: Add bindings for Davinci DSP processors

2017-05-26 Thread Suman Anna
Add the device tree bindings document for the DSP processor subsystem devices on TI Davinci DA8xx/OMAP-L13x SoCs. Signed-off-by: Suman Anna --- .../bindings/remoteproc/ti,davinci-rproc.txt | 92 ++ 1 file changed, 92 insertions(+) create mode 100644 Documentation/devi

[PATCH 2/4] remoteproc/davinci: add support to parse internal memories

2017-05-26 Thread Suman Anna
The DSP subsystem on OMAP-L13x SoCs has various internal RAM memories that can accessed from the ARM side. These memories can be configured to be used as either RAM or Cache. The Davinci remoteproc driver has been enhanced to parse and store the kernel mappings for these internal RAM memories. The

Re: [PATCH v9 1/7] LIB: Introduce a generic PIO mapping method

2017-05-26 Thread Bjorn Helgaas
On Thu, May 25, 2017 at 12:37:22PM +0100, Gabriele Paoloni wrote: > From: "zhichang.yuan" > > In 'commit 41f8bba7f555 ("of/pci: Add pci_register_io_range() and > pci_pio_to_address()")' a new I/O space management was supported. With that > driver, the I/O ranges configured for PCI/PCIE hosts on s

[stable backport PATCH v2] usercopy: Adjust tests to deal with SMAP/PAN

2017-05-26 Thread Arnd Bergmann
From: Kees Cook Commit f5f893c57e37ca730808cb2eee3820abd05e7507 upstream. Under SMAP/PAN/etc, we cannot write directly to userspace memory, so this rearranges the test bytes to get written through copy_to_user(). Additionally drops the bad copy_from_user() test that would trigger a memcpy() agai

Re: [PATCH v2] firmware: fix sending -ERESTARTSYS due to signal on fallback

2017-05-26 Thread Fuzzey, Martin
On 26 May 2017 at 21:40, Luis R. Rodriguez wrote: > On Thu, May 25, 2017 at 10:28:38AM +0200, Fuzzey, Martin wrote: >> On 25 May 2017 at 06:13, Andy Lutomirski wrote: >> >>> >> >>> Can you give a simple example of what's going on and why it matters? >> >>> >> >> >> Here is the use case in which I

Re: [PATCH v2 19/20] [RFC] task_struct: Allow randomized layout

2017-05-26 Thread Linus Torvalds
On Fri, May 26, 2017 at 1:17 PM, Kees Cook wrote: > This marks most of the layout of task_struct as randomizable, but leaves > thread_info and scheduler state untouched at the start, and thread_struct > untouched at the end. I think you want to abstract this out somehow, because this is both ugly

Re: [PATCH v2 5/5] HID: intel_ish-hid: enable compile testing

2017-05-26 Thread Srinivas Pandruvada
On Thu, 2017-05-18 at 22:21 +0200, Arnd Bergmann wrote: > To increase build coverage, drivers should generally be allowed to > build on other architectures even if they are only used on one > of them. > > Signed-off-by: Arnd Bergmann  Acked-by: Srinivas Pandruvada > --- >  drivers/hid/intel-ish

Re: arm64 test_user_copy crash on copy_from_user(uptr, kptr, size)

2017-05-26 Thread Arnd Bergmann
On Fri, May 26, 2017 at 5:40 PM, Mark Rutland wrote: > On Fri, May 26, 2017 at 05:24:47PM +0200, Arnd Bergmann wrote: > AFAICT, that test was disabled in commit: > > f5f893c57e37ca73 ("usercopy: Adjust tests to deal with SMAP/PAN") > > ... or have I misunderstood? I think you are right, my mis

Re: [PATCH v2] firmware: fix sending -ERESTARTSYS due to signal on fallback

2017-05-26 Thread Luis R. Rodriguez
On Fri, May 26, 2017 at 10:23:03PM +0200, Fuzzey, Martin wrote: > On 26 May 2017 at 21:40, Luis R. Rodriguez wrote: > > > > No no, this is not how the fallback system works. > > The sysfs file I was talking about is *not* the sysfs file involved in > the firmware loading mechanism > but a *custom

Re: [PATCHv3] usb: typec: Add a sysfs node to manage port type

2017-05-26 Thread Badhri Jagan Sridharan
On Fri, May 26, 2017 at 11:31 AM, Greg Kroah-Hartman wrote: > On Fri, May 26, 2017 at 10:45:59AM -0700, Badhri Jagan Sridharan wrote: >> User space applications in some cases have the need to enforce a >> specific port type(DFP/UFP/DRP). This change allows userspace to >> attempt setting the desir

Re: [PATCH v2 4/5] HID: intel_ish-hid: fix format string for size_t

2017-05-26 Thread Srinivas Pandruvada
On Thu, 2017-05-18 at 22:21 +0200, Arnd Bergmann wrote: > When building for 32-bit architectures, we get a harmless warning: > > intel-ish-hid/ishtp-hid-client.c: In function 'process_recv': > intel-ish-hid/ishtp-hid-client.c:139:7: error: format '%lu' expects > argument of type 'long unsigned int

Re: [PATCHv2 0/3] Enable no_cache flag to driver_data

2017-05-26 Thread Li, Yi
hi Luis On 5/25/2017 5:43 PM, Luis R. Rodriguez wrote: On Thu, May 25, 2017 at 3:30 PM, Li, Yi wrote: This patch is for "disabling the cache" for streaming and iwlwifi case, adding the test to verify the cache function should be a separate patch, right? I can look more into the cache part. H

[PATCH] JFS: do not ignore return code from write_one_page()

2017-05-26 Thread Dave Kleikamp
There are a couple places where jfs calls write_one_page() where clean recovery is not possible. In these cases, the file system should be marked dirty. To do this, it is now necessary to store the superblock in the metapage structure. Signed-off-by: Dave Kleikamp --- fs/jfs/jfs_metapage.c | 7 +

Re: [PATCH v2] firmware: fix sending -ERESTARTSYS due to signal on fallback

2017-05-26 Thread Dmitry Torokhov
On Fri, May 26, 2017 at 12:46 PM, Luis R. Rodriguez wrote: > On Fri, May 26, 2017 at 06:09:29AM -0500, Eric W. Biederman wrote: >> "Fuzzey, Martin" writes: >> Maybe SIGCHLD shouldn't interrupt firmware loading? >> > >> > I don't think there's a way of doing that without disabling all >> > si

  1   2   3   4   5   6   7   >