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 E3E1D30C637 for ; Mon, 6 Jul 2026 10:02:46 +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=1783332168; cv=none; b=mPeR9zBBzpfVAfJQ8mc0fgfRh0GffpHFtkipVYgjOlLNP1Ed6J/13FCdtPQyIIeuSMP8WTzAh01lGKx1zkOqLhtjGbPKSMpoq9pJtMU1hunNHUYfZJwkvBCIhbEfajt0Yo6R3u2HJPEvRkWYxfsoZAWeNzQiJmjVyhtraN2fjWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783332168; c=relaxed/simple; bh=xkUq6E0frsaInzwoabXWgqX0hcjL28UQaT3wfF2LHw8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Sic97xVyBlGsT44dzedO6YeqM0s4JMZ6cpI6QCyBgPJuuk/37zjUj9AfRauJJF+FgJzx9oiuYqgupywqZ4ddTYMsILY8yw5PIqktZDbsxpXtp3doHDRdfON/Q6f4yJlAXc7KLsESjemqVxBXF6uLKHrVwmptsJzRxqLxVCi54M4= 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=VzHB+Qjy; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=lrzOGxgv; 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="VzHB+Qjy"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="lrzOGxgv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783332165; 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=Prx3YP/QlyufoElU3hXt9XT8NpX+Helw1UMh1Uu4rUg=; b=VzHB+QjyCng7NmY0bVxyXS5MaBPERz0f/T/nKUMviKd01MUzndg8N/w2ALGtb3qIUKcZE3 1OUVgTliI+g0t0ro100TBX7/Q/3Gvv3emXH8En1IzHsmglIRoKGgAIzVg6ltQDfZQASRuL /vmg6GBBSdI34WjM7kjYWv+OiSPlkqg= 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-5-omqb87VaOEaAJ9CRhQU8lA-1; Mon, 06 Jul 2026 06:02:44 -0400 X-MC-Unique: omqb87VaOEaAJ9CRhQU8lA-1 X-Mimecast-MFC-AGG-ID: omqb87VaOEaAJ9CRhQU8lA_1783332163 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-493caa3c54eso24514285e9.2 for ; Mon, 06 Jul 2026 03:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783332163; x=1783936963; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Prx3YP/QlyufoElU3hXt9XT8NpX+Helw1UMh1Uu4rUg=; b=lrzOGxgvCG/rEcJwNGOL9KvQHUmWj+lx7baGLHA/LxQjQAubzAgwOkHY5ytJIdyOKm KAjsBQz2IGGbiCrcEEoAaTVkv4fGicYnTUGVeW+vfkBJfSe0p3NOq7qtzFH5H8aUA/Yb Htt+xn18JNLrSV0EHm8i6cDNnOKzkhrtV8mLnxWrfuddVDsHmgXVoyLHj7Z4poM2ZJqf p53zPIpJVvJrfOP0gVpdwZcIvVEtOscHrHmfFopAZPAImaa96LBffOxQedvHCEs8qqgX TZyqnr4uqx6qG0piF+vVhue3W3ZV9zCz+fu0dYY6rDX9IXfTmLubWbS596gsCl/Lqo3l PBBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783332163; x=1783936963; h=content-transfer-encoding:in-reply-to:content-language:from :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=Prx3YP/QlyufoElU3hXt9XT8NpX+Helw1UMh1Uu4rUg=; b=P3cdu/2Ss3zv6UWjq3sfXM92ddHiDNtJGV5sO9i0OfLMq/k+ZI4Ie7gxHK2WK4K+9Y scuOzk6SLxOWyuLGJ52AgTaghER+LC9+3IUC7t5Rq/XGPexTWrCITgiqIwS7Tizj9e6C VhDnrmiX16n/N4axDxj3qt/lC+LOx5BLhJcY2C2Br7/D0mplnf5JxuU+AXj5E4Eyg0aF y/8Gz+l8IAtUXOcbwW6lFVX016C6xO3YBeIOeu9n0Tzc1OfDkdfnuJTSsrhzZjy7s4cl 2xHglllhrSdhWzmtFO1XKuRVHsTlD9xi9qWHS68a+ZSsoQ0HNtL4DJzMYOdofIsYZ7o3 c6FA== X-Forwarded-Encrypted: i=1; AHgh+Rp1j8cCnlma5XzG6Kh5rc8WZ8YA6B9kEy/Pb9RKbtMkESA6KyoyzzftILAEmsY1UIQwaOiy2Ys9J/cavPY=@vger.kernel.org X-Gm-Message-State: AOJu0YyvTOdmJKcYADRZI2jNHfAR6FyEgVoTlDLmnZIeMbThyrqekBZG 4KabViZ+e+67qiNsWsn7ztdtQj4JchVSfL2ymkUZ1DGb0CCzd6xjOYY3OxqwpUwifj4Mugawo7C ERleq8nLm/OnDI4HS7ASw5LmyCl0m5Urk17BIMAGaS4aMzq6/Sc0n3CgQhVHhWHhX0g== X-Gm-Gg: AfdE7ck6vl7MIt8NIKamChBDdxb9n40Ypncl9lESXBZWgOFeXa++UDGQu2aDnTw285T on3JFWu/zeT4GGKeTDh/NgLT8Ana5o2nVUaaNc0n8mJGMwaFUWZ39FB+TBklnLwAjSLoy+Plvfk h9NMXrqp+njL3rrW/aZdyz9DnU7t2KGAQmgBkNkJRM1m+CiWBfUDuutY6cRuzWWoVsKntcMnqM0 /xQSAKSeHWGzVIihzHMeEs52Kllbxg1AKUAngmXezGhuLYK6DNp52h1RyRKP18kJnUJEE46rUae KNTcUoDdV8chdC1LgkexFHbObS1Xn96R1e6X9PC+IHJ5DL6t1zJFRgFi8sNrdi7IP2HqA0594hM r8RDEt1juh1EluqiNbom+AX1caUkd4T7yyr0nza9L83h8WLQ4JVs5I/JCBlZw7NqGFZ2VD/o8bG z3/rRe8FtvPN2R X-Received: by 2002:a05:600c:46d1:b0:493:c84c:2b57 with SMTP id 5b1f17b1804b1-493d11f7cdbmr108910075e9.29.1783332163404; Mon, 06 Jul 2026 03:02:43 -0700 (PDT) X-Received: by 2002:a05:600c:46d1:b0:493:c84c:2b57 with SMTP id 5b1f17b1804b1-493d11f7cdbmr108909625e9.29.1783332162933; Mon, 06 Jul 2026 03:02:42 -0700 (PDT) Received: from ?IPV6:2a0d:3344:5521:6b10:58fd:68f:7756:389d? ([2a0d:3344:5521:6b10:58fd:68f:7756:389d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493c63ba971sm595864885e9.13.2026.07.06.03.02.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2026 03:02:41 -0700 (PDT) Message-ID: <4730638c-9382-4689-a1e0-d6a50bc66c32@redhat.com> Date: Mon, 6 Jul 2026 12:02:40 +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] qede: fix off-by-one in BD ring consumption on build_skb failure To: Shigeru Yoshida , Jamie Bainbridge Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Matvey Kovalev , Pavel Zhigulin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260630164623.3152625-1-syoshida@redhat.com> <875x2te8l3.fsf@redhat.com> From: Paolo Abeni Content-Language: en-US In-Reply-To: <875x2te8l3.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/5/26 5:53 PM, Shigeru Yoshida wrote: > Jamie Bainbridge writes: > >> On Fri, 3 Jul 2026 at 09:52, Jamie Bainbridge >> wrote: >>> >>> On Wed, 1 Jul 2026 at 02:47, Shigeru Yoshida wrote: >>>> >>>> qede_rx_build_skb() and qede_tpa_rx_build_skb() do not check for a >>>> NULL return from qede_build_skb(). When it returns NULL under memory >>>> pressure, the functions still consume a BD from the ring before >>>> returning NULL. The callers then recycle additional BDs, resulting in >>>> one extra BD being consumed (off-by-one). This desynchronizes the BD >>>> ring, which can corrupt DMA page reference counts and lead to SLUB >>>> freelist corruption. >>> >>> Good catch. >>> >>> Reviewed-by: Jamie Bainbridge >> >> Sorry for the double mail. >> >> I believe the Fixes: should be against the problematic original code: >> >> Fixes: 8a8633978b842 ("qede: Add build_skb() support.") >> >> because that is what you are fixing. > > Thank you for your review. > > The problematic code was introduced in commit 8a8633978b84 ("qede: Add > build_skb() support."), so putting this in the Fixes tag would be > correct. > > I'll send the v2 patch with the modified Fixes tag. No need for a v2: I'll update the fixes tag while applying the patch. The PW is already quite significant and I think it's currently better to avoid repost if possible. Thanks! Paolo