empserver/tests
Markus Armbruster 5497126d05 edit: Fix stack smash in sector key 'L'
Key 'L' copies the source sector to a destination sector.  Bug: it
doesn't copy, it messes up the source sector badly instead, and can
smash the stack on some machines.

Root cause: doland() passes &sect instead of sect to ef_set_uid().
Impact:

1. ef_setuid() clobbers a few bytes at &sect.

   When the bitfield and uid fit into sizeof(sect) bytes, it clobbers
   just sect, which has no effect, because doland() returns without
   using it again.  This is the case on a typical 64-bit machine: bit
   field and uid are both 4 bytes, sizeof(sect) is 8.

   When they don't fit, whatever is adjacent to sect gets clobbered.
   On a typical 32-bit machine with stack growing down, that's p.
   Again, no effect, because doland() returns without using it again.
   With stack growing up, it could well be the return address,
   crashing the server.

2. ef_setuid() fails to update *sect.  Impact (when we survive 1):

   sect->sct_uid remains unchanged.  putsect() writes to the source
   sector instead of the destination sector, clobbering the source's
   sct_x, sct_y.  Breaks invariant sctoff(sct_x, sct_y) == sct_uid!
   Subsequent edits are all applied to the source sector.

   sect->sct_seqno remains unchanged.  No effect, because we write to
   the source sector, and the unchanged sequence number is the right
   one there.

Broken in commit 536ef0b0, v4.3.15.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
..
actofgod edit: Fix stack smash in sector key 'L' 2013-06-06 19:55:01 +02:00
fairland Change fairland island size probability distribution 2013-05-08 06:57:55 +02:00
files Use int instead of signed char for pln_flags 2013-05-08 06:57:54 +02:00
smoke tests: Capture player output via journal instead of client 2013-05-31 10:52:50 +02:00
actofgod-test tests/actofgod: New, disabled for now because it oopses 2013-06-06 19:52:20 +02:00
fairland-test Switch PRNG from BSD random() to Mersenne Twister 2013-05-08 06:55:21 +02:00
files-test Add files test to make check 2013-05-08 06:55:18 +02:00
normalize.pl tests: Cut off log file timestamp instead of normalizing it 2013-05-31 09:54:50 +02:00
smoke-test tests: Capture player output via journal instead of client 2013-05-31 10:52:50 +02:00
test-common.sh tests: Capture player output via journal instead of client 2013-05-31 10:52:50 +02:00