From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk2-f43.google.com (mail-qk2-f43.google.com [74.125.230.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A68975632B1 for ; Tue, 22 Sep 2026 16:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.230.235 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790094850; cv=none; b=B/GrEHJmtsN1tdirz1KoEysgiLY4Ew9H7cigGhOrWEXho81GAZL4bexw+eECPxgcTPd2ikEyZYdfH4GEE/ZFiAUD8EQEe/iQBZikYuWQucpTeQNpwbnm1hiR4QtLtgcUlRv9wxFc5NNeIE9z1v612RC4kk8wIX+svtz73h/eqhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790094850; c=relaxed/simple; bh=Dw4v6JTx0Usn/ZJ4sCYj1U150VDxILnbuKrTSzqE7i8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=g8umPbx4+6U1LthiUqQaRD1oANUhEtTDOwFBXNvGfwvAj2dFilzgmMZRypsuOEs69cwqLAc2L3+WtAi9r+lXVQcGmwckcpFeAPqOpODJa3dGw6Tpawd3qvnt1ibaFO+g8lmS08bi0Ru7chMmDRlsJc+cX4wEcZ4CtkMBPE5rtrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com; spf=none smtp.mailfrom=mojatatu.com; dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.b=TvVXMcHq; arc=none smtp.client-ip=74.125.230.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.b="TvVXMcHq" Received: by mail-qk2-f43.google.com with SMTP id af79cd13be357-93a2a8c29c4so7959485a.3 for ; Tue, 22 Sep 2026 09:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu.com; s=google; t=1790094847; x=1790699647; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=47mRdp5lPPjFXCfKGuPUegA86O97/a2J/8sFoZV85O0=; b=TvVXMcHqj5Xpoue63gH6PgeV/If0sHbl7UvVRoDquK4x78QvkIDUgPgTd1fStwFiJd l6G4mcAkrB3woNqfeeHgNxzhLJKc3McgSGqz1vW3Cms5RZXdlRQMQMYAZghGHRPHMgTk n6WObcpe/oKHv9FvMhOkASnn3PV1DfvYbNC0k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790094847; x=1790699647; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=47mRdp5lPPjFXCfKGuPUegA86O97/a2J/8sFoZV85O0=; b=r2S+xdWPuwLMc4rdUH1kajo2QYWlgMaoJMpyPZkYdoZQwr8kusBlUePfiHsLc5kJ6f 0yVUPDulZix4M6LIjNhJ/wRzcK47jCAsGGA7zCIyQjJVpBfcYHPBQOyio/as0kyHcGM8 PWWqGMz4hunzgt584C0zlqs9NtfRuqPVeH9THKsghTeT9UIJFSNPtY6bm1s+BHgL30kN /ZUsg7urLsEcgAS7VnxhXFBU4dxSmdIe/iyVUG1mxZzhyyES5UtGwCcHdPufPW7JovoP bT3b19psj2ZehXO3tQbledq+N+xGJrC4GyS1jhuhfhubsZ5ZIYth9q5o7hLyqI6ESkaS CRVQ== X-Gm-Message-State: AFuF++kw5nQ/weB0pV9qG4uOIjH1oV38ydwqf1GeRKH5HUIZMtDTzgoA l6zNApGfNC5BeuPjn5JDfWstuFo6FojshPodj+EsfOnEqkw994EQW6FYiJaUm+974MUEjSsI1vE ZLTZv+Q== X-Gm-Gg: AYBFou007fhCXiAAJwcklG8A9ALzm/+Mjb3wqyweACvy/N+JJ2rhtPsH4wHwhI2QZe0 5INtcb38EL4miFAISRPvhlj57ZfnXh1KMe3efc+VZjQVqef4ShD8ZS5AMpPIz0mciKXKmPLnlES b+m+dS260vTzfWumVpcYe/U0tOR0OZEyE78j76c1xs2GH5TuuweovuMmoN5oUwexHKfTk8vwah/ 8XlbW8BBpwHuL2w3oYPxDxJdUh9G5+1MzOE9oL8gEfCD+5YvmpBb6grfJPZVrIiUIAwbwllTmwY sl1MbsTBDMFcebkQ7f55I5ZBBBo3CUH8coJoROQltVNZFgPLng+pPK8PW/KYFYulYlXonyJMh9s 0xd4xkXgfAPie0gzNelD8MiqT6NmkZRR+ZZN3R61MtXnWcFjC4FH8aHgjz0J/oSnKtb/n5Cw20U 4MIRc8bssIO6oJKChsYxiMKmZ9hDJOG/FRkaeDgTwOl3uTzc4fwnFKXETYSZkar/Y8J+rP2XX0H wGXp4L9lmipvu6qY7YzId4Du8R89PwRxk7dsxbbXuxh0q5MTw== X-Received: by 2002:a05:620a:628a:b0:93b:e82b:a584 with SMTP id af79cd13be357-93c15e7be9amr598167585a.35.1790094846976; Tue, 22 Sep 2026 09:34:06 -0700 (PDT) Received: from majuu.waya ([184.147.180.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93c248bd54esm11220385a.38.2026.09.22.09.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2026 09:34:04 -0700 (PDT) From: Jamal Hadi Salim To: netdev@vger.kernel.org Cc: Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan , linux-kselftest@vger.kernel.org, Victor Nogueira , hybris , sashiko-bot@kernel.org Subject: [PATCH net 2/2] selftests: tc-testing: add duplicate action delete batch test Date: Tue, 22 Sep 2026 12:33:59 -0400 Message-Id: X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit tca_action_gd() takes one reference per nested TCA_ACT_TAB entry while tcf_action_delete() consumes two per slot, so three duplicate TCA_ACT_INDEX entries in one RTM_DELACTION free the action mid-walk and the next slot dereferences it. Assert a duplicate batch is rejected and the action survives. Conditions to recreate the bug: tc actions add action pass index 1 tc actions delete action gact index 1 action gact index 1 \ action gact index 1 Testing: Case 8135 fails on the unfixed kernel (tdc_8135_unfixed.log) and passes with the fix, alongside the batch-delete family (tdc_8135_fixed.log). Tested-by: hybris Signed-off-by: Jamal Hadi Salim --- .../tc-tests/actions/batch-delete.json | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json index ef7ca4a6775b..7620e927ae2c 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json @@ -111,5 +111,38 @@ 255 ] ] + }, + { + "id": "8135", + "name": "Reject duplicate action in a delete batch", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ], + "$TC actions add action pass index 1" + ], + "cmdUnderTest": "$TC actions del action gact index 1 action gact index 1 action gact index 1", + "expExitCode": "255", + "verifyCmd": "$TC actions ls action gact", + "matchPattern": "total acts 1\\b.*index 1 ref 1 bind 0\\b", + "matchCount": "1", + "teardown": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ] + ] } ] -- 2.43.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk2-f12.google.com (mail-qk2-f12.google.com [74.125.230.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0D423D0C18 for ; Fri, 25 Sep 2026 08:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.230.204 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790324605; cv=none; b=ZN4dfojJqBnOJqrAmYvW6Ssh/aiRwdAolZfJv9J6K1POPNTQE8SkN1C+BNNdGEoormbdqtm0hm37fn3UtlFmLOrQpWYJwDPx+uKyrLE53w7K3DRIUb7rFzH4OtaVmlVx/7R5QBiR6D8BM45zDkRCspuGRN/u3h0MmxhDsMn/bPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790324605; c=relaxed/simple; bh=Dw4v6JTx0Usn/ZJ4sCYj1U150VDxILnbuKrTSzqE7i8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VUyAYORAte+J8y91cBzjEAPqgkBP1AFSh02Qo784cq8WDb7TRmVi9b2DWPWjnxo7DwdiS4ztDN5qHIYf6Q+0tEOXPVpWyJRf1wAY3tY/vPSb4TUK7BVVhEfGqcxN5SKTH9ZPdJIMcbDNmpt0SkjjjNA1DZbI2k7EZxtmV4u6ssI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com; spf=none smtp.mailfrom=mojatatu.com; dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.b=gV5JhG24; arc=none smtp.client-ip=74.125.230.204 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.b="gV5JhG24" Received: by mail-qk2-f12.google.com with SMTP id d75a77b69052e-52fb767cc97so7408041cf.3 for ; Fri, 25 Sep 2026 01:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu.com; s=google; t=1790324602; x=1790929402; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=47mRdp5lPPjFXCfKGuPUegA86O97/a2J/8sFoZV85O0=; b=gV5JhG24dUHMKl9akl5bXE/xMMbzn5psxLfC+RW/hkcM5iFiVBcFXr3qE/8b8K+H5m cYlZQPQvxZFftblIUa8QdvuqZtgQDZGeOkAbaFVHnqN4Br1RtFDHy7QFhHaFG8o8vOqU 38PuRQL0RLo/kiMgVZ8EnkfsXxjE5+5eF/02g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790324602; x=1790929402; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=47mRdp5lPPjFXCfKGuPUegA86O97/a2J/8sFoZV85O0=; b=QNNHvcgaz4PNT4Ne4wv3AQqD4TG2vmKladAKVGfzphKmxiS/uEhh3t2UAkAmHDGTtw QGaKhQ/jrEntQHVRqNvozfvTZuRzFkrdkCEuTxiOh4pzmIgaTrfWgkRkDxKEnLC4B+/T Q3/uuUkpPX6vtFZQN4peg+LxAs6zJ85nW/47Ds7rI1Tbwg/0/4oll3eAOw/QiEZtSzfu u6AF1HhJXrfyjAM052IqUEfQ65nxFd5eSF6QQh5qornXr1U2wcTJFBLJJGes7Ez+xuGO dJcO3FHGKT7GAS4MLc+qC42aIrp0U0BaGptQokFsf2VuqwMWx4ur5rMYpTcE1m3hsdm3 wfsg== X-Gm-Message-State: AFuF++nRZgP7p0Mj7z74TAoo7Ebis3NCk4x+hZAP5pQQU88srkD9E6qB NjzaS/4+cNqAjj0C8kZwUVAUDm5tQKklcq+/Bt6jyRGfAB0+ZbvfQUazSbuTfoPtZiCutZHTghl noief7w== X-Gm-Gg: AYBFou2i5f84LfECFyHf/7yCDjMOzzC1uekrECc+HKEIrJ30pat0p+uTdQ2wQFY4D3b RJNR7LtZrADOEzZQ3G5xXp8K1ordAuVkQxovThWtDhgUXprQuhmGGo1wd2o7q1/rdKuuedC6AVc vl6YsK2iSNNatoJ6ZiCLVBVEaMp2Xc/LMmDi4CjcTfegpRXgXY3UaxZtpD5Q0HlCmjGNjWFzzMR u+77Nbo18vJ6VLizaEGVFM8Al4ergrJlTgsjvZHFlS7VehmM/ycrtB8XfzFr6LtZ5SuawALlBx1 GhM6edjrVJJsuQO38cE97kaxV8wGGQdXJOfZGEAp3UVT/H9q6ByPUt74v1kNNms+NyI8KYsGtxo eN9oKIhjWARp9EqHHuIAkmPqAvGwXs2IiYYrCcKiOoQFzo/T617h2VkSqe8H3qiihsraA2ElNCi QkhrmyIteDBI3veB4WducD/zzVO/TpcaAn1dnJ92Ai7h9YCewBOX4RGmjd5AOT8UaPbSQLftldA bfRKOV43maHxRNbyHXzJiYbuTFCiYdtikgkxwKvD/vQK7vbZQ== X-Received: by 2002:ac8:5f88:0:b0:530:f44b:5404 with SMTP id d75a77b69052e-5330b5b15f2mr30745391cf.14.1790324601795; Fri, 25 Sep 2026 01:23:21 -0700 (PDT) Received: from majuu.waya ([184.147.180.207]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5330c0aae6esm10554481cf.26.2026.09.25.01.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2026 01:23:21 -0700 (PDT) From: Jamal Hadi Salim To: netdev@vger.kernel.org Cc: Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Victor Nogueira , Shuah Khan , linux-kselftest@vger.kernel.org, hybris , sashiko-bot@kernel.org Subject: [PATCH net 2/2 repost] selftests: tc-testing: add duplicate action delete batch test Date: Fri, 25 Sep 2026 04:22:38 -0400 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: <20260925082238.ApYMOyeo4f2cyHtNpBH4bmakwqO17BYdV-HiDQLVM3s@z> tca_action_gd() takes one reference per nested TCA_ACT_TAB entry while tcf_action_delete() consumes two per slot, so three duplicate TCA_ACT_INDEX entries in one RTM_DELACTION free the action mid-walk and the next slot dereferences it. Assert a duplicate batch is rejected and the action survives. Conditions to recreate the bug: tc actions add action pass index 1 tc actions delete action gact index 1 action gact index 1 \ action gact index 1 Testing: Case 8135 fails on the unfixed kernel (tdc_8135_unfixed.log) and passes with the fix, alongside the batch-delete family (tdc_8135_fixed.log). Tested-by: hybris Signed-off-by: Jamal Hadi Salim --- .../tc-tests/actions/batch-delete.json | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json index ef7ca4a6775b..7620e927ae2c 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json @@ -111,5 +111,38 @@ 255 ] ] + }, + { + "id": "8135", + "name": "Reject duplicate action in a delete batch", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ], + "$TC actions add action pass index 1" + ], + "cmdUnderTest": "$TC actions del action gact index 1 action gact index 1 action gact index 1", + "expExitCode": "255", + "verifyCmd": "$TC actions ls action gact", + "matchPattern": "total acts 1\\b.*index 1 ref 1 bind 0\\b", + "matchCount": "1", + "teardown": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ] + ] } ] -- 2.43.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1199E37B00E for ; Sat, 3 Oct 2026 09:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791021304; cv=none; b=GKnDuioEADyFnt1BUl5SVLOEUm9I+7sFAUDfzCfaeqG5OM3mLDUgAOjcXoA0V235Kttbe+fYUR5xnKB0lpxAFj9T3vC3Ij4+ElyTnVZtRZMxmruc8LEQinGtUxSkROKfdQpm2ijnYlaSZ9DtJqvy/JeJVoGbzAEiS6Q9aO3/vX8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791021304; c=relaxed/simple; bh=cqoC/mpI00uBeyIZHK4KcDf5NQYVnPkZr/zaNcMKN1U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Slw1H+wP1BBPb2oKOk3DsmWThJqkj/H4g3YPLlJw2VNP639thZGmY05nGn6fBBwJB/c/X0rvwvKToh24arE5G5aSDIOKeXAUIHiO1suiDmBkTLVZ8hCRGvTJOY4Vq9KgXXpD/5loVPa1CyYnM1y0ZpHFu5VX2Hhye2sXSHIz/jw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com; spf=none smtp.mailfrom=mojatatu.com; dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.b=cNAvFfEv; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.b="cNAvFfEv" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-9144e8021d3so9197306d6.3 for ; Sat, 03 Oct 2026 02:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu.com; s=google; t=1791021302; x=1791626102; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yXMN+/zb28CkK1fnScLZHRvDxt7URwPd+oZeBLTFd18=; b=cNAvFfEvJN3glHvogLgb/ErlbpKdYjEB8LMFyRIN7S8fjViCYfZ9rgaUBrf/oUcat1 6QHZMz6yBI2W0rfo8lw3119KHPCY8aaswpbjmLfqSJFwyBHfJW1DT5Ag0NCxSLgGYEv3 ql+pJHcsY0RddurdH9hzInm/dmCZAosLI8sKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791021302; x=1791626102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=yXMN+/zb28CkK1fnScLZHRvDxt7URwPd+oZeBLTFd18=; b=xfO37wwq3Jmy1czqQvZ8evxzZNc8GLUEUPq0T7HrpAkfPmH82wxZQ4YCRKarWi8wqp o8gbUQoj6NS8ztjkUHyrH/kwCEsUN3IX2KchLGUZGeO6XgrubDT/vfOu44NefcleXX2x zLrMaHh5pQsbnvQaO0en1e6tkb2UVBznLSWt0KL1mDJSFAXmdglB4kqgHDlLTX0IS7SN uYtPp59FfJDbH32bv1Xf0pB4kQHM0WPys/o3OvIuX7dL+q+gXhWV9oZi8FYS9gg9/tkG XSg2Aku6V+EcwgEqMyqjExK28D1pKXLQRehHK+/zcGBc8Y3iIbo2NFlBdmI+8Akb3efr FwWw== X-Gm-Message-State: AFuF++npOh54C0H3ZmAikpqCAY3NNz9GqHbAt2xVaISX92ZEqxF7SURC dbHYf6Z964ouWSBgKo+Y4T2qMUNDNnzuJJZyX5DNEILhHtdOhbAd3rHLngUYuCB321IaOQDYsi0 /15g= X-Gm-Gg: AYBFou1EvunAbpJE2RCn9razgkablECYiixW+rbmS3m7VKr18GmsKb2i+cA0Ve5P4Xj VIj9zCFiwQpwWRFfoh+cKjm9twZ+82QgJQqtNcUbtGRJGoXZPBijdT22SmOTqwjZYOGvqVWyRia 3qi1t/Ie2mNyBlU3NLRtXfpxv4WkSTukRXCnSJyzs0O3b4S1wNFZ7CkHrB7mjexFdx9ylxAfAv9 Bysa+IbrQWiExaxQEWiVzXcZ8fDWWDtHC15wWpcxZp2rusqxE6I5zbgmOj5pbx7iE+C9+qcvWdm OGHC5ZbiIfi7I4aJuUmBVR7xTTfbRKlrLasRh9BxLfxFYL/Y5K48aa7YHlCuabCTi3Q7xhx89GD 0uoqCjcobfMu/d5RUX1BBJkUU2n7mPaZZRsIUEJDVAOyKd1iE6FlRjcJGAad9P0lkEYxlY6u1EJ HMSIiSMNw+NNfjbAEiczayQ8LsiLG/atbzw6ts0DGqcR8tWbDaSTsQUNT0fD4EU+ndeNjcdYBcy 0uyxbC1NpdECsSPmQr5DAxXcVXTQ7rp61PnPP4lVbOiBS+H+QcJ1Zb1Lub7 X-Received: by 2002:a05:620a:29c8:b0:93a:2bdc:cd57 with SMTP id af79cd13be357-93e50e0820emr341771285a.2.1791021301991; Sat, 03 Oct 2026 02:55:01 -0700 (PDT) Received: from mbili.tail33bf8.ts.net ([64.203.83.2]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-917e0c3e2bdsm40853956d6.49.2026.10.03.02.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2026 02:55:00 -0700 (PDT) From: Jamal Hadi Salim To: netdev@vger.kernel.org Cc: Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Victor Nogueira , Shuah Khan , linux-kselftest@vger.kernel.org, hybris , sashiko-bot@kernel.org Subject: [PATCH net 2/2 repost2] selftests: tc-testing: add duplicate action delete batch test Date: Sat, 3 Oct 2026 05:54:54 -0400 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: <20261003095454.A4i__8DE05M3wQB_gihs9BDHXVQXu0XpMHEs0y-k3Ow@z> tca_action_gd() takes one reference per nested TCA_ACT_TAB entry while tcf_action_delete() consumes two per slot, so three duplicate TCA_ACT_INDEX entries in one RTM_DELACTION free the action mid-walk and the next slot dereferences it. Assert a duplicate batch is rejected and the action survives. Conditions to recreate the bug: tc actions add action pass index 1 tc actions delete action gact index 1 action gact index 1 \ action gact index 1 Testing: Case 8135 fails on the unfixed kernel (tdc_8135_unfixed.log) and passes with the fix, alongside the batch-delete family (tdc_8135_fixed.log). Signed-off-by: Jamal Hadi Salim --- .../tc-tests/actions/batch-delete.json | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json index ef7ca4a6775b..7620e927ae2c 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json @@ -111,5 +111,38 @@ 255 ] ] + }, + { + "id": "8135", + "name": "Reject duplicate action in a delete batch", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ], + "$TC actions add action pass index 1" + ], + "cmdUnderTest": "$TC actions del action gact index 1 action gact index 1 action gact index 1", + "expExitCode": "255", + "verifyCmd": "$TC actions ls action gact", + "matchPattern": "total acts 1\\b.*index 1 ref 1 bind 0\\b", + "matchCount": "1", + "teardown": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ] + ] } ] -- 2.43.0