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: <6703a552-8d23-6136-c0b8-c68845d00aa8@prolan.hu>
Date:   Fri, 2 Sep 2022 09:35:56 +0200
From:   Csókás Bence <csokas.bence@...lan.hu>
To:     Florian Fainelli <f.fainelli@...il.com>, <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 2022. 09. 01. 18:26, Florian Fainelli wrote:
> 
>>       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.

`fec_ptp_init()` is called from `fec_probe()`, which init's the spinlock:

 > @@ -3907,7 +3908,7 @@ fec_probe(struct platform_device *pdev)
 >         }
 >
 >         fep->ptp_clk_on = false;
 > -       mutex_init(&fep->ptp_clk_mutex);
 > +       spin_lock_init(&fep->tmreg_lock);

Bence

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ