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 2EEDA46C45 for ; Tue, 29 Jul 2025 23:34:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F4574060F; Tue, 29 Jul 2025 23:34:28 +0200 (CEST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 8270B40653 for ; Tue, 29 Jul 2025 23:34:26 +0200 (CEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-45629703011so1728475e9.0 for ; Tue, 29 Jul 2025 14:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1753824866; x=1754429666; 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=LLzo9UXSUvyQAPL4qtR97U/Lx+nnnsAv7IpYn8nnA3k=; b=r9cWOCEke6W0oSZ04+1V07cd1kMjP4nPY1jEY6TTQ9UmaF8dSywD18dMOkVyyWEkNb Gs2xvQ11VrIQK+Rvd/J7lEOcx5kmkQeNRZwmH1YJJ6qxOVeqHcxAH8+Q6dJmcHfblDQm GDTVjb9MtpaovsM+zHHnsCmPDIiobp50EdgA35yAS26A4OcKSuR8nS10RaUQyQPluB4v cU5L2mhuzpQ417BvXWco3eGqO4oxhTyC12VFdbm38B6/kGgGUE6hBsmq5tFtYruvxvqY tIibo1GSd1vULJobLRlLsSCT75oBtswo0uf2hb/dyS/5Sp3RnmkOeGhEACvmUx66WZuL y0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753824866; x=1754429666; 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=LLzo9UXSUvyQAPL4qtR97U/Lx+nnnsAv7IpYn8nnA3k=; b=Ap/Jo2q0re0xlQyuxlfsEagEygIQPvxYO35gnOlxww73s+wWRyYI/hm8WdqIz6YVJJ b3b89XKpfzKGNCnlo+ha5kCXPMO3ihC48mMZYND7PgPhhwHvaeHDtJswuZfmuewEmVLG ky8bVs++MSTzJQc6poTiR+yct67iQ8iWJf1x3zBXFEbEwLYBXkJ2V1nAk6Tyl05dn37H /YRc9OX+sahQoVEu6bHkvY7S/DZ7ccFW3lJkvsamUFGdvxdb/X2r1g8wruxpMWxouJR5 d9hSq/ihm5xL0KBNB6DiLPtlb+f5zb/0VaKObtgI8eS/91AnBy2GDC52iKCfo4ntHC/S t2JA== X-Forwarded-Encrypted: i=1; AJvYcCX4nkgDM6a/nBPV410itMLrLyoy6NoAXiP8gHu/dZ14yFRhD/1DOfZiQD8Hd4bhqa/jsracjpQ=@dpdk.org X-Gm-Message-State: AOJu0YzGQO5w2gqWoGMc2OJ0T637ptk1sr7OMnOhfFgld8IHOv8mSebq pBezlAZzE41GpGTwU3Q8PcdGI8GOH44cWUT9Ur8c7GmV6oTf0LN/g/YUl14mR5eYMYE= X-Gm-Gg: ASbGncv/r/240Vx5ei2m9JvheOCP0wjvhZxamE8jayCsQnWjbEWCGP6VPghhJ6JOWfZ 5MRnhBUL4u43hi4gaWVt/JbUvyafgDbvY+A3JsNdM6rNoM3sxwQv1Kh39CJPR3LFTfkOU7kvUuq xAv7SwH+1B+pvKzpda//mWKVuWNGeM2ccbeSSQ9tWMq15m4KPNBP3U4iM1J6BtPGFp0WYTCQxhD zVXf8wJ1MaAXsEv9zASIQIFKPyn0ZJHTamKMTlccodNJ1fCIjDEgNP1Ya11dVkDn+S7Dnppfk4k RpRX4DbOAppAv88wtR3bfmeIVYnr+OZDhkW23vOSBdded9K/W4YB1Z5AidItfPPEC8zsyoj7uNu 58GkkCBhRRTETCpn3DzXYvfR0eH6n6kD1+1Kt7uQO/kRRLL4Y1n8L8g+1qPtQsjyTgj5Ib+QBgh A= X-Google-Smtp-Source: AGHT+IFM6SSlXZtebJ9rsHhi1dlgov2HPPmNTlr/DLdplV9cQHek6R2aCqtj0IJH5DzHsvF5DJtJVw== X-Received: by 2002:a05:600c:3b23:b0:456:117b:94bc with SMTP id 5b1f17b1804b1-45892bc58aemr12259935e9.17.1753824865727; Tue, 29 Jul 2025 14:34:25 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b78084f79csm11957058f8f.71.2025.07.29.14.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 14:34:24 -0700 (PDT) Date: Tue, 29 Jul 2025 14:34:20 -0700 From: Stephen Hemminger To: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> Cc: thomas@monjalon.net, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, stable@dpdk.org Subject: Re: [PATCH] [PATCH v4] lib/ethdev: fix segfault in secondary process by validating dev_private pointer Message-ID: <20250729143420.0fd7b627@hermes.local> In-Reply-To: <20250729054229.3537412-1-14pwcse1224@uetpeshawar.edu.pk> References: <20250728144552.361c17e4@hermes.local> <20250729054229.3537412-1-14pwcse1224@uetpeshawar.edu.pk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Tue, 29 Jul 2025 01:42:29 -0400 Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> wrote: > Hi Stephen, > > Many Thanks for the feedback. > I have addressed all the comments on the patch, I have removed the unnecessary check in ethdev, the only one check in rte_ethdev seems to be a neccessary one, as without it, it can still generate segfault while secondary exists after primary. > > Best regards, > Khadem Did a bunch more testing, and the problem is much deeper than your initial observation. If primary process exits, the data structures all over secondary process are complete garbage. Lots of use after free, linked lists that point to freed data ... The root cause is that when secondary process starts, it requests current device state (buses, devices, etc) from primary. When primary process exits it removes all devices; but there is no mechanism to tell secondary! For now, the only thing I can think of is to have the secondary process monitor in testpmd do an immediate exit, no cleanups.