linux icon indicating copy to clipboard operation
linux copied to clipboard

gpiolib backtraces when requesting invalid pin

Open shenki opened this issue 8 years ago • 0 comments

We should work out if we're missing a sanity check in our driver, or if this is something that all drivers do.

If it's common to all drivers we should chat with upstream about it. Userspace shouldn't be able to trigger a backtrace from normal behaviour. We could propose a patch to turn it into a dev_warn or similar.

------------[ cut here ]------------
WARNING: CPU: 0 PID: 869 at /var/lib/jenkins/workspace/openbmc-build-gerrit-trigger-multi/distro/ubuntu/target/zaius/openbmc/build/tmp/work-shared/zaius/kernel-source/drivers/gpio/gpiolib.c:100 gpio_to_desc+0x84/0x98
invalid GPIO 528
CPU: 0 PID: 869 Comm: button_reset.ex Not tainted 4.7.10-f26558191540830589fe03932d05577957670b8d #1
Hardware name: ASpeed SoC
[<801072f8>] (unwind_backtrace) from [<80105558>] (show_stack+0x10/0x14)
[<80105558>] (show_stack) from [<80110cc0>] (__warn+0xc4/0xf0)
[<80110cc0>] (__warn) from [<80110d30>] (warn_slowpath_fmt+0x44/0x6c)
[<80110d30>] (warn_slowpath_fmt) from [<80294df8>] (gpio_to_desc+0x84/0x98)
[<80294df8>] (gpio_to_desc) from [<80298c8c>] (export_store+0x38/0x118)
[<80298c8c>] (export_store) from [<801f831c>] (kernfs_fop_write+0x140/0x1ac)
[<801f831c>] (kernfs_fop_write) from [<801a3c08>] (__vfs_write+0x28/0x12c)
[<801a3c08>] (__vfs_write) from [<801a3e80>] (vfs_write+0xb8/0x144)
[<801a3e80>] (vfs_write) from [<801a400c>] (SyS_write+0x54/0xac)
[<801a400c>] (SyS_write) from [<801021c0>] (ret_fast_syscall+0x0/0x3c)
---[ end trace f550ac5f56efceee ]---
export_store: invalid GPIO 528

shenki avatar Feb 10 '17 00:02 shenki