Re: [PATCH v3 05/26] genirq/irqdesc: Annotate static information into meminspect

Lorenzo Stoakes <[email protected]>
Newsgroups org.kernel.vger.linux-remoteproc,org.kernel.vger.linux-arch,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.workflows,org.kvack.linux-mm
Message-ID <ak3_cfHe8fkNfyud@lucifer>
On Wed, Jul 08, 2026 at 11:01:44AM +0530, Mukesh Ojha wrote:
> From: Eugen Hristev <[email protected]>
>
> Annotate vital static information into inspection table:
>  - total_nr_irqs
>
> Information on these annotated variables is stored in a dedicated
> meminspect section.
>
> Signed-off-by: Eugen Hristev <[email protected]>
> Signed-off-by: Mukesh Ojha <[email protected]>
> ---
>  kernel/irq/irqdesc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
> index 80ef4e27dcf4..4e58e7f5fc6c 100644
> --- a/kernel/irq/irqdesc.c
> +++ b/kernel/irq/irqdesc.c
> @@ -16,6 +16,7 @@
>  #include <linux/irqdomain.h>
>  #include <linux/sysfs.h>
>  #include <linux/string_choices.h>
> +#include <linux/meminspect.h>
>
>  #include "internals.h"
>
> @@ -142,6 +143,7 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node,
>  }
>
>  unsigned int total_nr_irqs __read_mostly = NR_IRQS;
> +MEMINSPECT_SIMPLE_ENTRY(total_nr_irqs);

Err... this is effectively exporting this unexported variable to drivers?

This is massively open to abuse no? A driver could now manipulate this value if
it wanted to?

Why would we want internal state like this exposed to drivers/firmware? This
isn't something you can even do right now without kernel debug symbols.

I am getting ever more convinced that this resembles a backdoor EXPORT_SYMBOLS()
but now much worse because you get a VA and a PA and more information...!

>
>  /**
>   * irq_get_nr_irqs() - Number of interrupts supported by the system.
>
> --
> 2.53.0
>

Thanks, Lorenzo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.