From nobody Thu Apr 20 19:22:19 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 4Q2SGM6pKjz46T65 for ; Thu, 20 Apr 2023 19:22:19 +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 4Q2SGM5M8Qz4507 for ; Thu, 20 Apr 2023 19:22:19 +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=1682018539; 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=wVWo1yjhxLqtkYBZDATVm4lVZNWS3xYF/AkH1QqrM4E=; b=xxvY/xynh9OZ2XfIZYKe+ivLDyqKO1YB9JVhhqaCyfsQBGnZR1ZiYqbM6aPczTyB8WrAHf tco87PeJ0CSosmHjxWPvzio8/VW58HQee8+GXQCgfm+YRfd48ETrQAhbo8lV51o+rMc9F6 42i4YeFzK7Mt5iXz7+Z62lvo5oo6DYtMF4+ATJUelE3+Y4p93dTJ+7AM8r3Mjz9fGrsUKd /fMW60QbsCg/ZJtyQOZmvVoXX/smE8OwzkT8jmcQ0wx+duiHlkfKdaWLPNrdqoQ8X4fgwC PIphaCnnHPwvHZpJy7L7gmuYwMAaevENy6gRUJ62dTdOtknlcLBbx+j2rqCqsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682018539; a=rsa-sha256; cv=none; b=XY3RLwDO8HgzOXGOm15tSzy1O/lQqrpNi0NHgo2nhICdN2nBuZ/6qEI9T3UdbjU6v9S67a IcTwfR7XT0CiaH5y7o8oHAaM5g9KyfmusjpiKmtWLvmwJRt4F6wRlObuDUqG/9g0/ITv4O KoBRPtTcpPe7anKWvDrK32SeLlZHpdgobo402JtnU0hpFbrfx4LHG9ewMwtGDlUwKF41LW JWSvIK5uuDjSESWC7PVqYo5sNl/R5nSW0OxJj42WqPGtqdSUzl2/a5AxP5XTh0CkDZB2tC iEUSJ2nA/zi28DHIa0ttmkKFSBDDpCr3Us0oNtllihJc5m+gMgW4gj0v/iYU5g== 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 4Q2SGM4Kr4zqsm for ; Thu, 20 Apr 2023 19:22:19 +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 33KJMJrW049680 for ; Thu, 20 Apr 2023 19:22:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 33KJMJLG049647 for bugs@FreeBSD.org; Thu, 20 Apr 2023 19:22:19 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 270965] iflib/ice(4): invalid sized packet sent via netmap triggers MDD Date: Thu, 20 Apr 2023 19:22:19 +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=3D270965 Bug ID: 270965 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.=