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: <87bk10etn5.ffs@tglx>
Date: Fri, 06 Sep 2024 16:36:30 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Ma Ke <make24@...as.ac.cn>, jochen@...am.de, andi.shyti@...nel.org,
 grant.likely@...aro.org, thierry.reding@...il.com, rob.herring@...xeda.com
Cc: linuxppc-dev@...ts.ozlabs.org, linux-i2c@...r.kernel.org,
 linux-kernel@...r.kernel.org, Ma Ke <make24@...as.ac.cn>,
 stable@...r.kernel.org
Subject: Re: [PATCH] of/irq: handle irq_of_parse_and_map() errors

On Fri, Aug 30 2024 at 22:21, Ma Ke wrote:
> Zero and negative number is not a valid IRQ for in-kernel code and the
> irq_of_parse_and_map() function returns zero on error.  So this check for
> valid IRQs should only accept values > 0.

The subsystem prefix is wrong. This changes drivers/i2c/busses/i2c-cpm.c
and has nothing to do with of/irq. Sure, the problem has been caused
by the commit below, but that's a different thing.

> Cc: stable@...r.kernel.org
> Fixes: f7578496a671 ("of/irq: Use irq_of_parse_and_map()")
> Signed-off-by: Ma Ke <make24@...as.ac.cn>
> ---
>  drivers/i2c/busses/i2c-cpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
> index 4794ec066eb0..41e3c95c0ef7 100644
> --- a/drivers/i2c/busses/i2c-cpm.c
> +++ b/drivers/i2c/busses/i2c-cpm.c
> @@ -435,7 +435,7 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
>  	init_waitqueue_head(&cpm->i2c_wait);
>  
>  	cpm->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
> -	if (!cpm->irq)
> +	if (cpm->irq <= 0)
>  		return -EINVAL;

The function _cannot return a negative number:

extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);

So what is this actually fixing?

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ