Unverified Commit 7f2e8c7c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15225 cifs: Prevent NULL pointer dereference caused by cifs_sb->rsize is 0

parents d0f1e93a 3319eda6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3552,6 +3552,11 @@ int cifs_mount_get_tcon(struct cifs_mount_ctx *mnt_ctx)
	if ((cifs_sb->ctx->rsize == 0) ||
	    (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx)))
		cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx);
	if (cifs_sb->ctx->rsize == 0) {
		cifs_dbg(VFS, "Negotiated rsize is 0, get connect failed\n");
		rc = -EINVAL;
		goto out;
	}

	/*
	 * The cookie is initialized from volume info returned above.