Hi David, While testing some cifs patches, I found that xfstests generic/759 fails on cifs, but only when the mount uses 'sign':   mount -t cifs //server/share /mnt -o ...,sign fsx dies with SIGBUS in domapread(), and dmesg shows repeated:   CIFS: VFS: \\server\share SMB signature verification returned error = -13 But without 'sign', or with 'signloosely' (which sets server->ignoresignature), the test passes. I've tracked this down to netfs_read_gaps(), where it builds a read destination in which several bvec entries alias one page.  Data written through that iterator can't be read back through it, but cifs does exactly that; to verify the SMB3 response signature, it rehashes the destination iterator after the socket copy, so the check fails, the read is abandoned, the folio never becomes uptodate, and a mapped read of it gives SIGBUS. Reproduced on the latest cifs-next (7.2+); the relevant code is unchanged since v6.8. the construction: fs/netfs/buffered_read.c, netfs_read_gaps():         sink = folio_alloc(GFP_KERNEL, 0);         ...         if (from > 0) {                 bvec_set_folio(&bvec[i++], folio, from, 0);                 off = from;         }         while (off < to) {                 part = min_t(size_t, to - off, PAGE_SIZE);                 bvec_set_folio(&bvec[i++], sink, part, 0);                 off += part;         }         if (to < flen)                 bvec_set_folio(&bvec[i++], folio, flen - to, to);         iov_iter_bvec(&rreq->buffer.iter, ITER_DEST, bvec, i, rreq->len); The sink is a single order-0 folio, and every PAGE_SIZE chunk of the dirty region points at it at offset 0.  nr_bvec = flen / PAGE_SIZE + 2 shows multiple sink entries are expected, so with a large folio and dirty_len > PAGE_SIZE the destination iterator contains N aliases of the same page. For pure discard that is fine, and the file data itself is always correct, which is why this is invisible without signing.  However, the iterator no longer returns what was previously written; each sink chunk overwrites the previous one, so a replay of the iterator yields the last chunk's bytes wherever the earlier chunks were written. why it matters for cifs with signing: __cifs_calc_signature() computes the response CMAC over rqst->rq_iov[] followed by rqst->rq_iter, and for a read response rq_iter *is* the destination that cifs_read_iter_from_socket() just copied into. There's no separate source buffer to hash; the payload was copied straight into the page cache. cifs hashes the aliased iterator, gets bytes that were never on the wire, and smb2_verify_signature() returns -EACCES.  netfs retries it (identically), marks it I-BAD three times, and ABNDNs it.  So the folio never gets marked uptodate, and filemap_fault() returns VM_FAULT_SIGBUS. I used the attached bpftrace sigcheck.bt to capture the byte stream fed to AES-CMAC by hooking aes_cmac_update() under smb2_verify_signature(), and compared it against the PDU as it actually arrived (from pcap), and CMAC-verified using the smb2sigcheck.py script (also attached). 1. The wire is clean; the failing responses verify correctly against    the session signing key when the signature is recomputed from the    pcap:      mid=31388 READ pdu=8272 OK wire=... calc=... doff=80 dlen=8192    So the bytes arrived intact and cifs's own key is right. 2. The kernel hashed something else.  Diffing the kernel's CMAC input    against the wire PDU for one failing read (8192-byte read into an    8192-byte folio):      1675 of 8272 bytes differ, first at offset 952 (file data +872)        region: data +872 .. +4096 (3224 bytes)          == wire data +4968 (shift +4096, one PAGE_SIZE)    Every differing run in the region is byte-identical to the pcap    contents 4096 bytes further along.    That is precisely the aliased-sink signature: dirty_offset = 872,    dirty_len = 7320, to = 8192 = flen, giving      bvec[0] = folio,  872 bytes @ 0      bvec[1] = sink,  4096 bytes @ 0      bvec[2] = sink,  3224 bytes @ 0    The second sink chunk overwrites the first, so replaying the iterator    reads bvec[1]'s slot back as the bytes that were written by bvec[2] --    i.e. wire content shifted by +4096.  A Python model of that bvec list    reproduces the diff exactly, including where the coincidental matches    fall. 3. All three attempts hashed byte-identical contents, confirming this    is the buffer layout, not a concurrent modification of the folio. to replicate:  start bpftrace:   # BPFTRACE_MAX_STRLEN=8192 BPFTRACE_PERF_RB_PAGES=1024 \     bpftrace sigcheck.bt > /tmp/sig.out  start packet capture:   # tshark -F pcap -w trace.pcap -i lo tcp port 445  mount:   # mount //server/share /mnt/test -overs=3.1.1,sign  run generic/759  (or just the fsx command which crashes:   # /root/xfstests-dev/ltp/fsx -N 10000 -o 128000 -l 500000 -h -d /mnt/test/junk  stop pcap & bpftrace  run the checker script on the bpftrace output and pcap:   # ./smb2sigcheck.py --kernel sig.out trace.pcap I won't pretend to know how to fix it, but I'd be happy to test any fixes. Frank -- Frank Sorenson sorenson@redhat.com Principal Software Maintenance Engineer, filesystems Red Hat