Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp733369rwb; Wed, 26 Jul 2023 01:47:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlHbOtnWtruPjnwMAtwflZC5YKUylE0RL5/8PL2tLtaBLNVrfIzzdKzBLYEqslFXUTspqrQi X-Received: by 2002:a05:6a00:21c1:b0:682:537f:2cb8 with SMTP id t1-20020a056a0021c100b00682537f2cb8mr2024107pfj.26.1690361259253; Wed, 26 Jul 2023 01:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690361259; cv=none; d=google.com; s=arc-20160816; b=X07uOxmCX++hAt1cLm4oaZz0EJd5iO70nCN58KIaSguZacPD9rUo2aJlJMVg2yBQrB O7vdqINDrCyt23gUMoEQM0VgnX0C5XhZByGgEt3BUzv9Aat/PiqwPgvC6qmPxhR+QY5R 6EDtNL5zWTEyTFWrTgfioRxNcE0FjD5J0u/Cos0lQRDaOOT2efNp6Y692k+2gkkZrOzl GvSBpH+TzGOHSZ5cogEzIygcBjKeuAp7M4Z09IoWFm/UDpB5Wxrm3tkPEPWdxu1MYOn3 VcmaSfpkbw603+uslR9qlsDAYCxujQNB0NeNe/kKig7ojOEO1F3RlQ4wSWl597RA5Vl+ LylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=aeQuLi++SQHFpVVi2gTFekFdVrx5XJGUiFscGV8s7L8=; fh=2zT/TfH6EPP+jxBz15kHdFA1ozZ4wPp2+/msXuRVueo=; b=U3oJACghFMaYPBCZekfhrAkq7MZn1Bvm+yq1jXszKKiwbrA1/psfU1KDZGTmKQDfNf lX7XqGSEfEeQKTCqSd+ETT0qKDxg6e9ZEtxpXLlf1JZXXNBjEWNtTrDd8/GR4uq/3mR+ HhtCmQh/0Pl67Hq7PQEeJVy5/zkbPDgl8lgp0fxDOiTfi68kTE6Kw9Hw+VGgkwh4MXsA Saxw6QxhTR++3RiAbpeObtfJ7JOyS3bSmXIf5HAxEGYGSIZV0so4URx53hfjgi6dTUDu MTdkU4kIb6ZCk+gPtWoXAIjD2ueFurz+i9JmsVBID3u6WMIDlA3VkOI8Iups1q+F1GU0 tY+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="X/dldOHx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cj25-20020a056a00299900b0067b77e7f46csi12969899pfb.187.2023.07.26.01.47.24; Wed, 26 Jul 2023 01:47:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="X/dldOHx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbjGZIhk (ORCPT + 99 others); Wed, 26 Jul 2023 04:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233322AbjGZIhR (ORCPT ); Wed, 26 Jul 2023 04:37:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C86C4EDD for ; Wed, 26 Jul 2023 01:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690359932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aeQuLi++SQHFpVVi2gTFekFdVrx5XJGUiFscGV8s7L8=; b=X/dldOHxbevdZD9fSssoANqjyf8kIxDQY6OwFsW0WGzY5zMoAVg0yrZIFrlmRLA0+tu4bY TvLSHHVOu+d2z8c9eVJ7kMeupERJsQbiSuEqrYDZPedSLEjPa5yvn0LXEOTu5irRoUBsvp uoolRmJDJgDnJWTpI/0KxWt7e7Oeh1I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-180-hJ7vv31jNuqszxCiSc-tUw-1; Wed, 26 Jul 2023 04:25:27 -0400 X-MC-Unique: hJ7vv31jNuqszxCiSc-tUw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 881B0894EDA; Wed, 26 Jul 2023 08:25:26 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.242]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC98C492CA6; Wed, 26 Jul 2023 08:25:24 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <000000000000273d0105ff97bf56@google.com> To: Sven Schnelle Cc: dhowells@redhat.com, syzbot , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org Subject: Re: [syzbot] [mm?] WARNING in try_grab_page MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <125070.1690359924.1@warthog.procyon.org.uk> Date: Wed, 26 Jul 2023 09:25:24 +0100 Message-ID: <125071.1690359924@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sven Schnelle wrote: > However, hash_sendmsg() also unpins via af_alg_free_sg() in the error > path. From an API perspective, i would prefer if extract_user_to_sg() > does the unpinning on error. Any thoughts? In the event of an error, extract_user_to_sg() unpins only the pages it added to the scatterlist; it doesn't unpin any pages that were already there and doesn't free the scatterlist; it also decrements sgtable->nents so that the caller doesn't see the pages it attempted to add, so calling af_alg_free_sg() shouldn't hurt. Note that the error path also frees the result, so we do need to do at least part of it. David