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 4110E46BF2 for ; Wed, 23 Jul 2025 16:21:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B21F40E26; Wed, 23 Jul 2025 16:21:15 +0200 (CEST) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by mails.dpdk.org (Postfix) with ESMTP id 7C8C440DDB for ; Wed, 23 Jul 2025 16:21:12 +0200 (CEST) Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6facf4d8e9eso56177756d6.1 for ; Wed, 23 Jul 2025 07:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1753280472; x=1753885272; 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=Wtc27d1NZBnfkWcgEfPU37CmqkTxr4++vsc3oS/XW08=; b=XA+RhZM3/XT/ZEORTr2QsxEYxsnL6SdEPL78O3zAqawocqRT9yjBwBjggdDxj4AmVR VNweuwy817G1nfd6RrgkY7pAzn2zpnaH2Yjk63+Ejq5rgfAr9fEWxuQxnBQtNPHJ2lWm rc6mxvKhR/PYYyEbeBvDMCMZ4VOADin75QpYYNLOQbOw69BvpCg2/TGeZO6j4D/XD7ZA DCs0B9/ne3ywS2eUUa3oF0yo+ywMVJWiqEUXhno+OQzvVLa2HgHfwNiPS2d5vDdsfIXi LEzps/OOc9VwqYruxNYYtWmtmH2yhCrt2pFWlYFiLXCIBFTPy6hpzm5/qn7pTNaRoNx1 OzBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753280472; x=1753885272; 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=Wtc27d1NZBnfkWcgEfPU37CmqkTxr4++vsc3oS/XW08=; b=YPLxsB0T80MFbfht4KLvQHX4AabPODOau8Jwk5T1eGFEt0EzOMEswUp7UgVxsd6xac ReEz3p2sWTjM0fwdG7RwJvHYH2pMbP4cGrStQHzdJxrAZjsnpDK2/YlZXKTsarBFZSJV iVrWGuLkUh6QyfFr6ZtxT0VLDVhaA5VXuYMm7l+JaLPh0Y1UWImAp3utqYFGDkzitvDQ r/3WwyNm75L5qcTUjEjiHixi74czoXtlugdOKnYq8piLlJN26mHUATv65pc3AFJrSwjR Xbi8U9SoHWJhpj7HAwuXguVPwdCCIrT90iMUDb9R4ZOt78zo38fTStpmLW+BOTRVrSQU K8+w== X-Forwarded-Encrypted: i=1; AJvYcCXrwLFc7cmVJiLMw1Pvv6NFkhD7PNY7kr+tcvDJ6JLswgDR0c0ivn0VTqwo287flBZ0yZiAzL4=@dpdk.org X-Gm-Message-State: AOJu0YyAToweiXn91gcKIiM4gxuO+APl08CeGEH30yT3e+FBu0btHd89 JYZHAJ2sHw5PuvaSgkU409owZN36ngsMKfEa775a6660OtMKOl3JT31JkgNJ2weNKa8= X-Gm-Gg: ASbGncv58+S411oJDabFoEWDst23FSyQDE2wKeTFcIT33A1s15Uee4mbvfQNbMmkJsS TEprBQf/AdxP9m9ECSO4cKwSw762ctvXYoffMhScGSl2pqg/9GTfE7+zmpp92SXeHd3oiQtPeRn 45FzcxMCVafAK4l/D9kT+QRXuuPP4vVxKNOocp5ZlmtVPGRuVapR6xFNigqWMA94MAEJGZt+kV0 cDAsuZ23qtQG1RnyMgnYsxBoUTxJLdrnqLS/iC55hCi2kIw0pbIgzFhTiulHUr/H3ULcr/kpOW/ 25U9Shwjs9si8cjKAWkc3IDTsAN8ZynCcSMw8hWXIQYbtzyHTFBxi5gOODSEMyG+k5EZF+82WgY 3AF4vmiWrSf4lSTlK9DFPq2lSquYIYJXEmegIoYRQQrMFe9sJTPLBb8y35FTSxOz6H0LEoCeiKO 1Ct45P4mhHkQ== X-Google-Smtp-Source: AGHT+IGQeRAwPEWMPFktzxDG+w965nDwC+0RA35+rzo7NI8PziAfQLTWpgmwAVpA8udr4OQaD3kBAQ== X-Received: by 2002:a05:6214:27c9:b0:704:f952:18bc with SMTP id 6a1803df08f44-70700723634mr40031196d6.47.1753280471571; Wed, 23 Jul 2025 07:21:11 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-7051bab17f6sm63710846d6.98.2025.07.23.07.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jul 2025 07:21:11 -0700 (PDT) Date: Wed, 23 Jul 2025 07:21:08 -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 v2] lib/ethdev: fix segfault in secondary process by validating dev_private pointer Message-ID: <20250723072108.2d22d245@hermes.local> In-Reply-To: <20250723045022.1580829-1-14pwcse1224@uetpeshawar.edu.pk> References: <20250722115439.1353573-1-14pwcse1224@uetpeshawar.edu.pk> <20250723045022.1580829-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 Wed, 23 Jul 2025 00:50:22 -0400 Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> wrote: > In secondary processes, directly accessing 'dev->data->dev_private' can > cause a segmentation fault if the primary process has exited or if the > shared memory is no longer accessible. > > This patch adds a safety check using rte_mem_virt2phy(), with an > unlikely() branch hint to minimize performance impact in the fast path. > This ensures 'dev_private' is still valid before accessing it. > > Fixes: bdad90d12ec8 ("ethdev: change device info get callback to return int") > Cc: stable@dpdk.org > > Signed-off-by: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> > --- No still a band-aid solution, and it is depending on side effects. Is your secondary process monitoring for primary process exiting? If it is, then lets fix the monitoring path.