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 40F923AEF37 for ; Wed, 14 Jan 2026 22:19:30 +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=1768429180; cv=none; b=g54hE/fVe+UDvGqBGS5PkdnC7Fp7kiJseGJ32bojcPn1IwKVvp3dEOCMnAub2YgagdSaWxrWloFoadTObaPsIdzXkiHiw0vQSZv2vZa8tnKBs0ic5qb3q12W9tSgvsRqg00EdzKVyFMPQxZCHtBJ4pdPxbaSZUOq07eerrXTXVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768429180; c=relaxed/simple; bh=Zd3hjooXcRLvny48hHqRzr6SITpUI+66uIBAPLtuRVk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KJR7RZ5wwY/BoCGmnukAELnPnl/WSXamG1u8h0O8oiSB5JI8VBHtrEzv/7qqSBTVJSi7Sk/YAd5meFuaP1f9E86unV9lwW8MuL9InszUqIji04zrPW810eY01+8T78y0+MCCwyphxmEbUEfBw6KWeaA+BgigM7gsbIxqc9Uff4Q= 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=Aw2eqnlp; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=B6fEyAqd; 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="Aw2eqnlp"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="B6fEyAqd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768429167; 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=ftR49wJT1ig0dKZDi8tPuyXzRv13vJOC8jN0Oc8SYJ0=; b=Aw2eqnlpb2tUDBiGSvqOL69f6vSr86/nnqrYfZK/3hUDUeJ/EKpjH/gFt7PQL6EY6wZoCT CNmnmmPY0teoXcd465LNalM4nTTfMliC6xNVnAe1XighgyDs7O0prfZAG4JcGhVOcdyZuD H4zkwLXBWi5K6ljwDmLdnpx7ST8U4S0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-Jz-8rIoKMRWEbCck3rVeGg-1; Wed, 14 Jan 2026 17:19:25 -0500 X-MC-Unique: Jz-8rIoKMRWEbCck3rVeGg-1 X-Mimecast-MFC-AGG-ID: Jz-8rIoKMRWEbCck3rVeGg_1768429164 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-430fe16b481so132113f8f.3 for ; Wed, 14 Jan 2026 14:19:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1768429164; x=1769033964; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=ftR49wJT1ig0dKZDi8tPuyXzRv13vJOC8jN0Oc8SYJ0=; b=B6fEyAqdfIlD9e1DArygZ2NEEEmZtDLDgqKIAjfn/dy3kdvGyUEItLCkwjggoQzXCl /yW6u/S6Ko4u3ql1Zwst3DyoFuKK/+BP10DjTiQOb/OMDNV8Vo3Z1KEpHBq3WpcrJgcv m2UixGcX9YnNCHQBSSt/BGWRfyGqsnX/WnY1oC7oeyUdbI79rMzyuCpUlB0WnyRIVF+j sFnayxMcXdn9RGWE+XYdyU6GnuhfTUgL57LlkGPpZhUgZsan2tf4+fJ4ZUYPdRspZeCJ frZ3UaOmEOQNZRP74x6SJSyAiLI3RCSQ87xalE3qTgbO/RU+w4miVOitAqIxsUpU8ODR /nfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768429164; x=1769033964; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ftR49wJT1ig0dKZDi8tPuyXzRv13vJOC8jN0Oc8SYJ0=; b=ocYCHAsdI5CCpw1vM3Zpj7jsKCOZRD1y5r2t4aJra17d/hmXeAT05dTMcyQP/aQm8J NtVDXmLGmVf4VAZXQ/pe+5rPV8+oApo4+5x8guhYzYKrATWVuOM1Vv/YGc75N2EX6F8+ EF0r1LZYH1xxIfmVIvtKE8wxB11HtYYOBHS8SVeC0snfVA1TOhlkaamPZK52BU2ZWGLD 6h8hToVxrXGu9EqvwXPHP7heEmKdTjWYmTdEsia5L9MJmUDBbU/YUq0AG0ihIS0nVnOK fFEdGehDgBRe5KWjB7xWRj4b4c5yBh4eKXbx/Iq9aE4SOF5UivJb7DplUWNAHLaF0+cO Rr/w== X-Gm-Message-State: AOJu0YwRJiyH7a7oFTaM/gyZ666TTImqZEbynmFRJa54tJ8VWJEN+AUH Arv6Od5BNPeyba+Cq1B2i8jUn9t9r9g5qRUIgCln/EFPlMJNEPJSEsQrR7ra0qYNzY5qa+9RwnX jmMvQySjXaZvXu9bQ1A29RJPO2zLyyuWPqlcqQ3PQn3JS6/m2n93FGnRWxqvAphDf+A== X-Gm-Gg: AY/fxX4USsjJEqIB+E6nIp2B9XQgOekGT6tiEJezEH9zOFIO8JLKe+Fy6MJrQCBTzjG qAoxnh40fB27iGkqGcqpLf2SFRdkg7Ob/QeRrHbJyWFMajUv7g+RFbXlKNrZZYV2LJfXY1EgQ4U suo2MHJpmPr7Yc5Pxy49GDBgVb3IxicHICQ6z6Y0/C+wAkxIib3SUnyHYHWts1J6lPSuCz6imN6 vUEtGoSXtCWPUFyPLshv+1psFM+7YqH9eWNTXTH6fk/wUjYhdfevaxy2fxkuKUSwW7QoJrsmGCE RQSK3eK3lx+BXP5+51hjbRztUnGjcSn53t+MsiHwZRFFWZqDN84PQ24BtxVVmcdBM6g35S0hPlj 25glqL+JtteRXsH5FzUbr X-Received: by 2002:a5d:64e5:0:b0:433:1d30:45f with SMTP id ffacd0b85a97d-4342c3ed5c3mr4692488f8f.1.1768429164305; Wed, 14 Jan 2026 14:19:24 -0800 (PST) X-Received: by 2002:a5d:64e5:0:b0:433:1d30:45f with SMTP id ffacd0b85a97d-4342c3ed5c3mr4692469f8f.1.1768429163890; Wed, 14 Jan 2026 14:19:23 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-434af6535ddsm1648131f8f.15.2026.01.14.14.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 14:19:23 -0800 (PST) Date: Wed, 14 Jan 2026 23:19:22 +0100 From: Stefano Brivio To: Laurent Vivier Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Oliver Neukum , linux-usb@vger.kernel.org Subject: Re: [PATCH] usbnet: limit max_mtu based on device's hard_mtu Message-ID: <20260114231922.6b41e9ed@elisabeth> In-Reply-To: <20260114090317.3214026-1-lvivier@redhat.com> References: <20260114090317.3214026-1-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 14 Jan 2026 10:03:17 +0100 Laurent Vivier wrote: > The usbnet driver initializes net->max_mtu to ETH_MAX_MTU before calling > the device's bind() callback. When the bind() callback sets > dev->hard_mtu based the device's actual capability (from CDC Ethernet's > wMaxSegmentSize descriptor), max_mtu is never updated to reflect this > hardware limitation). > > This allows userspace (DHCP or IPv6 RA) to configure MTU larger than the > device can handle, leading to silent packet drops when the backend sends > packet exceeding the device's buffer size. > > Fix this by limiting net->max_mtu to the device's hard_mtu after the > bind callback returns. > > See https://gitlab.com/qemu-project/qemu/-/issues/3268 and > https://bugs.passt.top/attachment.cgi?bugid=189 > > Signed-off-by: Laurent Vivier Thanks for fixing this! Link: https://bugs.passt.top/show_bug.cgi?id=189 Reviewed-by: Stefano Brivio -- Stefano