чт, 5 сент. 2019 г. в 16:24, Steve French <smfrench@xxxxxxxxx>: > > I am getting EBADMSG from the call (in crypt_message in smb2ops.c) to > crypto_wait_req when trying to decrypt a 512K array of pages from an > SMB3 read in a worker thread (rather than in the usual cifsd thread > which works) - see attached patch (doesn't fail with non-offload > case). > > Any obvious bug anyone spots here? Looking at the crypto library for > CCM wasn't exactly clear to me what could be going on > + if (server->pdu_size > (512 * 1024)) { + dw = kmalloc(sizeof(struct smb2_decrypt_work), GFP_KERNEL); + if (dw == NULL) + goto non_offloaded_decrypt; + dw->buf = kmalloc(sizeof(struct smb2_transform_hdr), GFP_KERNEL); + if (dw->buf == NULL) { + kfree(dw); + goto non_offloaded_decrypt; + } + memcpy(dw->buf, buf, sizeof(struct smb2_transform_hdr)); ^^^ here buf contains transform header + read rsp -- see decrypt_raw_data() function for details. Should be sizeof(struct smb2_transform_hdr) + server->vals->read_rsp_size. -- Best regards, Pavel Shilovsky