Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/kern/imgact_elf.c | ||
|---|---|---|
| 865 | For the same reason as why we use LK_RETRY. The 'real' VFS calls return errors if anything went wrong. But vn_rdwr() returns EIO if the read was truncated. | |
Use local instead of imgp->phdrs. Remove __DECONST().
Remove all unneeded uses of curthread, replaced by imgp->td.
| sys/kern/imgact_elf.c | ||
|---|---|---|
| 865 |
I was more concerned about e_phoff itself: before, it was safe to assume that e_phoff < PAGE_SIZE, now it can be any 64-bit value. But in practice it is bounded by the file size, so probably this is not a real issue. | |
| 1232 | e.g., is it possible for these calculations to overflow now? | |
| 2959–2960 | Isn't this assuming that the phdrs are in the first page? | |
| sys/kern/imgact_elf.c | ||
|---|---|---|
| 865 | I do not understand why would it be important. if e_phoff is arbitrary large, and file is big enough, what is the problem? | |
| 1232 | It is possible, but it should not matter. First, to wrap around, I believe that the segment mapping must wrap. Second, the effect is only a wrong AT_PHDRS provided to userspace. Nonetheless, I added the wrapping check at the beginning of the function. | |
| sys/kern/imgact_elf.c | ||
|---|---|---|
| 865 | Sorry, I see what you mean now, even if overflow happens, the only result is an invalid auxv entry. | |