* [PATCH net-next] net: dns_resolver: allow shorter names in dns_query()
@ 2026-07-22 21:28 Paulo Alcantara
2026-07-23 12:23 ` David Howells
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paulo Alcantara @ 2026-07-22 21:28 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman
Cc: David Howells, Frank Sorenson, netdev, linux-cifs,
Pierguido Lambri, Paulo Alcantara
Customer reported a problem with mounting CIFS shares where the server
hostname was 2 chars long. Turned out that the CIFS client wasn't
able to resolve NetBIOS names shorter than 3 chars.
Fix this by allowing a minimum of one character per hostname in
dns_query().
Reproducer with samba server:
# 'ab' and 'srv' hotnames resolve to same ip address
$ ssh srv ln -s 'msdfs:\\ab\\share' /home/shares/dfs/link1
$ mount.cifs //srv/dfs/link1 /mnt -o ... [EINVAL]
Reported-by: Pierguido Lambri <plambri@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
---
net/dns_resolver/dns_query.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dns_resolver/dns_query.c b/net/dns_resolver/dns_query.c
index 14bee83cbe22..b8fb9a1245bf 100644
--- a/net/dns_resolver/dns_query.c
+++ b/net/dns_resolver/dns_query.c
@@ -72,7 +72,7 @@ int dns_query(struct net *net,
kenter("%s,%*.*s,%zu,%s",
type, (int)namelen, (int)namelen, name, namelen, options);
- if (!name || namelen < 3 || namelen > 255)
+ if (!name || namelen < 1 || namelen > 255)
return -EINVAL;
if (type && *type == '\0')
return -EINVAL;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: dns_resolver: allow shorter names in dns_query()
2026-07-22 21:28 [PATCH net-next] net: dns_resolver: allow shorter names in dns_query() Paulo Alcantara
@ 2026-07-23 12:23 ` David Howells
2026-07-27 18:40 ` Frank Sorenson
2026-07-28 1:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2026-07-23 12:23 UTC (permalink / raw)
To: Paulo Alcantara
Cc: dhowells, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Frank Sorenson, netdev, linux-cifs,
Pierguido Lambri
Paulo Alcantara <pc@manguebit.org> wrote:
> Customer reported a problem with mounting CIFS shares where the server
> hostname was 2 chars long. Turned out that the CIFS client wasn't
> able to resolve NetBIOS names shorter than 3 chars.
>
> Fix this by allowing a minimum of one character per hostname in
> dns_query().
>
> Reproducer with samba server:
>
> # 'ab' and 'srv' hotnames resolve to same ip address
> $ ssh srv ln -s 'msdfs:\\ab\\share' /home/shares/dfs/link1
> $ mount.cifs //srv/dfs/link1 /mnt -o ... [EINVAL]
>
> Reported-by: Pierguido Lambri <plambri@redhat.com>
> Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Acked-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: dns_resolver: allow shorter names in dns_query()
2026-07-22 21:28 [PATCH net-next] net: dns_resolver: allow shorter names in dns_query() Paulo Alcantara
2026-07-23 12:23 ` David Howells
@ 2026-07-27 18:40 ` Frank Sorenson
2026-07-28 1:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Frank Sorenson @ 2026-07-27 18:40 UTC (permalink / raw)
To: Paulo Alcantara, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman
Cc: David Howells, netdev, linux-cifs, Pierguido Lambri
On 7/22/26 4:28 PM, Paulo Alcantara wrote:
> Customer reported a problem with mounting CIFS shares where the server
> hostname was 2 chars long. Turned out that the CIFS client wasn't
> able to resolve NetBIOS names shorter than 3 chars.
>
> Fix this by allowing a minimum of one character per hostname in
> dns_query().
>
> Reproducer with samba server:
>
> # 'ab' and 'srv' hotnames resolve to same ip address
> $ ssh srv ln -s 'msdfs:\\ab\\share' /home/shares/dfs/link1
> $ mount.cifs //srv/dfs/link1 /mnt -o ... [EINVAL]
>
> Reported-by: Pierguido Lambri <plambri@redhat.com>
> Signed-off-by: Paulo Alcantara <pc@manguebit.org>
> return -EINVAL;
Acked-by: Frank Sorenson <sorenson@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: dns_resolver: allow shorter names in dns_query()
2026-07-22 21:28 [PATCH net-next] net: dns_resolver: allow shorter names in dns_query() Paulo Alcantara
2026-07-23 12:23 ` David Howells
2026-07-27 18:40 ` Frank Sorenson
@ 2026-07-28 1:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-28 1:40 UTC (permalink / raw)
To: Paulo Alcantara
Cc: davem, edumazet, kuba, pabeni, horms, dhowells, sorenson, netdev,
linux-cifs, plambri
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 22 Jul 2026 18:28:37 -0300 you wrote:
> Customer reported a problem with mounting CIFS shares where the server
> hostname was 2 chars long. Turned out that the CIFS client wasn't
> able to resolve NetBIOS names shorter than 3 chars.
>
> Fix this by allowing a minimum of one character per hostname in
> dns_query().
>
> [...]
Here is the summary with links:
- [net-next] net: dns_resolver: allow shorter names in dns_query()
https://git.kernel.org/netdev/net-next/c/a50eba1e778a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-28 1:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 21:28 [PATCH net-next] net: dns_resolver: allow shorter names in dns_query() Paulo Alcantara
2026-07-23 12:23 ` David Howells
2026-07-27 18:40 ` Frank Sorenson
2026-07-28 1:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox