All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] smb3: remove confusing dmesg when mounting with encryption ("seal")
@ 2019-11-08  5:19 Dan Carpenter
  2019-11-08  6:58 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-11-08  5:19 UTC (permalink / raw)
  To: stfrench; +Cc: linux-cifs

Hello Steve French,

This is a semi-automatic email about new static checker warnings.

The patch 6a364520b30e: "smb3: remove confusing dmesg when mounting
with encryption ("seal")" from Nov 5, 2019, leads to the following
Smatch complaint:

    fs/cifs/connect.c:1091 cifs_handle_standard()
    warn: variable dereferenced before check 'mid' (see line 1075)

fs/cifs/connect.c
  1074		length = server->ops->check_message(buf, server->total_read, server,
  1075						    mid->decrypted);
                                                    ^^^^^^^^^^^^^^
New unchecked dereference.

  1076		if (length != 0)
  1077			cifs_dump_mem("Bad SMB: ", buf,
  1078				min_t(unsigned int, server->total_read, 48));
  1079	
  1080		if (server->ops->is_session_expired &&
  1081		    server->ops->is_session_expired(buf)) {
  1082			cifs_reconnect(server);
  1083			wake_up(&server->response_q);
  1084			return -1;
  1085		}
  1086	
  1087		if (server->ops->is_status_pending &&
  1088		    server->ops->is_status_pending(buf, server))
  1089			return -1;
  1090	
  1091		if (!mid)
                    ^^^^
The old code assumed it could be NULL.

  1092			return length;
  1093	

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] smb3: remove confusing dmesg when mounting with encryption ("seal")
  2019-11-08  5:19 [bug report] smb3: remove confusing dmesg when mounting with encryption ("seal") Dan Carpenter
@ 2019-11-08  6:58 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2019-11-08  6:58 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Steve French, CIFS

This was fixed in a later version of this patch yesterday, but ...
Pavel suggested just removing the warning message that prompted this
patch - easier, and the warning message wasn't very useful.

On Thu, Nov 7, 2019 at 11:20 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hello Steve French,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 6a364520b30e: "smb3: remove confusing dmesg when mounting
> with encryption ("seal")" from Nov 5, 2019, leads to the following
> Smatch complaint:
>
>     fs/cifs/connect.c:1091 cifs_handle_standard()
>     warn: variable dereferenced before check 'mid' (see line 1075)
>
> fs/cifs/connect.c
>   1074          length = server->ops->check_message(buf, server->total_read, server,
>   1075                                              mid->decrypted);
>                                                     ^^^^^^^^^^^^^^
> New unchecked dereference.
>
>   1076          if (length != 0)
>   1077                  cifs_dump_mem("Bad SMB: ", buf,
>   1078                          min_t(unsigned int, server->total_read, 48));
>   1079
>   1080          if (server->ops->is_session_expired &&
>   1081              server->ops->is_session_expired(buf)) {
>   1082                  cifs_reconnect(server);
>   1083                  wake_up(&server->response_q);
>   1084                  return -1;
>   1085          }
>   1086
>   1087          if (server->ops->is_status_pending &&
>   1088              server->ops->is_status_pending(buf, server))
>   1089                  return -1;
>   1090
>   1091          if (!mid)
>                     ^^^^
> The old code assumed it could be NULL.
>
>   1092                  return length;
>   1093
>
> regards,
> dan carpenter



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-08  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-08  5:19 [bug report] smb3: remove confusing dmesg when mounting with encryption ("seal") Dan Carpenter
2019-11-08  6:58 ` Steve French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.