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: <CAEf4BzaSD_9pdaSzfcinAEapzzHK2vYytHhk39jpepkCKOBVwQ@mail.gmail.com>
Date:   Tue, 14 Mar 2023 16:56:15 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Naresh Kamboju <naresh.kamboju@...aro.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Daniel Müller <deso@...teo.net>,
        open list <linux-kernel@...r.kernel.org>,
        bpf <bpf@...r.kernel.org>, lkft-triage@...ts.linaro.org,
        Linux-Next Mailing List <linux-next@...r.kernel.org>,
        Andrii Nakryiko <andrii@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        KP Singh <kpsingh@...nel.org>,
        Anders Roxell <anders.roxell@...aro.org>
Subject: Re: next: zip.c:35:8: error: packed attribute causes inefficient
 alignment for 'magic' [-Werror=attributes]

On Tue, Mar 14, 2023 at 1:01 PM Ian Rogers <irogers@...gle.com> wrote:
>
> On Tue, Mar 14, 2023 at 11:52 AM Andrii Nakryiko
> <andrii.nakryiko@...il.com> wrote:
> >
> > On Mon, Mar 13, 2023 at 11:38 PM Naresh Kamboju
> > <naresh.kamboju@...aro.org> wrote:
> > >
> > > perf builds failing from Linux next-20230307..next-20230314 but pass on
> > > Linux mainline v6.3-rc2.
> > >
> > > Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
> >
> > Thanks for the report, but I'm not sure what's wrong here. We added
> > __attribute__((packed)) attribute intentionally and want to keep it
> > this way. It seems like perf itself is using packed structs (e.g.,
> > struct debug_line_header in util/genelf_debug.c), so I'm wondering why
> > that code doesn't cause any problems.
> >
> > Any hints from perf folks?
>
> We use a #pragma to disable the warnings in at least one place:
> https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/lib/perf/include/perf/event.h?h=perf-tools#n194
>

Ok, let's do the same here. Daniel, can you please send a follow up
patch to silence this warning?

> Thanks,
> Ian
>
> > >
> > > Build log:
> > > ---
> > > libbpf/staticobjs/zip.o
> > > zip.c:35:8: error: packed attribute causes inefficient alignment for
> > > 'magic' [-Werror=attributes]
> > >    35 |  __u32 magic;
> > >       |        ^~~~~
> > > zip.c:40:8: error: packed attribute causes inefficient alignment for
> > > 'this_disk' [-Werror=attributes]
> > >    40 |  __u16 this_disk;
> > >       |        ^~~~~~~~~
> > > zip.c:45:8: error: packed attribute causes inefficient alignment for
> > > 'cd_disk' [-Werror=attributes]
> > >    45 |  __u16 cd_disk;
> > >       |        ^~~~~~~
> > > zip.c:50:8: error: packed attribute causes inefficient alignment for
> > > 'cd_records' [-Werror=attributes]
> > >    50 |  __u16 cd_records;
> > >       |        ^~~~~~~~~~
> > > zip.c:55:8: error: packed attribute causes inefficient alignment for
> > > 'cd_records_total' [-Werror=attributes]
> > >    55 |  __u16 cd_records_total;
> > >       |        ^~~~~~~~~~~~~~~~
> > > zip.c:58:8: error: packed attribute causes inefficient alignment for
> > > 'cd_size' [-Werror=attributes]
> > >    58 |  __u32 cd_size;
> > >       |        ^~~~~~~
> > > zip.c:63:8: error: packed attribute causes inefficient alignment for
> > > 'cd_offset' [-Werror=attributes]
> > >    63 |  __u32 cd_offset;
> > >       |        ^~~~~~~~~
> > > zip.c:66:8: error: packed attribute causes inefficient alignment for
> > > 'comment_length' [-Werror=attributes]
> > >    66 |  __u16 comment_length;
> > >       |        ^~~~~~~~~~~~~~
> > > zip.c:79:8: error: packed attribute causes inefficient alignment for
> > > 'magic' [-Werror=attributes]
> > >    79 |  __u32 magic;
> > >       |        ^~~~~
> > > zip.c:80:8: error: packed attribute causes inefficient alignment for
> > > 'version' [-Werror=attributes]
> > >    80 |  __u16 version;
> > >       |        ^~~~~~~
> > > zip.c:82:8: error: packed attribute causes inefficient alignment for
> > > 'min_version' [-Werror=attributes]
> > >    82 |  __u16 min_version;
> > >       |        ^~~~~~~~~~~
> > > zip.c:83:8: error: packed attribute causes inefficient alignment for
> > > 'flags' [-Werror=attributes]
> > >    83 |  __u16 flags;
> > >       |        ^~~~~
> > > zip.c:84:8: error: packed attribute causes inefficient alignment for
> > > 'compression' [-Werror=attributes]
> > >    84 |  __u16 compression;
> > >       |        ^~~~~~~~~~~
> > > zip.c:85:8: error: packed attribute causes inefficient alignment for
> > > 'last_modified_time' [-Werror=attributes]
> > >    85 |  __u16 last_modified_time;
> > >       |        ^~~~~~~~~~~~~~~~~~
> > > zip.c:86:8: error: packed attribute causes inefficient alignment for
> > > 'last_modified_date' [-Werror=attributes]
> > >    86 |  __u16 last_modified_date;
> > >       |        ^~~~~~~~~~~~~~~~~~
> > > zip.c:87:8: error: packed attribute causes inefficient alignment for
> > > 'crc' [-Werror=attributes]
> > >    87 |  __u32 crc;
> > >       |        ^~~
> > > zip.c:88:8: error: packed attribute causes inefficient alignment for
> > > 'compressed_size' [-Werror=attributes]
> > >    88 |  __u32 compressed_size;
> > >       |        ^~~~~~~~~~~~~~~
> > > zip.c:89:8: error: packed attribute causes inefficient alignment for
> > > 'uncompressed_size' [-Werror=attributes]
> > >    89 |  __u32 uncompressed_size;
> > >       |        ^~~~~~~~~~~~~~~~~
> > > zip.c:90:8: error: packed attribute causes inefficient alignment for
> > > 'file_name_length' [-Werror=attributes]
> > >    90 |  __u16 file_name_length;
> > >       |        ^~~~~~~~~~~~~~~~
> > > zip.c:91:8: error: packed attribute causes inefficient alignment for
> > > 'extra_field_length' [-Werror=attributes]
> > >    91 |  __u16 extra_field_length;
> > >       |        ^~~~~~~~~~~~~~~~~~
> > > zip.c:92:8: error: packed attribute causes inefficient alignment for
> > > 'file_comment_length' [-Werror=attributes]
> > >    92 |  __u16 file_comment_length;
> > >       |        ^~~~~~~~~~~~~~~~~~~
> > > zip.c:94:8: error: packed attribute causes inefficient alignment for
> > > 'disk' [-Werror=attributes]
> > >    94 |  __u16 disk;
> > >       |        ^~~~
> > > zip.c:95:8: error: packed attribute causes inefficient alignment for
> > > 'internal_attributes' [-Werror=attributes]
> > >    95 |  __u16 internal_attributes;
> > >       |        ^~~~~~~~~~~~~~~~~~~
> > > zip.c:108:8: error: packed attribute causes inefficient alignment for
> > > 'magic' [-Werror=attributes]
> > >   108 |  __u32 magic;
> > >       |        ^~~~~
> > > zip.c:110:8: error: packed attribute causes inefficient alignment for
> > > 'min_version' [-Werror=attributes]
> > >   110 |  __u16 min_version;
> > >       |        ^~~~~~~~~~~
> > > zip.c:111:8: error: packed attribute causes inefficient alignment for
> > > 'flags' [-Werror=attributes]
> > >   111 |  __u16 flags;
> > >       |        ^~~~~
> > > zip.c:112:8: error: packed attribute causes inefficient alignment for
> > > 'compression' [-Werror=attributes]
> > >   112 |  __u16 compression;
> > >       |        ^~~~~~~~~~~
> > > zip.c:113:8: error: packed attribute causes inefficient alignment for
> > > 'last_modified_time' [-Werror=attributes]
> > >   113 |  __u16 last_modified_time;
> > >       |        ^~~~~~~~~~~~~~~~~~
> > > zip.c:114:8: error: packed attribute causes inefficient alignment for
> > > 'last_modified_date' [-Werror=attributes]
> > >   114 |  __u16 last_modified_date;
> > >       |        ^~~~~~~~~~~~~~~~~~
> > > zip.c:118:8: error: packed attribute causes inefficient alignment for
> > > 'file_name_length' [-Werror=attributes]
> > >   118 |  __u16 file_name_length;
> > >       |        ^~~~~~~~~~~~~~~~
> > > zip.c:119:8: error: packed attribute causes inefficient alignment for
> > > 'extra_field_length' [-Werror=attributes]
> > >   119 |  __u16 extra_field_length;
> > >       |        ^~~~~~~~~~~~~~~~~~
> > > cc1: all warnings being treated as errors
> > >
> > > Build links,
> > > https://storage.tuxsuite.com/public/linaro/lkft/builds/2MfXEyvgh4ba9y3rkt6KPf6sUMR/
> > >
> > >
> > > History link,
> > > https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230314/testrun/15564056/suite/build/test/gcc-10-lkftconfig-perf/history/
> > >
> > >
> > > --
> > > Linaro LKFT
> > > https://lkft.linaro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ