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: <E8C72537-4280-401A-B25D-9734D2756A6A@oracle.com>
Date:   Tue, 25 Jul 2023 16:48:14 +0000
From:   Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
To:     Naresh Kamboju <naresh.kamboju@...aro.org>
CC:     "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "lkft-triage@...ts.linaro.org" <lkft-triage@...ts.linaro.org>,
        Netdev <netdev@...r.kernel.org>,
        clang-built-linux <llvm@...ts.linux.dev>,
        Shuah Khan <shuah@...nel.org>,
        Anders Roxell <anders.roxell@...aro.org>,
        "David S. Miller" <davem@...emloft.net>,
        Liam Howlett <liam.howlett@...cle.com>
Subject: Re: selftests: connector: proc_filter.c:48:20: error: invalid
 application of 'sizeof' to an incomplete type 'struct proc_input'



> On Jul 25, 2023, at 6:05 AM, Naresh Kamboju <naresh.kamboju@...aro.org> wrote:
> 
> selftests: connector: proc_filter build failed with clang-16 due to below
> warnings / errors on Linux next-20230725.
> 
> Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
> 
> clang --target=aarch64-linux-gnu -fintegrated-as
> -Werror=unknown-warning-option -Werror=ignored-optimization-argument
> -Werror=option-ignored -Werror=unused-command-line-argument
> --target=aarch64-linux-gnu -fintegrated-as -Wall     proc_filter.c  -o
> /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/connector/proc_filter
> proc_filter.c:42:12: error: invalid application of 'sizeof' to an
> incomplete type 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^~~~~~~~~~~~~~~
> proc_filter.c:22:5: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                         ^     ~~~~~~~~~~~~~~~~~~~
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:48:20: error: invalid application of 'sizeof' to an
> incomplete type 'struct proc_input'
>                hdr->nlmsg_len = NL_MESSAGE_SIZE;
>                                 ^~~~~~~~~~~~~~~
> proc_filter.c:22:5: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                         ^     ~~~~~~~~~~~~~~~~~~~
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:64:14: error: invalid application of 'sizeof' to an
> incomplete type 'struct proc_input'
>                msg->len = sizeof(struct proc_input);
>                           ^     ~~~~~~~~~~~~~~~~~~~
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:65:35: error: incomplete definition of type 'struct proc_input'
>                ((struct proc_input *)msg->data)->mcast_op =
>                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:66:31: error: incomplete definition of type 'struct proc_input'
>                        ((struct proc_input *)pinp)->mcast_op;
>                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:67:35: error: incomplete definition of type 'struct proc_input'
>                ((struct proc_input *)msg->data)->event_type =
>                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:68:31: error: incomplete definition of type 'struct proc_input'
>                        ((struct proc_input *)pinp)->event_type;
>                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
> proc_filter.c:42:12: note: forward declaration of 'struct proc_input'
>        char buff[NL_MESSAGE_SIZE];
>                  ^
> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE'
>                         sizeof(struct proc_input))
>                                       ^
> proc_filter.c:245:20: error: variable has incomplete type 'struct proc_input'
>        struct proc_input input;
>                          ^
> proc_filter.c:245:9: note: forward declaration of 'struct proc_input'
>        struct proc_input input;
>               ^
> proc_filter.c:264:22: error: use of undeclared identifier
> 'PROC_EVENT_NONZERO_EXIT'
>                input.event_type = PROC_EVENT_NONZERO_EXIT;
>                                   ^
> 9 errors generated.
> make[4]: Leaving directory '/builds/linux/tools/testing/selftests/connector’
> 
> 
These are expected since you need to have the changes in kernel that were committed with this patch to be installed on the kernel on which this is being compiled/run on. That is what the test is for, and the check to make it run on previous kernels as well was made a runtime check. Do you expect this to compile on a kernel without the corresponding kernel changes that were committed with this patch?

Anjali

> 
> Links:
> - https://urldefense.com/v3/__https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4OXDmWl/__;!!ACWV5N9M2RV99hQ!KGpNLNgF9TB1Di6vnsIBKgjQbqYyghUqeNr4q4xMl0uGesYONZ7h5Gl26vUL62nVt-9YTJmiyE6cwUM7sAjAWYIVKZNKvMYc$ 
> 
> steps to reproduce:
> - https://urldefense.com/v3/__https://storage.tuxsuite.com/public/linaro/lkft/builds/2T3676HpK243gMBLYJCp4OXDmWl/tuxmake_reproducer.sh__;!!ACWV5N9M2RV99hQ!KGpNLNgF9TB1Di6vnsIBKgjQbqYyghUqeNr4q4xMl0uGesYONZ7h5Gl26vUL62nVt-9YTJmiyE6cwUM7sAjAWYIVKSfQKbzK$ 
> --
> Linaro LKFT
> https://urldefense.com/v3/__https://lkft.linaro.org__;!!ACWV5N9M2RV99hQ!KGpNLNgF9TB1Di6vnsIBKgjQbqYyghUqeNr4q4xMl0uGesYONZ7h5Gl26vUL62nVt-9YTJmiyE6cwUM7sAjAWYIVKYlwlLOK$ 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ