linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@cjr.nz>
To: David Disseldorp <ddiss@suse.de>
Cc: linux-cifs@vger.kernel.org, smfrench@gmail.com, aaptel@suse.com,
	stable@vger.kernel.org
Subject: Re: [PATCH] cifs: fix regression when mounting shares with prefix paths
Date: Mon, 03 May 2021 09:41:08 -0300	[thread overview]
Message-ID: <87wnsg2dnf.fsf@cjr.nz> (raw)
In-Reply-To: <20210501014005.41545d44@suse.de>

David Disseldorp <ddiss@suse.de> writes:

> On Fri, 30 Apr 2021 19:16:21 -0300, Paulo Alcantara wrote:
>
>> The commit 315db9a05b7a ("cifs: fix leak in cifs_smb3_do_mount() ctx")
>> revealed an existing bug when mounting shares that contain a prefix
>> path or DFS links.
>
> Sorry for the mess. One question...
>
> ...
>>  	if (mntopts) {
>>  		char *ip;
>>  
>> -		cifs_dbg(FYI, "%s: mntopts=%s\n", __func__, mntopts);
>>  		rc = smb3_parse_opt(mntopts, "ip", &ip);
>> -		if (!rc && !cifs_convert_address((struct sockaddr *)&ctx->dstaddr, ip,
>> -						 strlen(ip))) {
>> -			cifs_dbg(VFS, "%s: failed to convert ip address\n", __func__);
>> -			return -EINVAL;
>> +		if (!rc) {
>> +			rc = cifs_convert_address((struct sockaddr *)&ctx->dstaddr, ip, strlen(ip));
>> +			kfree(ip);
>> +			if (!rc) {
>> +				cifs_dbg(VFS, "%s: failed to convert ip address\n", __func__);
>> +				return -EINVAL;
>> +			}
>>  		}
>>  	}
>>  
>> @@ -3189,7 +3198,7 @@ cifs_setup_volume_info(struct smb3_fs_context *ctx, const char *mntopts, const c
>>  		return -EINVAL;
>>  	}
>>  
>> -	return rc;
>> +	return 0;
>>  }
>
> It seems that smb3_parse_opt() errors will no longer be propagated here.
> Is that intentional?

That was a mistake, actually.  Will fix it in v2.  Thanks!

  reply	other threads:[~2021-05-03 12:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 22:16 [PATCH] cifs: fix regression when mounting shares with prefix paths Paulo Alcantara
2021-04-30 23:40 ` David Disseldorp
2021-05-03 12:41   ` Paulo Alcantara [this message]
2021-05-03 14:55 ` [PATCH v2] " Paulo Alcantara
2021-05-03 23:20   ` David Disseldorp
2021-05-04 16:47     ` Paulo Alcantara
2021-05-04 16:58     ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnsg2dnf.fsf@cjr.nz \
    --to=pc@cjr.nz \
    --cc=aaptel@suse.com \
    --cc=ddiss@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).