Module Name: src Committed By: riz Date: Sat May 19 16:37:14 UTC 2012
Modified Files: src/sys/arch/amd64/amd64 [netbsd-5]: db_memrw.c src/sys/arch/i386/i386 [netbsd-5]: db_memrw.c Log Message: Pull up following revision(s) (requested by jym in ticket #1754): sys/arch/amd64/amd64/db_memrw.c: revision 1.10 sys/arch/amd64/amd64/db_memrw.c: revision 1.11 sys/arch/i386/i386/db_memrw.c: revision 1.29 Use the current destination address to compute PTE, not the address of origin. Harmless, except when db_write_text() passes a page boundary. From Bug Hunting. XXX has to be pulled up to -5 and -6. invlpg on a non canonical address is a noop, so no chance to invalidate the TLB and the CPU will not notice the access right change. This results in write protection faults in supervisor mode when patching kernel code through ddb(4) (originally mapped as read only). Bug reported by David Laight on port-amd64@ (thanks!), patch and test by me. i386 is unaffected as PG_LGFRAME does not mask the sign bits. For the sake of correctness, use VA_SIGN_NEG(...) anyway. XXX this is the patch that will be pulled-up to -5 and -6. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.10.1 src/sys/arch/amd64/amd64/db_memrw.c cvs rdiff -u -r1.24.10.1 -r1.24.10.2 src/sys/arch/i386/i386/db_memrw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.