CVS commit: src/sys/uvm

"YAMAMOTO Takashi" <[email protected]>
Newsgroups gmane.os.netbsd.devel.cvs
Message-ID <[email protected]>
Module Name:	src
Committed By:	yamt
Date:		Fri Mar 27 07:14:46 UTC 2026

Modified Files:
	src/sys/uvm: uvm_pager.c uvm_swap.c uvm_swap.h

Log Message:
fix swap encryption data corruption issue

when paging out, uvm_swap_io encrypts the page contents in-place
and then issues write requests to swapdev. if the write fails
for some reason, the pageout will be cancelled. but it leaves
the data in the pages encrypted. ie. data corruption. note that
this doesn't necessarily involve broken swap devices. as we are
in the pagedaemon context, some kind of transient errors are
rather normal. for example, ffs VOP_BMAP has special cases for
the pagedaemon to return ENOMEM.

this commit fixes the issue by simply reverting the encryption
on error.

PR/60082
https://gnats.netbsd.org/60082


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/uvm/uvm_pager.c
cvs rdiff -u -r1.221 -r1.222 src/sys/uvm/uvm_swap.c
cvs rdiff -u -r1.29 -r1.30 src/sys/uvm/uvm_swap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.