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]) by passt.top (Postfix) with ESMTP id BC5095A026F for ; Thu, 7 Sep 2023 17:45:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694101524; 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=lXvcEDGC0j3tToboYQOOHckWYEdGLdMCEL86AulpG1I=; b=hz0yEIxHsfJ9mRABpqTcnLXuMa5x6skG6t2cdFfhdrmJoJlZs4SLh4wqXKLoxBEfbsQGTy QomR1Oq7Vv2Oiay39y25zOd97iMdxULn40xUwc9f9hpJr+QKjqQIKqUlydmeiCZVuio+ME vD5BeKvsAzWpW0BUHpE/BRLIUWlEydo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-461-nKOklQAxOgeJ9fZTnXRZOw-1; Thu, 07 Sep 2023 11:45:22 -0400 X-MC-Unique: nKOklQAxOgeJ9fZTnXRZOw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72F7C803C96; Thu, 7 Sep 2023 15:45:22 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C91B521EE566; Thu, 7 Sep 2023 15:45:21 +0000 (UTC) Date: Thu, 7 Sep 2023 17:45:19 +0200 From: Stefano Brivio To: Stas Sergeev Subject: Re: [PATCH] tap: fix uses of l3_len in tap4_handler() Message-ID: <20230907174519.08eb598e@elisabeth> In-Reply-To: <20230829164406.594036-1-stsp2@yandex.ru> References: <20230829164406.594036-1-stsp2@yandex.ru> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: F46WM54KN6SK2JDML2KUQUYC46T3XPR5 X-Message-ID-Hash: F46WM54KN6SK2JDML2KUQUYC46T3XPR5 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 29 Aug 2023 21:44:06 +0500 Stas Sergeev wrote: > l3_len was calculated from the ethernet frame size, and it > was assumed to be equal to the length stored in an IP packet. > But if the ethernet frame is padded, then l3_len calculated > that way can only be used as a bound check to validate the > length stored in an IP header. It should not be used for > calculating the l4_len. > > This patch makes sure the small padded ethernet frames are > properly processed, by trusting the length stored in an IP > header. > > Signed-off-by: Stas Sergeev Applied, thanks! -- Stefano