On Wed, Jul 05, 2017 at 09:47:11AM -0600, Theo de Raadt wrote:
> > So I'd say for cases like src == dst we don't have to guarantee that
> > bytes are swapped.
> 
> and you've audited all the callers to this function?
> 
> > Agreed, I haven't checked for bad/dangerous usage in existing code for
> > reasons explained above.
> 
> No you haven't.
To be fair I glanced through sys and base for callers to swab() before
patching but didn't find any:

        $ grep -slRF swab\( /usr/src
        /usr/src/gnu/gcc/gcc/sys-protos.h
        /usr/src/gnu/usr.bin/gcc/gcc/sys-protos.h
        /usr/src/include/unistd.h
        /usr/src/lib/libc/string/Makefile.inc
        /usr/src/lib/libc/string/swab.c

> Completely irresponsible.
> 
> What a waste of time.

But you're right about irresponsibly not thinking this through.
Definitely noted, thanks.

Reply via email to