Bug 15830 - mount.smb3 7.2 breaks guest mount
Summary: mount.smb3 7.2 breaks guest mount
Status: NEW
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: user space tools (show other bugs)
Version: 5.x
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Jeff Layton
QA Contact: cifs QA contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-17 06:29 UTC by Michael Tokarev
Modified: 2025-03-19 16:20 UTC (History)
1 user (show)

See Also:


Attachments
Fix the issue (1.00 KB, patch)
2025-03-17 06:56 UTC, Michael Tokarev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Tokarev 2025-03-17 06:29:34 UTC
There's this commit in 7.2:

commit e447a48438b6c326f67745495ab0a430a8b79ebf
Author: Meetakshi Setiya <msetiya@microsoft.com>
Date:   Tue Oct 22 12:59:30 2024 -0400


which, among other things, contains this hunk:

@@ -1110,6 +1154,7 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info)
                case OPT_GUEST:
                        parsed_info->got_user = 1;
                        parsed_info->got_password = 1;
+                       parsed_info->got_password2 = 1;
                        goto nocopy;


This change breaks "guest" mount option:

# mount.smb3 /mnt //server/share -o guest
cifs: Bad value for 'password2'
mount: mount error(22): Invalid argument

This is because:

        if (parsed_info->got_password2 && !(parsed_info->is_krb5 || parsed_info->is_noauth)) {
                strlcat(options, ",password2=", options_size);
                strlcat(options, parsed_info->password2, options_size);
                if (parsed_info->verboseflag)
                        fprintf(stderr, ",password2=********");
        }

and the kernel expects a non-empty value for password2
mount option.  It has a code to handle empty password=,
but not empty password2

There's a debian bug report about this:
https://bugs.debian.org/1100615

(this stuff in kernel apparently needs a revisit, since
fs_parse now supports fs_param_can_be_empty flag).

((An unrelated note, I'd suggest using proper indentation in
this code, instead of:

        dst[j] = '\0';
+       if (is_pass2)
+               parsed_info->got_password2 = 1;
+       else
        parsed_info->got_password = 1;
        return 0;

c'mon, please indent the 'else' part!))
Comment 1 Michael Tokarev 2025-03-17 06:56:28 UTC
Created attachment 18609 [details]
Fix the issue