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]
Date:   Fri, 25 Feb 2022 22:03:01 +0100
From:   "Jason A. Donenfeld" <Jason@...c4.com>
To:     Alexander Graf <graf@...zon.com>
Cc:     Ard Biesheuvel <ardb@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Len Brown <lenb@...nel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        "Woodhouse, David" <dwmw@...zon.co.uk>
Subject: Re: [PATCH] ACPI: bus: Match first 9 bytes of device IDs

Hi Alex,

On Fri, Feb 25, 2022 at 08:06:39PM +0100, Alexander Graf wrote:
> On 25.02.22 19:39, Jason A. Donenfeld wrote:
> > Okay, the final piece, userspace:
> >
> > /sys/bus/acpi/devices/QEMUVGID:00/modalias gives:
> >      acpi:QEMUVGID:VM_GEN_COUNTER:
> >
> > modinfo -F alias vmgenid.ko gives:
> >      acpi*:VM_GEN_COUNTER:*
> >
> > udev src uses fnmatch.
> >
> > Bash confirms a match:
> >
> > $ [[ "acpi:QEMUVGID:VM_GEN_COUNTER:" == acpi*:VM_GEN_COUNTER:* ]] &&
> > echo matches
> > matches
> >
> > So I think with ACPI_ID_LEN --> 16 we are good to go.
> 
> 
> Is the size increase (mostly rodata I suppose? Anywhere else?) measurable?

On my test kernel, the size of vmlinux increases from 26918200 bytes to
26918200 bytes.

Wait, did I do that test right? I'll try again.

Yep, 26918200 -> 26918200, so it doesn't grow at all. I believe the
reason is mostly because of:

    #define ACPI_ID_LEN     16
    
    struct acpi_device_id {
      __u8 id[ACPI_ID_LEN];
      kernel_ulong_t driver_data;
      __u32 cls;
      __u32 cls_msk;
    };

Because of the padding, 9->16 doesn't actually change the way this
structure is allocated. Then, additional uses of ACPI_ID_LEN throughout
the tree are rather sparse or enclosed within other structures or
similar things.

In other words, code size seems like very much a non-issue. Also, it's
not as though MIPS has ACPI. We're talking about x86, Itanium, and
(sometimes, I guess) arm64.

Regards,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ