of: Fix crash in of_build_overlay_info#164
of: Fix crash in of_build_overlay_info#164jharvell wants to merge 121 commits intobeagleboard:4.14from
Conversation
|
In case someone is interested in reproducing the issue, I saw the crash with several overlays I tried to load. One of these is univ-bbgw-00A0.dtbo. I built this from sources below: Before the fix in this PR, echoing univ-bbgw to /sys/devices/platform/bone_capemgr/slots resulted i a SEGV with the kernel debug info in dmesg pointing to ovinfo->info being NULL. After the fix, I see the following when trying to apply the same overlay: |
|
I did a little more analysis. This crash will occur for any device blob that has a node /symbols. See the code below. An entry in ovinfo is added for each child node of tree in the first loop. ovinfo[cnt].info is populated in that case. Then there is a search for child node with name symbols. If found, it is added as the last element ovinfo. But for this case, ovinf[cnt].info is not set. And this is what the code crashes on. So if the compiler puts a /symbols node in the tree, then the kernel will crash tyring to apply it. I made a simple overlay with one node, and compiled it. When I do strings on that blob, there is no "symbols" string in the blob and that does not trigger this bug. Several other blobs I have tried from bb.org-overlays blobs have symbols in them and trigger this crash. |
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
This reverts commit 00f0ea7. Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
… on bootup Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
#https://lkml.org/lkml/2016/6/14/967 Pwm channels don't send uevents when exported, this change adds the channels to a pwm class and set their device type to pwm_channel so uevents are sent. To do this properly, the device names need to change to uniquely identify a channel. This change is from pwmN to pwm-(chip->base):N Signed-off-by: David Hsu <davidhsu@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
This reverts commit 956b200. Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
ADC channel 0 photodiode detects both infrared + visible light, but ADC channel 1 just detects infrared. However, the latter is a bit more sensitive in that range so complete darkness or low light causes a error condition in which the chan0 - chan1 is negative that results in a -EAGAIN. This patch changes the resulting lux1_input sysfs attribute message from "Resource temporarily unavailable" to a user-grokable lux value of 0. Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
…oves to v4.14.x base Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
When disabling an omap device (not when removing the driver), the device is removed but the hwmod's linger. Fix the resource leak and the crash when calling omap_device_idle() after the device's omap data have been removed. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Having an omap serial device without a serial aliases doesn't work. For now fallback to using the hwmod instance. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
When using DT the driver devm_kalloc's platform data and assigns them directly to the pdev->dev.platform variable. This is wrong since device de-registration expects the data to be kmalloc'ed instead, resulting in a crash. Fix by copying the platform data to a kmalloc buffer. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
We are going to need the overlays to appear on sysfs with runtime global properties (like master enable) so turn them into kobjects. They have to be in sysfs so that people can have information about the overlays applied in the system, i.e. where their targets are and whether removal is possible. In a future more attributes can be added in a backwards compatible manner. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
A throw once master enable switch to protect against any further overlay applications if the administrator desires so. A kernel command line option is provided as well. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation ABI entry for overlays sysfs entries. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Document the of_overlay_disable parameter. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* A per overlay can_remove sysfs attribute that reports whether the overlay can be removed or not due to another overlapping overlay. * A target sysfs attribute listing the target of each fragment, in a group named after the name of the fragment. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation for the per-overlay attributes. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fee3e78 to
e05b0a8
Compare
047c0e5 to
476f427
Compare
c63a75b to
83521be
Compare
071e37e to
648a42b
Compare
54d4b8a to
40d0fe1
Compare
62d2e67 to
8c22695
Compare
bd61e69 to
c4f86fc
Compare
3874da8 to
364fd94
Compare
516af9c to
e2e2c63
Compare
cad5402 to
36fe812
Compare
118271e to
3ac515c
Compare
Do not set of_overlay_info attribute_group name from overlay info when there is no
overlay info device
Analysis of kernel stack trace, registers and stack along with disassembly of code pointed to ovinfo->info being zero at this point in the code.
Application of this patch prevents crash though overlays fail to load for various different reasons.