From nobody Wed Jun 17 01:35:13 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 1DF303D9DD4 for ; Tue, 21 Apr 2026 14:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776783515; cv=none; b=SLdb5v0HyOcsgojG7mFt37gFZn77LPKqduugUINSXZuE1Eshd5FbvFEpoubgxN6vbOkaR2f6GK0SUh8+Wa2OFSVy+H8FWbYzNKPsL3wjD+b7m5SNWBdO9BABNXoVcockWwUdi74oOXbz7Ob/QGXkHfrtmc1EQ+c5r/NTByBbLiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776783515; c=relaxed/simple; bh=oMkPWBQsIyoDnS+6ID/6raP7oGgOgpzWjkT5mVWy8yo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=de4LmjkKzIEdz1qAtczj9dB4GxPRGjxD5Tjvr3fhB6Z+Ha8Esb8Hck82nVXXxZjW6VJHJar9UEuyWBqPFd7+sYFU6DZeSH6s6rHCqpOWOvr46RMvzMRjWJiPQPBSgP0qjaSF8w/peSpLq0ZgR5GHrTNGFYcnej41Cy9GCX43AMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=sX7IFuO9; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sX7IFuO9" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4891c00e7aeso22002685e9.2 for ; Tue, 21 Apr 2026 07:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776783512; x=1777388312; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZQ35oSVSI4KSh+xmtYFc6UscETFGPvX8289l7HgBZZY=; b=sX7IFuO9Lry8AJxT66mZzoFtzq76iRkJrtiR5o5lF13RDCw/vYkJaaEFTflld3Kgd/ U2g92QwLkrUlN93eJ5o4M1DfovBS/FLCrM/0lSU7s12KKKCFOwUFTXKl9fMCemF1x5qG C4L5aUgvGEWz8wtZYN9PbtbnnnvcYTWTzpP3t1Bd5bnUe9LufzfyL6qR62SJJjF3F7wQ dbt1KBIH0+hF8qjijuyJW7hd4g3NaUjUwBWckYf0N/h73HuLhJTtYYpda3NBta/NNmHn fmHGYzsgZyesHP0FP3Sweg8aqmxNuAjNtVgYE/49Y1flO7uzzeWanJI6nUY6y4HG461I sgrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776783512; x=1777388312; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZQ35oSVSI4KSh+xmtYFc6UscETFGPvX8289l7HgBZZY=; b=K2be0qC68aGPMPMgpHb/S9qpZJLEtKHcMNGFE17KsNuKHg4B4A22jORMqDQrr9krs6 s1/wkFUhbc+TaGVrB3g1AkVx6tReZR8XNg6/AyWihlwAX+eDxYwoQVLIXzn7G7lvuMJg Hwj4+EKzz8PMBudmr76HXfkELgK6pXdVTEBC1XBqklHpJDtMnZzXyfiNGzBRfGg2nsa1 muThVdRd/JTZD5TAuCeWgJcPKBjutTp8a0ygngN4mxrpylhi/vC30lSSZoAv19N2Ds6H x58MIX8ZndCtVjy4KHITnYzx4I3iHDxzfZBGnB0nZeKpBxCP+hsBWgDY2XouuaIJm67C SOqg== X-Forwarded-Encrypted: i=1; AFNElJ/O4DE73Sbi1oJYFurZp0sexng7hTfUe7RyetkjYOmkmOe539P4w0X3kTxtdOF0p84OGMiEW9536WWOWHY=@vger.kernel.org X-Gm-Message-State: AOJu0YzyDhAoxlLO+o9+NGRYtRDdWxuMDgWjEjW0z320W9cxDlg/HYOj xBxDLvRuEqcQHKqo+DTT6yrkILXPaIqm/SzB9KtWwJ1/XOYhESoXmY4e X-Gm-Gg: AeBDietoiiy6SjlfGXw7Fem+tpnP6bj64jjOkCEyQq2niqaohJ7MgPYSUfXzL1vsXiL z58dFARaWYwDj7tmegQh2YoN/r2o6ajrxL0VgPFxZKrfRsuELpGreiIvoDp1WmvTys7/oBZdZjn gI4t+099HjFcez9gMVPA+HbbP+xwlVLksEy2qWrkDR3Nt65BKM/VbqkW2efecG4FLuN1QHDxGOa EorR6wuJCZwbu2qugOUOCjpM+SmEVy9TfsNjU178+imKVVFOheuJJhhYYIbH2RVbpRhdii1tptD 0g2/AEHkxytPJzQpKcsEv0ztxL18CCJb0eturssUM4RmKGPNQ7VyByyDg2hAp72vYxQ3aPJdrg0 Z9ct6j1A/h2WFaDGAzHGKIAlqig4da8CGkQUeSHOkblOB4/d+RRm9R6dmfz9X1eDiSbz8z7zDZc /POZLIhM8pSv9jUyNkZpUFsDnG+kTnDMfceLt+eQ9ut3kKJa9S6A== X-Received: by 2002:a05:600c:c085:b0:486:fbdb:b718 with SMTP id 5b1f17b1804b1-488fb784948mr194444645e9.25.1776783512142; Tue, 21 Apr 2026 07:58:32 -0700 (PDT) Received: from nixos.int.ionis-it.com ([163.5.3.68]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7a0b60sm110771715e9.17.2026.04.21.07.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 07:58:31 -0700 (PDT) From: Titouan Ameline de Cadeville To: netdev@vger.kernel.org Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, Titouan Ameline de Cadeville Subject: [PATCH] net: ne2k-pci: fix missing residual byte in block output for 32-bit IO Date: Tue, 21 Apr 2026 16:57:36 +0200 Message-ID: <20260421145736.15949-1-titouan.ameline@gmail.com> X-Mailer: git-send-email 2.44.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ne2k_pci_block_output() handles residual bytes after the main outsl() loop when the transfer count is not a multiple of 4. It correctly handles the 2-byte residual case with outw(), but is missingg the 1 byte residual case. This means for packets where count % 4 =3D=3D 1 or count % 4 =3D=3D 3, the final byte is never written to the NIC's data port. In practice, this is masked by the count being rounded up to a 4-byte boundary earlier in the function for ONLY_32BIT_IO cards, but that rounding itself causes a little information leak by sending uninitialized kernel buffer bytes on the wire Add the missing outb() call for the odd byte case, mirroring what ne2k_pci_block_input() already does correctly. Signed-off-by: Titouan Ameline de Cadeville --- drivers/net/ethernet/8390/ne2k-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/83= 90/ne2k-pci.c index 1a34da07c0db..1bd5b94b5d22 100644 --- a/drivers/net/ethernet/8390/ne2k-pci.c +++ b/drivers/net/ethernet/8390/ne2k-pci.c @@ -632,6 +632,8 @@ static void ne2k_pci_block_output(struct net_device *de= v, int count, outw(le16_to_cpu(*b++), NE_BASE + NE_DATAPORT); buf =3D (char *)b; } + if (count & 1) + outb(*buf, NE_BASE + NE_DATAPORT); } } =20 --=20 2.44.2