From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EC5C18C92E for ; Mon, 28 Oct 2024 05:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730094146; cv=none; b=Gf3yjCdkBb6+j6R8O7Uu6WcZNU1sodsF18JP5RMw62NGSKtsPbw0EUyPJteIoZZ4JfYsNW1RaSZMxYMyEp5DdqCzX9mWNawrKZR/PKpb2GeZRz7Rq8AgIt8xhF4OhEECaUri2LD1nUhsuuzb+KQnhGgOo6go8GNoPJaLvTe3wzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730094146; c=relaxed/simple; bh=iZJDBmewrqSqINIiyukj1T9906bliPxi/ce+MGLFIN8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fxEpdxiBbX626MnmbLXDanHKRfjUluLODXK01Mc6WeCzimKzGv69jfZDdWI6QUvmsS3EcOox+9QmMkKvM+BKhbJDwdaEaXvbVBjdXvYrOWlzC8M7tGJrbXme97fGC++YH0ocku07m1GCUuVNzJpH0/HctgUJmG7CmJmSSed+gEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=wwaYkLlz; arc=none smtp.client-ip=91.218.175.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wwaYkLlz" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1730094140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T69UsbBUL523sfFP32uSh2+sUnNKiKJ6dIRsDgjuqrg=; b=wwaYkLlza+vQIXMqdX9AdzWvv0ci4ah34dpnpFgKG/gvinM0w7UWqmOIeuxU5HDX4y5hQ6 TzpMPnjDnZBhoymR5n/GWzjn0p8lO72kZGIf/KL6XaUrS0RqVknNUsV7KkYbV2jFwWywOj V04hHDKQkJRmY2WqVs+E8cemAdcswh4= Date: Sun, 27 Oct 2024 22:42:08 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net] Drop packets with invalid headers to prevent KMSAN infoleak Content-Language: en-GB To: Daniel Yang , Martin KaFai Lau Cc: Daniel Borkmann , John Fastabend , Alexei Starovoitov , Andrii Nakryiko , Eduard Zingerman , Song Liu , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "open list:BPF [NETWORKING] (tcx & tc BPF, sock_addr)" , "open list:BPF [NETWORKING] (tcx & tc BPF, sock_addr)" , open list , syzbot+346474e3bf0b26bd3090@syzkaller.appspotmail.com References: <20241019071149.81696-1-danielyangkang@gmail.com> <5c8fb835-b0cb-428b-ab07-e20f905eb19f@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 10/27/24 1:49 AM, Daniel Yang wrote: > On Tue, Oct 22, 2024 at 11:14 AM Martin KaFai Lau wrote: >> On 10/21/24 6:37 PM, Daniel Yang wrote: >>>> A test in selftests/bpf is needed to reproduce and better understand this. >>> I don't know much about self tests but I've just been using the syzbot >>> repro and #syz test at the link in the patch: >>> https://syzkaller.appspot.com/bug?extid=346474e3bf0b26bd3090. Testing >>> the patch showed that the uninitialized memory was not getting written >>> to memory. >>> >>>> Only bpf_clone_redirect() is needed to reproduce or other bpf_skb_*() helpers calls >>>> are needed to reproduce? >> If only bpf_clone_redirect() is needed, it should be simple to write a selftest >> to reproduce it. It also helps to catch future regression. >> >> Please tag the next respin as "bpf" also. > I have a problem. I can't seem to build the bpf kselftests for some > reason. There is always a struct definition error: > In file included from progs/profiler1.c:5: > progs/profiler.inc.h:599:49: error: declaration of 'struct > syscall_trace_enter' will not be visible outside of t] > 599 | int tracepoint__syscalls__sys_enter_kill(struct > syscall_trace_enter* ctx) > | ^ > progs/profiler.inc.h:604:15: error: incomplete definition of type > 'struct syscall_trace_enter' > 604 | int pid = ctx->args[0]; > | ~~~^ > progs/profiler.inc.h:599:49: note: forward declaration of 'struct > syscall_trace_enter' > 599 | int tracepoint__syscalls__sys_enter_kill(struct > syscall_trace_enter* ctx) > | ^ > progs/profiler.inc.h:605:15: error: incomplete definition of type > 'struct syscall_trace_enter' > 605 | int sig = ctx->args[1]; > | ~~~^ > progs/profiler.inc.h:599:49: note: forward declaration of 'struct > syscall_trace_enter' > 599 | int tracepoint__syscalls__sys_enter_kill(struct > syscall_trace_enter* ctx) > > I just run the following to build: > $ cd tools/testing/selftests/bpf/ > $ make It might be due to your .config file. The 'struct syscall_trace_enter' is defined in kernel/trace/trace.h, which is used in kernel/trace/trace_syscalls.c. Maybe your config does not have CONFIG_FTRACE_SYSCALLS? > > I can't find anyone else encountering the same error.