From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DB4F29AAEA for ; Thu, 23 Apr 2026 07:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776930631; cv=none; b=UL8WT4IN2MdDkBOXdxFVwRQUkQNGmllObLmak1x3Ys2KNDaBky9vBfTkiG1QG1f7YST2yg68YMxDNPjsjRwDwUfrDNNon9GwyWm1389TT3NovmE6/DIqh1UfK7sD8bpwiItTsNMS7FjVGpFv6cacvx97uufBDZ4/rvqpvTboKsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776930631; c=relaxed/simple; bh=89j00iLcqHYB5cU4LIGHWsJdhgF0Qz2eMdlFKcdrmQg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EbM4FPvBZlBf9BxcG9fyO1IXPai15PtPR6/cbGf/Oeyc1zYR+bSulJpdBhWcLCZ77LCG1sghLNEkEgi5JIjrPrm3utfOR+RDjC/zMU/L1j85RRk7Cuo6jeB2X0CMIPA2OCF/dujVWS34aB0sYt4uDH0HUGB0rBdw8h1SOYSJ83U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GwfA5SFF; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=U5GKfbBq; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GwfA5SFF"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="U5GKfbBq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776930627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D30yfVtGlHBCp6XmrkjxJaDZ/v2wJtlooW7205vdCuE=; b=GwfA5SFF35P2UBKiwU0Wk0yQ3VKOl/ZBdKw3IXtqXe3jm0UyRvEa/peqfH3EgUsZr+en6r pGk0rIcgrDBNyWozvjuLd369+JM1IeizcxcmFYXs9QeidXPy6N4dja9Fzx0WwvxOIUzlpc UkudELjaX/ENmeEmrRVW9nC54DLy1yU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-nTPgJ-1DNj-XmLl5q4qggg-1; Thu, 23 Apr 2026 03:50:25 -0400 X-MC-Unique: nTPgJ-1DNj-XmLl5q4qggg-1 X-Mimecast-MFC-AGG-ID: nTPgJ-1DNj-XmLl5q4qggg_1776930624 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4836abfc742so62035115e9.0 for ; Thu, 23 Apr 2026 00:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776930624; x=1777535424; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=D30yfVtGlHBCp6XmrkjxJaDZ/v2wJtlooW7205vdCuE=; b=U5GKfbBq3DUEtlSKfPFhTDhQw+9TreHXMQu58wIG52dVXfy6RQPtVXtbMFXc3MnFMh yEHRWd7h7efhsvU1DhYKBOIwcCW3LnW/cwyxnT1KRxiaB8igKv858uil7sZUreYp9wlH RCdxoW4LDD71OcG6wYc37q0pxZEVSfMlyHq6tGnnKDgmQ+Q5HeTbm1Ef3BQXj7FLeaBj Ft7b6594vcINrwcuffSzlp4Iy1OUrA+9Jlpa0MfnNMywvzMIcAebSAkQj0O6tRI6v/Ic y4O5Qx2G3WjH+AaTZas4LySDO6S1LTS4ZV2GAXyaC2ctyMFS4i36sE6FdJVKVhkc+3PO UySA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776930624; x=1777535424; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to: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=D30yfVtGlHBCp6XmrkjxJaDZ/v2wJtlooW7205vdCuE=; b=nLivX5WaygEOmc1ejG9KD0m0av68lkk0vT+jV4XKrEChO4VKuCEQ5mUatRy2W6EBX8 +Ra+isZpNsxJgR9XumgULU8PbS6VIGNDBBgvr9TezZeEOL0Fd2RODaaXLYnPwBIQ+ewm fNbHO/u8iW5ZuJ2/sCmpB/1P0SSClgZSj8DrF/pmPKugquRu0FsweqXg+vtmmyBRYRma +vGICNZDvvEzwwNZND/NCyzZIPNLy6QR+GeIGsPJw6IQBC+vcSjp8zou4vknqUm8OmtK FH5viepj1UuwphqeALTyrZ8tfIUyBta6nekJ1/30jQvqFwtCEI6GlWdTo7NAuKoB54qs ps1Q== X-Forwarded-Encrypted: i=1; AFNElJ8gjG8WSH0XyzQFhNu0v4lKLTvzC/xMJYvpwGf0zIzICvJVtaCZndAxHRsXjj6sNre+6PkkX+Kht+q5QAQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxDE9R2N05Cdd/YSA0S66u7HKfEt50eEIaaN38mtvvEFUeSfu2/ vIz8fo4Te1Aemlw/IPrfYt3JPFmy0OLXEAYMMF/+f869/1wB8k4C/mUjOLjWU2iVj+nvlAKTGTA 4BeTABkh2sHlFFcuNovsr8v7wb0iHM8/NMs0w88MVLmvaVUhuFMTf6O0Ly6wY/Wy5Qw== X-Gm-Gg: AeBDiesvPZ8NhLicvKPgBH1D9yqFafRrb/g1R/S757b0nNPom8C7wmHitGyVEmcy7kV HpZhgwGRQb3sJFsv4ox+suZy5uw6XgEOEvuUdgu8QE/PY1DrzsfgLkLTajda6sTAURxcQMyQF8v pi1F6PJShqUZaTctRGpUyp8DH8Sw42CgWG/8Q/5h9VXmdRJyVeGDapXV03PPxkTuAjZSEcJeTkO hqF0Igi8TgP+0OuEAwyeWJ04J7ardUAf5risKZi23GiKBUxqeDtfkpk0CGFk7VUqaNgQbRirm4c 3xK229fFSFoOOD3u/i1kvPI35Cv5keycvM1GsblXBw2NB0MzGS0H/ZFLTfUcnvWy4mo9V4pB1YH PLBECo29jbHPbA1cLZuFStsPsL+wSHkXucZttdZn35fGPXSHyK6hAH222VB+v6leMlVA= X-Received: by 2002:a05:600c:3b04:b0:48a:5574:3a57 with SMTP id 5b1f17b1804b1-48a55743eb7mr137090145e9.29.1776930624013; Thu, 23 Apr 2026 00:50:24 -0700 (PDT) X-Received: by 2002:a05:600c:3b04:b0:48a:5574:3a57 with SMTP id 5b1f17b1804b1-48a55743eb7mr137089715e9.29.1776930623580; Thu, 23 Apr 2026 00:50:23 -0700 (PDT) Received: from [192.168.88.32] ([150.228.93.216]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4891cc7b2efsm166355775e9.0.2026.04.23.00.50.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Apr 2026 00:50:22 -0700 (PDT) Message-ID: <87f5e94e-d354-423d-9976-6cf3fb0710b1@redhat.com> Date: Thu, 23 Apr 2026 09:50:21 +0200 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 v8 4/6] net/sched: netem: validate slot configuration To: jhs@mojatatu.com Cc: netdev@vger.kernel.org, jiri@resnulli.us, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Dave Taht , open list , Stephen Hemminger , Simon Horman References: <20260418032027.900913-1-stephen@networkplumber.org> <20260418032027.900913-5-stephen@networkplumber.org> <20260421131039.GA651125@horms.kernel.org> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20260421131039.GA651125@horms.kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/21/26 3:10 PM, Simon Horman wrote: > On Fri, Apr 17, 2026 at 08:19:42PM -0700, Stephen Hemminger wrote: >> Reject slot configurations that have no defensible meaning: >> >> - negative min_delay or max_delay >> - min_delay greater than max_delay >> - negative dist_delay or dist_jitter >> - negative max_packets or max_bytes >> >> Negative or out-of-order delays underflow in get_slot_next(), >> producing garbage intervals. Negative limits trip the per-slot >> accounting (packets_left/bytes_left <= 0) on the first packet of >> every slot, defeating the rate-limiting half of the slot feature. >> >> Note that dist_jitter has been silently coerced to its absolute >> value by get_slot() since the feature was introduced; rejecting >> negatives here converts that silent coercion into -EINVAL. The >> abs() can be removed in a follow-up. >> >> Fixes: 836af83b54e3 ("netem: support delivering packets in delayed time slots") >> Signed-off-by: Stephen Hemminger > > Reviewed-by: Simon Horman > > I acknowledge that Sashiko has provided feedback on this patch. > > 1. "Does rejecting negative dist_jitter values with -EINVAL cause a > regression in userspace ABI backward compatibility? Since the kernel > previously accepted these values and silently coerced them using abs(), > existing userspace tools or scripts that happen to pass negative values > might start failing to configure the qdisc." > > This is intended and explicitly explained in the cover letter. Jamal, given the uAPI implication, could you please double check that the change is fine? Thanks, Paolo