Page MenuHomePhabricator

[ELF2] - fixed infinite includes depth (in linkerscript)
AbandonedPublic

Authored by grimar on Oct 19 2015, 8:38 AM.

Details

Reviewers
ruiu
rafael
Summary

Infinite including leads to out of memory after hard freeze because of infinite loop. According to specs INCLUDE should be limited to 10 levels depth.

Diff Detail

Event Timeline

grimar updated this revision to Diff 37761.Oct 19 2015, 8:38 AM
grimar retitled this revision from to [ELF2] - fixed infinite includes depth.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
grimar retitled this revision from [ELF2] - fixed infinite includes depth to [ELF2] - fixed infinite includes depth (in linkerscript).Oct 19 2015, 8:41 AM
ruiu edited edge metadata.Oct 19 2015, 8:58 AM

Adding a marker string to the vector which otherwise contain only real tokens is too hacky. The linker script handler is intentionally dumb and simple. Please leave it alone now.

grimar added a comment.EditedOct 19 2015, 9:05 AM
In D13872#270287, @ruiu wrote:

Adding a marker string to the vector which otherwise contain only real tokens is too hacky. The linker script handler is intentionally dumb and simple. Please leave it alone now.

But I compare address of first element, not the token values:

if (Tok.begin() == EndInclude.begin())

That should not affect the real tokens..

ruiu added a comment.Oct 19 2015, 9:15 AM

Yes I know. This change itself is correct. It's that I don't want to add more safeguard code here as all code in this file will soon be rewritten when we start working on real implementation.

grimar abandoned this revision.Oct 19 2015, 9:18 AM

Ok then..