From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f42.google.com (mail-dl1-f42.google.com [74.125.82.42]) (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 87F8231AF1F for ; Wed, 21 Jan 2026 21:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769032150; cv=none; b=NwQniJe4woWScCjjOGTUIC8LvY7Yn4td4umIQU/im1BI5Utwqb2S+ECpE/ePkIwg3uDSwOkMoOkJZn1Pu25uc4As+1parbmbM8D5zUoITxcaLJwDELzBypnqYbcfE0x/C0kqzWZnMpCN5RKjI/zUyiuGK6nebBtbLqquhtXuk9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769032150; c=relaxed/simple; bh=2SFqDiH83MW4ugjSYoc3/nCATH+R8FXbL80fYxa71co=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=L2AFc/7upAubLRjTtEtXrBdHHSypzw5ns6oXM6G0dNFckvQX9ROsUmCU59m9lth7jQpLsYMCNpHykj3mE7iopYZKROcDhFTXyNhBiHwrqknR55kYWHPKYE1urv71GkP+H5qYRmAbruKMhCszRLBDk6a+uUIrjD2iKEK4Z9T2IbA= 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 (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b=ecYTw7xK; arc=none smtp.client-ip=74.125.82.42 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 (2048-bit key) header.d=mojatatu-com.20230601.gappssmtp.com header.i=@mojatatu-com.20230601.gappssmtp.com header.b="ecYTw7xK" Received: by mail-dl1-f42.google.com with SMTP id a92af1059eb24-1233bb90317so1201817c88.1 for ; Wed, 21 Jan 2026 13:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20230601.gappssmtp.com; s=20230601; t=1769032147; x=1769636947; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=J5o26zUnay0o8KGgb7cyYz/y8MIhvkmFsB5HLG6SVuQ=; b=ecYTw7xKvpsrSRzuYUK7y1MEjBcnZ8BbiQFS4jivnso1LJ6+BokxipVxRuxpr1CD0K aa6NAIiJVOL3LQXhVzMqm34zGDGiLOppFRWg9zuhjDHrxN30rA3WePntt6H6vy891GDy R7c7NfTsz6MqR1rIYiFB7QaUPu1ysAyuY+03FPf3SRBA/YFqXyCRU2apTmtBRPWQ5G4/ jiLXLOpxBdMrE56p/8AuS4UsQuIandbhOIg5Z/4KXVa5KlIeDQy7qy7KIPDYUGlhNlw8 9A+U3dZe4vKSadHsWiH088upHRIXus/Qab0w87Zjx03xp3V81Mhs7NM6FTlK49Fhjf4r vylA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769032147; x=1769636947; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J5o26zUnay0o8KGgb7cyYz/y8MIhvkmFsB5HLG6SVuQ=; b=S2tx8o3oFxQfKE9gFCIsiulr8XSowMb4uHgcYluIiyEte2h4II3fok147F+6zVNfos Ffjna7fBC3MBHKtAkHuEBh8Z7tcL6uY4WXoBjtfT8KjJAMFS/oJk4l2oqZ9PDpWSHIix L2AIQig1qIn/kC1lCzMm9W4WAhxpTJ1895y6j+ZDYax1yjdSdfPwxQF/aTTt5w2lDYO7 Xnb3C2IWLpwxWiOS1vp1QHJpH7pmzQHed6Y36iOfK7qYWZP+V54JivKsxapc8mGU15m1 /2GTeNAbphNvIPh9gMpxn3sJqeuc2UFeLDpYt3aXpkNMcku9UK703KJNHWwGlXFhwxM5 m2pg== X-Forwarded-Encrypted: i=1; AJvYcCXJPciwY5GeLYRttflK/im29iG0vowZYuJ7KVuIk61BBiTJfQ8L8IX/csgRy3NkFGL4U/nxPqrqVEjLBj8=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/pGZIEjrkyCAbqOg6f8GsKqYVGSTwo02VqPNOziOAD7A8idbZ +RRYVUuPnRvQmqcoe53i7CsOobwUbhKIE8WNnV0FK+PpstqTaYF+3qCCxMhGYdnSjg== X-Gm-Gg: AZuq6aLdEQnqDW4qm2L6HvMMajyJjqApuMJHwZTRVMq3i6g2pNigtsyDbiy2CgJXL1i 65wLKSM8bTgypKIKHihOudmInvgmiSb3sN9Ob9vu0HyZdIlnme5m+E4c+UUKypY16IVkMK+wsvr pMIM3gDL+wb7YFzFrev0D08jCy90esrAk0XetcxPySG8JcEYW3rBqrvGB4LzWChdSZp73ztArS4 0jRAClwsXUPA2RA1NYVcJFGaG6nArfcjTpXEt9JXEZ4JmJsm2mMsGx34J1f2mxWuGw4WG2MDSZB 6K6LTIvJmD32IrgLo9ln/ekgXHKZMPYEi/Gy5i4drg22iydDDuxEnxB2QH1AFcq/VORVDLWbnmS mwOnu3M3iBD+u9GzEEmIQnIyWA3nrCs8mzh58LaCzyXOF1WLU0lS7+BgMoCYwPqWM8atnIKIqDy 4Z/7jzPcYfcX6HhFsqlM78mg== X-Received: by 2002:a05:7300:ad2d:b0:2b6:b246:dee0 with SMTP id 5a478bee46e88-2b7247158f4mr526028eec.4.1769032147014; Wed, 21 Jan 2026 13:49:07 -0800 (PST) Received: from ?IPV6:2804:14d:5c54:4efb::1c9d? ([2804:14d:5c54:4efb::1c9d]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b70d7f729bsm6550761eec.16.2026.01.21.13.49.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jan 2026 13:49:06 -0800 (PST) Message-ID: <412136f7-1d46-42ac-96f9-b6cc462204b2@mojatatu.com> Date: Wed, 21 Jan 2026 18:48:59 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v3 6/7] net/sched: act_gate: reject empty schedule list From: Victor Nogueira To: Paul Moses , netdev@vger.kernel.org Cc: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260121131954.2710459-1-p@1g4.org> <20260121131954.2710459-7-p@1g4.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 21/01/2026 16:44, Victor Nogueira wrote: > On 21/01/2026 10:20, Paul Moses wrote: >> Reject empty schedules (num_entries == 0) so next_entry is always >> valid and >> RCU readers/timer logic never walk an empty list. taprio enforces the >> same >> constraint on schedules (sch_taprio.c, commit 09dbdf28f9f9fa). >> >> Fixes: a51c328df310 ("net: qos: introduce a gate control flow action") >> Signed-off-by: Paul Moses >> Cc: stable@vger.kernel.org >> --- >>   net/sched/act_gate.c | 6 ++++++ >>   1 file changed, 6 insertions(+) >> >> diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c >> index 48ff378bb051a..e4134b9a4a314 100644 >> --- a/net/sched/act_gate.c >> +++ b/net/sched/act_gate.c >> @@ -509,6 +509,12 @@ static int tcf_gate_init(struct net *net, struct >> nlattr *nla, >>           cycletime_ext = nla_get_u64(tb[TCA_GATE_CYCLE_TIME_EXT]); >>       p->tcfg_cycletime_ext = cycletime_ext; >> +    if (p->num_entries == 0) { >> +        NL_SET_ERR_MSG(extack, "The entry list is empty"); >> +        err = -EINVAL; >> +        goto release_mem; >> +    } > > It would be simpler to check this in parse_gate_list. > That way you could return -EINVAL there directly > in case 0 entries were passed. On second thought, I believe it would be better to check whether parse_gate_list's return is 0 and the op is a create. Something like: err = parse_gate_list(tb[TCA_GATE_ENTRY_LIST], p, extack); ... if (!err && ret == ACT_P_CREATED) { NL_SET_ERR_MSG(extack, "The entry list is empty"); err = -EINVAL; goto release_mem; } so that you don't need to add new arguments to parse_gate_list. cheers, Victor