From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAB9C3DE42C for ; Mon, 4 May 2026 18:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777920945; cv=none; b=gj5LFstxAFN92CbIjO+YzP++PgcZakaIlXRaiZLJW9N0ne161V/2yJNq5izibojllCayXU0Yzg977y7SOK7NoejF7IT7pjjIXWJyE7k7fSp+fKGlIyxYUeYDLbRWNjjJCaipfsnvAEUDLRbUpWFbWJp3xlqBDwJsUTbQO5Z80Go= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777920945; c=relaxed/simple; bh=J9RoJy40EqeSlTwS3lFcthxbl6NE7GxI6UtEfVoMQTw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gFikQ5PE/V0GFYpL6xI6i/e1FILqZeuVjWYxJfMjn/aXkAKJO6JdJVl6Gyt+HdPPmCakudD8Jg/y5hABguCumPYjL5LhtPXFWhSMCTd7i0LBHwRFWuT8rslOdHY0u5uvtXfl0PsU08wg9pGk/3hb1x5kjQuzyHKrbejm3nrq2jI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DhBsySXW; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DhBsySXW" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-834da62e52dso2130349b3a.3 for ; Mon, 04 May 2026 11:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777920943; x=1778525743; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9ekag8HpagqUYt6GzX/RCTDXN8ntakuY7kIa4gof9sg=; b=DhBsySXWl4cudNOKXpiL4atRQW9/vXUyq4Twd05S1zH92AWml5Da5fesyMKy/SfIJq l9yMzIsnq/I9eeDoSHEAdYaJ7ltIvdJeWqEs8sWAfiy+8cQXOzLTjG/6YPjPC2ewTXju hqbE8ihW04sQnewv+xFBFEf5bxvI/96LiFeXnkJsXtMFHYw4xr2qYimZuTIrcVKarNyF rDwB2OWDR1z34Fxurcc2KargpDjBRyhIyFpLkdOW/u/ctbAioSBt4q/lH/69YssmeVwa ck6WZt3KoRMztNO2EEGfjgZkR+QrRklXCU7CCgU1uZ505GYAQLQseixvtJW7++mQQE1K FidA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777920943; x=1778525743; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ekag8HpagqUYt6GzX/RCTDXN8ntakuY7kIa4gof9sg=; b=pnr7BSP7ZNkuQE6Co07KIQas2Xn1gXJ80OYhWBpa27dR+kxflhsrKgmOGQoneZ+VaC j2oWc3/uZhbeYv3I1MoFzdYyrwyj34hI1pJvM2PrQHlef5d/S08dVVFrcpgm/kMZs/it 7oCu3wBwjr7A1GIxbmYpJMLhNrp97krE0NuqInT+w3WH6b3Js2sJw4jwsqGLcHoBgfeA g6fZFzZbjCGr23106C2ZrHB6J5OuC8SZoxrhGWJLAvx3yJIU+7GHuySIrMLFe84AwqSW keeLlDNSrQYLf5nENTYjIFNrWY1YAFSUpY6TWyWPGVc8TTsxkpKuGhG/8n2bE9LhBQYx cN9w== X-Forwarded-Encrypted: i=1; AFNElJ/8sajdvS/EW/dLD57BJdQyDd0w1SAEkCaMyvAMVNNLrDTS7FJikyAQ6Hr+RHJNXU4Rwf+6FgLbel+1riE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+Xdpzr2WayGGIsjLN8GNCL0xVkry0ya090Q5Mh1zXNJHMRTee 6XZWb9doq8B2C8nKdU0DfNbJ+d+KeXVHta81i/zGO1Xpu3itXWrLuFR2 X-Gm-Gg: AeBDiesHkSoCm/6VA6ZWpC3w7qiM+93YLmxNARXFVvdy4v/skuyZXEa8JfYs6oYHprJ QpvhSwiJdk3YpF/8QZ2Xk0LVazXOZoyyHjMnruLyyCXQmdz7sLufQx6SRfc343fh4/yAf0rUqKa yxxGS/63SNj7xu2fmpv0qf3ezV09y1c6JZX5eWUDvN3ugTG6vo+E2waAMGnBp7nKzQzYBKr/lTt GMNMz1zIocDPmm6oi/YuN9BNgPDKLMFtv/ohqdp1DVlMNZzErGjMsUJh4SY9dIRVCQi1HqYIbsA 4Gu8wfwDFZm0z8VeCEBSP/WlHdI0AIAXzWj1u1gJyxBHnGKoaGZrnvNvTdDN/ksai/ltWPlFWFG cCg1RhHkTjzkXkkzQhDx1tXLZ2eUhH2xFRJ7pDMhPpc4tE/e+FSMtqCPIS5EMR9caHgSXzsstVl WKvICTPKNJ5f2EJljjlIy1CvlcgndbcuPhLNbvwhoeIaKqtXjFd2qrIg== X-Received: by 2002:a05:6a00:3003:b0:82f:2b0:2809 with SMTP id d2e1a72fcca58-83921df9f9fmr143440b3a.1.1777920943043; Mon, 04 May 2026 11:55:43 -0700 (PDT) Received: from v4bel ([58.123.110.97]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8392b7ca908sm8605b3a.27.2026.05.04.11.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 11:55:42 -0700 (PDT) Date: Tue, 5 May 2026 03:55:38 +0900 From: Hyunwoo Kim To: Steffen Klassert Cc: HexRabbit , netdev@vger.kernel.org, Greg Kroah-Hartman , Herbert Xu , Simon Horman , "David S . Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ido Schimmel , linux-kernel@vger.kernel.org, imv4bel@gmail.com Subject: Re: [PATCH net v2] xfrm: esp: avoid in-place decrypt on shared skb frags Message-ID: References: <20260504152712.76305-1-h3xrabbit@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, May 04, 2026 at 08:47:04PM +0200, Steffen Klassert wrote: > On Tue, May 05, 2026 at 03:01:15AM +0900, Hyunwoo Kim wrote: > > On Mon, May 04, 2026 at 11:27:12PM +0800, HexRabbit wrote: > > > From: Kuan-Ting Chen > > > > > > MSG_SPLICE_PAGES can attach pages from a pipe directly to an skb. TCP > > > marks such skbs with SKBFL_SHARED_FRAG after skb_splice_from_iter(), > > > so later paths that may modify packet data can first make a private > > > copy. The IPv4/IPv6 datagram append paths did not set this flag when > > > splicing pages into UDP skbs. > > > > > > That leaves an ESP-in-UDP packet made from shared pipe pages looking > > > like an ordinary uncloned nonlinear skb. ESP input then takes the no-COW > > > fast path for uncloned skbs without a frag_list and decrypts in place > > > over data that is not owned privately by the skb. > > > > > > Mark IPv4/IPv6 datagram splice frags with SKBFL_SHARED_FRAG, matching > > > TCP. Also make ESP input fall back to skb_cow_data() when the flag is > > > present, so ESP does not decrypt externally backed frags in place. > > > Private nonlinear skb frags still use the existing fast path. > > > > > > This intentionally does not change ESP output. In esp_output_head(), > > > the path that appends the ESP trailer to existing skb tailroom without > > > calling skb_cow_data() is not reachable for nonlinear skbs: > > > skb_tailroom() returns zero when skb->data_len is nonzero, while ESP > > > tailen is positive. Thus ESP output will either use the separate > > > destination-frag path or fall back to skb_cow_data(). > > > > > > Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible") > > > Fixes: 03e2a30f6a27 ("esp6: Avoid skb_cow_data whenever possible") > > > Fixes: 7da0dde68486 ("ip, udp: Support MSG_SPLICE_PAGES") > > > Fixes: 6d8192bd69bb ("ip6, udp6: Support MSG_SPLICE_PAGES") > > > Reported-by: Hyunwoo Kim > > > Reported-by: Kuan-Ting Chen > > > > I dynamically tested this patch and confirm it resolves the > > issue. Clean work. > > Feel free to add a Tested-by: tag. > > > One correction request before merge -- please drop the > > second Reported-by tag (your own) from the trailer. > > > > The report and patch for this issue were already posted on > > the public netdev ML 6 days ago, i.e., the bug was already > > publicly reported: > > > > https://lore.kernel.org/all/afLDKSvAvMwGh7Fy@v4bel/ > > > > Credit for patch authorship is adequately covered by > > Signed-off-by alone. Setting aside that your work proceeded > > independently rather than as a review of my earlier > > submission, the trailer should conform to convention to > > avoid future misunderstanding. > > The issue was reported independently, so both Reported-by tags > are valid. But indeed the Signed-off-by tag should cover the > second one. I've applied it to the testing branch of the ipsec > tree to make it available to our test systems. I can still fix > the tags on request, no need for a v3. > > > No objections to the patch itself. > > Thanks a lot for your effort! Hi Steffen, Thanks for the Tested-by tag offer -- please add: Tested-by: Hyunwoo Kim And please drop the second Reported-by: line as well. Appreciate the careful handling. Best regards, Hyunwoo Kim