Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2174228iof; Tue, 7 Jun 2022 22:10:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxcPUsXXjcXqlU9synR9/3U5UwXprTXQFHegg+KSA9jmbA31UucWgmcMa+UpU+XbiLxyZw X-Received: by 2002:a65:6e96:0:b0:3fd:c8b7:5fa6 with SMTP id bm22-20020a656e96000000b003fdc8b75fa6mr11193681pgb.569.1654665058197; Tue, 07 Jun 2022 22:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665058; cv=none; d=google.com; s=arc-20160816; b=uq8oUHjkAwFj0COsTr8as3kLxgey07F2DVcZL6L+MpYigJbiecSlDWICaQRnaULLy0 VOnQKb2iDDxwUfzDiwADDELi+PLeRznSxKK7PI+6wR1mJd7Nk2OINe+g09YB3jClt/uN n3mRrF1W4GFMUmK41NKoAp+nqASTv6boEI1ytoS+QsfbJqudNN5S4NDora4+30E8W7Of +kN8bFG7CRGjUQZ2hKv8XcPsexxmxfkNpAMj73Ar0tc87THle6SAVXAQNOGYlQeh2cLW qop9O1CPuh9S41K36f8TrbEHcCpqbsUesZHUdrF9F2/MRvKUmn8CliV+xbZgaNpjcMdy fE8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0OzpVh9sqx9vqq67khg7rw7z7ikkZBMxVOUVuYHS3EY=; b=oW7A9V0RKl/8CywW9BaW9+SET6k7+Dgmvm0BL8pi+um08HOXMHHHyhFDiEL00rrMkl pFLvlTIT57+qKBQ+MW5DlYUSqqXc7s22KLM2M+BFndFUnDmQQ8m3RgLfLmi035oW92bv NCZyrVvB4qTZ/ZJI32XTarmDQsZv7tM0K0McxNQaD8Z+zalZG5rjD2B4UFq3ipgQjc+F Sma5wCaQ7DxGUPd/iGzqT4saye6HcO16T/FExFcFdEVMr6GQEh9zZkdC9cFxqyiZ9ibZ IJ3PUwGuPQ+qqP+vRKvDvL0OqT6Vh4Ir1ZF1JlvcnL7J7gN+manHPDqYkDkBExZPNb03 pT5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zefBUM+U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e11-20020a170903240b00b001588973b195si4644860plo.436.2022.06.07.22.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zefBUM+U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8EFB940079D; Tue, 7 Jun 2022 21:41:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350007AbiFGSKS (ORCPT + 99 others); Tue, 7 Jun 2022 14:10:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349411AbiFGRur (ORCPT ); Tue, 7 Jun 2022 13:50:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA8517048; Tue, 7 Jun 2022 10:38:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4F14CB822B5; Tue, 7 Jun 2022 17:37:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3FF3C385A5; Tue, 7 Jun 2022 17:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623464; bh=PP6xuZ+OYIWi/Lg7w2BAYMZ4Np2wleQMLd4YyDw0zp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zefBUM+UhjI3jzP8SF2JkbJzjaiKt7w5StznelQXkCO+fHWUEvdoKAQ0s3lEjalJ+ saLp9aY3phFYyWUq/7HqRIKRxWtvYf3LCjHXGxFFv5tuQzFF3mEQY/Twtxi6k+Okjx jqpsd0b+NiopQgx6yTGCQogI670wQsoAtZuKdivk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Elder , Jakub Kicinski Subject: [PATCH 5.10 428/452] net: ipa: fix page free in ipa_endpoint_trans_release() Date: Tue, 7 Jun 2022 19:04:45 +0200 Message-Id: <20220607164921.309516217@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_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 From: Alex Elder commit 155c0c90bca918de6e4327275dfc1d97fd604115 upstream. Currently the (possibly compound) page used for receive buffers are freed using __free_pages(). But according to this comment above the definition of that function, that's wrong: If you want to use the page's reference count to decide when to free the allocation, you should allocate a compound page, and use put_page() instead of __free_pages(). Convert the call to __free_pages() in ipa_endpoint_trans_release() to use put_page() instead. Fixes: ed23f02680caa ("net: ipa: define per-endpoint receive buffer size") Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ipa/ipa_endpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1179,7 +1179,7 @@ void ipa_endpoint_trans_release(struct i struct page *page = trans->data; if (page) - __free_pages(page, get_order(IPA_RX_BUFFER_SIZE)); + put_page(page); } }