]> Git Repo - linux.git/commitdiff
netfs: Fix a KMSAN uninit-value error in netfs_clear_buffer
authorChang Yu <[email protected]>
Tue, 1 Oct 2024 06:31:52 +0000 (23:31 -0700)
committerChristian Brauner <[email protected]>
Tue, 1 Oct 2024 14:02:42 +0000 (16:02 +0200)
Use folioq_count instead of folioq_nr_slots to fix a KMSAN uninit-value
error in netfs_clear_buffer

Signed-off-by: Chang Yu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Fixes: cd0277ed0c18 ("netfs: Use new folio_queue data type and iterator instead of xarray iter")
Acked-by: David Howells <[email protected]>
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=921873345a95f4dae7e9
Signed-off-by: Christian Brauner <[email protected]>
fs/netfs/misc.c

index 63280791de3b3882b1187456566705b996275ddc..78fe5796b2b2f7fc31547ae2ae6b2d686cc3a111 100644 (file)
@@ -102,7 +102,7 @@ void netfs_clear_buffer(struct netfs_io_request *rreq)
 
        while ((p = rreq->buffer)) {
                rreq->buffer = p->next;
-               for (int slot = 0; slot < folioq_nr_slots(p); slot++) {
+               for (int slot = 0; slot < folioq_count(p); slot++) {
                        struct folio *folio = folioq_folio(p, slot);
                        if (!folio)
                                continue;
This page took 0.049401 seconds and 4 git commands to generate.