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: <87k12xn1d7.fsf@nanos.tec.linutronix.de>
Date:   Thu, 02 Apr 2020 21:17:40 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Marcelo Schmitt <marcelo.schmitt1@...il.com>,
        linux-kernel@...r.kernel.org
Cc:     lars@...afoo.de
Subject: Re: [RFC] genirq: prevent allocated_irqs from being smaller than NR_IRQS

Marcelo,

Marcelo Schmitt <marcelo.schmitt1@...il.com> writes:
> #ifdef CONFIG_SPARSE_IRQ
> # define IRQ_BITMAP_BITS (NR_IRQS + 8196)
> #else
> # define IRQ_BITMAP_BITS NR_IRQS
> #endif
>
> The thing I'm troubled about is that BITS_TO_LONGS divides
> IRQ_BITMAP_BITS by sizeof(long) * 8, which makes it possible for the
> size of allocated_irqs to be smaller than NR_IRQS.

No. It calculates the number of longs which are required to store
IRQ_BITMAP_BITS bits. And it does not only divide, it also takes the
reminder into account.

One byte fits 8 bits. Multiplied with sizeof(long) tells you how many
bits fit into a long: Unsurprisingly that 32 on 32bit and 64 on 64bit
systems.

> By the way, is there any mailing list for IRQ related discussions?
> I couldn't find one at vger.kernel.org.

The MAINTAINERS file tells you:

IRQ SUBSYSTEM
L:      linux-kernel@...r.kernel.org

So you picked the right one.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ