News for hackers. Stuff that matters.
Re:GDB 8.1 Released by modeless on Wednesday January 31, 2018 @02:08PM (#16276575)
Having the program behave differently under a debugger is a great way to introduce bugs that disappear when the debugger is present. Any features of this type would have to be completely optional.
Re:GDB 8.1 Released by kazinator on Wednesday January 31, 2018 @02:29PM (#16276770)
Any optional features are a good way to have an application behave differently when the option is on, versus off. :)

Programs behave differently under a debugger anyway; "bugs disappearing under a debugger" already happens now.

It's just a question of the risk/reward.

"This debugger feature increases the scope of situations when a bug disappears under the debugger": that's a risk.

"This debugger feature gives me a better overall debugging experience most of the time": benefit

Re:GDB 8.1 Released by dustfinger on Wednesday January 31, 2018 @02:19PM (#16276684)
Yes, and introducing bugs is not the only issue at stake.

Imagine malware that could react differently when a debugger is attached.

Re:GDB 8.1 Released by jcelerier on Wednesday January 31, 2018 @04:13PM (#16277592)
> Imagine malware that could react differently when a debugger is attached.

that has been the case for a long time: simply timing some instructions is generally enough to tell you that you're running under a debugger. It's also helpful for copy protection.

Re:GDB 8.1 Released by ChrisLomont on Wednesday January 31, 2018 @02:31PM (#16276797)
Malware already does this on many platforms via many methods, and has done so for perhaps decades.

Here's [1] the tip of the iceberg on this issue.

[1] antukh.com/blog/2015/01/19/malware-techniques-cheat-sheet/

Re:GDB 8.1 Released by kazinator on Wednesday January 31, 2018 @02:30PM (#16276785)
The debugger could have a mode of "stealth attachment" under which that feature is not activated; the connection with that special interface is not made, and so the program is not informed that it's under a debugger, and those debug streams don't connect to anything.
Re:GDB 8.1 Released by dustfinger on Wednesday January 31, 2018 @02:32PM (#16276803)
Well, to be fair malware already exists that can detect when a system debugger is attached so maybe my concern is invalid. I guess the greater concern is the introduction of bugs after all.

Edit - Other commenters beet me to this point :-P

Re:GDB 8.1 Released by kazinator on Wednesday January 31, 2018 @02:40PM (#16276865)
The program is what it is and it has bugs. There is a risk that bugs are irreproducible under a debugger (no matter how transparent the debugger). Oh well; you have to debug those in some other way. That risk shouldn't paralyze us from innovating debuggers.

There are bugs that won't reproduce when you debug via JTAG; so what.

Simply pausing on a breakpoint can make a bug irreproducible.

Programs can infer that they are being debugged via timings, and various side channels.

Re:GDB 8.1 Released by saagarjha on Wednesday January 31, 2018 @03:26PM (#16277239)
The issue is that by introducing this feature, you're increasing the number of programs that behave differently when a debugger is attached. Just because this can be an issue today doesn't mean that we should make it even more of an issue tomorrow.
Re:GDB 8.1 Released by stouset on Wednesday January 31, 2018 @02:31PM (#16276793)
Malware already does this. Non-malware programs already do this to complicate analysis.
Re:GDB 8.1 Released by kazinator on Wednesday January 31, 2018 @02:42PM (#16276884)
If those non-malware programs are fixed to use a proper API instead of side channel hacks, then it simplifies analysis.
Re:GDB 8.1 Released by saagarjha on Wednesday January 31, 2018 @02:59PM (#16277016)
> If those non-malware programs are fixed to use a proper API instead of side channel hacks, then it simplifies analysis.

I think you’re missing the point as to why programs would do this. Usually it’s to protect some sort of DRM scheme through obscurity.