Skip to content
Snippets Groups Projects
Select Git revision
  • 24e45bbe695719dca8c20e03d386eb6ea86526b5
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

thinkpad_acpi.c

  • Henrique de Moraes Holschuh's avatar
    24e45bbe
    thinkpad-acpi: fix LED handling on older ThinkPads · 24e45bbe
    Henrique de Moraes Holschuh authored
    
    The less tested codepaths for LED handling, used on ThinkPads 570, 600e/x,
    770e, 770x, A21e, A2xm/p, T20-22, X20 and maybe a few others, would write
    data to kernel memory it had no business touching, for leds number 3 and
    above.  If one is lucky, that illegal write would cause an OOPS, but
    chances are it would silently corrupt a byte.
    
    The problem was introduced in commit af116101, "ACPI: thinkpad-acpi: add
    sysfs led class support to thinkpad leds (v3.2)".
    
    Fix the bug by refactoring the entire code to be far more obvious on what
    it wants to do.  Also do some defensive "constification".
    
    Issue reported by Karol Lewandowski <lmctlx@gmail.com> (he's an lucky guy
    and got an OOPS instead of silent corruption :-) ).
    
    Root cause of the OOPS identified by Adrian Bunk <bunk@kernel.org>.
    Thanks, Adrian!
    
    Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
    Tested-by: default avatarKarol Lewandowski <lmctlx@gmail.com>
    Signed-off-by: default avatarLen Brown <len.brown@intel.com>
    24e45bbe
    History
    thinkpad-acpi: fix LED handling on older ThinkPads
    Henrique de Moraes Holschuh authored
    
    The less tested codepaths for LED handling, used on ThinkPads 570, 600e/x,
    770e, 770x, A21e, A2xm/p, T20-22, X20 and maybe a few others, would write
    data to kernel memory it had no business touching, for leds number 3 and
    above.  If one is lucky, that illegal write would cause an OOPS, but
    chances are it would silently corrupt a byte.
    
    The problem was introduced in commit af116101, "ACPI: thinkpad-acpi: add
    sysfs led class support to thinkpad leds (v3.2)".
    
    Fix the bug by refactoring the entire code to be far more obvious on what
    it wants to do.  Also do some defensive "constification".
    
    Issue reported by Karol Lewandowski <lmctlx@gmail.com> (he's an lucky guy
    and got an OOPS instead of silent corruption :-) ).
    
    Root cause of the OOPS identified by Adrian Bunk <bunk@kernel.org>.
    Thanks, Adrian!
    
    Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
    Tested-by: default avatarKarol Lewandowski <lmctlx@gmail.com>
    Signed-off-by: default avatarLen Brown <len.brown@intel.com>