From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (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 55BFF3A7F72 for ; Sun, 3 May 2026 06:23:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777789431; cv=none; b=hWo1SDhNQqQVbtRJoNyr7uRqSRQ8Gg1mEReAcmtocOTmNtN/ZHkKbrNca1V/Jl2qxo8hAaMSIfriOopaPvvBHInRDjXawe1DW/V0kQ8CWNXYFLeH7+7360UkGz9Bedff/VxFEwHmlGZIjiQb1CsvvRkRSPoyIJXDg//RXvdUoeg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777789431; c=relaxed/simple; bh=Fsmgq5cAKrXPL9pLv0TXR5n4zPRRZMK9jy8Mv9X5XLw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pQGk8bAbFr1SJ37wu4yFmQu65sW6UV0myohG6uX3VJXF6pyDiCAXwRT4PWbjOisViZC4hG+GbPGdC5b9qtIm4KyuEqM76v9QTRkV9VTOgCbhUyZPy7D99bd1swJzZGG/iDidLMdhmf6F9z0cs2/c8Hv/CWvo9C/GyPpBlsVEQ0M= 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=Jnusn47/; arc=none smtp.client-ip=209.85.216.51 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="Jnusn47/" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-3651fa24c6bso405047a91.2 for ; Sat, 02 May 2026 23:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777789430; x=1778394230; 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=jauMLsv8rVhaM9q3nubRO4klXhEWZOV4Z40Yc2+Ynwc=; b=Jnusn47/gLBcYwmf37RoNooyu6JOJii+mFOmJnqk1EiwQoUgYVe/hZQRJ1S+6om7Xh gTIyc0YfmMBYDR9jO4pp1EwYVN3VBgeQ94u1CnofFGv3xqRa5v9HdnW749wVTvxfybLr 04G6VQyZIN45aMLBRMbdJOy8+djOxcKBikODtPrpsVOqNPBa45arDuK088idEKEacfFI z9UhLu4Fuk+JYdI4NeTDjrdaslYW79wID27/zA2g8fyNIPMJfgpaMknGC9trGuiCgZQn 7cfB5AMwC3lSgD5zfO8/voUeMI3ve03uCnoDsPXU/DF9axD0O5UY/1qTHYh6ODYSFVL3 ZCyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777789430; x=1778394230; 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=jauMLsv8rVhaM9q3nubRO4klXhEWZOV4Z40Yc2+Ynwc=; b=sxbUI2TlRIjjaMYk7+mOeo/caRo3JaaYpOTOhukNPODPt3uWcGMJp9pbEgz39Z7luq 72VhOt1gnisQhFMQleLGbu4TS60GHD1jOnAOk2+/0u8AnloKttQdzT1HFSZadbDAZ781 bCwUbgjRDqws2gdpkRlNA02zDwFa5PbV5dl9nBL5tlm4qaS5uVDsxN4Bjli8Wp44bMQU ZKr2pZf2NQXP1Tbpm12ZJYKO5mSWL1VEy43WvQ08OTheMz7ZD6tEyXPaU6Ds/kROA6KS KQtuhKfkMBnNIItI1YCccLar2Km8sFsiCTO4wX2t9r2Xb06AVXI/NblI1os3rvsyW6DJ js6g== X-Forwarded-Encrypted: i=1; AFNElJ+Pl7mipo9zAQHygFvDCTV1R4eTAaP8FPMATNoQ1dMv83mAgxSoXBccbOhI/t/q+5nyBrr+nvT5ZDZE3pY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5pEEOJpOQOTMGZwyd0wrepVxmd2lEsvJwiWz2VvpUdjYs/Gsq oQxe64KY6o9NxUiel/x/64YvOKXwjsoOzlSUnOcILPXBzZeP/QI1W4A26JqxXw== X-Gm-Gg: AeBDiesSMm3wnApnh34+kw1cmvtKTt3hcClfoDsaKuw5A1blKjvy6j9qpBDPj35+q8C CFX6B35/le2WX2gNKOlfyXd3autIjPKnb81Wvi3KofJRSV+0p6UyLymuXPq3o+XKs1jdEfEojyQ 74IKTv2lsfhWe8kzyJsFVnpietaxgaItTJ2nWorGpsIsouJNxsPFIC/5eWw7O28eidfDHEs6kyx H0hE8jbDrEQlT5pLZh2SdO3RHAjRB4zKsUwT57y5AOTGopc35ERWEm6aC1wPANjg29gyc5lsAoH g5+rAeg4jUHcy/3GlaBoV0K8WCxR3p/2CbZk2MsaHKsH25TDyxKmx2eZhvE0A2/GSjqEAHeUScr 8Veqh1R2OXEsJwiu57H7Xb0nk0DoxsmAqOa0UI/9ZynOKndRVG6cK3BqEo3ZgZGPTN0Lip5oeEs E0UROio34IgY+p3tMqgbZIwVIwpoDXDMpOZw1iZjga+35bEJb4+23AyQ9rLpbUApCJ X-Received: by 2002:a17:90b:3849:b0:359:87a8:e65c with SMTP id 98e67ed59e1d1-3650ce38382mr5709647a91.17.1777789429662; Sat, 02 May 2026 23:23:49 -0700 (PDT) Received: from v4bel ([58.123.110.97]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-364ebec736dsm7243126a91.3.2026.05.02.23.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2026 23:23:49 -0700 (PDT) Date: Sun, 3 May 2026 15:23:45 +0900 From: Hyunwoo Kim To: Ziyi Guo Cc: David Howells , Marc Dionne , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imv4bel@gmail.com Subject: Re: [PATCH] rxrpc: always copy skb on in-place decrypt to avoid pagecache aliasing Message-ID: References: <20260502211340.446927-1-n7l8m4@u.northwestern.edu> 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: <20260502211340.446927-1-n7l8m4@u.northwestern.edu> On Sat, May 02, 2026 at 09:13:40PM +0000, Ziyi Guo wrote: > skb_cloned() does not detect frag-level page sharing introduced by splice() > with MSG_SPLICE_PAGES. When such an skb reaches the rxrpc DATA path, > in-place decryption (rxkad/rxgk) writes plaintext into file > pagecache pages still aliased to the source file, leading to > corrupt the page cache of any readable file. > > Drop the skb_cloned() gate so skb_copy() is performed unconditionally > for DATA packets, severing the alias before decrypt. > > Fixes: d0d5c0cd1e71 ("rxrpc: Use skb_unshare() rather than skb_cow_data()") > Signed-off-by: Ziyi Guo > --- > net/rxrpc/call_event.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c > index fdd683261226..39d19a354172 100644 > --- a/net/rxrpc/call_event.c > +++ b/net/rxrpc/call_event.c > @@ -333,10 +333,12 @@ bool rxrpc_input_call_event(struct rxrpc_call *call) > saw_ack |= sp->hdr.type == RXRPC_PACKET_TYPE_ACK; > > if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA && > - sp->hdr.securityIndex != 0 && > - skb_cloned(skb)) { > - /* Unshare the packet so that it can be > - * modified by in-place decryption. > + sp->hdr.securityIndex != 0) { > + /* Always unshare: skb_cloned() does not > + * detect frag-level page sharing introduced > + * by splice() with MSG_SPLICE_PAGES, so > + * in-place decryption could otherwise corrupt > + * the source file's page cache. > */ > struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); > > -- > 2.34.1 > Hi, A patch for this issue has already been posted earlier: https://lore.kernel.org/all/afKV2zGR6rrelPC7@v4bel/ Best regards, Hyunwoo Kim