From owner-freebsd-bugs Tue Jan 15 1:27:52 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D90DE37B416 for ; Tue, 15 Jan 2002 01:21:54 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0F9KB705187; Tue, 15 Jan 2002 01:20:11 -0800 (PST) (envelope-from gnats) Date: Tue, 15 Jan 2002 01:20:11 -0800 (PST) Message-Id: <200201150920.g0F9KB705187@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Crist J . Clark" Subject: Re: kern/33904: secure mode bug Reply-To: "Crist J . Clark" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/33904; it has been noted by GNATS. From: "Crist J . Clark" To: "D. McCullough" Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: kern/33904: secure mode bug Date: Tue, 15 Jan 2002 01:12:30 -0800 On Mon, Jan 14, 2002 at 03:44:48PM -0800, D. McCullough wrote: [snip] > >Description: > settimeofday silently fails in secure mode. > > I wasted a lot of time baffled -- > this makes all the various date > apps and clients silently fail. The problem is that it doesn't _completely_ fail. > >Fix: > When an operation prohibited by secure mode fails, > this failure must be accurately reported by the API. If you run your test program, # ./testtime gettimeofday = 0; t = 1011071149.590024 settimeofday = 0; t = 1011067549.590024 gettimeofday = 0; t = 1011071148.591402 At securelevel == 2, we see that the time _has_ been changed by the call, but like the log message says, Jan 14 21:05:44 bubbles kernel: Time adjustment clamped to -1 second So the call of settimeofday(2) didn't actually fail due to "permission denied," but the result is not exactly what the caller expected either. Now, whether this whole approach is wrong is more of a discussion for freebsd-arch@freebsd.org. -- "It's always funny until someone gets hurt. Then it's hilarious." Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message