Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d455df0b authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag '4.15-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
 "Small SMB3 fixes for stable and 4.15rc"

* tag '4.15-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6:
  CIFS: don't log STATUS_NOT_FOUND errors for DFS
  cifs: fix NULL deref in SMB2_read
parents e375922f 5702591f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1406,6 +1406,7 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,
	} while (rc == -EAGAIN);

	if (rc) {
		if (rc != -ENOENT)
			cifs_dbg(VFS, "ioctl error in smb2_get_dfs_refer rc=%d\n", rc);
		goto out;
	}
+15 −15
Original line number Diff line number Diff line
@@ -2678,17 +2678,16 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
	cifs_small_buf_release(req);

	rsp = (struct smb2_read_rsp *)rsp_iov.iov_base;
	shdr = get_sync_hdr(rsp);

	if (shdr->Status == STATUS_END_OF_FILE) {
		free_rsp_buf(resp_buftype, rsp_iov.iov_base);
		return 0;
	}

	if (rc) {
		if (rc != -ENODATA) {
			cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE);
			cifs_dbg(VFS, "Send error in read = %d\n", rc);
	} else {
		}
		free_rsp_buf(resp_buftype, rsp_iov.iov_base);
		return rc == -ENODATA ? 0 : rc;
	}

	*nbytes = le32_to_cpu(rsp->DataLength);
	if ((*nbytes > CIFS_MAX_MSGSIZE) ||
	    (*nbytes > io_parms->length)) {
@@ -2697,7 +2696,8 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
		rc = -EIO;
		*nbytes = 0;
	}
	}

	shdr = get_sync_hdr(rsp);

	if (*buf) {
		memcpy(*buf, (char *)shdr + rsp->DataOffset, *nbytes);