Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3923336pxj; Mon, 21 Jun 2021 09:27:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF6FI1GRiESXpI1/1EQ2CWf35A+aoO4T5zX1rJ/smzBMpt3pXY8uczTaV5BDEdKLffTjRB X-Received: by 2002:a92:4a02:: with SMTP id m2mr14766753ilf.58.1624292862346; Mon, 21 Jun 2021 09:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292862; cv=none; d=google.com; s=arc-20160816; b=vG+TBCwMgvbuupbZfJmSMkwMR+wLs05ASSAHmazs2FmmKFbkzF1tm3/bRCDGim67C8 veNqRpY3I4YpsAny7QkKWp36vQ9PKHPbxVCqldRiuiGV1jVuojrlzSMo6AJO9LpWwc5N 6yyE+D5kf7V3O+XwofPZVeUU6CQdLKEvQdeieULlvwsxLL2TVfX6IHZRVrCCXU5voxfQ 8pQwSsmeDeHSHwjgp8J96g5D5O1ZjQmFtHzzLXDufd0lmrAmCtjFIhMWPIIlXSrp6Mdj iJPjquBwqHkoUc3m2B9YCQSEL1IJ+cKvtI2bZhixk0lq7YYIvFixetUdqVsPBBQoqlla SDkA== 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=DRPIeiDQatXUkA/TFJTJ6H1oLpzujNIDMBUsP+me+qg=; b=j2iTywjgpfu/cNTaqiLdsC1ZCXjk8OhQetmeFO/SfGXjIv3uc/NOhmUFgKPl8D47D8 o/HNRUl4s5hOCQv67UFokPQ9ue46PGMdTAIOyDxeJtp5ibMUJmVLkk1RhZWwz21oTA5j cWaKQFpxZnSdIvyh7uF86LP/que0yO7mnpcTfhq5LyFOUrV+NCCh8+1Fau8X1IqEsvN2 Ldgd4v9CW8X+dwvL6+OyaAw43gjrgGhkslg+k4IjREgpdHRp+6c2SmcVVuEeq8gZ39S8 7m2B2cAXqdm0gnlfZTcP9hPDhVaQEDUEXkU/AZy5w2yCtQGeJczspc45hprxjtdz/ORm JAvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vq8VV/gz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si520359ilj.136.2021.06.21.09.27.29; Mon, 21 Jun 2021 09:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vq8VV/gz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231744AbhFUQ3A (ORCPT + 99 others); Mon, 21 Jun 2021 12:29:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:49592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231874AbhFUQ1a (ORCPT ); Mon, 21 Jun 2021 12:27:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 19472613DA; Mon, 21 Jun 2021 16:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292571; bh=wU82TVApRkhtI7f0iv/+54MYKfS6dYu+wuaftVjHOJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vq8VV/gztFCylWGW6p2TAHnR6pXfUDjP3rNk0pHoHYq4kArR7gRmvC8otjsKJ09oV CMHdtit/A0JJcyCpxNZyqQ4FscXnK8zGTlKHUtBTJqgUu5aw+UbDq5uDn9nWFOK/uK IBvUu32nBqbuwrwCdSy+SkwnmGAa9uyyfbAErD2k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kev Jackson , Andrii Nakryiko , Yonghong Song , Sasha Levin Subject: [PATCH 5.10 016/146] libbpf: Fixes incorrect rx_ring_setup_done Date: Mon, 21 Jun 2021 18:14:06 +0200 Message-Id: <20210621154911.820327580@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kev Jackson [ Upstream commit 11fc79fc9f2e395aa39fa5baccae62767c5d8280 ] When calling xsk_socket__create_shared(), the logic at line 1097 marks a boolean flag true within the xsk_umem structure to track setup progress in order to support multiple calls to the function. However, instead of marking umem->tx_ring_setup_done, the code incorrectly sets umem->rx_ring_setup_done. This leads to improper behaviour when creating and destroying xsk and umem structures. Multiple calls to this function is documented as supported. Fixes: ca7a83e2487a ("libbpf: Only create rx and tx XDP rings when necessary") Signed-off-by: Kev Jackson Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/YL4aU4f3Aaik7CN0@linux-dev Signed-off-by: Sasha Levin --- tools/lib/bpf/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 7150e34cf2af..3028f932e10c 100644 --- a/tools/lib/bpf/xsk.c +++ b/tools/lib/bpf/xsk.c @@ -779,7 +779,7 @@ int xsk_socket__create_shared(struct xsk_socket **xsk_ptr, goto out_put_ctx; } if (xsk->fd == umem->fd) - umem->rx_ring_setup_done = true; + umem->tx_ring_setup_done = true; } err = xsk_get_mmap_offsets(xsk->fd, &off); -- 2.30.2