From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E727F45AAF; Fri, 4 Oct 2024 18:04:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC5684279F; Fri, 4 Oct 2024 18:04:11 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id A2CB642797 for ; Fri, 4 Oct 2024 18:04:09 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-71df04d3cd1so104691b3a.2 for ; Fri, 04 Oct 2024 09:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728057848; x=1728662648; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=MFjJxRoh6/wUWyuH/rPmWnBPW8JQkmVD5Kk3uvit5wc=; b=0OABEeVZa/dR4gA4d2gJ7T3wMiI/kpF1l5Kx0AFqmwrQT88UVHNqyRwb/mhIKDL89L UkO58s57hKZCKwntuk/fJ8mw/XMRpkfbfudGuq2bZJRir2lBMrLLuI+CF1L/J6i3ITWC lObbxvI3+V6BGnDXhqc3SAdMflHVC45cL2wXTVjlK7djupCJK8Yk+YuFfTwz2LWCtAEt JCQdz600eA1jLfIGNPiYM/7E3X8lUfYxKX+Kt7s+YvX3/PFvbHz2pISL2Yr+HBJHSsTK BwPn1Xt4azq1+1k4FXF2AbGA54Fr6YE9AMkq+49tg1bwmSND6Y3/qePaXlsTBKQ3YZCN PmXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728057848; x=1728662648; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MFjJxRoh6/wUWyuH/rPmWnBPW8JQkmVD5Kk3uvit5wc=; b=BtUtx7Rk2qW3St5p3ZmodI2ABsA/yHJYJF/Glwbvdn9s26FPxhjljm+jtdInH5aZVe rZSWP8b1s5ZvoxekNrGV7treFC0ApbqlzfwGx5H3+QU0rQvwDVx61sYWpTVPmgbus/F3 pREOjMtKw/7xMUCcc3xQb80Sd05lkzvBU5BEPZNjKh8opnBNz1OwgcmZhlXcIV+FA6TL yYE85T8fIs1z7C0BXaxbWkQpZDjHtg0bSTPrwg53clWYd/5tQjAByTGs2q3KF8Lj4TYv j3lm9GlbER/KTnylOO/EjU+vEHYwUy8oRrsamOJMMkHV1R/Sx1a0+utdzbUju5mPDBg4 n19Q== X-Forwarded-Encrypted: i=1; AJvYcCWHgl40wbnqy0AuUQ6yU/D8eJ/El8BP+QSwEnJCSjCKgergTL5yuOPhn7Bup5LfKZgcaSA=@dpdk.org X-Gm-Message-State: AOJu0Yxf3Zy12Vy6sQGS4QbzMvAFynr7+/EXtgqBpx+gBpwteJan1n67 jQVrq6W0wxDnWdwkhue/mvYDO+k8oDSCZoyGNepODOZlb2TioCRs/VMw8s7EX4w= X-Google-Smtp-Source: AGHT+IHhy9H/OejwKU4GGrdb4BeHd1oTpv76wdUkClkyXu1HgNn/hQxmCzW0dYYP+AeEni7MebdthQ== X-Received: by 2002:a05:6a00:2e86:b0:717:849a:d668 with SMTP id d2e1a72fcca58-71de23cf2e2mr5491218b3a.10.1728057848507; Fri, 04 Oct 2024 09:04:08 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9f6c35d03sm103099a12.60.2024.10.04.09.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 09:04:08 -0700 (PDT) Date: Fri, 4 Oct 2024 09:04:06 -0700 From: Stephen Hemminger To: suntianyuan Cc: , , Subject: Re: [PATCH v2] vhost: fix crash on vhost-user client port deletion Message-ID: <20241004090406.34dc79c3@hermes.local> In-Reply-To: <20230511145957.33904-1-suntianyuan@baidu.com> References: <20230511145957.33904-1-suntianyuan@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 11 May 2023 22:59:57 +0800 suntianyuan wrote: > The rte_vhost_driver_unregister() and vhost_user_read_cb() can be > called at the same time by 2 threads. reconn may be added back to > reconn_list by vhost_user_read_cb() after rte_vhost_driver_unregister() > removed from reconn_list. Then rte_vhost_driver_unregister free vsocket, > cause vhost_user_client_reconnect access invalid vsocket memory. > > Timeline is as below: > rte_vhost_driver_unregister thread execute vhost_user_remove_reconnect > vhost_user_read_cb thread execute vhost_user_start_client add reconn to > reconn_list > vhost_user_read_cb thread free conn > rte_vhost_driver_unregister thread cannot find conn, then execute > vhost_user_socket_mem_free > vhost_user_client_reconnect access invalid mem, crash > > Signed-off-by: suntianyuan There is a test failure in the vf jumbo frames that needs evaluation. And this kind of patch needs ack from Maxime.