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

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: remove checks for ses->status == CifsExiting
cifs: add check for kmalloc in parse_dacl
cifs: don't send an echo request unless NegProt has been done
cifs: enable signing flag in SMB header when server has it on
cifs: Possible slab memory corruption while updating extended stats (repost)
CIFS: Fix variable types in cifs_iovec_read/write (try #2)
cifs: fix length vs. total_read confusion in cifs_demultiplex_thread

+28 -18
+4
fs/cifs/cifsacl.c
··· 372 372 373 373 ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), 374 374 GFP_KERNEL); 375 + if (!ppace) { 376 + cERROR(1, "DACL memory allocation error"); 377 + return; 378 + } 375 379 376 380 for (i = 0; i < num_aces; ++i) { 377 381 ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
+1 -4
fs/cifs/cifssmb.c
··· 136 136 } 137 137 } 138 138 139 - if (ses->status == CifsExiting) 140 - return -EIO; 141 - 142 139 /* 143 140 * Give demultiplex thread up to 10 seconds to reconnect, should be 144 141 * greater than cifs socket timeout which is 7 seconds ··· 153 156 * retrying until process is killed or server comes 154 157 * back on-line 155 158 */ 156 - if (!tcon->retry || ses->status == CifsExiting) { 159 + if (!tcon->retry) { 157 160 cFYI(1, "gave up waiting on reconnect in smb_init"); 158 161 return -EHOSTDOWN; 159 162 }
+13 -9
fs/cifs/connect.c
··· 337 337 struct TCP_Server_Info *server = container_of(work, 338 338 struct TCP_Server_Info, echo.work); 339 339 340 - /* no need to ping if we got a response recently */ 341 - if (time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) 340 + /* 341 + * We cannot send an echo until the NEGOTIATE_PROTOCOL request is done. 342 + * Also, no need to ping if we got a response recently 343 + */ 344 + if (server->tcpStatus != CifsGood || 345 + time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) 342 346 goto requeue_echo; 343 347 344 348 rc = CIFSSMBEcho(server); ··· 582 578 else if (reconnect == 1) 583 579 continue; 584 580 585 - length += 4; /* account for rfc1002 hdr */ 581 + total_read += 4; /* account for rfc1002 hdr */ 586 582 587 - 588 - dump_smb(smb_buffer, length); 589 - if (checkSMB(smb_buffer, smb_buffer->Mid, total_read+4)) { 590 - cifs_dump_mem("Bad SMB: ", smb_buffer, 48); 583 + dump_smb(smb_buffer, total_read); 584 + if (checkSMB(smb_buffer, smb_buffer->Mid, total_read)) { 585 + cifs_dump_mem("Bad SMB: ", smb_buffer, 586 + total_read < 48 ? total_read : 48); 591 587 continue; 592 588 } 593 589 ··· 637 633 mid_entry->largeBuf = isLargeBuf; 638 634 multi_t2_fnd: 639 635 mid_entry->midState = MID_RESPONSE_RECEIVED; 640 - list_del_init(&mid_entry->qhead); 641 - mid_entry->callback(mid_entry); 642 636 #ifdef CONFIG_CIFS_STATS2 643 637 mid_entry->when_received = jiffies; 644 638 #endif 639 + list_del_init(&mid_entry->qhead); 640 + mid_entry->callback(mid_entry); 645 641 break; 646 642 } 647 643 mid_entry = NULL;
+6 -5
fs/cifs/file.c
··· 1662 1662 cifs_iovec_write(struct file *file, const struct iovec *iov, 1663 1663 unsigned long nr_segs, loff_t *poffset) 1664 1664 { 1665 - size_t total_written = 0; 1666 - unsigned int written = 0; 1667 - unsigned long num_pages, npages; 1668 - size_t copied, len, cur_len, i; 1665 + unsigned int written; 1666 + unsigned long num_pages, npages, i; 1667 + size_t copied, len, cur_len; 1668 + ssize_t total_written = 0; 1669 1669 struct kvec *to_send; 1670 1670 struct page **pages; 1671 1671 struct iov_iter it; ··· 1821 1821 { 1822 1822 int rc; 1823 1823 int xid; 1824 - unsigned int total_read, bytes_read = 0; 1824 + ssize_t total_read; 1825 + unsigned int bytes_read = 0; 1825 1826 size_t len, cur_len; 1826 1827 int iov_offset = 0; 1827 1828 struct cifs_sb_info *cifs_sb;
+4
fs/cifs/transport.c
··· 359 359 if (rc) 360 360 return rc; 361 361 362 + /* enable signing if server requires it */ 363 + if (server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 364 + in_buf->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; 365 + 362 366 mutex_lock(&server->srv_mutex); 363 367 mid = AllocMidQEntry(in_buf, server); 364 368 if (mid == NULL) {