Loading fs/cifs/CHANGES +2 −1 Original line number Diff line number Diff line Version 1.40 ------------ Use fsuid (fsgid) more consistently instead of uid (gid). Use fsuid (fsgid) more consistently instead of uid (gid). Improve performance of readpages by eliminating one extra memcpy. Version 1.39 ------------ Loading fs/cifs/cifsencrypt.c +54 −1 Original line number Diff line number Diff line /* * fs/cifs/cifsencrypt.c * * Copyright (C) International Business Machines Corp., 2003 * Copyright (C) International Business Machines Corp., 2005 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify Loading Loading @@ -82,6 +82,59 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct TCP_Server_Info * server, return rc; } static int cifs_calc_signature2(const struct kvec * iov, int n_vec, const char * key, char * signature) { struct MD5Context context; if((iov == NULL) || (signature == NULL)) return -EINVAL; MD5Init(&context); MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16); /* MD5Update(&context,cifs_pdu->Protocol,cifs_pdu->smb_buf_length); */ /* BB FIXME BB */ MD5Final(signature,&context); return -EOPNOTSUPP; /* return 0; */ } int cifs_sign_smb2(struct kvec * iov, int n_vec, struct TCP_Server_Info *server, __u32 * pexpected_response_sequence_number) { int rc = 0; char smb_signature[20]; struct smb_hdr * cifs_pdu = iov[0].iov_base; if((cifs_pdu == NULL) || (server == NULL)) return -EINVAL; if((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0) return rc; spin_lock(&GlobalMid_Lock); cifs_pdu->Signature.Sequence.SequenceNumber = cpu_to_le32(server->sequence_number); cifs_pdu->Signature.Sequence.Reserved = 0; *pexpected_response_sequence_number = server->sequence_number++; server->sequence_number++; spin_unlock(&GlobalMid_Lock); rc = cifs_calc_signature2(iov, n_vec, server->mac_signing_key, smb_signature); if(rc) memset(cifs_pdu->Signature.SecuritySignature, 0, 8); else memcpy(cifs_pdu->Signature.SecuritySignature, smb_signature, 8); return rc; } int cifs_verify_signature(struct smb_hdr * cifs_pdu, const char * mac_key, __u32 expected_sequence_number) { Loading fs/cifs/cifsproto.h +3 −3 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, struct smb_hdr * /* out */ , int * /* bytes returned */ , const int long_op); extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *, struct kvec *, int /* nvec */, struct kvec *, int /* nvec to send */, int * /* bytes returned */ , const int long_op); extern int checkSMBhdr(struct smb_hdr *smb, __u16 mid); extern int checkSMB(struct smb_hdr *smb, __u16 mid, int length); Loading Loading @@ -237,12 +237,10 @@ extern int CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, const __u64 lseek, unsigned int *nbytes, const char *buf, const char __user *ubuf, const int long_op); #ifdef CONFIG_CIFS_EXPERIMENTAL extern int CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, const int netfid, const unsigned int count, const __u64 offset, unsigned int *nbytes, struct kvec *iov, const int nvec, const int long_op); #endif /* CONFIG_CIFS_EXPERIMENTAL */ extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon, const unsigned char *searchName, __u64 * inode_number, const struct nls_table *nls_codepage, Loading @@ -269,6 +267,8 @@ extern void tconInfoFree(struct cifsTconInfo *); extern int cifs_reconnect(struct TCP_Server_Info *server); extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *,__u32 *); extern int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *, __u32 *); extern int cifs_verify_signature(struct smb_hdr *, const char * mac_key, __u32 expected_sequence_number); extern int cifs_calculate_mac_key(char * key,const char * rn,const char * pass); Loading fs/cifs/cifssmb.c +1 −4 Original line number Diff line number Diff line Loading @@ -1155,7 +1155,6 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, return rc; } #ifdef CONFIG_CIFS_EXPERIMENTAL int CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, const int netfid, const unsigned int count, Loading Loading @@ -1234,8 +1233,6 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, } #endif /* CIFS_EXPERIMENTAL */ int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, const __u16 smb_file_id, const __u64 len, Loading fs/cifs/file.c +0 −6 Original line number Diff line number Diff line Loading @@ -870,7 +870,6 @@ static ssize_t cifs_write(struct file *file, const char *write_data, if (rc != 0) break; } #ifdef CONFIG_CIFS_EXPERIMENTAL /* BB FIXME We can not sign across two buffers yet */ if((experimEnabled) && ((pTcon->ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0)) { Loading @@ -889,7 +888,6 @@ static ssize_t cifs_write(struct file *file, const char *write_data, iov, 1, long_op); } else /* BB FIXME fixup indentation of line below */ #endif rc = CIFSSMBWrite(xid, pTcon, open_file->netfid, min_t(const int, cifs_sb->wsize, Loading Loading @@ -1026,7 +1024,6 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) return rc; } #ifdef CONFIG_CIFS_EXPERIMENTAL static int cifs_writepages(struct address_space *mapping, struct writeback_control *wbc) { Loading Loading @@ -1229,7 +1226,6 @@ static int cifs_writepages(struct address_space *mapping, return rc; } #endif static int cifs_writepage(struct page* page, struct writeback_control *wbc) { Loading Loading @@ -1875,9 +1871,7 @@ struct address_space_operations cifs_addr_ops = { .readpage = cifs_readpage, .readpages = cifs_readpages, .writepage = cifs_writepage, #ifdef CONFIG_CIFS_EXPERIMENTAL .writepages = cifs_writepages, #endif .prepare_write = cifs_prepare_write, .commit_write = cifs_commit_write, .set_page_dirty = __set_page_dirty_nobuffers, Loading Loading
fs/cifs/CHANGES +2 −1 Original line number Diff line number Diff line Version 1.40 ------------ Use fsuid (fsgid) more consistently instead of uid (gid). Use fsuid (fsgid) more consistently instead of uid (gid). Improve performance of readpages by eliminating one extra memcpy. Version 1.39 ------------ Loading
fs/cifs/cifsencrypt.c +54 −1 Original line number Diff line number Diff line /* * fs/cifs/cifsencrypt.c * * Copyright (C) International Business Machines Corp., 2003 * Copyright (C) International Business Machines Corp., 2005 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify Loading Loading @@ -82,6 +82,59 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct TCP_Server_Info * server, return rc; } static int cifs_calc_signature2(const struct kvec * iov, int n_vec, const char * key, char * signature) { struct MD5Context context; if((iov == NULL) || (signature == NULL)) return -EINVAL; MD5Init(&context); MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16); /* MD5Update(&context,cifs_pdu->Protocol,cifs_pdu->smb_buf_length); */ /* BB FIXME BB */ MD5Final(signature,&context); return -EOPNOTSUPP; /* return 0; */ } int cifs_sign_smb2(struct kvec * iov, int n_vec, struct TCP_Server_Info *server, __u32 * pexpected_response_sequence_number) { int rc = 0; char smb_signature[20]; struct smb_hdr * cifs_pdu = iov[0].iov_base; if((cifs_pdu == NULL) || (server == NULL)) return -EINVAL; if((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0) return rc; spin_lock(&GlobalMid_Lock); cifs_pdu->Signature.Sequence.SequenceNumber = cpu_to_le32(server->sequence_number); cifs_pdu->Signature.Sequence.Reserved = 0; *pexpected_response_sequence_number = server->sequence_number++; server->sequence_number++; spin_unlock(&GlobalMid_Lock); rc = cifs_calc_signature2(iov, n_vec, server->mac_signing_key, smb_signature); if(rc) memset(cifs_pdu->Signature.SecuritySignature, 0, 8); else memcpy(cifs_pdu->Signature.SecuritySignature, smb_signature, 8); return rc; } int cifs_verify_signature(struct smb_hdr * cifs_pdu, const char * mac_key, __u32 expected_sequence_number) { Loading
fs/cifs/cifsproto.h +3 −3 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, struct smb_hdr * /* out */ , int * /* bytes returned */ , const int long_op); extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *, struct kvec *, int /* nvec */, struct kvec *, int /* nvec to send */, int * /* bytes returned */ , const int long_op); extern int checkSMBhdr(struct smb_hdr *smb, __u16 mid); extern int checkSMB(struct smb_hdr *smb, __u16 mid, int length); Loading Loading @@ -237,12 +237,10 @@ extern int CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, const __u64 lseek, unsigned int *nbytes, const char *buf, const char __user *ubuf, const int long_op); #ifdef CONFIG_CIFS_EXPERIMENTAL extern int CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, const int netfid, const unsigned int count, const __u64 offset, unsigned int *nbytes, struct kvec *iov, const int nvec, const int long_op); #endif /* CONFIG_CIFS_EXPERIMENTAL */ extern int CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon, const unsigned char *searchName, __u64 * inode_number, const struct nls_table *nls_codepage, Loading @@ -269,6 +267,8 @@ extern void tconInfoFree(struct cifsTconInfo *); extern int cifs_reconnect(struct TCP_Server_Info *server); extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *,__u32 *); extern int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *, __u32 *); extern int cifs_verify_signature(struct smb_hdr *, const char * mac_key, __u32 expected_sequence_number); extern int cifs_calculate_mac_key(char * key,const char * rn,const char * pass); Loading
fs/cifs/cifssmb.c +1 −4 Original line number Diff line number Diff line Loading @@ -1155,7 +1155,6 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, return rc; } #ifdef CONFIG_CIFS_EXPERIMENTAL int CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, const int netfid, const unsigned int count, Loading Loading @@ -1234,8 +1233,6 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, } #endif /* CIFS_EXPERIMENTAL */ int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, const __u16 smb_file_id, const __u64 len, Loading
fs/cifs/file.c +0 −6 Original line number Diff line number Diff line Loading @@ -870,7 +870,6 @@ static ssize_t cifs_write(struct file *file, const char *write_data, if (rc != 0) break; } #ifdef CONFIG_CIFS_EXPERIMENTAL /* BB FIXME We can not sign across two buffers yet */ if((experimEnabled) && ((pTcon->ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0)) { Loading @@ -889,7 +888,6 @@ static ssize_t cifs_write(struct file *file, const char *write_data, iov, 1, long_op); } else /* BB FIXME fixup indentation of line below */ #endif rc = CIFSSMBWrite(xid, pTcon, open_file->netfid, min_t(const int, cifs_sb->wsize, Loading Loading @@ -1026,7 +1024,6 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) return rc; } #ifdef CONFIG_CIFS_EXPERIMENTAL static int cifs_writepages(struct address_space *mapping, struct writeback_control *wbc) { Loading Loading @@ -1229,7 +1226,6 @@ static int cifs_writepages(struct address_space *mapping, return rc; } #endif static int cifs_writepage(struct page* page, struct writeback_control *wbc) { Loading Loading @@ -1875,9 +1871,7 @@ struct address_space_operations cifs_addr_ops = { .readpage = cifs_readpage, .readpages = cifs_readpages, .writepage = cifs_writepage, #ifdef CONFIG_CIFS_EXPERIMENTAL .writepages = cifs_writepages, #endif .prepare_write = cifs_prepare_write, .commit_write = cifs_commit_write, .set_page_dirty = __set_page_dirty_nobuffers, Loading