Re: Automount causes zero-pointer dereference in 2.6.36-rc2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> (Cc-ing linux-cifs@vger@kernel.org)
>
> Does the following patch fixes the problem for you? This patch has been included
> in the cifs development git and should be available in the next -rc.
>
>
> Subject: [PATCH] cifs: check for NULL session password
> From: Jeff Layton <jlayton@xxxxxxxxxx>
> Date: Mon, 23 Aug 2010 11:38:04 -0400
> To: smfrench@xxxxxxxxx
> CC: linux-cifs@xxxxxxxxxxxxxxx
>
> It's possible for a cifsSesInfo struct to have a NULL password, so we
> need to check for that prior to running strncmp on it.
>
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> ---
>  fs/cifs/connect.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 18af707..ec0ea4a 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -1673,6 +1673,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
>                                    MAX_USERNAME_SIZE))
>                                continue;
>                        if (strlen(vol->username) != 0 &&
> +                           ses->password != NULL &&
>                            strncmp(ses->password,
>                                    vol->password ? vol->password : "",
>                                    MAX_PASSWORD_SIZE))
>
>
>

This does indeed fix the issue. Makes perfect sense, the
session-password was empty.
Thanks a lot for your quick response!
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux