Thread (31 messages) 31 messages, 6 authors, 2021-03-11

RE: [PATCH v3] x86/fault: Send a SIGBUS to user process always for hwpoison page access.

From: "Luck, Tony" <tony.luck@intel.com>
Date: 2021-03-01 23:56:04
Also in: lkml

Programs that get a signal might expect that the RIP that the signal
frame points to is the instruction that caused the signal and that the
instruction faulted without side effects.  For SIGSEGV, I would be
especially nervous about this.  Maybe SIGBUS is safer.  For SIGSEGV,
it's entirely valid to look at CR2 / si_fault_addr, fix it up, and
return.  This would be completely *invalid* with your patch.  I'm not
sure what to do about this.
The original plan was that s/w like databases would be able to write
their own application specific recovery code. E.g. they hit poison while
reading some "table". The process gets a SIGBUS with siginfo telling
the handler the virtual address range that has been lost. The code
uses mmap(MAP_FIXED) to map a new page into the lost address and
fills it with suitable data (either reconstructing lost data by replaying
transactions, or filling the table with some "data unknown" indicator).

Then the SIGBUS handler returns to re-execute the instruction that
failed.

As far as I know nobody has been that creative in production s/w.
But I think there are folks with a siglongjmp() to a "this whole transaction
just failed" safe point.

-Tony
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help