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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220831171259.GA147052@francesco-nb.int.toradex.com>
Date:   Wed, 31 Aug 2022 19:12:59 +0200
From:   Francesco Dolcini <francesco.dolcini@...adex.com>
To:     Csókás Bence <csokas.bence@...lan.hu>
CC:     netdev@...r.kernel.org, Richard Cochran <richardcochran@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
        kernel@...gutronix.de, Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: [PATCH] Use a spinlock to guard `fep->ptp_clk_on`

On Wed, Aug 31, 2022 at 02:56:31PM +0200, Csókás Bence wrote:
> Mutexes cannot be taken in a non-preemptible context,
> causing a panic in `fec_ptp_save_state()`. Replacing
> `ptp_clk_mutex` by `ptp_clk_lock` fixes this.

I would probably add the kernel BUG trace to the commit message.

> Fixes: 91c0d987a9788dcc5fe26baafd73bf9242b68900
> Fixes: 6a4d7234ae9a3bb31181f348ade9bbdb55aeb5c5
> Fixes: f79959220fa5fbda939592bf91c7a9ea90419040

Just

Fixes: f79959220fa5 ("fec: Restart PPS after link state change")

> 
> Reported-by: Marc Kleine-Budde <mkl@...gutronix.de>

Is this https://lore.kernel.org/all/20220827160922.642zlcd5foopozru@pengutronix.de/ the report?

I just stumbled on the same issue on latest torvalds 6.0-rc3.

[   22.718465] =============================
[   22.725431] [ BUG: Invalid wait context ]
[   22.732439] 6.0.0-rc3-00007-gdcf8e5633e2e #1 Tainted: G        W
[   22.742278] -----------------------------
[   22.749217] kworker/3:1/45 is trying to lock:
[   22.757157] c211b71c (&fep->ptp_clk_mutex){+.+.}-{3:3}, at: fec_ptp_gettime+0x30/0xcc
[   22.770814] other info that might help us debug this:
[   22.778718] context-{4:4}
[   22.784065] 4 locks held by kworker/3:1/45:
[   22.790949]  #0: c20072a8 ((wq_completion)events_power_efficient){+.+.}-{0:0}, at: process_one_work+0x1e4/0x730
[   22.806494]  #1: e6a15f18 ((work_completion)(&(&dev->state_queue)->work)){+.+.}-{0:0}, at: process_one_work+0x1e4/0x730
[   22.822744]  #2: c287a478 (&dev->lock){+.+.}-{3:3}, at: phy_state_machine+0x34/0x228
[   22.835884]  #3: c211b2a4 (&dev->tx_global_lock){+...}-{2:2}, at: netif_tx_lock+0x10/0x1c
[   22.849669] stack backtrace:
[   22.855340] CPU: 3 PID: 45 Comm: kworker/3:1 Tainted: G        W          6.0.0-rc3-00007-gdcf8e5633e2e #1
[   22.870713] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   22.880149] Workqueue: events_power_efficient phy_state_machine
[   22.888999]  unwind_backtrace from show_stack+0x10/0x14
[   22.897107]  show_stack from dump_stack_lvl+0x58/0x70
[   22.905067]  dump_stack_lvl from __lock_acquire+0x2844/0x29d4
[   22.913755]  __lock_acquire from lock_acquire+0x108/0x37c
[   22.922065]  lock_acquire from __mutex_lock+0x88/0x105c
[   22.930203]  __mutex_lock from mutex_lock_nested+0x1c/0x24
[   22.938611]  mutex_lock_nested from fec_ptp_gettime+0x30/0xcc
[   22.947278]  fec_ptp_gettime from fec_ptp_save_state+0x14/0x50
[   22.955991]  fec_ptp_save_state from fec_restart+0x48/0x8d4
[   22.964410]  fec_restart from fec_enet_adjust_link+0xa8/0x184
[   22.973004]  fec_enet_adjust_link from phy_link_change+0x28/0x54
[   22.981898]  phy_link_change from phy_check_link_status+0x94/0x108
[   22.990954]  phy_check_link_status from phy_state_machine+0x68/0x228
[   23.000153]  phy_state_machine from process_one_work+0x288/0x730
[   23.008968]  process_one_work from worker_thread+0x38/0x4d0
[   23.017289]  worker_thread from kthread+0xe4/0x104
[   23.024758]  kthread from ret_from_fork+0x14/0x28
[   23.032065] Exception stack(0xe6a15fb0 to 0xe6a15ff8)
[   23.039664] 5fa0:                                     00000000 00000000 00000000 00000000
[   23.052816] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   23.066101] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000


Francesco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ