From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: dma-buf: Fix silent overflow for phys vec to sgt Date: Thu, 28 May 2026 12:05:55 +1000 Message-ID: In-Reply-To: <20260527205048.2168808-1-xuehaohu@google.com> References: <20260527205048.2168808-1-xuehaohu@google.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: dma-buf: Fix silent overflow for phys vec to sgt Author: David Hu Patches: 1 Reviewed: 2026-05-28T12:05:55.710402 --- This is a single-patch fix for a real overflow bug in `dma_buf_phys_vec_to_sgt()` where MMIO regions larger than 4GB cause `mapped_len` (declared as `unsigned int`) to silently wrap around when accumulating `size_t` lengths. The fix is straightforward and correct: promote `mapped_len` to `size_t`. The secondary changes (loop iterator signedness in `fill_sg_entry`, overflow guard in `calc_sg_nents`) are reasonable hardening. The patch is **mostly good** but has a couple of issues worth addressing. --- Generated by Claude Code Patch Reviewer