summaryrefslogtreecommitdiff
path: root/components/rust/docs/4.modules
diff options
context:
space:
mode:
authorseteiro <[email protected]>2026-11-11 23:14:20 +0800
committerRbb666 <[email protected]>2026-11-12 09:35:48 +0800
commit2e2ec0151de58781d8dbc2df4abe8159903efab6 (patch)
tree6b40f8111bc589dc2129ea05232897b827f316cc /components/rust/docs/4.modules
parent5caa519bec2e261146260149e2a8aa1708d79940 (diff)
[dfs][nfs] bound READ copy length to request and data_len
Fix #11917 nfs_read() used the server-controlled READ3resok.count as the memcpy length without checking it against the request or the decoded data. Clamp each copy to min(server count, args.count, data.data_len), advance buf and the remaining count by the bytes actually copied, and break out when a reply makes no progress so the loop cannot spin. Share DFS_NFS_MAX_MTU (1024) in dfs_nfs.h for both READ/WRITE request caps and the xdr_READ3resok() opaque decode limit, replacing the separate NFS_READ_MAX_DATA definition. In nfs_write(), clamp WRITE3resok.count to the submitted length and advance buf/count/offset only by the accepted bytes so short writes retry the tail correctly and zero-count replies stop the loop. Follow-up for Yunlk's review observations on nfs_read(): - When an RPC or NFS status failure occurs after earlier iterations already copied bytes and advanced fd->offset, keep total and return the bytes copied so far instead of resetting total to 0; only set total = -1 when total == 0. - Remove the stale placeholder comment inside the eof handling branch where fd->eof = TRUE and break are already performed.
Diffstat (limited to 'components/rust/docs/4.modules')
0 files changed, 0 insertions, 0 deletions