From nobody Thu Apr 20 19:21:56 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q2SFw6c9Zz46TWW for ; Thu, 20 Apr 2023 19:21:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q2SFw4kQPz43sX for ; Thu, 20 Apr 2023 19:21:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682018516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+91HL+8sNFzqa+xnE54euSpqfPFHW7fhtE8NoMx4m0=; b=NaGCFD2qB1N6Qj/q0HiceioVPpo72QhjKq6CEEFG44T4du1LjiRhOQx+Tb1D2NOedZ533x BmnoD8sC2XSlHOctt4NrkWAjdsbCLfwIZDUhRBBXKTfv4Wl4kvz+FzuYRcudPfvXRm+w5i rsJn8HIWM/eWD6eaEm4MlXjis7LqhXzBcRt1y9jKSbKX0S195cMbo1se6q+kL/3Tn8tzAP Lq/08WTrvxjokHmmrn2fB9vlOJiomB66Vovl6vmWsFEW6UTB3cgSKhPXCHWPzHb58R/KZN EEWT2UnzTkA0Xlx74fkON7c/cv0yFcE1EONUbOhZIc/Yzsxfs7kAi37uF7kzOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682018516; a=rsa-sha256; cv=none; b=DDM4Y1YxWxg+39Q7kxhOU5M+r7408cAyNwlUxztWGL+QEJLNuKm4lZrpU+6G9UErmomKkx SfKE+mRD55wHOIWs2StcBdjQTy66e5tZXF60ZClxg8nyslZ10gvm8SVb2yARrPGvDqFKC6 nOFy46pjwdtfGFfRdSQ0+g9IWmeFhYsjGC+W3n0Q+rfUwifDz6cMzkiY7TLE0ruLCCjtC/ e3TZY+zJS544FC9vXtQuzDU2sItK0q0FjAi7WHKHtoBNoTRyGoBvBASv1oSzyO5KVql9Jm eyt6v7iO6SfmrPS6WTpoLHMK+wg3qjtUAqGDbWPBl2u892H0wl8a+3cmSQkpiQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q2SFw3pBrzqW4 for ; Thu, 20 Apr 2023 19:21:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 33KJLuI6045285 for ; Thu, 20 Apr 2023 19:21:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33KJLuBf045283 for bugs@FreeBSD.org; Thu, 20 Apr 2023 19:21:56 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 270964] iflib/ice(4): invalid sized packet sent via netmap triggers MDD Date: Thu, 20 Apr 2023 19:21:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: brian90013@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270964 Bug ID: 270964 Summary: iflib/ice(4): invalid sized packet sent via netmap triggers MDD Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: brian90013@gmail.com Hello, We recently saw a machine with Intel E810 cards stop transmitting and start printing "Malicious Driver Detection Tx Descriptor check event 'Packet too small or too big'" to the console. Some investigation showed a user applica= tion was incorrectly building packets over 9724 bytes and passing them via netma= p to the ice driver. We quickly avoided the MDD event by fixing the user application. However, I= was surprised there appears to be no length checking when using netmap with ifl= ib drivers. Looking at iflib_netmap_txsync(), it assembles the set of fragments composi= ng a packet and passes them to ctx->isc_txd_encap() aka ice_ift_txd_encap(). That function has an int return value and seems like an excellent place to compa= re the total packet length (in pi->ipi_len) against ICE_MAX_FRAME_SIZE. (In fa= ct the ixl driver does this with MPASS().) The issue is iflib_netmap_txsync() ignores the return code and always increments the nic_i pointer. I have made several attempts to modify this function to handle failures from isc_txd_encap but none have passed all my tests. I wonder if there is a reasonable way to modify iflib_netmap_txsync() to dr= op fragments if isc_txd_encap returns an error code? I realize this code is in= the fast path and should be kept to a minimum. However, this change would let t= he ice driver (and other iflib users) inspect packet sizes, avoid this class of MDD events, and keep the interface up and running. --=20 You are receiving this mail because: You are the assignee for the bug.=