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]
Date: Sat, 13 Apr 2024 09:44:13 +0100
From: Marc Zyngier <maz@...nel.org>
To: Guanrui Huang <guanrui.huang@...ux.alibaba.com>
Cc: yuzenghui@...wei.com,
	shannon.zhao@...ux.alibaba.com,
	tglx@...utronix.de,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] irqchip/gic-v3-its: remove BUG_ON in its_vpe_irq_domain_alloc

On Sat, 13 Apr 2024 07:40:51 +0100,
Guanrui Huang <guanrui.huang@...ux.alibaba.com> wrote:
> 
> If vm is NULL in here, that means caller has a bug.
> BUG_ON in here is useless, this will paper over bug.

This BUG_ON() doesn't paper over a bug like your previous patch
did. It catches a bug (vm should never be NULL), but also forces the
system to crash for no good reason.

The same effect will be obtained by letting the code run its course
and vm being dereferenced, triggering an exception.

> 
> So just remove this check.
> 
> Signed-off-by: Guanrui Huang <guanrui.huang@...ux.alibaba.com>
> ---
>  drivers/irqchip/irq-gic-v3-its.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 2305f6b524a9..55c83e19719d 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -4521,8 +4521,6 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
>  	struct page *vprop_page;
>  	int base, nr_ids, i, err = 0;
>  
> -	BUG_ON(!vm);
> -
>  	bitmap = its_lpi_alloc(roundup_pow_of_two(nr_irqs), &base, &nr_ids);
>  	if (!bitmap)
>  		return -ENOMEM;

With the commit message fixed:

Acked-by: Marc Zyngier <maz@...nel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ