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 D68DBC636D3 for ; Thu, 9 Feb 2023 12:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbjBIM03 (ORCPT ); Thu, 9 Feb 2023 07:26:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjBIM01 (ORCPT ); Thu, 9 Feb 2023 07:26:27 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7FC3AA2 for ; Thu, 9 Feb 2023 04:26:25 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id eq11so1963036edb.6 for ; Thu, 09 Feb 2023 04:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=diag.uniroma1.it; s=google; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=5YFGvWHONsZaq676i+5BQUR6fT+K1OZMUM624Of9vyY=; b=pn/bWfmDky37Tek+LVpF3BQm5uYd+ZMYBSTu7gxAOQHKC+48qei0gojpXl6X0visn3 rseGDFiMVjV5HYJ2ncTVUrYkiuMn15RFkqzzEw9bgLbl6txVoE15muyMMXr5j4wK2oWP DrKqyortHFQqxwURAD5JAU8zwigRmHJu3NyLo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5YFGvWHONsZaq676i+5BQUR6fT+K1OZMUM624Of9vyY=; b=aJZTZiiok4+KoqfACjDW3HFQHtmh+LXwWQfZ/div3VkNcUZF5rASPC0atPjj6vyZAE JpZI44u3+mA+CyAk+6ZsNXqLVFxsgBBeNe8MyGPk/MbmSPnJ9QEssPgG/JtWtM1MV4sH i4bfkNinLh5MkA7GQljYKkPYXvZMIXeuPxBcpBEQgaugq5+Yo0CsIh4RsPQFXUzNAbm6 jf/pnTto6TJ4YEh8dqfNuKCMAOYIv7RpZRvFgwxsurrHdqmBJvX58POHuPfpUXuGAPoM 1T+Ai0luNZQyWP7BDIr9XmUCygjfyLfxwVT7SAIja4XU5W4OVf3T8Ulv+JeD9m2P1yck 8I9A== X-Gm-Message-State: AO0yUKXBdnNPZQfr3DZlco2YngcB45lJdgbV20BX8Y9N7k0puBGCJu/G rXdrC+ip7nZ2S+lJ9yk2TasQ6w== X-Google-Smtp-Source: AK7set/ru8CUI8c6WpTA2FeFNHdHENt9JS4H+RebLU17rNnUCdDG5WDW1tuUdlAeWsMkdKQJtcqEew== X-Received: by 2002:a50:ce4d:0:b0:4ab:ed5:dd46 with SMTP id k13-20020a50ce4d000000b004ab0ed5dd46mr5558221edj.6.1675945584370; Thu, 09 Feb 2023 04:26:24 -0800 (PST) Received: from [192.168.17.2] (wolkje-127.labs.vu.nl. [130.37.198.127]) by smtp.gmail.com with ESMTPSA id la12-20020a170907780c00b008a7936de7b4sm802264ejc.119.2023.02.09.04.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 04:26:24 -0800 (PST) From: Pietro Borrello Date: Thu, 09 Feb 2023 12:26:23 +0000 Subject: [PATCH net-next] rds: rds_rm_zerocopy_callback() correct order for list_add_tail() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230209-rds-list-add-tail-v1-1-5f928eb81713@diag.uniroma1.it> X-B4-Tracking: v=1; b=H4sIAG7m5GMC/x2NSQrDMAwAvxJ0rsB2CV2+UnqQI6URpG6RTAiE/ L1Oj8MwzAYupuJw7zYwWdT1UxrEUwfDROUlqNwYUkjnkMINjR1n9YrEjJV0xhivHPpLjn0eoXW ZXDAblWE6yjd5FTvE12TU9T97QJGKRdYKz33/AUPd74OGAAAA To: Santosh Shilimkar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Sowmini Varadhan Cc: Cristiano Giuffrida , "Bos, H.J." , Jakob Koschel , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org, Pietro Borrello X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1675945583; l=1189; i=borrello@diag.uniroma1.it; s=20221223; h=from:subject:message-id; bh=1+oqBi1a+MGySfKXgQ/C9VVxNB2UcZkL12bRQa+5lhw=; b=z6C7Q3vCOIgmEb64xOGg1+IsHU2oCBwRfxtKTmN1eR6g2EzJ4zyCQVReXbLwTOxWSJkgxTfDoNyM 6uuO8YZ7AtOdC3mPdar3mFuKm7lbppaa9vjdBBhaSVhuAdYsHesW X-Developer-Key: i=borrello@diag.uniroma1.it; a=ed25519; pk=4xRQbiJKehl7dFvrG33o2HpveMrwQiUPKtIlObzKmdY= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 b47e4f0a1639..ff10efa51632 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() */ --- base-commit: 4ec5183ec48656cec489c49f989c508b68b518e3 change-id: 20230209-rds-list-add-tail-118d057b15bf Best regards, -- Pietro Borrello