Bug 216881 - CIFS 1.0 mounts fail with "VFS: bogus file nlink value 0"
Summary: CIFS 1.0 mounts fail with "VFS: bogus file nlink value 0"
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: File System
Classification: Unclassified
Component: CIFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_cifs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-04 07:00 UTC by Kim Scarborough
Modified: 2023-01-10 08:42 UTC (History)
3 users (show)

See Also:
Kernel Version: 6.1.2
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Log file (10.43 KB, text/plain)
2023-01-06 22:05 UTC, Kim Scarborough
Details
PCAP file (5.34 KB, application/vnd.tcpdump.pcap)
2023-01-06 22:06 UTC, Kim Scarborough
Details
patch 1 (2.07 KB, patch)
2023-01-06 23:39 UTC, Paulo Alcantara
Details | Diff
patch 2 (1.53 KB, patch)
2023-01-06 23:39 UTC, Paulo Alcantara
Details | Diff

Description Kim Scarborough 2023-01-04 07:00:50 UTC
An SMB mount to a Windows XP machine in my fstab no longer works. It last worked with 6.0.9. fstab line:

//server/D /remote/server/D cifs noauto,_netdev,username=example,password=example,uid=1000,vers=1.0,nomultichannel 0 0

When I attempt to mount this now, I get the following error:

mount error(20): Not a directory

dmesg shows:

CIFS: VFS: bogus file nlink value 0
Comment 1 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-01-05 08:15:57 UTC
(In reply to Kim Scarborough from comment #0)
> It last worked with 6.0.9.

Do you mean it broke with later 6.0.y kernels? Or did you switch to 6.1 after that?
Comment 2 Kim Scarborough 2023-01-06 02:42:21 UTC
I went to 6.1 after 6.0.9. Sorry, I should have made that clear.
Comment 3 Paulo Alcantara 2023-01-06 16:00:43 UTC
Hi Kim,

Thanks for the report.

Could you please try this patch[1] and see if it works for you?

Please make sure that you also have

	9ee2afe5207b ("cifs: prevent copying past input buffer boundaries")

[1] https://pc.cjr.nz/smb1.diff
Comment 4 Kim Scarborough 2023-01-06 21:22:30 UTC
I applied the patch and installed the new kernel, but I'm getting the same error.
Comment 5 Paulo Alcantara 2023-01-06 21:33:52 UTC
Thanks for testing it.

In this case, please generate verbose logs and network trace

	# umount any existing shares
	dmesg --clear
	echo 'module cifs +p' > /sys/kernel/debug/dynamic_debug/control
	echo 'file fs/cifs/* +p' > /sys/kernel/debug/dynamic_debug/control
	echo 1 > /proc/fs/cifs/cifsFYI
	echo 1 > /sys/module/dns_resolver/parameters/debug
	tcpdump -s 0 -w trace.pcap port 445 & pid=$!
	sleep 3
	mount.cifs ...
	sleep 3
	kill $pid
	dmesg > trace.log
	cat /proc/fs/cifs/dfscache >> trace.log

and then send trace.log and trace.pcap files.
Comment 6 Kim Scarborough 2023-01-06 22:05:22 UTC
Created attachment 303540 [details]
Log file
Comment 7 Kim Scarborough 2023-01-06 22:06:39 UTC
Created attachment 303541 [details]
PCAP file
Comment 8 Paulo Alcantara 2023-01-06 23:39:08 UTC
Created attachment 303542 [details]
patch 1
Comment 9 Paulo Alcantara 2023-01-06 23:39:41 UTC
Created attachment 303543 [details]
patch 2
Comment 10 Paulo Alcantara 2023-01-06 23:40:21 UTC
Hi Jim,

Thanks for providing the logs and trace.

Could you please try the two attached patches instead?
Comment 11 Paulo Alcantara 2023-01-06 23:40:49 UTC
s/Jim/Kim/
Comment 12 Kim Scarborough 2023-01-07 02:55:01 UTC
Those fixed it. Thanks!
Comment 13 Paulo Alcantara 2023-01-09 17:36:12 UTC
FYI, fixes[1] sent upstream already.

[1] https://lore.kernel.org/linux-cifs/20230107200134.4822-1-pc@cjr.nz/T/#t
Comment 14 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-01-09 18:12:38 UTC
(In reply to Paulo Alcantara from comment #13)
> FYI, fixes[1] sent upstream already.
> [1] https://lore.kernel.org/linux-cifs/20230107200134.4822-1-pc@cjr.nz/T/#t

FWIW, that "Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216881" should have been "Link: https://bugzilla.kernel.org/show_bug.cgi?id=216881" (see Documentation/process/submitting-patches.rst , Documentation/process/5.Posting.rst or mails like these:

https://lore.kernel.org/all/CAHk-=wjMmSZzMJ3Xnskdg4+GGz=5p5p+GSYyFBTh0f-DgvdBWg@mail.gmail.com/
https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/
https://lore.kernel.org/all/CAHk-=wjxzafG-=J8oT30s7upn4RhBs6TX-uVFZ5rME+L5_DoJA@mail.gmail.com/ )
Comment 15 Paulo Alcantara 2023-01-09 18:22:09 UTC
(In reply to The Linux kernel's regression tracker (Thorsten Leemhuis) from comment #14)
> (In reply to Paulo Alcantara from comment #13)
> > FYI, fixes[1] sent upstream already.
> > [1] https://lore.kernel.org/linux-cifs/20230107200134.4822-1-pc@cjr.nz/T/#t
> 
> FWIW, that "Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216881" should
> have been "Link: https://bugzilla.kernel.org/show_bug.cgi?id=216881" (see
> Documentation/process/submitting-patches.rst ,
> Documentation/process/5.Posting.rst or mails like these:
> 
> https://lore.kernel.org/all/CAHk-=wjMmSZzMJ3Xnskdg4+GGz=5p5p+GSYyFBTh0f-
> DgvdBWg@mail.gmail.com/
> https://lore.kernel.org/all/CAHk-
> =wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/
> https://lore.kernel.org/all/CAHk-=wjxzafG-=J8oT30s7upn4RhBs6TX-
> uVFZ5rME+L5_DoJA@mail.gmail.com/ )

Thanks!  I'll ask Steve to fix those before merging.

Note You need to log in before you can comment on or make changes to this bug.