From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 00E60204687; Mon, 24 Feb 2025 22:26:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740436006; cv=none; b=rVChCcV9xq7NvYnFcn7USHS+b4N7SAoNtq8R3DQm/tz213y7IBudTUM6PHcN/2vAmbvrJ8Pv6g137uSzvCoZLnLfLddCLfujN7eE7qst7jjzFGDDzDaqC7e4OtyVciyPj6RUMV41JQvjgUobtTxuu7FWA/YNe4JVGXnUmlGyxSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740436006; c=relaxed/simple; bh=QcYkjBOdJxVH7cTUR2mujk8yFO9GgvzVk3JPMLEdJYY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JNiHsMfTi80muNX6i8CYai+jbDLymlRXgB0DI/d/+ZHqt7hmm/QBRk8Za4YW5HR+z45C7wcVW/lopP7RQ72Bg51z2VKcfLEu5LtRpFFf8SFRmox56ctfxFCuWZ6vEqut7aQ5Pq9fknMQR4dIa1ZUYJ9UKf9BQ6DknitjkXKsoGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oDkB0OAs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oDkB0OAs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E195AC4CED6; Mon, 24 Feb 2025 22:26:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740436005; bh=QcYkjBOdJxVH7cTUR2mujk8yFO9GgvzVk3JPMLEdJYY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oDkB0OAs0nKzmO2rtq1kGyfMOb3Qqw6+x5fFKJhmM5XXmzHb3U09awJj5hIIJ6/6L dWzeZ4yx3oQJmfv3VN4VxX6tPZFJGyvCgoHFnLx6EQeuhAAw13S8qCivfOf6LkQ+F0 u9isopyZEYfXbejwBRpkLmB4V19EIQxhyndApNOCUtgrrLnk8Tc9LWasW+Q88a9rZC C6fiBbsvoj3NPOZo7FWodAk/Z2hC1Hiqz1VyGMi4r4f+ZIEwbVSkGYgAv2R/Wg9Qqf 1PJlMpX+MBuXmyThuyOJoSCLezYc16xLq8ibWm/4t1ELDcj1e7iOp4q3ki5CQyzwxx qB7B3m8sUFOfQ== Date: Mon, 24 Feb 2025 14:26:44 -0800 From: Jakub Kicinski To: Jiayuan Chen Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, horms@kernel.org, ricardo@marliere.net, viro@zeniv.linux.org.uk, dmantipov@yandex.ru, aleksander.lobakin@intel.com, linux-ppp@vger.kernel.org, linux-kernel@vger.kernel.org, mrpre@163.com, syzbot+853242d9c9917165d791@syzkaller.appspotmail.com Subject: Re: [PATCH net-next v2 1/1] ppp: Fix KMSAN warning by initializing 2-byte header Message-ID: <20250224142644.7c084e9e@kernel.org> In-Reply-To: <20250221061219.295590-2-jiayuan.chen@linux.dev> References: <20250221061219.295590-1-jiayuan.chen@linux.dev> <20250221061219.295590-2-jiayuan.chen@linux.dev> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 21 Feb 2025 14:12:19 +0800 Jiayuan Chen wrote: > + /* Check if we should pass this packet. > + * BPF filter instructions assume each PPP packet has a 4-byte > + * header (e.g., those generated by libpcap), and then default > + * to skipping the first 2 bytes at the beginning of the > + * instruction. However, we still need to initialize these > + * 2-byte new headers to prevent crafted BPF programs from > + * reading them which would cause reading of uninitialized > + * data. Here, we set the headers according to the RFC 1662. > + */ > + *(u16 *)skb_push(skb, 2) = htons(0xff03); The constant from the RFC deserves a #define or enum. Looks like we may already need it in one other place: drivers/net/wan/fsl_ucc_hdlc.h:#define DEFAULT_PPP_HEAD 0xff03 -- pw-bot: cr