Public bug reported:

Problem:
Following error logged when mounting Azure file share with CIFS 3.0 protocol.
 
[ 4856.227895] CIFS VFS: error -22 on ioctl to get interface list
 
It looks like linux-azure kernel > 5 has some cifs bug. (It might be 
reproducible with a upstream kernel as well.)
This is not reproducible with -o 2.1 mount option or linux-azure 4.15.
And It can be easily reproducible with platform image like 
Canonical:UbuntuServer:18.04-LTS:18.04.202002180.
 
What I have done to reproduce:
VM create CLI command
        $ az vm create --resource-group rgname --name cifsubuntu --image 
Canonical:UbuntuServer:18.04-LTS:18.04.202002180
 
mount command
        # mount -t cifs //accountname.file.core.windows.net/test /mnt/somewhere 
-o vers=3.0,credentials=/etc/smbcredentials/cred.cred --verbose
 
Do you have any knowledge about this?
As far as I research, SMB2_ioctl which is in cifs kernel module send some 
invalid parameter to the server.
 
Here is a debug log.

[  156.667830] SMB2_ioctl:2506: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2pdu.c: SMB2 IOCTL
[  156.667836] smb3_init_transform_rq:3164: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: encrypt message 
returned 0
[  156.667840] __smb_send_rqst:341: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/transport.c: Sending smb: 
smb_len=177
[  156.668906] cifs_demultiplex_thread:1184: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/connect.c: RFC1002 header 
0x7d
[  156.668914] decrypt_raw_data:3205: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: decrypt message 
returned 0
[  156.668915] receive_encrypted_standard:3533: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: mid found
[  156.668916] smb2_calc_size:421: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2misc.c: SMB2 data 
length 0 offset 0
[  156.668917] smb2_calc_size:439: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2misc.c: SMB2 len 73
[  156.668918] smb2_add_credits:122: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: add 2 credits 
total=39
[  156.668924] cifs_sync_mid_result:708: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/transport.c: 
cifs_sync_mid_result: cmd=11 mid=8 state=4
[  156.668925] Status code returned 0xc000000d STATUS_INVALID_PARAMETER
[  156.668929] map_smb2_to_linux_error:2484: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2maperror.c: Mapping 
SMB2 status code 0xc000000d to POSIX err -22
[  156.668930] cifs_small_buf_release:222: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/misc.c: Null buffer passed 
to cifs_small_buf_release
[  156.668931] CIFS VFS: error -22 on ioctl to get interface list
 
To enable the debug, I have done following command before mount.
# modprobe cifs
# echo 'module cifs +lfp' > /sys/kernel/debug/dynamic_debug/control
# echo 'file fs/cifs/* +lfp' > /sys/kernel/debug/dynamic_debug/control
# echo 7 > /proc/fs/cifs/cifsFYI
 
I am not sure but it looks like following SMB2_ioctl has some invalid argument.
 
"fs/cifs/smb2ops.c"
516 static int
 517 SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
 518 {
 519         int rc;
 520         unsigned int ret_data_len = 0;
 521         struct network_interface_info_ioctl_rsp *out_buf = NULL;
 522         struct cifs_server_iface *iface_list;
 523         size_t iface_count;
 524         struct cifs_ses *ses = tcon->ses;
 525
 526         rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
 527                         FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* 
is_fsctl */,
 528                         NULL /* no data input */, 0 /* no data input */,
 529                         (char **)&out_buf, &ret_data_len);
 530         if (rc == -EOPNOTSUPP) {
 531                 cifs_dbg(FYI,
 532                          "server does not support query network 
interfaces\n");
 533                 goto out;
 534         } else if (rc != 0) {
 535                 cifs_dbg(VFS, "error %d on ioctl to get interface list\n", 
rc);
 536                 goto out;

** Affects: linux-azure (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-azure in Ubuntu.
https://bugs.launchpad.net/bugs/1864131

Title:
  CIFS VFS: error -22 on ioctl to get interface list

Status in linux-azure package in Ubuntu:
  New

Bug description:
  Problem:
  Following error logged when mounting Azure file share with CIFS 3.0 protocol.
   
  [ 4856.227895] CIFS VFS: error -22 on ioctl to get interface list
   
  It looks like linux-azure kernel > 5 has some cifs bug. (It might be 
reproducible with a upstream kernel as well.)
  This is not reproducible with -o 2.1 mount option or linux-azure 4.15.
  And It can be easily reproducible with platform image like 
Canonical:UbuntuServer:18.04-LTS:18.04.202002180.
   
  What I have done to reproduce:
  VM create CLI command
        $ az vm create --resource-group rgname --name cifsubuntu --image 
Canonical:UbuntuServer:18.04-LTS:18.04.202002180
   
  mount command
        # mount -t cifs //accountname.file.core.windows.net/test /mnt/somewhere 
-o vers=3.0,credentials=/etc/smbcredentials/cred.cred --verbose
   
  Do you have any knowledge about this?
  As far as I research, SMB2_ioctl which is in cifs kernel module send some 
invalid parameter to the server.
   
  Here is a debug log.

  [  156.667830] SMB2_ioctl:2506: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2pdu.c: SMB2 IOCTL
  [  156.667836] smb3_init_transform_rq:3164: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: encrypt message 
returned 0
  [  156.667840] __smb_send_rqst:341: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/transport.c: Sending smb: 
smb_len=177
  [  156.668906] cifs_demultiplex_thread:1184: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/connect.c: RFC1002 header 
0x7d
  [  156.668914] decrypt_raw_data:3205: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: decrypt message 
returned 0
  [  156.668915] receive_encrypted_standard:3533: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: mid found
  [  156.668916] smb2_calc_size:421: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2misc.c: SMB2 data 
length 0 offset 0
  [  156.668917] smb2_calc_size:439: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2misc.c: SMB2 len 73
  [  156.668918] smb2_add_credits:122: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2ops.c: add 2 credits 
total=39
  [  156.668924] cifs_sync_mid_result:708: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/transport.c: 
cifs_sync_mid_result: cmd=11 mid=8 state=4
  [  156.668925] Status code returned 0xc000000d STATUS_INVALID_PARAMETER
  [  156.668929] map_smb2_to_linux_error:2484: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/smb2maperror.c: Mapping 
SMB2 status code 0xc000000d to POSIX err -22
  [  156.668930] cifs_small_buf_release:222: 
/build/linux-azure-ZlnYF6/linux-azure-5.0.0/fs/cifs/misc.c: Null buffer passed 
to cifs_small_buf_release
  [  156.668931] CIFS VFS: error -22 on ioctl to get interface list
   
  To enable the debug, I have done following command before mount.
  # modprobe cifs
  # echo 'module cifs +lfp' > /sys/kernel/debug/dynamic_debug/control
  # echo 'file fs/cifs/* +lfp' > /sys/kernel/debug/dynamic_debug/control
  # echo 7 > /proc/fs/cifs/cifsFYI
   
  I am not sure but it looks like following SMB2_ioctl has some invalid 
argument.
   
  "fs/cifs/smb2ops.c"
  516 static int
   517 SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
   518 {
   519         int rc;
   520         unsigned int ret_data_len = 0;
   521         struct network_interface_info_ioctl_rsp *out_buf = NULL;
   522         struct cifs_server_iface *iface_list;
   523         size_t iface_count;
   524         struct cifs_ses *ses = tcon->ses;
   525
   526         rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
   527                         FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* 
is_fsctl */,
   528                         NULL /* no data input */, 0 /* no data input */,
   529                         (char **)&out_buf, &ret_data_len);
   530         if (rc == -EOPNOTSUPP) {
   531                 cifs_dbg(FYI,
   532                          "server does not support query network 
interfaces\n");
   533                 goto out;
   534         } else if (rc != 0) {
   535                 cifs_dbg(VFS, "error %d on ioctl to get interface 
list\n", rc);
   536                 goto out;

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-azure/+bug/1864131/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to