Re: [PATCH net] net: vlan: fix format-truncation warnings in? register_vlan_device
From: jiang.peng9
Date: Thu Jun 19 2025 - 21:33:48 EST
> name is passed to alloc_netdev(). Which is a wrapper around alloc_netdev_mqs()
> which includes the following check:
>
> BUG_ON(strlen(name) >= sizeof(dev->name));
>
> And the size of dev->name is IFNAMSIZ.
>
> So while I am very pleased to see efforts to address format-truncation
> warning - indeed I have made efforts elsewhere to this end myself - I don't
> think we can solve this problem the way you propose.
Thanks for pointing this out! After checking the code again, you're absolutely right - my proposed change could actually cause issues with alloc_netdev_mqs() since the BUG_ON check explicitly enforces the IFNAMSIZ limit.
It's unfortunate that we can't solve the warning this way, but I really appreciate you taking the time to explain the situation clearly. Your patience and attention to detail here are super helpful!
> Also, I suspect any work in this area will not be a bug fix, and
> thus more appropriate to target at net-next rather than net.
>
> Subject; [PATCH net-next]
>
> And please make sure patches for net or next-next apply against
> their target tree: this patch applies to cleanly to neither.
>
> For more information on process for networking patches please see
> https://docs.kernel.org/process/maintainer-netdev.html
Got it! Thanks again for your guidance on this - I really appreciate you taking the time to explain both the technical details and the proper submission process.
Best regards
Peng