On Mar 18, 8:15am, al...@yandex.ru (Alexander Nasonov) wrote: -- Subject: Re: KASSERT in exec_elf.c for DYN executable when p_align==0
| Christos Zoulas wrote: | > In article <20180317225722.GA1538@neva>, | > Alexander Nasonov <al...@yandex.ru> wrote: | > >Coverity (CID 1427746) complains about a division by zero when | > >align is 0 in all PT_LOAD headers. | > >... | > >I would be nice to perform sanity checks of tainted executable | > >instead of panicing. | > | > Fixed, thanks. | | But it doesn't fix CID 1427746. Given that both 0 and 1 specify no alignment, | the fix is simple: | | - for (align = i = 0; i < eh->e_phnum; i++) | + align = 1; | + for (i = 0; i < eh->e_phnum; i++) | if (ph[i].p_type == PT_LOAD && ph[i].p_align > align) | align = ph[i].p_align; I missed that part, sorry. christos