From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22F6FEB64D9 for ; Tue, 4 Jul 2023 09:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231576AbjGDJEj (ORCPT ); Tue, 4 Jul 2023 05:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbjGDJEg (ORCPT ); Tue, 4 Jul 2023 05:04:36 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA136127; Tue, 4 Jul 2023 02:04:29 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qGbxR-000RVO-1q; Tue, 04 Jul 2023 19:04:26 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Tue, 04 Jul 2023 17:04:18 +0800 Date: Tue, 4 Jul 2023 17:04:18 +0800 From: Herbert Xu To: David Howells Cc: Ondrej Mosnacek , Linux Crypto Mailing List , Paolo Abeni , netdev@vger.kernel.org, Linux Kernel Mailing List , regressions@lists.linux.dev Subject: Re: Regression bisected to "crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES" Message-ID: References: <1357760.1688460637@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1357760.1688460637@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 04, 2023 at 09:50:37AM +0100, David Howells wrote: > One problem with libkcapi is that it's abusing vmsplice(). It must not use > vmsplice(SPLICE_F_GIFT) on a buffer that's in the heap. To quote the manual > page: > > The user pages are a gift to the kernel. The application may > not modify this memory ever, otherwise the page cache and on- > disk data may differ. Gifting pages to the kernel means that a > subsequent splice(2) SPLICE_F_MOVE can successfully move the > pages; if this flag is not specified, then a subsequent > splice(2) SPLICE_F_MOVE must copy the pages. Data must also be > properly page aligned, both in memory and length. > > Basically, this can destroy the integrity of the process's heap as the > allocator may have metadata there that then gets excised. All it's saying is that if you modify the data after sending it off via splice then the data that will be on the wire is undefined. There is no reason why this should crash. > If I remove the flag, it still crashes, so that's not the only problem. If we can't fix this the patches should be reverted. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt