From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB9A88820 for ; Fri, 10 Mar 2023 14:50:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42BFBC433D2; Fri, 10 Mar 2023 14:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678459811; bh=PEA5Ct73r+dldQmS2xxBcKP9MLwQWjRGymWTGuIiyzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2b+EDwXLwRw0Gz/thWxgzrKcIZwWw/3uVpLjGsRsB57C25M6mP/GKEdGDKK5bbvE9 1+L6kLX8AIqa9Xh0DOhVgM+oL79TkI9MZC9wbGJyJuM3rL6iwYSxQbP6AXbaBChi/Q IgoNQfyvyPA1vkxbA/KgPtiI8fxURkA1wWuLS7+g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paolo Abeni , Pietro Borrello , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 128/529] rds: rds_rm_zerocopy_callback() correct order for list_add_tail() Date: Fri, 10 Mar 2023 14:34:31 +0100 Message-Id: <20230310133810.911387383@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Pietro Borrello [ Upstream commit 68762148d1b011d47bc2ceed7321739b5aea1e63 ] rds_rm_zerocopy_callback() uses list_add_tail() with swapped arguments. This links the list head with the new entry, losing the references to the remaining part of the list. Fixes: 9426bbc6de99 ("rds: use list structure to track information for zerocopy completion notification") Suggested-by: Paolo Abeni Signed-off-by: Pietro Borrello Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/rds/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/message.c b/net/rds/message.c index b363ef13c75ef..8fa3d19c2e667 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -118,7 +118,7 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs, ck = &info->zcookies; memset(ck, 0, sizeof(*ck)); WARN_ON(!rds_zcookie_add(info, cookie)); - list_add_tail(&q->zcookie_head, &info->rs_zcookie_next); + list_add_tail(&info->rs_zcookie_next, &q->zcookie_head); spin_unlock_irqrestore(&q->lock, flags); /* caller invokes rds_wake_sk_sleep() */ -- 2.39.2