[EMAIL PROTECTED] wrote:

> The attached patch will print a backtrace if any calls to malloc
> fail to have either M_WAITOK or M_NOWAIT.

Please do not commit this as-is..  There is a DoS here if a user figures
out how to provoke this.  This is exactly the situation that Alfred was
worried about.

> +     indx = flags & (M_WAITOK | M_NOWAIT);
> +     if (indx == M_NOWAIT) {
> +             /* OK */
> +     } else if (indx == M_WAITOK) {
> +             /* OK */
> +     } else {
> +             printf("Missing M_WAITOK flag\n");
> +             backtrace();
> +             flags |= M_WAITOK;
> +     }

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to