Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Posted Nov 4, 2015 1:54 UTC (Wed) by ploxiln (subscriber, #58395)In reply to: Kernel security: beyond bug fixing by Gollum
Parent article: Kernel security: beyond bug fixing
foo() {
char buf[16];
bar(buf, 16);
...
}
So if bar could overflow a buffer in its stack frame, or in foo's stack frame, no matter how you arrange them, one of them could hit the return address.
Posted Nov 4, 2015 12:30 UTC (Wed)
by renox (guest, #23785)
[Link] (14 responses)
"No matter how you arrange them" is not correct: if you have separated variable and address stack, you cannot use a buffer overflow to override a return address.
Posted Nov 4, 2015 23:47 UTC (Wed)
by PaXTeam (guest, #24616)
[Link] (12 responses)
Posted Nov 5, 2015 9:31 UTC (Thu)
by renox (guest, #23785)
[Link] (11 responses)
Can you explain it again or do you have a link with an article explaining how it could work?
Posted Nov 5, 2015 10:36 UTC (Thu)
by PaXTeam (guest, #24616)
[Link] (10 responses)
assume the attacker controls the data behind 'in' and that the memcpy overwrites both 'p' and 's' on the stack, the last line will then be able to write anything anywhere. in short, there are many ways a memory corruption bug can be exploited, overwriting the return address of the current frame is just one and perhaps the most popularized textbook example but by far not the only way. this is the reason why having a proper threat model helps avoiding mistakes in devising defenses.
Posted Nov 5, 2015 10:45 UTC (Thu)
by renox (guest, #23785)
[Link] (9 responses)
Posted Nov 5, 2015 11:25 UTC (Thu)
by PaXTeam (guest, #24616)
[Link] (8 responses)
Posted Nov 5, 2015 12:25 UTC (Thu)
by renox (guest, #23785)
[Link] (1 responses)
The 'arbitrary write' can overwrite the return address only if the address of the return address is known, which can be quite difficult if there is randomisation.
Also for the Mill CPU(unfortunately paperware only currently) I think that the separated address stack is managed directly by the CPU, so an 'arbitrary write' cannot overwrite a return address.
Posted Nov 5, 2015 12:46 UTC (Thu)
by PaXTeam (guest, #24616)
[Link]
Posted Nov 5, 2015 12:28 UTC (Thu)
by hummassa (subscriber, #307)
[Link] (5 responses)
Posted Nov 5, 2015 12:52 UTC (Thu)
by PaXTeam (guest, #24616)
[Link] (4 responses)
Posted Nov 10, 2015 16:39 UTC (Tue)
by hummassa (subscriber, #307)
[Link] (3 responses)
Posted Nov 10, 2015 17:29 UTC (Tue)
by PaXTeam (guest, #24616)
[Link] (2 responses)
Posted Nov 24, 2015 13:43 UTC (Tue)
by hummassa (subscriber, #307)
[Link] (1 responses)
Posted Nov 24, 2015 16:25 UTC (Tue)
by PaXTeam (guest, #24616)
[Link]
Posted Nov 6, 2015 3:38 UTC (Fri)
by ploxiln (subscriber, #58395)
[Link]
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Thanks.
Kernel security: beyond bug fixing
{
long *p;
char out[8];
memcpy(out, in, 1024);
*p = s;
}
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing
Kernel security: beyond bug fixing