git: 3377f38cfe28 - main - uiomove_fault(): initialize save with ~0 when no flags are cleared

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 24 Jun 2026 22:31:10 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3377f38cfe284a8490b49611614aae3a2bea78e4

commit 3377f38cfe284a8490b49611614aae3a2bea78e4
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-06-24 22:27:45 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-06-24 22:31:02 +0000

    uiomove_fault(): initialize save with ~0 when no flags are cleared
    
    Reported by:    markj
    Fixes:  4c4195700249 ("sys: use curthread_pflags_set/restore to manage TDP_DEADLKTREAT for uio")
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/kern/subr_uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c
index 7e492d8aa705..e2059d3813d4 100644
--- a/sys/kern/subr_uio.c
+++ b/sys/kern/subr_uio.c
@@ -264,7 +264,7 @@ uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault)
 		save = curthread_pflags_set(newflags);
 	} else {
 		KASSERT(nofault == 0, ("uiomove: nofault"));
-		save = 0;
+		save = ~0;
 	}
 
 	while (n > 0 && uio->uio_resid) {