Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cifs: update smb2_calc_size to use smb2_sync_hdr instead of smb2_hdr

smb2_hdr is just a wrapper around smb2_sync_hdr at this stage
and smb2_hdr is going away.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Ronnie Sahlberg and committed by
Steve French
84f0cbfb 0d5a288d

+4 -6
+4 -6
fs/cifs/smb2misc.c
··· 395 395 unsigned int 396 396 smb2_calc_size(void *buf, struct TCP_Server_Info *srvr) 397 397 { 398 - struct smb2_pdu *pdu = (struct smb2_pdu *)buf; 399 - struct smb2_hdr *hdr = &pdu->hdr; 400 - struct smb2_sync_hdr *shdr = get_sync_hdr(hdr); 398 + struct smb2_sync_pdu *pdu = (struct smb2_sync_pdu *)buf; 399 + struct smb2_sync_hdr *shdr = &pdu->sync_hdr; 401 400 int offset; /* the offset from the beginning of SMB to data area */ 402 401 int data_length; /* the length of the variable length data area */ 403 402 /* Structure Size has already been checked to make sure it is 64 */ ··· 411 412 if (has_smb2_data_area[le16_to_cpu(shdr->Command)] == false) 412 413 goto calc_size_exit; 413 414 414 - smb2_get_data_area_len(&offset, &data_length, hdr); 415 + smb2_get_data_area_len(&offset, &data_length, (struct smb2_hdr *)buf); 415 416 cifs_dbg(FYI, "SMB2 data length %d offset %d\n", data_length, offset); 416 417 417 418 if (data_length > 0) { ··· 419 420 * Check to make sure that data area begins after fixed area, 420 421 * Note that last byte of the fixed area is part of data area 421 422 * for some commands, typically those with odd StructureSize, 422 - * so we must add one to the calculation (and 4 to account for 423 - * the size of the RFC1001 hdr. 423 + * so we must add one to the calculation. 424 424 */ 425 425 if (offset + srvr->vals->header_preamble_size + 1 < len) { 426 426 cifs_dbg(VFS, "data area offset %zu overlaps SMB2 header %d\n",