From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 647E4383C85 for ; Mon, 4 May 2026 18:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777917682; cv=none; b=Rpj+3uipjIZBnYeqHBIufjQa2zD0qQhsKDfR2+9/x5lxu3V9eQVBxOYPbpKV1l8I/ElDThP5Xm04K5bDQefGYL5kJAYNA2dvItzQHL15zmWUlmeAwloYzSltCC4sD4y6VORpbQjryuqjd/nuxV463/5EioFPPFdpQAuG80E4rU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777917682; c=relaxed/simple; bh=vs+JKxkWL4C9tFoqc20xdPetd8Tahq+BP7nzeAOMwXM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m9BWK7xHbIzlw3CkywyFf8l6xqURSbM8ScTl5ANYrkQpIz4AHIhYA7+zDlynLqyCgFgqLNN/JWuZFA2nIRClqnbGK1iyNASlUyWesqRViigVO3xxjgjMCSXkIOnVShuwacsLqjvRqqMBE0P0XqooGLynCXd6knNaXowcUKT5ckE= 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=oQ4gY85T; arc=none smtp.client-ip=209.85.216.48 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="oQ4gY85T" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-36536771300so926611a91.1 for ; Mon, 04 May 2026 11:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777917681; x=1778522481; 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=VMVg3MoSD5rf46bARIwWV/VX/i27SxbGd3T7TBit19I=; b=oQ4gY85TLUR/JBzNazNdh3k5eGM6BusFGxPGJUuPN47EzDDP93aZ0e+m7gMEm22qaT u5bmRNlFsAG2RJ1fpuvC//NzeGwAhbqWqTNHsl7Ea75w+DyJIlbc5NzVzvL5ewpjzGHJ I+rsPnjiLbcH9P00P00xNKvMIpDr9i0NDaa1HL3Ow8GnC6Ib4HXlvzhnPUtIPtauZqz/ Xc7qAOGrpauw0DJuxLwNwUWjcqktSfcWfrW+o1mFwJ1CMaZBJPNV0Vtu1nBypfMzMSfC qR5BIgtuIaXD9+P8fE/JSwfQKYdA6qMHtIB8YsCgwsa8Gk/gLR5Y2LosL0XLwJGmGc0/ kYsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777917681; x=1778522481; 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=VMVg3MoSD5rf46bARIwWV/VX/i27SxbGd3T7TBit19I=; b=JTNSEopYemhUqHTb3y4X+kzlkJfKAINwhNrymChBNqhI5gth8O6yMEZTysXw/OgAxP ixGmn9WrcEo7jQFWrjTq1JMkZY4QbwTOaFbQJwgzL14k27Q5IhcVcRg1S2mT/h7iTB0f jTwV5+YUbVrWUXGzZ6znuONFoHh4PF8UcA/iG6NEUW9eMsgs8q9aif3GHRkyC/AXvn6D rQjluAHNQfmOPu438efEgR8+kWGyo42R/UUwy3vgp70/3DmvZt6YhhVZWKd7zn0vi9qs ucZ3RhCaq3AquX2eo+0ngb7+v+yE+6ef50aGU3bM7fBt/53XCQYOvLcPwlHfT02WlAsA tXIQ== X-Forwarded-Encrypted: i=1; AFNElJ+ljG2de7CfNNrdDmgXR/NHUOf4BjE0odhgKzfN9ZdQDpMOFhTq4tDv589RBmw4l99OiRn0H+8+Zf7nKPg=@vger.kernel.org X-Gm-Message-State: AOJu0YzGmTH00RK1vnPhUcuBbRedI93zKg6xpJQIlP2DaBI4+PStbJ6K PhptnyJoR8K9ZWXjJw+WDOWCeWOmZrNTT0fm7KiVmjWugJRbCZpSehD1 X-Gm-Gg: AeBDieuJ2yS/2Th71SPd8Mh5e5qrs4gVgELW2ZOhw/BDFciGGBST8XqTDJ3LAnNOzHu xhK8UuCT0e0BAs57E2UP96Sarf4GWFiBiNWJK+UfWUIA3W5tuXCGi0GsEILXigg8bON6fNo+edu niDZKTc7Kqgg/BB5D/nb0uSdFsJwFNMTRWNojHNaoUPUZ7iiFoP2QzeyyAdsYlxddLKv5m5NAPT Ml17v4YCcO4hQAztLK31GKMh3Pe6lV5wrnX23HXkuAm1cGjANHlb05gh5WEzITZG+wyvGHcYQMW W1iO+Pb6UPh45cue76Z+/AA8N2Ylw3XzK3YpW3Mnu9MyMBELWuRRRfegRQBdNglRjwLnHuvxUUu uKhXuvDuTIM6WWDVg8yyzHwHHa4leYk7p82Ju8camyE2m0NkUubk00UqVx6asJMNmNXTo2DDSxD oFVv9I4sTFyg6arxf9ElOtSw9JGHjKIEHB/xPKaPvvUXBkqiNWPR/S/A== X-Received: by 2002:a17:90a:e703:b0:364:52d1:32b6 with SMTP id 98e67ed59e1d1-36572732f8amr394453a91.10.1777917680256; Mon, 04 May 2026 11:01:20 -0700 (PDT) Received: from v4bel ([58.123.110.97]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-364f488df2fsm5594991a91.6.2026.05.04.11.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 11:01:19 -0700 (PDT) Date: Tue, 5 May 2026 03:01:15 +0900 From: Hyunwoo Kim To: HexRabbit Cc: netdev@vger.kernel.org, Steffen Klassert , 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, stable@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: <20260504152712.76305-1-h3xrabbit@gmail.com> 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. 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. No objections to the patch itself. Best regards, Hyunwoo Kim