From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796526433; b=N2OJGgL9f501ZkdBr1oH4VPGk7PYaIlscXsChfXGQx+oJXASZXCHDfQ6ZOmpGG2xwQ6o oqSc3vmfOskxsZxhMc/JD61Rzhlg50Oae1FoVkabwfFLFiImtQyuY15YQEfpRBaAKE/4F 9Fr6V1v9Klr/1CvFX4KZLUD7JeP/98K16B9u3EldH8k6vnL+tvGj04T99/C4fxIIgCahK LkN/Ps13ij+e6gxyaQam/ZMx+I7ncbT7raKZZsszPz5mw8rZ9JN0K97wBZBHmHcizWR+K s1w9R0RZYzg2j6Odlhvoi1kLMh7t7dVwsSBkTcLjaqzAKUlDFtmC12e47xLBwtyNgLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796526433; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=0YzxPs19jnex2v1vpWMtnyn2Cycr8F5m+6Mq1uQ84IU=; b=HBniHYWQMcUkP+t+aPDYLwzyrloUG21dQbLRENjeT/iZccvMRuV8SxFBnTJm4yesQ7d6 420YuKUHvb+RmiwYlrXQrYtEZ8Xyp1p2L6J1qLXxldCoyXIhiy3WMKQL7EbZwzBsIVuoU PAKGVN2jl5RSH2yKMxk1q4xccMCvBzVXdpEO9Tl1Nnl60m0Sr9oTb4cn/s8r4d21brqQk EQtBtcIR8ZfZ72w1Zojn6vwmP4jrC67BKqJS57pE3lzXTx5KvVO+W6C34wQPqk6tv/TfY UzpQPjE0JTBE1KNRg3gpWbJjrohqPyAldmIFu7EBGHrp48rAP/oMsmJJujJ5nDNVJIA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=kcjWbPr0; arc=none smtp.remote-ip=209.85.219.72 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E352B606A322 for ; Sun, 6 Dec 2026 03:07:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E352B606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--willemb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=kcjWbPr0 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-920fb8b9859so70366056d6.2 for ; Sat, 05 Dec 2026 19:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796526432; x=1797131232; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0YzxPs19jnex2v1vpWMtnyn2Cycr8F5m+6Mq1uQ84IU=; b=kcjWbPr02BSPNvICM6SMybGovbqztSw0uOxyBjWJFc/y1O+Y5fIzlhv5dvw0Fg/rA4 JeU1clkgjhJlu9jiuz0FLGBDPcsT3p8R2Lk0qjt+ycT0gUHhqyV1GstBueR9nPbxAde+ hwjSrAM6Ujb4y4qDPDehZRrskiKVVZzi0Fb4Q06CRAj0sHVOfEF9Z/AUupXKRLA3DwfT xylGfrGS7WEY5VELYVoWJ8KDUSZGWaGAWIWKHUb99wdoEEHdZPQwGUYLrwt99ZSfPRWY tn4qx00q+Zs4xV/67NvNAE7CwhlmD4oosNuQRuetdWJOiECJbzfUPWKymI4xHwQnR1/4 zcNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796526432; x=1797131232; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0YzxPs19jnex2v1vpWMtnyn2Cycr8F5m+6Mq1uQ84IU=; b=d1ORbNBPPKuNTlx+XpUoiW9K2S23AZhki/k/Ir/btGoJG89yOcCvt+WtjHeiuvmlrJ dRoqWcn1zqCeGrtiVU22f9QNtpI6M+y5Z0loHstUHekiOW9pWgb1QZ6nFgVOKxq8tznz OQRO/+GTRz3t5lENApBaypCREpC+y1++E9emHj3LwXOjfey0FcZSgnvzJUiybBp04MNx wH4fDMW3YDBvOHOd+9qmhUtOydJWAVI5w9qHEnhTbCRdNAi88JH0GOPJXy3fHkCG+2/6 /Xt9Uljc1zKEFfRHJYdO/mnwvBUWwu2yPQQ0e48eUy8P+Quq0oGKmfTxkZmZRab4Z9LG UH6g== X-Forwarded-Encrypted: i=1; AL+hErFygsO2phB6UUY746EwanCDX/JLpqFz9quWBVHZ4LqWmScHd6E/INbkT6wPBFHri+hXvae294I=@vger.kernel.org X-Gm-Message-State: AB4q+uH+iZh5Ea6/X0jCiPD4eDIa2pYD9XszRl6TQcPj2/YcggbhApjF Oit+/mOb+o0c975VvBlC5T/MFkHUCGrUoLgKwvxe/vPuqlMqvf2LL5I/4mbnRzuWibxiXljjA3h l8PeIiIqGjw== X-Received: from qvbel5.prod.google.com ([2002:ad4:59c5:0:b0:921:101d:2262]) (user=willemb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6214:519d:b0:921:d76f:1fe7 with SMTP id 6a1803df08f44-921e245ced3mr100827426d6.26.1796526431688; Sat, 05 Dec 2026 19:07:11 -0800 (PST) Date: Sat, 05 Dec 2026 22:07:10 -0500 In-Reply-To: X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH net v5 0/2] net/sched: act_gate: bound the cycle time and start time arithmetic From: willemb@google.com To: Jamal Hadi Salim , netdev@vger.kernel.org Cc: Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Simon Horman , Shuah Khan , linux-kselftest@vger.kernel.org, Alexei Starovoitov , Victor Nogueira , stable@vger.kernel.org, syzbot+0054fed3dc9085390f51@syzkaller.appspotmail.com, shaos Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Jamal Hadi Salim wrote: > The cycle time and the base time are read from u64 attributes into a > signed ktime_t, and the cycle arithmetic built on them wraps when either > value is above S64_MAX. With base_time = 1 and cycle_time = all ones the > timer is armed in the past on every expiry, so the softirq never finishes > and the installing task soft-locks the CPU. > Neither attribute has been bounded since the action was introduced, so one > request is enough to stall a CPU on any kernel that has it. > Patch 1 bounds both attributes at KTIME_MAX and computes the next > boundary with ktime_add_safe(), so an unrepresentable expiry saturates in > the far future. Patch 2 covers the accepted upper bound and both refusals > in tc-testing. > The 10 us schedule-entry floor from the previous posting is a policy > change and moves to net-next; it follows once this series lands, and is > not > part of this series. > Changes since v4: > - Split: only the regression fix and its tests are here; the entry > interval floor and its test cases move to net-next. Applied the fix to net. Please include the test in the net-next series. > - Conditions states the user-namespace route through a filter, which is > the minimum privilege that reaches the code (reported on the list). > - The test cases match the kernel's own message on a libmnl build as > well as the strerror text, use deterministic signed values instead of a > 2^63 decimal whose conversion is architecture dependent, and assert > the stored value instead of only the index. > Jamal Hadi Salim (2): > net/sched: act_gate: bound the cycle time and start time arithmetic > selftests: tc-testing: act_gate: cover the cycle time and base time > bounds > net/sched/act_gate.c | 34 +++--- > .../tc-testing/tc-tests/actions/gate.json | 108 ++++++++++++++++++ > 2 files changed, 127 insertions(+), 15 deletions(-) > -- > 2.34.1