Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Feb 2003 10:34:22 -0800
From:      Peter Wemm <peter@wemm.org>
To:        phk@phk.freebsd.dk
Cc:        current@freebsd.org
Subject:   Re: cvs commit: src/sys/alpha/alpha busdma_machdep.c src/sys/alpha/osf1 imgact_osf1.c osf1_misc.c src/sys/cam cam_periph.c cam_sim.c cam_xpt.c src/sys/cam/scsi scsi_cd.c scsi_ch.c scsi_da.c scsi_low.c scsi_sa.c scsi_target.c src/sys/coda cnode.h ... 
Message-ID:  <20030219183422.059862A8C3@canning.wemm.org>
In-Reply-To: <76449.1045642469@critter.freebsd.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
phk@phk.freebsd.dk 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 - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030219183422.059862A8C3>