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: <80f9cb5b-0e02-a367-5263-4fbffec055bb@gmail.com>
Date:   Thu, 1 Sep 2022 09:26:48 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Csókás Bence <csokas.bence@...lan.hu>,
        netdev@...r.kernel.org
Cc:     Richard Cochran <richardcochran@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Francesco Dolcini <francesco.dolcini@...adex.com>,
        Andrew Lunn <andrew@...n.ch>, kernel@...gutronix.de,
        Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: [PATCH v2] net: fec: Use a spinlock to guard `fep->ptp_clk_on`



On 9/1/2022 7:04 AM, 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 `tmreg_lock` fixes this.
> 
> Fixes: 6a4d7234ae9a ("net: fec: ptp: avoid register access when ipg clock is disabled")
> Fixes: f79959220fa5 ("fec: Restart PPS after link state change")
> Reported-by: Marc Kleine-Budde <mkl@...gutronix.de>
> Link: https://lore.kernel.org/all/20220827160922.642zlcd5foopozru@pengutronix.de/
> Signed-off-by: Csókás Bence <csokas.bence@...lan.hu>
> ---

[snip]

>   	schedule_delayed_work(&fep->time_keep, HZ);
>   }
> @@ -599,8 +593,6 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
>   	}
>   	fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed;
>   
> -	spin_lock_init(&fep->tmreg_lock);

This change needs to be kept as there is no other code in the driver 
that would initialize the tmreg_lock otherwise. Try building a kernel 
with spinlock debugging enabled and you should see it barf with an 
incorrect spinlock bad magic.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ