lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdYbZfcyGUUCe2NomFHAoaychOTBjr+k6Xyqe3AjEq0+wA@mail.gmail.com>
Date: Tue, 15 Apr 2025 10:13:14 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Lukas Schmid <lukas.schmid@...cube.li>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [BUG] pinctrl_mcp23s08_i2c: mutex used in irq_bus_lock causes
 'scheduling while atomic' with matrix_keypad

On Sat, Apr 5, 2025 at 1:48 PM Lukas Schmid <lukas.schmid@...cube.li> wrote:

> I'm encountering a "BUG: scheduling while atomic" when using the MCP23017 GPIO
> expander with the `matrix_keypad` driver in IRQ mode on Linux v6.12.20

Apply this commit from the upstream kernel:

commit a37eecb705f33726f1fb7cd2a67e514a15dfe693 (tag: pinctrl-v6.13-2)
Author: Evgenii Shatokhin <e.shatokhin@...ro.com>
Date:   Mon Dec 9 10:46:59 2024 +0300

    pinctrl: mcp23s08: Fix sleeping in atomic context due to regmap locking

    If a device uses MCP23xxx IO expander to receive IRQs, the following
    bug can happen:

      BUG: sleeping function called from invalid context
        at kernel/locking/mutex.c:283
      in_atomic(): 1, irqs_disabled(): 1, non_block: 0, ...
      preempt_count: 1, expected: 0
      ...
      Call Trace:
      ...
      __might_resched+0x104/0x10e
      __might_sleep+0x3e/0x62
      mutex_lock+0x20/0x4c
      regmap_lock_mutex+0x10/0x18
      regmap_update_bits_base+0x2c/0x66
      mcp23s08_irq_set_type+0x1ae/0x1d6
      __irq_set_trigger+0x56/0x172
      __setup_irq+0x1e6/0x646
      request_threaded_irq+0xb6/0x160
      ...


Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ