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: <Y0VUWvJgBXVADpYD@unreal>
Date:   Tue, 11 Oct 2022 14:32:42 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Divya Koppera <Divya.Koppera@...rochip.com>
Cc:     andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, UNGLinuxDriver@...rochip.com
Subject: Re: [RESEND PATCH net] net: phy: micrel: Fixes FIELD_GET assertion

On Tue, Oct 11, 2022 at 03:24:37PM +0530, Divya Koppera wrote:
> FIELD_GET() must only be used with a mask that is a compile-time
> constant. Mark the functions as __always_inline to avoid the problem.
> 
> Fixes: 21b688dabecb6a ("net: phy: micrel: Cable Diag feature for lan8814 phy")
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Divya Koppera <Divya.Koppera@...rochip.com>
> ---
>  drivers/net/phy/micrel.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 3757e069c486..54a17b576eac 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -1838,7 +1838,7 @@ static int ksz886x_cable_test_start(struct phy_device *phydev)
>  	return phy_clear_bits(phydev, MII_BMCR, BMCR_ANENABLE | BMCR_SPEED100);
>  }
>  
> -static int ksz886x_cable_test_result_trans(u16 status, u16 mask)
> +static __always_inline int ksz886x_cable_test_result_trans(u16 status, u16 mask)

I don't think that this is valid workaround. You are adding inline
function to C-files.

Please find another solution. For example, adding new field_get function
to bitfield.h that accepts dynamic fields.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ