From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796059336; b=eQHQt9I6XwvmNvxAku+5jycWUpiiqbZ6swuQ7EfSrBLMzPVlyOkl8p3t1tAH76IHQpLd xXsPz9jEJxyp8taEM3CS2aRZvHXMpr2al16jfCXlXlA32Ga2Jzcdn4VksQt6gjroOXpKK dwhclv9xuZQWpPPi9jOhCK9Vp28hQw9JFSUXrLIpWsky+88h7md+/3KOQF58Las0CUdC3 wlYQTlyFzCrR50I+uw1Jz+Vjb6FYMjHES9hxDjAH5OjbJG2IaUTPIxJK3vVKO9skbz+m/ Wrqm++wyZvHF1EwrR8/eRctBS+XHG0RNGumKOjkZpCcCt0k+NjHUOClaU1V59RfXX2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796059336; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: To:Cc:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=AhsYTqRyEmlddsWfPrVeZsDXeRnCsktKeN5GfFh1H5o=; b=wQW5C4XzR5lZuY/9h60Ta94A8JAiKbfB+vHtq501683bMWabhg4v+SUjoiOYmfSmOpXH OPv/YzWeFok07bmsO6yNCpqJZjzkcHQyj8Nz6yTtrfbY0srxuaMYNBYH3j713+vzBs06M 3e+gyq6O2emtb0mr1VB8KMhwaCo0doWXCQ51JwYOPQudmHW3gT93CKmVF2JlEJgJkuOdI s69veCsXqPDFW+05xB+b1oi953VuUUI/Wu6qLhqG0gluMnjK/zeUs7hcSTfDQXNXlMvGX Kh+2+AIWqn33nLIy2w5xGC/Spth7y4sOTxNKoq0HmP06MLSU4+wIk26fOxsqUbqZZjQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ETywTsyC; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=F3B0LGql; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 659DB60A2637 for ; Mon, 30 Nov 2026 17:22:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 659DB60A2637 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.a=rsa-sha256 header.s=mimecast20190719 header.b=ETywTsyC; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=F3B0LGql DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796059334; 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=AhsYTqRyEmlddsWfPrVeZsDXeRnCsktKeN5GfFh1H5o=; b=ETywTsyC0qeCLX7C0yDgAyGQwWW6XdSKsQ5wMnhZnqc3H+rgh8DW+mXv94SpxI1sKNyFx+ 4GVR4Iuo4XxpyjHuy8eIjDp4tMUn8Ohb7Gc22JD3BC8ih9eTqs1I8xCgR1LjN3rdGCZ74X 4/YtH4EJTVTmkvPSB9OHxz2dVwPFESI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-RjXr-fqwNjeqJueH6FCfOg-1; Mon, 30 Nov 2026 17:22:10 +0000 X-MC-Unique: RjXr-fqwNjeqJueH6FCfOg-1 X-Mimecast-MFC-AGG-ID: RjXr-fqwNjeqJueH6FCfOg_1796059328 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4bb67b2c00cso59883505e9.1 for ; Mon, 30 Nov 2026 09:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796059328; x=1796664128; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=AhsYTqRyEmlddsWfPrVeZsDXeRnCsktKeN5GfFh1H5o=; b=F3B0LGqlcP+avttesoB9Dq1JGKMhCqTRLBx2/cS4i6oI3wcm8Q/AwD12D878KV4qHh pCibRELjRopuU5qqlpiRCSktvbND+LDBSpx5qQZIzgNEmESqj9fzATmLBo5vfasytf14 IKYv2WRkVwH9kMHHjbDW4wVCaJAIVPrH+Fh0tI58ZH+SpVSg+FhhcEYwi7HxQxceGQyr 8rbyedZ5Dz6n6tzP21RsN5KzeUTIpexZK8qrZW6Y/EBtR+NO2BIMQ4F1UwgDsJIGHDu1 pT0KpeJr1qSr6DmVkmaDw3ICZXEwtGNZxG9ZuAxPZNotucP8zm85rOTiiUmmyTDCncRO siuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796059328; x=1796664128; h=content-transfer-encoding:content-type: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:content-type; bh=AhsYTqRyEmlddsWfPrVeZsDXeRnCsktKeN5GfFh1H5o=; b=UGMrpBKMLPnUTR7RclJHfxLMkufKdi/GB7diUXtCF5jDe6a/N2DCtR0dKj7t+BtoBs vlB81q6oZnR9uL4eJkS9J9FdYCphXbgUeoVSkhpVmWhf4VmrA/QD25inYZuKYh1GOQY+ STmqLeneoWeStNVd5N+FFSia/xcnasy/p5qypvfvouvNrRyw7N6SJfA6XEuJJt4kf5g+ CWpRtDtVrCkmNSYzjw/kWjjS0yxwL1jKAY/MMki55f4PuFT88ph/VvMg1UbMb1wrT2Vb PrN91OOo7NHKZpAg7jKefN190k09tp2x36ysWLDmkUY8bTlcYWNYIO+8vxZYt2Ezk8F0 Z3BA== X-Forwarded-Encrypted: i=1; AL+hErEhKi3qd+eVvayNZdCSAvtl6rgSG6DB0/mEWgj7vOsjS7qAIYflszLiCwnJgOqrLf6pa1IyfIs=@vger.kernel.org X-Gm-Message-State: APuU4Z9VpPlshF8UPdfIQZCLbrehBxdjEezquJ8hUmK2obmN7p9FuQ4g 4EUzO9RE2ftYcnLrrhkV+ui4Fmn5zopm/CNt8BUyiFNm9hQVNZo8ztNI1i2CwdRATKrgFcK47vv aJUpB+6JuFhx9SZn69iNH6sDZu8K5nUyHqTOvvvhmz9NtJQPh3GbLiAGpnUfI3toSBA== X-Gm-Gg: AZFdTZeA8JT1bDVSBqn4mI34NNn63jqcuoFPMMqsadBy2OgIbeh1DkhwUHFJ4b+RRqZ gjs27w45SCzcZyLLlYaMgy4T2FPwaYsr7iJWhMzDhwngSZ4k7mBa7HrqzKD2hp5l1F4TTIRiy3g /hOr2PtW1hH+TC+G/WlONnMJM57/6OoyTh6NDzeYqjTE5zwq8QBL0jjqEirvf43L6yOWEVeMCRp 9RH9XvGBLrj/R811PPfooKvLhAqH9gJ+KrBYZmPfM5CXMa6a8z8HzfeWtGQ3ZujkmCZUOtxyUum QPD34iTgnGg22wlcEPH+qn29dcqu6Xh38bzNHmZDte+JqJv635iGNjqYMghREqsRJ+ASWGgg+it rUYc4lxUA8/QLi/QhB2vxh073oOBVUvv2RYH+P4XnIr1Ok4nJLreMobn9jbM7oy4swpm/VTvIs6 /udCSVB1X/kUJT/PbalfLsaPlYD1MBhW5ZR15qFWbOxlWo X-Received: by 2002:a05:600c:8b6b:b0:4bb:5e8c:13bc with SMTP id 5b1f17b1804b1-4bbba61a187mr184162735e9.7.1796059328243; Mon, 30 Nov 2026 09:22:08 -0800 (PST) X-Received: by 2002:a05:600c:8b6b:b0:4bb:5e8c:13bc with SMTP id 5b1f17b1804b1-4bbba61a187mr184162215e9.7.1796059327890; Mon, 30 Nov 2026 09:22:07 -0800 (PST) Received: from [192.168.88.30] (ip231-128-192-82.pool-bba.aruba.it. [82.192.128.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853a1e8bsm771075905e9.9.2026.11.30.09.22.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 09:22:07 -0800 (PST) Message-ID: <7ecbb59e-d985-4b75-9240-ce83bcd87175@redhat.com> Date: Mon, 30 Nov 2026 18:22:06 +0100 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 net] net/sched: sch_qfq: bound backward slot rotation To: jhs@mojatatu.com, jiri@resnulli.us, netdev@vger.kernel.org, Lin Jiapeng Cc: Lin Jiapeng , TencentOS Corvus AI , kuba@kernel.org, davem@davemloft.net, edumazet@kernel.org, paolo.valente@unimore.it, linux-kernel@vger.kernel.org, horms@kernel.org References: <20261124040208.13282-1-ljp1205831794@gmail.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20261124040208.13282-1-ljp1205831794@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/24/26 05:01, Lin Jiapeng wrote: > From: Lin Jiapeng > > QFQ+ keeps aggregates in timestamp-ordered slots and rotates the > occupied-slot bitmap when a group's start time decreases, avoiding the > need to move the aggregates themselves. Insertions are capped so that > occupied slots leave room for a later backward adjustment. > > A stale aggregate can make the decrease larger than the slots can > represent. Rotation can then drop occupied bits or alias distinct logical > slots onto one physical hlist, and a later removal can clear bits in the > following slot-list pointers or leave stale bits. KASAN reports a > slab-use-after-free read of size 8 in qfq_choose_next_agg+0xd04/0xd90 by > task repro/92 after the corrupted group is selected, followed by a panic. > > Limit backward rotation using the highest occupied bit so every occupied > offset remains below QFQ_MAX_SLOTS. If the decrease exceeds that limit, > move the activating aggregate's S/F and rounded start time forward by the > same slot-aligned delta before rotating. This preserves its service > interval and the logical-to-physical slot mapping, including repeated > rotations, while leaving representable rotations unchanged. > > Fixes: 462dbc9101ac ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost") > Reported-by: TencentOS Corvus AI > Link: https://lore.kernel.org/all/20261116121710.77403-1-ljp1205831794@gmail.com/ > Signed-off-by: Lin Jiapeng @Jamal: could you please have a look? It's totally unclear to me how the aggregates become state and if the issue could/should be addressed flushing such stale entries earlier. /P