Skip to contentSkip to conversation

gcc 8 warning

DISCUSSION Bruno Wolff III 2 participants 2 messages Jan 30, 2018

lore
Share & tools
lore
#0 lore raw

While there were a few other warnings about sibling call from callable instruction with modified stack frame, the following looked more significant if it isn't a gcc bug.
CC [M] /home/bruno/WireGuard/src/crypto/chacha20poly1305.o
In file included from ./include/linux/bitmap.h:9,

                from ./include/linux/cpumask.h:12,
                from ./arch/x86/include/asm/cpumask.h:5,
                from ./arch/x86/include/asm/msr.h:11,
                from ./arch/x86/include/asm/processor.h:21,
                from ./arch/x86/include/asm/cpufeature.h:5,
                from ./arch/x86/include/asm/thread_info.h:53,
                from ./include/linux/thread_info.h:38,
                from ./arch/x86/include/asm/preempt.h:7,
                from ./include/linux/preempt.h:81,
                from ./include/linux/spinlock.h:51,
                from ./include/linux/seqlock.h:36,
                from ./include/linux/time.h:6,
                from ./include/linux/skbuff.h:19,
                from ./include/linux/ip.h:20,
                from /home/bruno/WireGuard/src/compat/compat.h:583,
                from <command-line>:

In function ‘memcpy’,
inlined from ‘poly1305_update’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:549:4,
inlined from ‘chacha20poly1305_encrypt_sg’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:673:4:
./include/linux/string.h:344:9: warning: ‘__builtin_memcpy’ forming offset [233, 272] is out of the bounds [0, 232] of object ‘poly1305_state’ with type ‘struct poly1305_ctx’ [-Warray-bounds]

 return __builtin_memcpy(p, q, size);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c: In function ‘chacha20poly1305_encrypt_sg’:
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c:652:22: note: ‘poly1305_state’ declared here
 struct poly1305_ctx poly1305_state;
                     ^~~~~~~~~~~~~~
In file included from ./include/linux/bitmap.h:9,
                from ./include/linux/cpumask.h:12,
                from ./arch/x86/include/asm/cpumask.h:5,
                from ./arch/x86/include/asm/msr.h:11,
                from ./arch/x86/include/asm/processor.h:21,
                from ./arch/x86/include/asm/cpufeature.h:5,
                from ./arch/x86/include/asm/thread_info.h:53,
                from ./include/linux/thread_info.h:38,
                from ./arch/x86/include/asm/preempt.h:7,
                from ./include/linux/preempt.h:81,
                from ./include/linux/spinlock.h:51,
                from ./include/linux/seqlock.h:36,
                from ./include/linux/time.h:6,
                from ./include/linux/skbuff.h:19,
                from ./include/linux/ip.h:20,
                from /home/bruno/WireGuard/src/compat/compat.h:583,
                from <command-line>:

In function ‘memcpy’,
inlined from ‘poly1305_update’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:549:4,
inlined from ‘chacha20poly1305_decrypt_sg’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:789:4:
./include/linux/string.h:344:9: warning: ‘__builtin_memcpy’ forming offset [233, 272] is out of the bounds [0, 232] of object ‘poly1305_state’ with type ‘struct poly1305_ctx’ [-Warray-bounds]

 return __builtin_memcpy(p, q, size);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c: In function ‘chacha20poly1305_decrypt_sg’:
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c:764:22: note: ‘poly1305_state’ declared here
 struct poly1305_ctx poly1305_state;
                     ^~~~~~~~~~~~~~
#1 lore raw
Quoted 21 lines · Bruno Wolff III

While there were a few other warnings about sibling call from callable instruction with modified stack frame, the following looked more significant if it isn't a gcc bug.
CC [M] /home/bruno/WireGuard/src/crypto/chacha20poly1305.o
In file included from ./include/linux/bitmap.h:9,

                from ./include/linux/cpumask.h:12,
                from ./arch/x86/include/asm/cpumask.h:5,
                from ./arch/x86/include/asm/msr.h:11,
                from ./arch/x86/include/asm/processor.h:21,
                from ./arch/x86/include/asm/cpufeature.h:5,
                from ./arch/x86/include/asm/thread_info.h:53,
                from ./include/linux/thread_info.h:38,
                from ./arch/x86/include/asm/preempt.h:7,
                from ./include/linux/preempt.h:81,
                from ./include/linux/spinlock.h:51,
                from ./include/linux/seqlock.h:36,
                from ./include/linux/time.h:6,
                from ./include/linux/skbuff.h:19,
                from ./include/linux/ip.h:20,
                from /home/bruno/WireGuard/src/compat/compat.h:583,
                from <command-line>:
Quoted 8 lines

In function ‘memcpy’,
inlined from ‘poly1305_update’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:549:4,
inlined from ‘chacha20poly1305_encrypt_sg’ at /home/bruno/WireGuard/src/crypto/chacha20poly1305.c:673:4:
./include/linux/string.h:344:9: warning: ‘__builtin_memcpy’ forming offset [233, 272] is out of the bounds [0, 232] of object ‘poly1305_state’ with type ‘struct poly1305_ctx’ [-Warray-bounds]

 return __builtin_memcpy(p, q, size);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/bruno/WireGuard/src/crypto/chacha20poly1305.c: In function ‘chacha20poly1305_encrypt_sg’:
/home/bruno/WireGuard/src/crypto/chacha20poly1305.c:652:22: note: ‘poly1305_state’ declared here

I don't think the kernel builds properly with gcc8 just yet, so I wouldn't worry too much about stuff like this.

Try building the 4.15 kernel release with gcc8 and see what happens :)

thanks,

greg k-h