FreeBSD/Alpha local DoS
Marceta Milos
root at marcetam.net
Tue Jun 22 13:30:42 GMT 2004
>
>
Hi, Thank you for reply.
>The third, actually - but you should talk to alpha at freebsd.org
>instead. We do not issue security advisories for local denial of
>service vulnerabilities.
Ok. Well, I hope you don't maint if I issue it somewhere. (I would just
like to hear from Alpha developers, to know they wrote solution for it).
>>something like putting :
>>#ifdef ALPHA
>>#define ALIGNED(x) x << 62 ? 0 : 1
>>#endif
>It's not that simple, because alignment requirements exist on other
>platforms as well, and usually vary with the type of data. Since argv
>and envv are pointers to arrays of pointers, we need to check that
>they satisfy the alignment requirements for pointers:
>#define PTR_ALIGNED(x) (((x) & 0x7) == 0)
I agree. Thank you for pointing this out.
>>#ifdef ALPHA
>>if (!ALIGNED(*argv) || !ALIGNED(*env))
>>return -ERROR;
>>#endif
> You need to check argv itself, not what it points to; and "return
> -ERROR" is a Linuxism. The correct incantation in FreeBSD would be
>
> if (!PTR_ALIGNED(uap->argv) || !PTR_ALIGNED(uap->envv))
> return (EFAULT);
Sorry for Linuxism, I just didn't pay attention to it. Just wanted to share idea.
Of course that formal incantation should be respected. Your line looks like
possible workaround.
>which should be at the top of execve() in src/sys/kern/kern_exec.c.
>Actually, we already have an ALIGNED_POINTER() macro on Alpha, AMD64
>and IA64, but we can't use it in MI code since it doesn't exist on all
>platforms. This should be easy to fix.
Please correct me if I am wrong, but src/sys/kern/kern_exec.c is
MI code.
So, putting the macro ALIGNED_POINTER or PTR_ALIGNED into execve(),
in mentioned file, whould be actually, putting MD code (since it's
not necessary on all platforms), into MI code ?
Well, I guess it's easy to fix, but I would just like to hear someone from
Alpha developers, to see their final idea, solution and patch for this.
Best regards,
Milos Marceta
More information about the freebsd-alpha
mailing list