From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (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 B4B601EEE4; Fri, 13 Sep 2024 17:24:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726248266; cv=none; b=eiZRiXLjvxikoYyrvwx9YewrJmswrlsBwyLIpqzQWAB5Mf3Zxuz1lsyS/jWfMLbd5CTQmof06xfVyb84+If0t9Nyq10vK9phk4aNB+vQrryABqNuYF/di+UN4oUzuUjNlpzP/r9pGzeRf3k1e6iwmfPsLMooSOoKkw9rIvmiDVE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726248266; c=relaxed/simple; bh=sllu2LtMOhcdH/FD8wUSmEhJWjy45HTpNiNXgVAUspU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=W6d9rI4buhMyghtEFb88LzzWRx9F2PcRgSxcJMe2F2jElJK0OA24kGShvjrV9c4AOranFtFORK1KynlSBuB+oJ9aYbvjlI56KQRMKh2ouOyUAxw/xeOoBigF/682Cwiy+ik6lHozrKC6LS1+OEsdl88taFwjudnptWVj+2M9ueE= 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=Yk6uccGY; arc=none smtp.client-ip=91.218.175.174 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="Yk6uccGY" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1726248260; 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=eUlMI/VUG0tbtBW/0vyoiiaa/eRH5yrftzcJDI7pfa4=; b=Yk6uccGYN6b+Y8rna0u6tXJc1FyRwl3xoyTZX3NS+dAPIOwIqURDELqvdltb8saVILHLKL 7PBy7oqaLuG2UqwAsSfCyCvkQrO2/FVD+0bJ2DQDaFpSTgZdACLrpjp96GU8e8GHJWLCxP bVc3vdUJ6gUo+6M8+OEDHunEIIMXq48= Date: Fri, 13 Sep 2024 10:24:09 -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] netkit: Assign missing bpf_net_context To: Breno Leitao Cc: kuba@kernel.org, bpf@vger.kernel.org, Daniel Borkmann , Nikolay Aleksandrov , "David S. Miller" , Eric Dumazet , Paolo Abeni , Alexei Starovoitov , =?UTF-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Jesper Dangaard Brouer , Sebastian Andrzej Siewior , vadim.fedorenko@linux.dev, andrii@kernel.org, "open list:BPF [NETKIT] (BPF-programmable network device)" , open list References: <20240912155620.1334587-1-leitao@debian.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20240912155620.1334587-1-leitao@debian.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 9/12/24 8:56 AM, Breno Leitao wrote: > During the introduction of struct bpf_net_context handling for > XDP-redirect, the netkit driver has been missed, which also requires it > because NETKIT_REDIRECT invokes skb_do_redirect() which is accessing the > per-CPU variables. Otherwise we see the following crash: > > BUG: kernel NULL pointer dereference, address: 0000000000000038 > bpf_redirect() > netkit_xmit() > dev_hard_start_xmit() > > Set the bpf_net_context before invoking netkit_xmit() program within the > netkit driver. Acked-by: Martin KaFai Lau