Re: [GIT PULL] tracing: More updates for 6.13

From: Paul Moore
Date: Fri Nov 29 2024 - 08:15:55 EST


On November 28, 2024 9:17:31 PM Yafang Shao <laoar.shao@xxxxxxxxx> wrote:
On Fri, Nov 29, 2024 at 7:23 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

On Thu, 28 Nov 2024 15:51:20 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:


I've pushed out my resolution, and hopefully rust people can actually
test it. I might just be full of it.

Looks better than what I had. I'll kick my tests on it just as a sanity
check.

And my tests failed. But not for this change. The build failed. Config attached:

CC kernel/time/tick-broadcast.o
In file included from /work/build/trace/nobackup/linux-test.git/include/linux/string.h:390,
from /work/build/trace/nobackup/linux-test.git/include/linux/bitmap.h:13,
from /work/build/trace/nobackup/linux-test.git/include/linux/cpumask.h:12,
from /work/build/trace/nobackup/linux-test.git/include/linux/smp.h:13,
from /work/build/trace/nobackup/linux-test.git/include/linux/lockdep.h:14,
from /work/build/trace/nobackup/linux-test.git/include/linux/spinlock.h:63,
from /work/build/trace/nobackup/linux-test.git/include/linux/wait.h:9,
from /work/build/trace/nobackup/linux-test.git/include/linux/wait_bit.h:8,
from /work/build/trace/nobackup/linux-test.git/include/linux/fs.h:6,
from /work/build/trace/nobackup/linux-test.git/kernel/auditsc.c:37:
In function ‘sized_strscpy’,
inlined from ‘__audit_ptrace’ at /work/build/trace/nobackup/linux-test.git/kernel/auditsc.c:2732:2:
/work/build/trace/nobackup/linux-test.git/include/linux/fortify-string.h:293:17: error: call to ‘__write_overflow’ declared with attribute error: detected write beyond size of object (1st parameter)
293 | __write_overflow();
| ^~~~~~~~~~~~~~~~~~
CC arch/x86/kernel/tracepoint.o
In function ‘sized_strscpy’,
inlined from ‘audit_signal_info_syscall’ at /work/build/trace/nobackup/linux-test.git/kernel/auditsc.c:2759:3:
/work/build/trace/nobackup/linux-test.git/include/linux/fortify-string.h:293:17: error: call to ‘__write_overflow’ declared with attribute error: detected write beyond size of object (1st parameter)
293 | __write_overflow();
| ^~~~~~~~~~~~~~~~~~
AR drivers/nvmem/built-in.a
make[4]: *** [/work/build/trace/nobackup/linux-test.git/scripts/Makefile.build:229: kernel/auditsc.o] Error 1

I'm currently too busy eating turkey, so I'll let someone else figure this out.

The issue appears to be a known GCC bug, though the root cause remains
unclear at this time.

A potential workaround has been proposed, which you can find here:
https://lore.kernel.org/linux-hardening/202410171059.C2C395030@keescook/

However, it seems that the patch has not yet been accepted into the mainline.

I didn't pull that into the audit tree because it isn't a real patch. Looking at it again on my phone before today's holiday stuff kicks off, I don't have a problem with the workaround, but i do need to see it as a proper patch with a commit description, sign off, etc. before I can merge it.

For anyone who is going to put together a patch, please make it clear that it is a compiler bug and provide the associated bug report links.

--
paul-moore.com