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:   Tue, 27 Apr 2021 13:17:45 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     Anirudha Sarangi <anirudha.sarangi@...inx.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Michal Simek <michal.simek@...inx.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Douglas Anderson <dianders@...omium.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Maulik Shah <mkshah@...eaurora.org>,
        Zhen Lei <thunder.leizhen@...wei.com>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        <devicetree@...r.kernel.org>, <git@...inx.com>
Subject: Re: [PATCH 1/3] irqchip: xilinx: Avoid __init macro usage for xilinx_intc_of_init

On Tue, 27 Apr 2021 12:31:34 +0100,
Anirudha Sarangi <anirudha.sarangi@...inx.com> wrote:
> 
> This patch ensures that xilinx_intc_of_init API is not allocated into
> the .init.text section. Since this API calls the API set_handle_irq
> which uses __init macro to be put into .init.text section, this patch
> makes changes to ensure that set_handle_irq also does not stay in
> .init.text section.
> This patch is in preparation for the patch through which the xilinx
> intc driver will be loaded and unloaded as a module.
> 
> Signed-off-by: Anirudha Sarangi <anirudha.sarangi@...inx.com>
> ---
>  drivers/irqchip/irq-xilinx-intc.c | 4 ++--
>  include/linux/irq.h               | 2 +-
>  kernel/irq/handle.c               | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c
> index 1d3d273309bd..642733a6cbdf 100644
> --- a/drivers/irqchip/irq-xilinx-intc.c
> +++ b/drivers/irqchip/irq-xilinx-intc.c
> @@ -177,8 +177,8 @@ static void xil_intc_irq_handler(struct irq_desc *desc)
>  	chained_irq_exit(chip, desc);
>  }
>  
> -static int __init xilinx_intc_of_init(struct device_node *intc,
> -					     struct device_node *parent)
> +static int xilinx_intc_of_init(struct device_node *intc,
> +			       struct device_node *parent)
>  {
>  	struct xintc_irq_chip *irqc;
>  	int ret, irq;
> diff --git a/include/linux/irq.h b/include/linux/irq.h
> index 2efde6a79b7e..252fab8074de 100644
> --- a/include/linux/irq.h
> +++ b/include/linux/irq.h
> @@ -1250,7 +1250,7 @@ int ipi_send_mask(unsigned int virq, const struct cpumask *dest);
>   * Returns 0 on success, or -EBUSY if an IRQ handler has already been
>   * registered.
>   */
> -int __init set_handle_irq(void (*handle_irq)(struct pt_regs *));
> +int set_handle_irq(void (*handle_irq)(struct pt_regs *));
>  
>  /*
>   * Allows interrupt handlers to find the irqchip that's been registered as the
> diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
> index 762a928e18f9..a0b18e8f5af0 100644
> --- a/kernel/irq/handle.c
> +++ b/kernel/irq/handle.c
> @@ -218,7 +218,7 @@ irqreturn_t handle_irq_event(struct irq_desc *desc)
>  }
>  
>  #ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
> -int __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
> +int set_handle_irq(void (*handle_irq)(struct pt_regs *))
>  {
>  	if (handle_arch_irq)
>  		return -EBUSY;

No, never.

This function is for a root interrupt controller. You will never be
able to use this from a module. If you are calling this from something
that isn't marked __init, this is a terrible bug.

	M.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ