From owner-freebsd-audit Sun Aug 19 0:21:56 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-7.dsl.lsan03.pacbell.net [63.207.60.7]) by hub.freebsd.org (Postfix) with ESMTP id DC64237B412 for ; Sun, 19 Aug 2001 00:21:50 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 4D16266D03; Sun, 19 Aug 2001 00:21:50 -0700 (PDT) Date: Sun, 19 Aug 2001 00:21:50 -0700 From: Kris Kennaway To: audit@FreeBSD.org Subject: iostat signal handler patch Message-ID: <20010819002149.A52245@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable iostat is still setgid kmem in RELENG_4..I don't know how easy it would be to backport the sysctl additions which allowed us to remove setgid kmem in -current, but in the meantime perhaps this patch should be committed. This patch is relative to the RELENG_4 code. Kris Index: iostat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr2/ncvs/src/usr.sbin/iostat/iostat.c,v retrieving revision 1.17.2.2 diff -u -r1.17.2.2 iostat.c --- iostat.c 2001/07/19 04:15:42 1.17.2.2 +++ iostat.c 2001/08/19 07:20:02 @@ -108,6 +108,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,7 @@ struct device_selection *dev_select; int maxshowdevs; int dflag =3D 0, Iflag =3D 0, Cflag =3D 0, Tflag =3D 0, oflag =3D 0, Kflag= =3D 0; +volatile sig_atomic_t phdr_flag =3D 0; =20 #define nlread(x, v) \ kvm_read(kd, namelist[x].n_value, &(v), sizeof(v)) @@ -142,6 +144,7 @@ /* local function declarations */ static void usage(void); static void phdr(int signo); +static void do_phdr(); static void devstats(int perf_select); static void cpustats(void); =20 @@ -406,8 +409,13 @@ long tmp; double etime; =20 + if (phdr_flag) { + phdr_flag =3D 0; + do_phdr(); + } + =09 if (!--headercount) { - phdr(0); + do_phdr(); headercount =3D 20; } (void)kvm_read(kd, namelist[X_TK_NIN].n_value, @@ -451,7 +459,7 @@ errx(1, "%s", devstat_errbuf); break; case 1: - phdr(0); + do_phdr(); headercount =3D 20; break; default: @@ -482,7 +490,7 @@ errx(1,"%s", devstat_errbuf); break; case 1: - phdr(0); + do_phdr(); headercount =3D 20; break; default: @@ -528,6 +536,13 @@ =20 static void phdr(int signo) +{ + + phdr_flag =3D 1;=09 +} + +static void +do_phdr()=20 { register int i; int printed; --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7f2kMWry0BWjoQKURAoEPAKCk9RqoQ7LnVbJZTrrwiq/S7ANH5ACdERJe HAyawSM4Y4/pliDz1YQN4L0= =JqCR -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 8:51:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mout1.freenet.de (mout1.freenet.de [194.97.50.132]) by hub.freebsd.org (Postfix) with ESMTP id CB78C37B40F for ; Sun, 19 Aug 2001 08:51:43 -0700 (PDT) (envelope-from Alexander@leidinger.net) Received: from [194.97.50.136] (helo=mx3.freenet.de) by mout1.freenet.de with esmtp (Exim 3.32 #1) id 15YUrR-0001TP-00; Sun, 19 Aug 2001 17:51:37 +0200 Received: from a3711.pppool.de ([213.6.55.17] helo=Magelan.Leidinger.net) by mx3.freenet.de with esmtp (Exim 3.32 #1) id 15YUrQ-0001QY-00; Sun, 19 Aug 2001 17:51:37 +0200 Received: from Leidinger.net (netchild@localhost [127.0.0.1]) by Magelan.Leidinger.net (8.11.5/8.11.5) with ESMTP id f7JFpSV01199; Sun, 19 Aug 2001 17:51:29 +0200 (CEST) (envelope-from netchild@Leidinger.net) Message-Id: <200108191551.f7JFpSV01199@Magelan.Leidinger.net> Date: Sun, 19 Aug 2001 17:51:27 +0200 (CEST) From: Alexander Leidinger Subject: Re: [art@cvs.openbsd.org: CVS: cvs.openbsd.org: src] To: kris@obsecurity.org Cc: audit@FreeBSD.ORG In-Reply-To: <20010818190339.A76832@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 18 Aug, Kris Kennaway wrote: > Anyone up for porting this? I'm not volunteering, but want to raise the "the stack is misaligned" issue... at least I haven't seen a commit ehich says the opposite (and I paid attention to this issue since (should be in the archive of -current)). If someone picks up the OpenBSD commit it should be easy to align the stack at the same time. > Log message: > Add a possibility to add a random offset to the stack on exec. This makes > it slightly harder to write generic buffer overflows. This doesn't really > give any real security, but it raises the bar for script-kiddies and it's > really cheap. Bye, Alexander. -- Reboot America. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 12: 7:27 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 8D0DE37B40D for ; Sun, 19 Aug 2001 12:07:23 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f7JJTRp49176; Sun, 19 Aug 2001 15:29:27 -0400 (EDT) (envelope-from mike) Date: Sun, 19 Aug 2001 15:29:27 -0400 From: Mike Barcroft To: Kris Kennaway Cc: audit@FreeBSD.org Subject: Re: Checking issetugid() with getenv() in libraries Message-ID: <20010819152927.A49129@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , Kris Kennaway , audit@FreeBSD.org References: <20010818221258.A79194@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010818221258.A79194@xor.obsecurity.org>; from kris@obsecurity.org on Sat, Aug 18, 2001 at 10:12:58PM -0700 Organization: The FreeBSD Project Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kris Kennaway writes: > There were a number of places where library routines blindly use > getenv() in ways which may be insecure if called from setugid code. > Please review the following. > > I also changed the uthread_info.c to respect TMPDIR if !issetugid() > instead of dumping to /tmp always. > > Kris > > Index: libc/db/test/dbtest.c > =================================================================== > RCS file: /mnt/ncvs/src/lib/libc/db/test/dbtest.c,v > retrieving revision 1.4 > diff -u -r1.4 dbtest.c > --- libc/db/test/dbtest.c 2000/08/04 10:50:21 1.4 > +++ libc/db/test/dbtest.c 2001/08/19 04:25:47 > @@ -155,7 +155,8 @@ > * want it around, and it often screws up tests. > */ > if (fname == NULL) { > - p = getenv("TMPDIR"); > + if (issetugid() == 0) > + p = getenv("TMPDIR"); > if (p == NULL) > p = "/var/tmp"; > (void)snprintf(buf, sizeof(buf), "%s/__dbtest", p); [...] Is p initialized to NULL above this? If not, p could be uninitialized when issetugid() != 0. > Index: libc/stdio/tmpfile.c > =================================================================== > RCS file: /mnt/ncvs/src/lib/libc/stdio/tmpfile.c,v > retrieving revision 1.6 > diff -u -r1.6 tmpfile.c > --- libc/stdio/tmpfile.c 2001/07/07 04:08:32 1.6 > +++ libc/stdio/tmpfile.c 2001/08/19 04:19:53 > @@ -61,7 +61,8 @@ > char *buf; > const char *tmpdir; > > - tmpdir = getenv("TMPDIR"); > + if (issetugid() == 0) > + tmpdir = getenv("TMPDIR"); > if (tmpdir == NULL) > tmpdir = _PATH_TMP; > [...] There's a similar problem here. > Index: libncp/ncpl_rcfile.c > =================================================================== > RCS file: /mnt/ncvs/src/lib/libncp/ncpl_rcfile.c,v > retrieving revision 1.3 > diff -u -r1.3 ncpl_rcfile.c > --- libncp/ncpl_rcfile.c 2000/05/26 02:00:20 1.3 > +++ libncp/ncpl_rcfile.c 2001/08/19 04:52:39 > @@ -390,7 +390,8 @@ > char *home, *fn; > int error; > > - home = getenv("HOME"); > + if (issetugid() == 0) > + home = getenv("HOME"); > if (home) { > fn = malloc(strlen(home) + 20); > sprintf(fn, "%s/.nwfsrc", home); [...] Also here. The rest of the changes look good. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 12:11:23 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id CC70237B412 for ; Sun, 19 Aug 2001 12:11:20 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f7JJXQ849201; Sun, 19 Aug 2001 15:33:26 -0400 (EDT) (envelope-from mike) Date: Sun, 19 Aug 2001 15:33:26 -0400 From: Mike Barcroft To: Kris Kennaway Cc: audit@FreeBSD.org Subject: Re: Checking issetugid() with getenv() in libraries Message-ID: <20010819153326.B49129@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , Kris Kennaway , audit@FreeBSD.org References: <20010818221258.A79194@xor.obsecurity.org> <20010818222846.B79436@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010818222846.B79436@xor.obsecurity.org>; from kris@obsecurity.org on Sat, Aug 18, 2001 at 10:28:46PM -0700 Organization: The FreeBSD Project Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kris Kennaway writes: > Another one: > > Index: ./libdialog/rc.c > =================================================================== > RCS file: /mnt/ncvs/src/gnu/lib/libdialog/rc.c,v > retrieving revision 1.2 > diff -u -r1.2 rc.c > --- ./libdialog/rc.c 1994/10/20 21:56:43 1.2 > +++ ./libdialog/rc.c 2001/08/19 05:27:47 > @@ -103,12 +103,12 @@ > * > */ > > - if ((tempptr = getenv("DIALOGRC")) != NULL) > + if (issetugid() == 0 && (tempptr = getenv("DIALOGRC")) != NULL) > rc_file = fopen(tempptr, "rt"); > > if (tempptr == NULL || rc_file == NULL) { /* step (a) failed? */ > /* try step (b) */ > - if ((tempptr = getenv("HOME")) == NULL) > + if (issetugid() != 0 || (tempptr = getenv("HOME")) == NULL) > return 0; /* step (b) failed, use default values */ > > if (tempptr[0] == '\0' || lastch(tempptr) == '/') Same problem here as well, unless tempptr is initialized to NULL above this. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 12:28:33 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 2FAA637B414 for ; Sun, 19 Aug 2001 12:28:30 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f7JJoY349234; Sun, 19 Aug 2001 15:50:34 -0400 (EDT) (envelope-from mike) Date: Sun, 19 Aug 2001 15:50:34 -0400 From: Mike Barcroft To: Kris Kennaway Cc: audit@FreeBSD.org Subject: Re: at(1) signal handler fix Message-ID: <20010819155034.C49129@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , Kris Kennaway , audit@FreeBSD.org References: <20010818235833.A36306@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010818235833.A36306@xor.obsecurity.org>; from kris@obsecurity.org on Sat, Aug 18, 2001 at 11:58:33PM -0700 Organization: The FreeBSD Project Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kris Kennaway writes: > This patch is adapted from OpenBSD..please review. > > Kris > > Index: at.c > =================================================================== > RCS file: /mnt/ncvs/src/usr.bin/at/at.c,v > retrieving revision 1.19 > diff -u -r1.19 at.c > --- at.c 2001/07/24 14:15:51 1.19 > +++ at.c 2001/08/19 06:58:02 [...] > static void alarmc(int signo) > { > -/* Time out after some seconds > - */ > - panic("file locking timed out"); > + char buf[1024]; > + > + /* Time out after some seconds. */ > + strlcpy(buf, namep, sizeof(buf)); > + strlcat(buf, ": file locking timed out\n", sizeof(buf)); > + write(STDERR_FILENO, buf, strlen(buf)); > + if (fcreated) { > + PRIV_START > + unlink(atfile); > + PRIV_END > + } > + _exit(EXIT_FAILURE); > } [...] Why not just call sigc() after write(2)? The other changes look okay. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 14: 8: 5 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id E112F37B414 for ; Sun, 19 Aug 2001 14:08:02 -0700 (PDT) (envelope-from nectar@nectar.com) Received: by gw.nectar.com (Postfix, from userid 1001) id 12003547; Sun, 19 Aug 2001 16:08:02 -0500 (CDT) Date: Sun, 19 Aug 2001 16:08:02 -0500 From: "Jacques A. Vidrine" To: Kris Kennaway Cc: audit@FreeBSD.org Subject: Re: Checking issetugid() with getenv() in libraries Message-ID: <20010819160801.A84442@hellblazer.nectar.com> References: <20010818221258.A79194@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010818221258.A79194@xor.obsecurity.org>; from kris@obsecurity.org on Sat, Aug 18, 2001 at 10:12:58PM -0700 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I think this is introducing a few uninitialized pointer bugs. For example, in this chunk it is clear we're going to crash. Of course, this particular chunk is probably wrong in other ways -- if you don't want to look at HOME, I guess you'll need to use getpwuid(). > diff -u -r1.3 ncpl_rcfile.c > --- libncp/ncpl_rcfile.c 2000/05/26 02:00:20 1.3 > +++ libncp/ncpl_rcfile.c 2001/08/19 04:52:39 > @@ -390,7 +390,8 @@ > char *home, *fn; > int error; > > - home = getenv("HOME"); > + if (issetugid() == 0) > + home = getenv("HOME"); > if (home) { > fn = malloc(strlen(home) + 20); > sprintf(fn, "%s/.nwfsrc", home); Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 17:16:30 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id EB09637B40B; Sun, 19 Aug 2001 17:16:23 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.5/8.11.5) with SMTP id f7K0GMP34669; Sun, 19 Aug 2001 20:16:22 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 19 Aug 2001 20:16:21 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: "Andrew R. Reiter" Cc: audit@freebsd.org, security@freebsd.org Subject: Re: login_cap In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Would this make use of the setlogincontext() code in libutil? If so, I'd be very happy to see that used more pervasively through the system. In particular, using LOGIN_SETALL with appropriate bits substracted, rather than specifying individual bits. The reasoning for this is that my MAC code uses a new LOGIN_SETLABEL flag, and I noticed a number of existing uses of setlogincontext() that set only specific bits but leave out parts of the context setup. Likewise, places in the system where uids/etc are manually configured, resulting in incorrect setting of additional groups, resource limits, etc. Given that appropriate enforcement of system resource limits is now vital to maintaining multi-user systems, being consistent about enforcing them in all situations is very important. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services On Fri, 17 Aug 2001, Andrew R. Reiter wrote: > Hey, > > Im wondering if there's any real interest for patches to be made for some > services so that they do login class, etc authentication? Such an example > would be for atrun.c in libexec/atrun/. > > In my opinion, it is probably worth doing and getting commited, but if no > one would commit the patches, I dont see a point in doing them :-) > > btw, if you're unfamiliar with login caps, check out login_cap(3) and > login_class(3). > > Andrew > > *-------------................................................. > | Andrew R. Reiter > | arr@fledge.watson.org > | "It requires a very unusual mind > | to undertake the analysis of the obvious" -- A.N. Whitehead > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-security" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sun Aug 19 18:42: 2 2001 Delivered-To: freebsd-audit@freebsd.org Received: from Veronica.wmol.com (veronica.wmol.com [208.242.83.241]) by hub.freebsd.org (Postfix) with ESMTP id D959C37B40D for ; Sun, 19 Aug 2001 18:41:58 -0700 (PDT) (envelope-from david@phobia.ms) Received: from rain.hill.hom (081bc122.chartermi.net [24.247.81.122]) by Veronica.wmol.com (Vircom SMTPRS 5.0.193) with ESMTP id for ; Sun, 19 Aug 2001 21:39:48 -0400 Date: Sun, 19 Aug 2001 21:40:16 -0400 From: David Hill To: audit@freebsd.org Subject: write.c patch - WARNS=2 Message-Id: <20010819214016.298f8222.david@phobia.ms> X-Mailer: Sylpheed version 0.5.3 (GTK+ 1.2.10; i386-unknown-freebsd5.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun__19_Aug_2001_21:40:16_-0400_08192c00" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --Multipart_Sun__19_Aug_2001_21:40:16_-0400_08192c00 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello - Here is a write.c patch. 1. Constified 2. Changed a strncpy to a strlcpy 3. Changed S_IWRITE >> 3 to S_IWGRP 4. Code cleaup (declaration and unused variable) when WARNS=2 - David --Multipart_Sun__19_Aug_2001_21:40:16_-0400_08192c00 Content-Type: application/octet-stream; name="write.c.patch" Content-Disposition: attachment; filename="write.c.patch" Content-Transfer-Encoding: base64 ZGlmZiAtcnUgL3Vzci9zcmMvdXNyLmJpbi93cml0ZS5vcmlnL01ha2VmaWxlIC91c3Ivc3JjL3Vz ci5iaW4vd3JpdGUvTWFrZWZpbGUKLS0tIC91c3Ivc3JjL3Vzci5iaW4vd3JpdGUub3JpZy9NYWtl ZmlsZQlGcmkgQXVnIDEwIDIyOjU0OjE2IDIwMDEKKysrIC91c3Ivc3JjL3Vzci5iaW4vd3JpdGUv TWFrZWZpbGUJRnJpIEF1ZyAxMCAyMjo1NDo0NSAyMDAxCkBAIC0zLDUgKzMsNiBAQAogUFJPRz0J d3JpdGUKIEJJTk1PREU9MjU1NQogQklOR1JQPQl0dHkKK1dBUk5TPz0gMgogCiAuaW5jbHVkZSA8 YnNkLnByb2cubWs+CmRpZmYgLXJ1IC91c3Ivc3JjL3Vzci5iaW4vd3JpdGUub3JpZy93cml0ZS5j IC91c3Ivc3JjL3Vzci5iaW4vd3JpdGUvd3JpdGUuYwotLS0gL3Vzci9zcmMvdXNyLmJpbi93cml0 ZS5vcmlnL3dyaXRlLmMJRnJpIEF1ZyAxMCAyMjo1NDoxNiAyMDAxCisrKyAvdXNyL3NyYy91c3Iu YmluL3dyaXRlL3dyaXRlLmMJRnJpIEF1ZyAxMCAyMzowMToxMSAyMDAxCkBAIC02NCwxMiArNjQs MTIgQEAKICNpbmNsdWRlIDx1dG1wLmg+CiAKIHZvaWQgZG9uZSBfX1AoKGludCkpOwotdm9pZCBk b193cml0ZSBfX1AoKGNoYXIgKiwgY2hhciAqLCB1aWRfdCkpOwordm9pZCBkb193cml0ZSBfX1Ao KGNvbnN0IGNoYXIgKiwgY29uc3QgY2hhciAqLCB1aWRfdCkpOwogc3RhdGljIHZvaWQgdXNhZ2Ug X19QKCh2b2lkKSk7Ci1pbnQgdGVybV9jaGsgX19QKChjaGFyICosIGludCAqLCB0aW1lX3QgKiwg aW50KSk7CitpbnQgdGVybV9jaGsgX19QKChjb25zdCBjaGFyICosIGludCAqLCB0aW1lX3QgKiwg aW50KSk7CiB2b2lkIHdyX2ZwdXRzIF9fUCgodW5zaWduZWQgY2hhciAqcykpOwotdm9pZCBzZWFy Y2hfdXRtcCBfX1AoKGNoYXIgKiwgY2hhciAqLCBjaGFyICosIHVpZF90KSk7Ci1pbnQgdXRtcF9j aGsgX19QKChjaGFyICosIGNoYXIgKikpOwordm9pZCBzZWFyY2hfdXRtcCBfX1AoKGNvbnN0IGNo YXIgKiwgY29uc3QgY2hhciAqLCBjaGFyICosIHVpZF90KSk7CitpbnQgdXRtcF9jaGsgX19QKChj b25zdCBjaGFyICosIGNvbnN0IGNoYXIgKikpOwogCiBpbnQKIG1haW4oYXJnYywgYXJndikKQEAg LTEwNyw3ICsxMDcsNyBAQAogCS8qIGNoZWNrIGFyZ3MgKi8KIAlzd2l0Y2ggKGFyZ2MpIHsKIAlj YXNlIDI6Ci0JCXNlYXJjaF91dG1wKGFyZ3ZbMV0sIHR0eSwgbXl0dHksIG15dWlkKTsKKwkJc2Vh cmNoX3V0bXAoYXJndlsxXSwgbXl0dHksIHR0eSwgbXl1aWQpOwogCQlkb193cml0ZSh0dHksIG15 dHR5LCBteXVpZCk7CiAJCWJyZWFrOwogCWNhc2UgMzoKQEAgLTE0MSw3ICsxNDEsNyBAQAogICov CiBpbnQKIHV0bXBfY2hrKHVzZXIsIHR0eSkKLQljaGFyICp1c2VyLCAqdHR5OworCWNvbnN0IGNo YXIgKnVzZXIsICp0dHk7CiB7CiAJc3RydWN0IHV0bXAgdTsKIAlpbnQgdWZkOwpAQCAtMTcyLDgg KzE3Miw5IEBACiAgKiB3cml0aW5nIGZyb20sIHVubGVzcyB0aGF0J3MgdGhlIG9ubHkgdGVybWlu YWwgd2l0aCBtZXNzYWdlcyBlbmFibGVkLgogICovCiB2b2lkCi1zZWFyY2hfdXRtcCh1c2VyLCB0 dHksIG15dHR5LCBteXVpZCkKLQljaGFyICp1c2VyLCAqdHR5LCAqbXl0dHk7CitzZWFyY2hfdXRt cCh1c2VyLCBteXR0eSwgdHR5LCBteXVpZCkKKwljb25zdCBjaGFyICp1c2VyLCAqbXl0dHk7CisJ Y2hhciAqdHR5OwogCXVpZF90IG15dWlkOwogewogCXN0cnVjdCB1dG1wIHU7CkBAIC0xOTAsOCAr MTkxLDcgQEAKIAl3aGlsZSAocmVhZCh1ZmQsIChjaGFyICopICZ1LCBzaXplb2YodSkpID09IHNp emVvZih1KSkKIAkJaWYgKHN0cm5jbXAodXNlciwgdS51dF9uYW1lLCBzaXplb2YodS51dF9uYW1l KSkgPT0gMCkgewogCQkJKytubG9nZ2VkdHR5czsKLQkJCSh2b2lkKXN0cm5jcHkoYXR0eSwgdS51 dF9saW5lLCBVVF9MSU5FU0laRSk7Ci0JCQlhdHR5W1VUX0xJTkVTSVpFXSA9ICdcMCc7CisJCQko dm9pZClzdHJsY3B5KGF0dHksIHUudXRfbGluZSwgVVRfTElORVNJWkUpOwogCQkJaWYgKHRlcm1f Y2hrKGF0dHksICZtc2dzb2ssICZhdGltZSwgMCkpCiAJCQkJY29udGludWU7CS8qIGJhZCB0ZXJt PyBza2lwICovCiAJCQlpZiAobXl1aWQgJiYgIW1zZ3NvaykKQEAgLTIyNyw3ICsyMjcsNyBAQAog ICovCiBpbnQKIHRlcm1fY2hrKHR0eSwgbXNnc29rUCwgYXRpbWVQLCBzaG93ZXJyb3IpCi0JY2hh ciAqdHR5OworCWNvbnN0IGNoYXIgKnR0eTsKIAlpbnQgKm1zZ3Nva1AsIHNob3dlcnJvcjsKIAl0 aW1lX3QgKmF0aW1lUDsKIHsKQEAgLTI0MCw3ICsyNDAsNyBAQAogCQkJd2FybigiJXMiLCBwYXRo KTsKIAkJcmV0dXJuKDEpOwogCX0KLQkqbXNnc29rUCA9IChzLnN0X21vZGUgJiAoU19JV1JJVEUg Pj4gMykpICE9IDA7CS8qIGdyb3VwIHdyaXRlIGJpdCAqLworCSptc2dzb2tQID0gKHMuc3RfbW9k ZSAmIFNfSVdHUlApICE9IDA7CS8qIGdyb3VwIHdyaXRlIGJpdCAqLwogCSphdGltZVAgPSBzLnN0 X2F0aW1lOwogCXJldHVybigwKTsKIH0KQEAgLTI1MCwxMCArMjUwLDExIEBACiAgKi8KIHZvaWQK IGRvX3dyaXRlKHR0eSwgbXl0dHksIG15dWlkKQotCWNoYXIgKnR0eSwgKm15dHR5OworCWNvbnN0 IGNoYXIgKnR0eSwgKm15dHR5OwogCXVpZF90IG15dWlkOwogewotCXJlZ2lzdGVyIGNoYXIgKmxv Z2luLCAqbm93czsKKwlyZWdpc3RlciBjaGFyIGNvbnN0ICpsb2dpbjsKKwlyZWdpc3RlciBjaGFy ICpub3dzOwogCXJlZ2lzdGVyIHN0cnVjdCBwYXNzd2QgKnB3ZDsKIAl0aW1lX3Qgbm93OwogCWNo YXIgcGF0aFtNQVhQQVRITEVOXSwgaG9zdFtNQVhIT1NUTkFNRUxFTl0sIGxpbmVbNTEyXTsKQEAg LTI5Myw2ICsyOTQsNyBAQAogZG9uZShuKQogaW50IG47ICAvKiBzaWduYWwgbnVtYmVyICovCiB7 CisJbiA9IDA7CiAJKHZvaWQpcHJpbnRmKCJFT0ZcclxuIik7CiAJZXhpdCgwKTsKIH0K --Multipart_Sun__19_Aug_2001_21:40:16_-0400_08192c00-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 0:33: 8 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 5369D37B40F; Mon, 20 Aug 2001 00:33:00 -0700 (PDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.5/8.11.5) with SMTP id f7K7Wwn37668; Mon, 20 Aug 2001 03:32:58 -0400 (EDT) (envelope-from arr@watson.org) Date: Mon, 20 Aug 2001 03:32:57 -0400 (EDT) From: "Andrew R. Reiter" To: Robert Watson Cc: audit@freebsd.org, security@freebsd.org Subject: Re: login_cap In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Cool, a response :-) I actually didn't know about setlogincontext() until you mentioned it now. After browsing the login_class.c source, this does seem like a good thing to utilize -- perhaps a patch to the man page would help too. I wonder if it's wise if we come up with a list of pieces of code that we should start moving setlogincontext() into? My first shot would be to go for the set{u,g}id program and network daemons. Thoughts? Cheers, Andrew On Sun, 19 Aug 2001, Robert Watson wrote: : :Would this make use of the setlogincontext() code in libutil? If so, I'd :be very happy to see that used more pervasively through the system. In :particular, using LOGIN_SETALL with appropriate bits substracted, rather :than specifying individual bits. The reasoning for this is that my MAC :code uses a new LOGIN_SETLABEL flag, and I noticed a number of existing :uses of setlogincontext() that set only specific bits but leave out parts :of the context setup. Likewise, places in the system where uids/etc are :manually configured, resulting in incorrect setting of additional groups, :resource limits, etc. Given that appropriate enforcement of system :resource limits is now vital to maintaining multi-user systems, being :consistent about enforcing them in all situations is very important. : :Robert N M Watson FreeBSD Core Team, TrustedBSD Project :robert@fledge.watson.org NAI Labs, Safeport Network Services : :On Fri, 17 Aug 2001, Andrew R. Reiter wrote: : :> Hey, :> :> Im wondering if there's any real interest for patches to be made for some :> services so that they do login class, etc authentication? Such an example :> would be for atrun.c in libexec/atrun/. :> :> In my opinion, it is probably worth doing and getting commited, but if no :> one would commit the patches, I dont see a point in doing them :-) :> :> btw, if you're unfamiliar with login caps, check out login_cap(3) and :> login_class(3). :> :> Andrew :> :> *-------------................................................. :> | Andrew R. Reiter :> | arr@fledge.watson.org :> | "It requires a very unusual mind :> | to undertake the analysis of the obvious" -- A.N. Whitehead :> :> :> To Unsubscribe: send mail to majordomo@FreeBSD.org :> with "unsubscribe freebsd-security" in the body of the message :> : : *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 2:34: 3 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-7.dsl.lsan03.pacbell.net [63.207.60.7]) by hub.freebsd.org (Postfix) with ESMTP id 4A5C537B410; Mon, 20 Aug 2001 02:34:00 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id BB91266D15; Mon, 20 Aug 2001 02:33:59 -0700 (PDT) Date: Mon, 20 Aug 2001 02:33:59 -0700 From: Kris Kennaway To: Mike Barcroft , Kris Kennaway , audit@FreeBSD.org Subject: Re: at(1) signal handler fix Message-ID: <20010820023359.A65314@xor.obsecurity.org> References: <20010818235833.A36306@xor.obsecurity.org> <20010819155034.C49129@coffee.q9media.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010819155034.C49129@coffee.q9media.com>; from mike@FreeBSD.org on Sun, Aug 19, 2001 at 03:50:34PM -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 19, 2001 at 03:50:34PM -0400, Mike Barcroft wrote: > > + if (fcreated) { > > + PRIV_START > > + unlink(atfile); > > + PRIV_END > > + } > > + _exit(EXIT_FAILURE); > > } > [...] >=20 > Why not just call sigc() after write(2)? Seems like a reasonable suggestion..thanks. Kris --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7gNmGWry0BWjoQKURAmesAKDo/uy7W8H2spFRD8XBGtXbmBJoQwCg8rS6 eKd3R0XQM7IG/C+iFrj2Jlk= =ce5P -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 3:32:54 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by hub.freebsd.org (Postfix) with ESMTP id A47E737B410; Mon, 20 Aug 2001 03:32:43 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (dialup14-50.iptelecom.net.ua [212.9.229.114]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id NAA12383; Mon, 20 Aug 2001 13:32:37 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.4/8.11.3) with ESMTP id f7KAW6o11776; Mon, 20 Aug 2001 13:32:06 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3B80E75F.4C1C578F@FreeBSD.org> Date: Mon, 20 Aug 2001 13:33:03 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Akinori MUSHA Cc: audit@FreeBSD.org, "Brian F. Feldman" , Mike Barcroft , ports@FreeBSD.org Subject: Re: adding -P option to pkg_delete(1) References: <86ofpl0yq8.wl@archon.local.idaemons.org> <200108122310.f7CNAUZ01898@green.bikeshed.org> <86k804weed.wl@archon.local.idaemons.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Akinori MUSHA wrote: > OK, adopting green's suggestion I'd propose the attached patch again. > FWIW, I've confirmed that it works. > > Since I've had no objection against it so far, I'm going to commit it > this weekend and do MFC after the 4.4-RELEASE unless someone objects. > > FYI, 4.4-RELEASE users can use my pkg_deinstall(1) utility included in > sysutils/portupgrade. It is a wrapper of pkg_delete(1) with almost > upper compatible syntax, and which already has the -P option. > > Mental note: > > We'll have to audit the whole pkg_install code to eliminate possible > buffer overflows. Please hold on. What is the purpose of this feature? I can't recall any discussion regarding the topic. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 4:25:53 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id 4C53837B644; Mon, 20 Aug 2001 04:25:44 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 3DDB74D835; Mon, 20 Aug 2001 20:25:20 +0900 (JST) Date: Mon, 20 Aug 2001 20:25:20 +0900 Message-ID: <864rr355y7.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: Maxim Sobolev Cc: audit@FreeBSD.org, "Brian F. Feldman" , Mike Barcroft , ports@FreeBSD.org Subject: Re: adding -P option to pkg_delete(1) In-Reply-To: <3B80E75F.4C1C578F@FreeBSD.org> References: <86ofpl0yq8.wl@archon.local.idaemons.org> <200108122310.f7CNAUZ01898@green.bikeshed.org> <86k804weed.wl@archon.local.idaemons.org> <3B80E75F.4C1C578F@FreeBSD.org> User-Agent: Wanderlust/2.7.2 (Too Funky) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Mon, 20 Aug 2001 13:33:03 +0300, sobomax wrote: > Please hold on. What is the purpose of this feature? I can't recall > any discussion regarding the topic. It's okay, but why don't you just try to read the patch in which the purpose of the feature is *explicitly* written? -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 4:29:52 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-7.dsl.lsan03.pacbell.net [63.207.60.7]) by hub.freebsd.org (Postfix) with ESMTP id C902937B41C; Mon, 20 Aug 2001 04:29:46 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 11B1A66D15; Mon, 20 Aug 2001 04:29:46 -0700 (PDT) Date: Mon, 20 Aug 2001 04:29:45 -0700 From: Kris Kennaway To: Akinori MUSHA Cc: audit@FreeBSD.ORG, "Brian F. Feldman" , Mike Barcroft , ports@FreeBSD.ORG Subject: Re: adding -P option to pkg_delete(1) Message-ID: <20010820042945.A85555@xor.obsecurity.org> References: <86ofpl0yq8.wl@archon.local.idaemons.org> <200108122310.f7CNAUZ01898@green.bikeshed.org> <86k804weed.wl@archon.local.idaemons.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <86k804weed.wl@archon.local.idaemons.org>; from knu@iDaemons.org on Thu, Aug 16, 2001 at 06:19:22PM +0900 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 16, 2001 at 06:19:22PM +0900, Akinori MUSHA wrote: > We'll have to audit the whole pkg_install code to eliminate possible > buffer overflows. Well, there are literally dozens or hundreds of those. You can almost count the *safe* string operations in that code on one hand :-) Kris --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7gPSpWry0BWjoQKURArMSAJ96JUWKwPRbJpwlpfmwQV0puOHlAgCeIjNP InusjbnodGF5qOOkFcL5Lt0= =qqLL -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 4:40:26 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by hub.freebsd.org (Postfix) with ESMTP id 60B9137B40F; Mon, 20 Aug 2001 04:40:10 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (dialup6-28.iptelecom.net.ua [212.9.227.92]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id OAA24185; Mon, 20 Aug 2001 14:39:58 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.4/8.11.3) with ESMTP id f7KBcRo15297; Mon, 20 Aug 2001 14:38:27 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3B80F6EC.948F7633@FreeBSD.org> Date: Mon, 20 Aug 2001 14:39:24 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Akinori MUSHA Cc: audit@FreeBSD.org, "Brian F. Feldman" , Mike Barcroft , ports@FreeBSD.org Subject: Re: adding -P option to pkg_delete(1) References: <86ofpl0yq8.wl@archon.local.idaemons.org> <200108122310.f7CNAUZ01898@green.bikeshed.org> <86k804weed.wl@archon.local.idaemons.org> <3B80E75F.4C1C578F@FreeBSD.org> <864rr355y7.wl@archon.local.idaemons.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Akinori MUSHA wrote: > At Mon, 20 Aug 2001 13:33:03 +0300, > sobomax wrote: > > Please hold on. What is the purpose of this feature? I can't recall > > any discussion regarding the topic. > > It's okay, but why don't you just try to read the patch in which the > purpose of the feature is *explicitly* written? Well, perhaps you misread my question. I meant "what the code in question is expected to be used for?", not "what the code in question does?". Also idea to hardcode regex (two of them actually) into an utility doesn't looks very solid to me, instead I would like to see it be specificable (or at least overrideable) from the command line, i.e.: # pkg_delete -P ^.\*foo.bar foo-0.0 (don't delete files which end with `foo.bar'). -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 5:28:11 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id F41EE37B413; Mon, 20 Aug 2001 05:28:04 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 25E134E24D; Mon, 20 Aug 2001 21:26:57 +0900 (JST) Date: Mon, 20 Aug 2001 21:26:47 +0900 Message-ID: <86zo8u533s.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: Maxim Sobolev Cc: audit@FreeBSD.org, "Brian F. Feldman" , Mike Barcroft , ports@FreeBSD.org Subject: Re: adding -P option to pkg_delete(1) In-Reply-To: <3B80F6EC.948F7633@FreeBSD.org> References: <86ofpl0yq8.wl@archon.local.idaemons.org> <200108122310.f7CNAUZ01898@green.bikeshed.org> <86k804weed.wl@archon.local.idaemons.org> <3B80E75F.4C1C578F@FreeBSD.org> <864rr355y7.wl@archon.local.idaemons.org> <3B80F6EC.948F7633@FreeBSD.org> User-Agent: Wanderlust/2.7.2 (Too Funky) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Mon, 20 Aug 2001 14:39:24 +0300, sobomax wrote: > > At Mon, 20 Aug 2001 13:33:03 +0300, > > sobomax wrote: > > > Please hold on. What is the purpose of this feature? I can't recall > > > any discussion regarding the topic. > > > > It's okay, but why don't you just try to read the patch in which the > > purpose of the feature is *explicitly* written? > > Well, perhaps you misread my question. I meant "what the code in question > is expected to be used for?", not "what the code in question does?". Also I don't differentiate the two, or three. All your questions above sounds pointless to me. What are you implying actually? > idea to hardcode regex (two of them actually) into an utility doesn't > looks very solid to me, instead I would like to see it be specificable > (or at least overrideable) from the command line, i.e.: > > # pkg_delete -P ^.\*foo.bar foo-0.0 > (don't delete files which end with `foo.bar'). Sounds interesting, but I'm afraid it would be superfluous, I mean you might be doing YAGNI[*], since I don't see why we need this extension as much as we just need to preserve shared libraries. I suggest you explain the expected use of it, that is, what for example you want to preserve other than old shared libraries. Regards, [*] YAGNI = "You Aren't Gonna Need It!" -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 5:55: 3 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by hub.freebsd.org (Postfix) with ESMTP id 08B2F37B42B; Mon, 20 Aug 2001 05:48:04 -0700 (PDT) (envelope-from max@vega.com) Received: from vega.vega.com (dialup13-58.iptelecom.net.ua [212.9.229.58]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id PAA35603; Mon, 20 Aug 2001 15:46:54 +0300 (EEST) (envelope-from max@vega.com) Received: (from max@localhost) by vega.vega.com (8.11.4/8.11.3) id f7KCkNg15792; Mon, 20 Aug 2001 15:46:23 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) From: Maxim Sobolev Message-Id: <200108201246.f7KCkNg15792@vega.vega.com> Subject: Re: adding -P option to pkg_delete(1) To: knu@iDaemons.org (Akinori MUSHA) Date: Mon, 20 Aug 2001 15:46:23 +0300 (EEST) Cc: sobomax@FreeBSD.ORG (Maxim Sobolev), audit@FreeBSD.ORG, green@FreeBSD.ORG (Brian F. Feldman), mike@FreeBSD.ORG (Mike Barcroft), ports@FreeBSD.ORG In-Reply-To: from "Akinori MUSHA" at Aug 20, 2001 09:26:47 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > At Mon, 20 Aug 2001 14:39:24 +0300, > sobomax wrote: > > > At Mon, 20 Aug 2001 13:33:03 +0300, > > > sobomax wrote: > > > > Please hold on. What is the purpose of this feature? I can't recall > > > > any discussion regarding the topic. > > > > > > It's okay, but why don't you just try to read the patch in which the > > > purpose of the feature is *explicitly* written? > > > > Well, perhaps you misread my question. I meant "what the code in question > > is expected to be used for?", not "what the code in question does?". Also > > I don't differentiate the two, or three. All your questions above > sounds pointless to me. What are you implying actually? Ok, let me put it differently - I just do not see any reasonable use for the new option. What the user would gain by removing all package content except of shared libraries? We couldn't reasonably gurantee that package will work after such partial removal, so I suppose that we are just asking ourselves a trouble in the form on increased number of PRs "hey, I pkg_delete'd -P libfoo-1.0, and bar-2.0 stopped working." Also such partial removal will screw our dependency system - LIB_DEPENDS will detect shared library, but at the same time all headers of the package will be missed. > > idea to hardcode regex (two of them actually) into an utility doesn't > > looks very solid to me, instead I would like to see it be specificable > > (or at least overrideable) from the command line, i.e.: > > > > # pkg_delete -P ^.\*foo.bar foo-0.0 > > (don't delete files which end with `foo.bar'). > > Sounds interesting, but I'm afraid it would be superfluous, I mean you > might be doing YAGNI[*], since I don't see why we need this extension > as much as we just need to preserve shared libraries. > > I suggest you explain the expected use of it, that is, what for > example you want to preserve other than old shared libraries. Just a bit of generalisation, forget it if you don't like it. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 7:53:31 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id 2BDBC37B40E; Mon, 20 Aug 2001 07:53:19 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 48F114D835; Mon, 20 Aug 2001 23:53:17 +0900 (JST) Date: Mon, 20 Aug 2001 23:53:17 +0900 Message-ID: <86y9oe4wbm.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: Maxim Sobolev Cc: audit@FreeBSD.org, green@FreeBSD.org (Brian F. Feldman), mike@FreeBSD.org (Mike Barcroft), ports@FreeBSD.org Subject: Re: adding -P option to pkg_delete(1) In-Reply-To: <200108201246.f7KCkNg15792@vega.vega.com> References: <200108201246.f7KCkNg15792@vega.vega.com> User-Agent: Wanderlust/2.7.2 (Too Funky) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Mon, 20 Aug 2001 15:46:23 +0300 (EEST), sobomax wrote: > Ok, let me put it differently - I just do not see any reasonable use for > the new option. What the user would gain by removing all package content We would certainly not (have to) gurantee anything. As mentioned in the man page, -P is supposed to be used given a user knows what s/he is doing. > except of shared libraries? We couldn't reasonably gurantee that package > will work after such partial removal, so I suppose that we are just asking > ourselves a trouble in the form on increased number of PRs "hey, I > pkg_delete'd -P libfoo-1.0, and bar-2.0 stopped working." Also such > partial removal will screw our dependency system - LIB_DEPENDS will That doesn't make sense! As long as our dependency system works as you say in the latter part, one could not pkg_delete libfoo when bar-2.0 properly LIB_DEPENDS on it as you say in the former part. Besides, the fact is opposite. The -P option prevents us from getting the "hey, I pkg_delete'd -P libfoo-1.0, and bar-2.0 stopped working." type of PRs. Some pieces of software in ports detect and pick up libraries which are not listed in LIB_DEPENDS. For instance, the XEmacs port picks up and links libldap automatically without a user's notice. So in this case, we may get a PR which says "hey, I pkg_delete'd openldap-2.0.11_4, and xemacs-21.1.14 stopped working somehow.". Note that I am not denying that we should add `--without-openldap' or something to the port's CONFIGURE_ARGS, but we cannot cover every case. Granted, s/he would never get into trouble if there were the -P option and he knew of that. It doesn't solve anything essentially, but at least it helps people in a certain case to two. (See below) > detect shared library, but at the same time all headers of the package > will be missed. That's no problem. Because when one (re)builds a new binary, s/he will use the new version of the headers and the library anyway. It's just for backward (binary) compatibility. By the way, do you remove all the old shared libraries everytime you do a `make world'? I suppose not, since you know you (or other users) might still have some executables and shared libraries that depend on the older ones. Don't you install compat4x after you upgrade one of your 4-STABLE box to 5-CURRENT? I suppose yes, for the same reason. Given the above, you may reasonably want to preserve shared libraries when you upgrade a package. Do I make myself clear? -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 8:40:17 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by hub.freebsd.org (Postfix) with ESMTP id 6A2A337B415; Mon, 20 Aug 2001 08:39:48 -0700 (PDT) (envelope-from max@vega.com) Received: from vega.vega.com (dialup2-43.iptelecom.net.ua [212.9.226.107]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id SAA66525; Mon, 20 Aug 2001 18:39:39 +0300 (EEST) (envelope-from max@vega.com) Received: (from max@localhost) by vega.vega.com (8.11.4/8.11.3) id f7KFd7N16456; Mon, 20 Aug 2001 18:39:07 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) From: Maxim Sobolev Message-Id: <200108201539.f7KFd7N16456@vega.vega.com> Subject: Re: adding -P option to pkg_delete(1) To: knu@iDaemons.org (Akinori MUSHA) Date: Mon, 20 Aug 2001 18:38:27 +0300 (EEST) Cc: sobomax@FreeBSD.ORG (Maxim Sobolev), audit@FreeBSD.ORG, green@FreeBSD.ORG (Brian F. Feldman), mike@FreeBSD.ORG (Mike Barcroft), ports@FreeBSD.ORG In-Reply-To: from "Akinori MUSHA" at Aug 20, 2001 11:53:17 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > At Mon, 20 Aug 2001 15:46:23 +0300 (EEST), > sobomax wrote: > > Ok, let me put it differently - I just do not see any reasonable use for > > the new option. What the user would gain by removing all package content > > We would certainly not (have to) gurantee anything. As mentioned in > the man page, -P is supposed to be used given a user knows what s/he > is doing. > > > except of shared libraries? We couldn't reasonably gurantee that package > > will work after such partial removal, so I suppose that we are just asking > > ourselves a trouble in the form on increased number of PRs "hey, I > > pkg_delete'd -P libfoo-1.0, and bar-2.0 stopped working." Also such > > partial removal will screw our dependency system - LIB_DEPENDS will > > That doesn't make sense! As long as our dependency system works as > you say in the latter part, one could not pkg_delete libfoo when > bar-2.0 properly LIB_DEPENDS on it as you say in the former part. Then it makes even more questionable the usability of the new feature. If our dependency mechanist works, then you will be prevented from deleting shared library until there are still packages that require it, isn't it? Logically, one would be able to delete package only when there are no more packages that depend on it, so why to leave useless libfoo.so.X behind then? > Besides, the fact is opposite. The -P option prevents us from getting > the "hey, I pkg_delete'd -P libfoo-1.0, and bar-2.0 stopped working." > type of PRs. I think opposite. It sound to me like it would encourage users to delete all package contents expept of shared library and expect that the resulting setup will continue working, but in many cases it won't! > Some pieces of software in ports detect and pick up libraries which > are not listed in LIB_DEPENDS. For instance, the XEmacs port picks up > and links libldap automatically without a user's notice. So in this > case, we may get a PR which says "hey, I pkg_delete'd > openldap-2.0.11_4, and xemacs-21.1.14 stopped working somehow.". Note > that I am not denying that we should add `--without-openldap' or > something to the port's CONFIGURE_ARGS, but we cannot cover every > case. No, we can and should (as long as the amount of possible cases is not infinite, which isn't the case obviously ;). > Granted, s/he would never get into trouble if there were the -P option > and he knew of that. It doesn't solve anything essentially, but at > least it helps people in a certain case to two. (See below) No, you are trying to solve the problem from the wrong end. XEmacs should be fixed instead to detect installed libraries and expand its LIB_DEPENDS accordingly to ensure proper dependency registration. After all, how in this situation the user expected to know which packages he/she have to remove with `-P' and which without? > > detect shared library, but at the same time all headers of the package > > will be missed. > > That's no problem. Because when one (re)builds a new binary, s/he > will use the new version of the headers and the library anyway. It's > just for backward (binary) compatibility. Where is the gurantee that the user will install new library after deleting the old version of package with `-P'? With this option it is very easy to shoot yourself in a foot by deleting some packages with `-P', forget about it and run into the problems later, when LIB_DEPENDS will detect shared library of partially removed package, thus breaking the build in strange ways. > By the way, do you remove all the old shared libraries everytime you > do a `make world'? I suppose not, since you know you (or other users) > might still have some executables and shared libraries that depend on > the older ones. > > Don't you install compat4x after you upgrade one of your 4-STABLE box > to 5-CURRENT? I suppose yes, for the same reason. > > Given the above, you may reasonably want to preserve shared libraries > when you upgrade a package. > > > Do I make myself clear? Yes, though I'm still don't see much point in this option. However, I would not object to its inclusion into pkg_install as long as the following criterias are meet: 1. It should be clear indicated in the manpage that the setup resulted from the usage of `-P' option is completely unsupported by us (i.e. The Project) and the user should use this option only when he/she really understands all implications (some of them I outlined above); 2. This option is not enabled by default; 3. Nobody else disagrees. Moreover, to protect users from some of the shortcomings above I would propose to move leftover shared libraries into some form of attic (e.g. lib/compat/), instead of leaving them in the lib/ so it is immediately clean what shared libraries are there only for compatibility purposes. Then, our dependency resolution mechanism could be teached to ignore those directories thus eliminating the possibility of misdetection of dependency. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Mon Aug 20 9:28:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id BFCA437B40F; Mon, 20 Aug 2001 09:28:35 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 0A4D34E24D; Tue, 21 Aug 2001 01:28:34 +0900 (JST) Date: Tue, 21 Aug 2001 01:28:33 +0900 Message-ID: <86wv3y4rwu.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: Maxim Sobolev Cc: audit@FreeBSD.ORG, green@FreeBSD.ORG (Brian F. Feldman), mike@FreeBSD.ORG (Mike Barcroft), ports@FreeBSD.ORG Subject: Re: adding -P option to pkg_delete(1) In-Reply-To: <200108201539.f7KFd7N16456@vega.vega.com> References: <200108201539.f7KFd7N16456@vega.vega.com> User-Agent: Wanderlust/2.7.2 (Too Funky) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Mon, 20 Aug 2001 18:38:27 +0300 (EEST), sobomax wrote: > > That doesn't make sense! As long as our dependency system works as > > you say in the latter part, one could not pkg_delete libfoo when > > bar-2.0 properly LIB_DEPENDS on it as you say in the former part. > > Then it makes even more questionable the usability of the new feature. > If our dependency mechanist works, then you will be prevented from > deleting shared library until there are still packages that require it, > isn't it? Logically, one would be able to delete package only when > there are no more packages that depend on it, so why to leave useless > libfoo.so.X behind then? The world is not 100% made of packages, and a package system cannot handle everything. Sometimes a user can be lazy to (tell his/her users to) rebuild and reinstall all the binaries that depend on a library that's being updated via ports/packages, when s/he is sure that keeping the old version would save everything that's working at the time. It may include packages, or it may include some users' locally built stuff. Ideally, I admit packages should be strictly administrated within the framework. but users' stuff could not. > > Besides, the fact is opposite. The -P option prevents us from getting > > the "hey, I pkg_delete'd -P libfoo-1.0, and bar-2.0 stopped working." > > type of PRs. > > I think opposite. It sound to me like it would encourage users to > delete all package contents expept of shared library and expect that the > resulting setup will continue working, but in many cases it won't! Define many, please? Most shared libraries work by itself without depending on version specific configuration files. That's one of the purpose we have shared library versions and allow several versions of a library to coexist. I think I can name concrete examples as much as you want. > No, we can and should (as long as the amount of possible cases is not > infinite, which isn't the case obviously ;). That's not a good attitude to live with the reality. If everything worked as you think it "should", you'd have no problem in the first place. At least until we fix most of them, we certainly need this kind of workarounds. > No, you are trying to solve the problem from the wrong end. XEmacs > should be fixed instead to detect installed libraries and expand its > LIB_DEPENDS accordingly to ensure proper dependency registration. After > all, how in this situation the user expected to know which packages > he/she have to remove with `-P' and which without? Putting -P is safer in general. That's all. I'm not going to overrate it. > Where is the gurantee that the user will install new library after > deleting the old version of package with `-P'? With this option it is > very easy to shoot yourself in a foot by deleting some packages with > `-P', forget about it and run into the problems later, when LIB_DEPENDS > will detect shared library of partially removed package, thus breaking > the build in strange ways. You have a point here. So, I liked your "lib/compat" idea in the last paragraph. > > Do I make myself clear? > > Yes, though I'm still don't see much point in this option. However, I > would not object to its inclusion into pkg_install as long as the > following criterias are meet: I'm glad we are walking up to each other. > 1. It should be clear indicated in the manpage that the setup resulted > from the usage of `-P' option is completely unsupported by us (i.e. > The Project) and the user should use this option only when he/she > really understands all implications (some of them I outlined above); I agree with that, but then we should also mention that there are many other "unsupported" commands and options like pkg_update, pkg_add -I, pkg_delete -D, etc. . In my opinion, ports/packages are already flawful and is hard to guarantee much. For example, pkg_add installs a package even though a different version is still installed. Anyway, it is a good thing to document as much as we can. > 2. This option is not enabled by default; Sure. Because it is an "option" as it is. :) > 3. Nobody else disagrees. So far it seems. > Moreover, to protect users from some of the shortcomings above I would > propose to move leftover shared libraries into some form of attic (e.g. > lib/compat/), instead of leaving them in the lib/ so it is immediately > clean what shared libraries are there only for compatibility purposes. > Then, our dependency resolution mechanism could be teached to ignore > those directories thus eliminating the possibility of misdetection of > dependency. That's a pretty good idea. I'll test the mechanism with my pkg_deinstall(1) utility and see if/how it works, then I'll feed it back to pkg_delete. Actually -P was first implemented in pkg_deinstall(1) and I am feeding it back. Regards, -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 21 7:12: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 55A2537B406; Tue, 21 Aug 2001 07:12:01 -0700 (PDT) (envelope-from nectar@nectar.com) Received: from madman.nectar.com (madman.nectar.com [10.0.1.111]) by gw.nectar.com (Postfix) with ESMTP id B08904C4; Tue, 21 Aug 2001 09:12:00 -0500 (CDT) Received: (from nectar@localhost) by madman.nectar.com (8.11.3/8.11.3) id f7LEC0Y25154; Tue, 21 Aug 2001 09:12:00 -0500 (CDT) (envelope-from nectar) Date: Tue, 21 Aug 2001 09:12:00 -0500 From: "Jacques A. Vidrine" To: freebsd-audit@freebsd.org Cc: dd@freebsd.org, re@freebsd.org Subject: setprogname Message-ID: <20010821091200.A24891@madman.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , freebsd-audit@freebsd.org, dd@freebsd.org, re@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, This needs to be fixed before 4.4-RELEASE. Heimdal is currently broken (daemon PID files are written in the wrong location). It has its own implementation of setprogname, but it is not used in 4-STABLE or 5-CURRENT since we now have an implementation. I only mailed Dima yesterday about it; I'm redirecting here so soon only due to the code freeze. Index: setprogname.c =================================================================== RCS file: /home/ncvs/src/lib/libc/gen/setprogname.c,v retrieving revision 1.1 diff -u -r1.1 setprogname.c --- setprogname.c 2001/05/15 23:41:01 1.1 +++ setprogname.c 2001/08/21 14:07:27 @@ -8,6 +8,8 @@ void setprogname(const char *progname) { + char *p; - __progname = progname; + p = strrchr('/', progname); + __progname = p ? p : progname; } -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 21 8:39:31 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 4997F37B418 for ; Tue, 21 Aug 2001 08:39:25 -0700 (PDT) (envelope-from nectar@nectar.com) Received: from madman.nectar.com (madman.nectar.com [10.0.1.111]) by gw.nectar.com (Postfix) with ESMTP id BCB736C3; Tue, 21 Aug 2001 10:39:20 -0500 (CDT) Received: (from nectar@localhost) by madman.nectar.com (8.11.3/8.11.3) id f7LFdK727405; Tue, 21 Aug 2001 10:39:20 -0500 (CDT) (envelope-from nectar) Date: Tue, 21 Aug 2001 10:39:20 -0500 From: "Jacques A. Vidrine" To: freebsd-audit@freebsd.org Cc: oss-list-freebsd-audit@technorama.net Subject: Re: setprogname Message-ID: <20010821103920.A27397@madman.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , freebsd-audit@freebsd.org, oss-list-freebsd-audit@technorama.net References: <20010821091200.A24891@madman.nectar.com> <20010821113802.A84678@technorama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010821113802.A84678@technorama.net>; from oss-list-freebsd-audit@technorama.net on Tue, Aug 21, 2001 at 11:38:02AM -0400 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Aug 21, 2001 at 11:38:02AM -0400, oss-list-freebsd-audit@technorama.net wrote: > On Tue, Aug 21, 2001 at 09:12:00AM -0500, Jacques A. Vidrine wrote: > > > > + __progname = p ? p : progname; > > should be > > > + __progname = p ? p+1 : progname; Oops, yes thanks! -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 21 9:16: 0 2001 Delivered-To: freebsd-audit@freebsd.org Received: from winston.freebsd.org (adsl-64-173-15-98.dsl.sntc01.pacbell.net [64.173.15.98]) by hub.freebsd.org (Postfix) with ESMTP id A69A037B409; Tue, 21 Aug 2001 09:15:55 -0700 (PDT) (envelope-from jkh@freebsd.org) Received: from localhost (jkh@localhost [127.0.0.1]) by winston.freebsd.org (8.11.4/8.11.4) with ESMTP id f7LGFjI09226; Tue, 21 Aug 2001 09:15:45 -0700 (PDT) (envelope-from jkh@freebsd.org) To: n@nectar.com Cc: freebsd-audit@freebsd.org, dd@freebsd.org, re@freebsd.org Subject: Re: setprogname In-Reply-To: <20010821091200.A24891@madman.nectar.com> References: <20010821091200.A24891@madman.nectar.com> X-Mailer: Mew version 1.94.1 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010821091545S.jkh@freebsd.org> Date: Tue, 21 Aug 2001 09:15:45 -0700 From: Jordan Hubbard X-Dispatcher: imput version 20000228(IM140) Lines: 38 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG OK, please do. - Jordan From: "Jacques A. Vidrine" Subject: setprogname Date: Tue, 21 Aug 2001 09:12:00 -0500 > Hello, > > This needs to be fixed before 4.4-RELEASE. Heimdal is currently > broken (daemon PID files are written in the wrong location). It has > its own implementation of setprogname, but it is not used in 4-STABLE > or 5-CURRENT since we now have an implementation. I only mailed Dima > yesterday about it; I'm redirecting here so soon only due to the code > freeze. > > > Index: setprogname.c > =================================================================== > RCS file: /home/ncvs/src/lib/libc/gen/setprogname.c,v > retrieving revision 1.1 > diff -u -r1.1 setprogname.c > --- setprogname.c 2001/05/15 23:41:01 1.1 > +++ setprogname.c 2001/08/21 14:07:27 > @@ -8,6 +8,8 @@ > void > setprogname(const char *progname) > { > + char *p; > > - __progname = progname; > + p = strrchr('/', progname); > + __progname = p ? p : progname; > } > > -- > Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 21 10: 7: 4 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id D14EC37B407; Tue, 21 Aug 2001 10:06:52 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare/smtpfeed 1.12) with ESMTP/inet id f7LH6aI12648; Wed, 22 Aug 2001 02:06:37 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: peter@wemm.org Cc: iwasaki@jp.FreeBSD.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <20010817072149.0BCD63811@overcee.netplex.com.au> References: <20010809035801V.iwasaki@jp.FreeBSD.org> <20010817072149.0BCD63811@overcee.netplex.com.au> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010822020634P.iwasaki@jp.FreeBSD.org> Date: Wed, 22 Aug 2001 02:06:34 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 86 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, thanks peter for your comments. > > Index: locore.s > > =================================================================== > > RCS file: /home/ncvs/src/sys/i386/i386/locore.s,v > > retrieving revision 1.144 > > diff -u -r1.144 locore.s > > --- locore.s 2001/07/12 06:32:50 1.144 > > +++ locore.s 2001/08/08 17:49:28 > > @@ -374,6 +374,12 @@ > > movl IdlePTD,%esi > > movl %esi,PCB_CR3(%eax) > > > > + testl $CPUID_PGE, R(cpu_feature) > > + jz 1f > > + movl %cr4, %eax > > + orl $CR4_PGE, %eax > > + movl %eax, %cr4 > > +1: > > pushl physfree /* value of first for init386(f > irst) */ > > call init386 /* wire 386 chip for unix opera > tion */ > > > > @@ -718,13 +724,6 @@ > > */ > > > > create_pagetables: > > - > > - testl $CPUID_PGE, R(cpu_feature) > > - jz 1f > > - movl %cr4, %eax > > - orl $CR4_PGE, %eax > > - movl %eax, %cr4 > > -1: > > > > /* Find end of kernel image (rounded up to a page boundary). */ > > movl $R(_end),%esi > > This part is fine. OK, I'll commit this one first. > However: > > > Also I have another thing to be confirmed. Should we utilize TLB by > > enabling PGE bit at very later stage? I think it would be more > > efficient to cache page entries with G flag in multi-user environment, > > not in kernel bootstrap. If we enable PGE bit in locore.s, TLB could > > be occupied by entries which is referenced by initialization code > > (yes, most of them are executed only once). > > # but I could be wrong... > > The G bit does not "lock" the TLB entries in. All it does is stop > unnecessary flushes when %cr3 is changed. If entries are not used > for a short while, they will be recycled when the TLB slot is needed > for something else soon enough. ie: this should not be a problem. My point is that users need higher system performance in multi-user environment rather than in kernel bootstrap. Also PGE bit has effects in multi-user environment where %cr3 is changed frequently. I think enabling PGE in early stage of kernel bootstrap won't give us performance advantages, entries which is used in bootstrap will remain in the TLB as Intel's document says; ---- 3.7. TRANSLATION LOOKASIDE BUFFERS (TLBS) [snip] When the processor loads a page-directory or page-table entry for a global page into a TLB, the entry will remain in the TLB indefinitely. The only way to deterministically invalidate global page entries is to clear the PGE flag and then invalidate the TLBs or to use the INVLPG instruction to invalidate individual page-directory or page-table entries in the TLBs. ---- According to i386/locore.s, it seems that PTEs for kernel text, data, bss and symbols have PG_G bit, I worry that it is enough many to fill TLB slot out... > Regardless of my doubts above, I do have a problem with the patch... > It only works for the PPro/p2/p3 and not the p4. Is this intentional? > All have the CPUID_PGE bit. I think the test for cpu_id & 0x600 is > bogus and should be removed. Understood. Thanks for pointing it out. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 21 12: 1:30 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id E359437B40C for ; Tue, 21 Aug 2001 12:01:13 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.3) id f7LJNeR54813 for audit@FreeBSD.org; Tue, 21 Aug 2001 15:23:40 -0400 (EDT) (envelope-from mike) Date: Tue, 21 Aug 2001 15:23:39 -0400 From: Mike Barcroft To: audit@FreeBSD.org Subject: wc(1) warns patch Message-ID: <20010821152339.A54793@coffee.q9media.com> Mail-Followup-To: Mike Barcroft , audit@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: The FreeBSD Project Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I would appreciate comments on the following patch to wc(1). I would like to commit it shortly. Best regards, Mike Barcroft ---------------------------------------------------------------------- wc.20010821.patch o Quiet warnings on alpha o Constify, staticize, set WARNS=2 Index: wc/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/wc/Makefile,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile --- wc/Makefile 1994/05/27 12:33:28 1.1.1.1 +++ wc/Makefile 2001/08/20 03:47:24 @@ -1,5 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= wc +WARNS?= 2 .include Index: wc/wc.c =================================================================== RCS file: /home/ncvs/src/usr.bin/wc/wc.c,v retrieving revision 1.11 diff -u -r1.11 wc.c --- wc/wc.c 1999/08/28 01:07:34 1.11 +++ wc/wc.c 2001/08/20 03:47:24 @@ -58,11 +58,11 @@ #include #include -u_quad_t tlinect, twordct, tcharct; +unsigned long long tlinect, twordct, tcharct; int doline, doword, dochar; -int cnt __P((char *)); -void usage __P((void)); +static int cnt __P((const char *)); +static void usage __P((void)); int main(argc, argv) @@ -113,22 +113,22 @@ if (total > 1) { if (doline) - (void)printf(" %7qu", tlinect); + (void)printf(" %7llu", tlinect); if (doword) - (void)printf(" %7qu", twordct); + (void)printf(" %7llu", twordct); if (dochar) - (void)printf(" %7qu", tcharct); + (void)printf(" %7llu", tcharct); (void)printf(" total\n"); } exit(errors == 0 ? 0 : 1); } -int +static int cnt(file) - char *file; + const char *file; { struct stat sb; - u_quad_t linect, wordct, charct; + unsigned long long linect, wordct, charct; int fd, len; short gotsp; u_char *p; @@ -163,10 +163,10 @@ ++linect; } tlinect += linect; - (void)printf(" %7qu", linect); + (void)printf(" %7llu", linect); if (dochar) { tcharct += charct; - (void)printf(" %7qu", charct); + (void)printf(" %7llu", charct); } (void)close(fd); return (0); @@ -217,21 +217,21 @@ } if (doline) { tlinect += linect; - (void)printf(" %7qu", linect); + (void)printf(" %7llu", linect); } if (doword) { twordct += wordct; - (void)printf(" %7qu", wordct); + (void)printf(" %7llu", wordct); } if (dochar) { tcharct += charct; - (void)printf(" %7qu", charct); + (void)printf(" %7llu", charct); } (void)close(fd); return (0); } -void +static void usage() { (void)fprintf(stderr, "usage: wc [-clw] [file ...]\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Aug 21 22:55:59 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 74EDD37B40A; Tue, 21 Aug 2001 22:55:45 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id PAA20801; Wed, 22 Aug 2001 15:55:23 +1000 Date: Wed, 22 Aug 2001 15:55:18 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mitsuru IWASAKI Cc: , , , Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <20010822020634P.iwasaki@jp.FreeBSD.org> Message-ID: <20010822154635.P6058-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 22 Aug 2001, Mitsuru IWASAKI wrote: > Hi, thanks peter for your comments. > > The G bit does not "lock" the TLB entries in. All it does is stop > > unnecessary flushes when %cr3 is changed. If entries are not used > > for a short while, they will be recycled when the TLB slot is needed > > for something else soon enough. ie: this should not be a problem. > > My point is that users need higher system performance in multi-user > environment rather than in kernel bootstrap. Also PGE bit has effects > in multi-user environment where %cr3 is changed frequently. > I think enabling PGE in early stage of kernel bootstrap won't give us > performance advantages, entries which is used in bootstrap will remain > in the TLB as Intel's document says; > ---- > 3.7. TRANSLATION LOOKASIDE BUFFERS (TLBS) > [snip] > When the processor loads a page-directory or page-table entry for a > global page into a TLB, the entry will remain in the TLB indefinitely. ^^^^^^^^^^^^ > The only way to deterministically invalidate global page entries is to > clear the PGE flag and then invalidate the TLBs or to use the INVLPG > instruction to invalidate individual page-directory or page-table > entries in the TLBs. > ---- I think this just means that it is hard to say how long the entries remain in the TLB, not thatthey remain there forever. > According to i386/locore.s, it seems that PTEs for kernel text, data, > bss and symbols have PG_G bit, I worry that it is enough many to fill > TLB slot out... > > > Regardless of my doubts above, I do have a problem with the patch... > > It only works for the PPro/p2/p3 and not the p4. Is this intentional? > > All have the CPUID_PGE bit. I think the test for cpu_id & 0x600 is > > bogus and should be removed. Another thing I don't like about it: it uses a SYSINIT() so it obfuscates the initialization order. The problem fixed by the other half of your patch shows that it's hard enough to get the order right when the initializations are done inline. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 0:29:25 2001 Delivered-To: freebsd-audit@freebsd.org Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id E78C437B406; Wed, 22 Aug 2001 00:29:02 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.135.228.Dial1.SanJose1.Level3.net [209.245.135.228]) by snipe.mail.pas.earthlink.net (8.11.5/8.9.3) with ESMTP id f7M7Skh05589; Wed, 22 Aug 2001 00:28:46 -0700 (PDT) Message-ID: <3B835F58.68534CCE@mindspring.com> Date: Wed, 22 Aug 2001 00:29:28 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mitsuru IWASAKI Cc: peter@wemm.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit References: <20010809035801V.iwasaki@jp.FreeBSD.org> <20010817072149.0BCD63811@overcee.netplex.com.au> <20010822020634P.iwasaki@jp.FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mitsuru IWASAKI wrote: > > This part is fine. > > OK, I'll commit this one first. What does setting PGE early do for you? I use PGE to avoid TLB shootdown on a number of memory regions shared between user and kernel space (including zero system call time functions), but setting it early seems wrong. Specifically, the conceptual idea is to make a VM that looks exactly like real memory, with the smallest relocation code chunk possible, so that as much as possible can be done in C code, and there's as little strangeness as possible (e.g. the evil that is machdep.c, and the "magic" numbers in pmap.h that have to match exactly the magic address at which the kernel gets linked, and have to be offset exactly by the SMP pages and other "off by one" hidden values). > > However: > > > > > Also I have another thing to be confirmed. Should we utilize TLB by > > > enabling PGE bit at very later stage? I think it would be more > > > efficient to cache page entries with G flag in multi-user environment, > > > not in kernel bootstrap. If we enable PGE bit in locore.s, TLB could > > > be occupied by entries which is referenced by initialization code > > > (yes, most of them are executed only once). > > > # but I could be wrong... PGE might be useful for shared libraries. It's set on the kernel itself, which means that trapping to kernel mode does not end up costing unnecessary overhead. It's kind of ugly, when the 4M page is set on the kernel, which loses the page table page for the 4k pages (yuck), and it's not nice for the case where the kernel gets larger than 4M. From a practical point of view, the hassle of having to set and unset a bit in CR3 to cause the TLB shootdown to occur is not really worth setting the PGE bit so early that you do not have most of the PTE's set up. > > The G bit does not "lock" the TLB entries in. All it does is stop > > unnecessary flushes when %cr3 is changed. If entries are not used > > for a short while, they will be recycled when the TLB slot is needed > > for something else soon enough. ie: this should not be a problem. It also stops necessary ones, unless you bounce it off, hit CR3, and bounce it back on... that's the strange code around the 4M page enable code. > My point is that users need higher system performance in multi-user > environment rather than in kernel bootstrap. Also PGE bit has effects > in multi-user environment where %cr3 is changed frequently. > I think enabling PGE in early stage of kernel bootstrap won't give us > performance advantages, entries which is used in bootstrap will remain > in the TLB as Intel's document says; > ---- > 3.7. TRANSLATION LOOKASIDE BUFFERS (TLBS) > [snip] > When the processor loads a page-directory or page-table entry for a > global page into a TLB, the entry will remain in the TLB indefinitely. > The only way to deterministically invalidate global page entries is to > clear the PGE flag and then invalidate the TLBs or to use the INVLPG > instruction to invalidate individual page-directory or page-table > entries in the TLBs. > ---- The INVLPG doesn't work exactly like you think it should, with PGE on, on more recent processors, unfortunately. > According to i386/locore.s, it seems that PTEs for kernel text, data, > bss and symbols have PG_G bit, I worry that it is enough many to fill > TLB slot out... The kernel is in a 4M page in most cases, so it's not an issue in most cases. It's really very important that you not have to flush in the case of a kernel entry (interrupt, system call, etc.), since it _will_ make a protection domain crossing significantly more expensive. Also, note that the 4M pages are in a seperate 8 entry conflict domain, and aren't in the same 16 entry data or 16 entry instruction TLB's, on every processor where they are supported, so the kernel is not competing with user space code anyway. NB: 4M pages only make sense in certain specific limited situations... using up 4M chunks of KVA space is generally a bad idea, unless the objects you are using them for are really 4M or larger in size. This is particularly true on 4G machines, where you really don't have any sparseness to burn on unused pages, and can't afford to use the remainder space without the same mapping you used for the rest of it (e.g. for libc.so, a copy-on-write page that is also executable, unless you split the code and data across the page boundary). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 0:36:42 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id EB8C237B405; Wed, 22 Aug 2001 00:36:28 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f7M7aSM77733; Wed, 22 Aug 2001 00:36:28 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id B64AB38FD; Wed, 22 Aug 2001 00:36:28 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: tlambert2@mindspring.com Cc: Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <3B835F58.68534CCE@mindspring.com> Date: Wed, 22 Aug 2001 00:36:28 -0700 From: Peter Wemm Message-Id: <20010822073628.B64AB38FD@overcee.netplex.com.au> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > Mitsuru IWASAKI wrote: > > > This part is fine. > > > > OK, I'll commit this one first. > > What does setting PGE early do for you? The change is to avoid violating the rules in the CPU developers guide. Did you read the thread? Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "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-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1: 2:32 2001 Delivered-To: freebsd-audit@freebsd.org Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id DA48F37B403; Wed, 22 Aug 2001 01:02:25 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.135.228.Dial1.SanJose1.Level3.net [209.245.135.228]) by snipe.mail.pas.earthlink.net (8.11.5/8.9.3) with ESMTP id f7M82Kh04101; Wed, 22 Aug 2001 01:02:20 -0700 (PDT) Message-ID: <3B836737.9C15EA8@mindspring.com> Date: Wed, 22 Aug 2001 01:03:03 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Peter Wemm Cc: Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit References: <20010822073628.B64AB38FD@overcee.netplex.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Wemm wrote: > Terry Lambert wrote: > > Mitsuru IWASAKI wrote: > > > > This part is fine. > > > > > > OK, I'll commit this one first. > > > > What does setting PGE early do for you? > > The change is to avoid violating the rules in the CPU developers > guide. Did you read the thread? Yes. I still don't get what rules are being broken (no one quoted anything in comments inline in the code, citing the relevent pages in the guide, with a URL for the guide, for example). Let me ask again: what was broken before that is now fixed? To me, it seems that this will load the PGE bit enabled entries for the 4K pages into core exceptionally early, and that doing this will conflict with the later 4M page entry, which will end up having its own mapping (since 4M pages have their own, seperate table), and thus I will end up with two mappings for the same pages, neither of which can be easily invalidated on a P3 or P4 without toggling PGE off first, since they all have the PG_G bit set in them. I can tell you from personal experience on a Tyan Tiger with 1G of RAM and on a Super Micro with 4G of RAM that this can lead to very bad problems, unless you have enough entries being made in the KVA space to cause the invalidations to LRU out the pages... specifically, I saw some very interesting faults with mbufs, until I grew some kernel structures large enough to force the shootdown during the normal boot process, and it wasn't until later that I recognized the origin of the problem. It used to be that you could just reload CR3 with the same value to force an invalidation of pages without PG_G set with PGE enabled, or with PG_G set, without PGE enabled, but that's no longer true on newer systems, which will forego the invalidation if you are reloading the same value (for obvious performance reasons). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1:28: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 495DF37B40E; Wed, 22 Aug 2001 01:27:50 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f7M8RoM78007; Wed, 22 Aug 2001 01:27:50 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id ED86038FD; Wed, 22 Aug 2001 01:27:49 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: tlambert2@mindspring.com Cc: Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <3B836737.9C15EA8@mindspring.com> Date: Wed, 22 Aug 2001 01:27:49 -0700 From: Peter Wemm Message-Id: <20010822082749.ED86038FD@overcee.netplex.com.au> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > Peter Wemm wrote: > > Terry Lambert wrote: > > > Mitsuru IWASAKI wrote: > > > > > This part is fine. > > > > > > > > OK, I'll commit this one first. > > > > > > What does setting PGE early do for you? > > > > The change is to avoid violating the rules in the CPU developers > > guide. Did you read the thread? > > Yes. I still don't get what rules are being broken (no one > quoted anything in comments inline in the code, citing the > relevent pages in the guide, with a URL for the guide, for > example). > > Let me ask again: what was broken before that is now fixed? The very first article in the thread said: ======== According to developer's manual from Intel site, ftp://download.intel.com/design/PentiumII/manuals/24319202.pdf ---- 2.5. CONTROL REGISTERS [snip] PGE (2-17) Page Global Enable (bit 7 of CR4). (Introduced in the P6 family processors.) Enables the global page feature when set; disables the global page feature when clear. [snip] In addition, the bit must not ^^^^^^^^^^^^^^^^ be enabled before paging is enabled via CR0.PG. Program correctness ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ may be affected by reversing this sequence, and processor performance will be impacted. ---- Currently, we enable CR4.PGE bit in create_pagetables, then enable CR0.PG in locore.s. This seems to violate Intel's note. ====== This was in: Message-id: <20010809035801V.iwasaki@jp.FreeBSD.org> Subject: CFR: Timing to enable CR4.PGE bit From: Mitsuru IWASAKI Date: Thu, 09 Aug 2001 03:58:01 +0900 To: arch@FreeBSD.ORG Cc: audit@FreeBSD.ORG, kumabu@t3.rim.or.jp .. which is why I asked if you read the entire thread. I thought that quote was quite clear that we were in violation. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "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-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1:38:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from robin.mail.pas.earthlink.net (robin.mail.pas.earthlink.net [207.217.120.65]) by hub.freebsd.org (Postfix) with ESMTP id 46EC437B414 for ; Wed, 22 Aug 2001 01:38:45 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from blossom.cjclark.org (dialup-209.245.133.160.Dial1.SanJose1.Level3.net [209.245.133.160]) by robin.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id BAA04234 for ; Wed, 22 Aug 2001 01:38:43 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.4/8.11.3) id f7M8cfn76681 for freebsd-audit@freebsd.org; Wed, 22 Aug 2001 01:38:41 -0700 (PDT) (envelope-from cjc) Date: Wed, 22 Aug 2001 01:38:41 -0700 From: "Crist J. Clark" To: freebsd-audit@freebsd.org Subject: syslogd(8) Hostname Upgrade Message-ID: <20010822013841.A76483@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I brought this up as a PR (bin/24444) some months ago. I figured I'd finally close the PR and add this. This patch makes syslogd(8) update the hostname when the daemon is reinitialized. Before anyone points it out, this is not meant to be a security feature. It allows syslogd(8) to update the hostname without terminating and restarting the daemon and generates a message logging the change, nothing more, nothing less. I've been running with it for months on -CURRENT and -STABLE with no problems. Nit picks anyone? Index: syslogd.c =================================================================== RCS file: /export/ncvs/src/usr.sbin/syslogd/syslogd.c,v retrieving revision 1.81 diff -u -r1.81 syslogd.c --- syslogd.c 2001/08/20 13:24:39 1.81 +++ syslogd.c 2001/08/22 04:55:12 @@ -318,7 +318,7 @@ struct sockaddr_un sunx, fromunix; struct sockaddr_storage frominet; FILE *fp; - char *p, *hname, line[MAXLINE + 1]; + char *hname, line[MAXLINE + 1]; struct timeval tv, *tvp; struct sigaction sact; sigset_t mask; @@ -398,12 +398,6 @@ consfile.f_type = F_CONSOLE; (void)strcpy(consfile.f_un.f_fname, ctty + sizeof _PATH_DEV - 1); - (void)gethostname(LocalHostName, sizeof(LocalHostName)); - if ((p = strchr(LocalHostName, '.')) != NULL) { - *p++ = '\0'; - LocalDomain = p; - } else - LocalDomain = ""; (void)strcpy(bootfile, getbootfile()); (void)signal(SIGTERM, die); (void)signal(SIGINT, Debug ? die : SIG_IGN); @@ -1346,10 +1340,26 @@ char cline[LINE_MAX]; char prog[NAME_MAX+1]; char host[MAXHOSTNAMELEN]; + char oldLocalHostName[MAXHOSTNAMELEN]; + char hostMsg[2*MAXHOSTNAMELEN+40]; dprintf("init\n"); /* + * Load hostname (may have changed). + */ + if (signo) + (void)strlcpy(oldLocalHostName, LocalHostName, + sizeof(oldLocalHostName)); + if (gethostname(LocalHostName, sizeof(LocalHostName))) + err(EX_OSERR, "gethostname failed"); + if ((p = strchr(LocalHostName, '.')) != NULL) { + *p++ = '\0'; + LocalDomain = p; + } else + LocalDomain = ""; + + /* * Close all open log files. */ Initialized = 0; @@ -1498,6 +1508,16 @@ logmsg(LOG_SYSLOG|LOG_INFO, "syslogd: restart", LocalHostName, ADDDATE); dprintf("syslogd: restarted\n"); + /* + * Log a change in hostname, but only on a restart. + */ + if (signo && strcmp(oldLocalHostName, LocalHostName)) { + snprintf(hostMsg, sizeof(hostMsg), + "syslogd: hostname changed, \"%s\" to \"%s\"", + oldLocalHostName, LocalHostName); + logmsg(LOG_SYSLOG|LOG_INFO, hostMsg, LocalHostName, ADDDATE); + dprintf("%s\n", hostMsg); + } } /* -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1:44:26 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (dialmess.nanolink.com [217.75.135.246]) by hub.freebsd.org (Postfix) with SMTP id 23D4037B407 for ; Wed, 22 Aug 2001 01:44:20 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 8628 invoked by uid 1000); 22 Aug 2001 08:42:41 -0000 Date: Wed, 22 Aug 2001 11:42:41 +0300 From: Peter Pentchev To: cjclark@alum.mit.edu Cc: freebsd-audit@freebsd.org Subject: Re: syslogd(8) Hostname Upgrade Message-ID: <20010822114241.C8189@ringworld.oblivion.bg> Mail-Followup-To: cjclark@alum.mit.edu, freebsd-audit@freebsd.org References: <20010822013841.A76483@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010822013841.A76483@blossom.cjclark.org>; from cristjc@earthlink.net on Wed, Aug 22, 2001 at 01:38:41AM -0700 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 22, 2001 at 01:38:41AM -0700, Crist J. Clark wrote: > I brought this up as a PR (bin/24444) some months ago. I figured I'd > finally close the PR and add this. > > This patch makes syslogd(8) update the hostname when the daemon is > reinitialized. Before anyone points it out, this is not meant to be a > security feature. It allows syslogd(8) to update the hostname without > terminating and restarting the daemon and generates a message logging > the change, nothing more, nothing less. > > I've been running with it for months on -CURRENT and -STABLE with no > problems. Nit picks anyone? Just one, and not a major one at that :) [snip] > /* > + * Load hostname (may have changed). > + */ > + if (signo) > + (void)strlcpy(oldLocalHostName, LocalHostName, > + sizeof(oldLocalHostName)); Do you really need the (void) here? If you want to make lint and friends happy, you should put the (void) in a couple of other places, too - like snprintf(), logmsg(), dprintf().. IMHO, just drop it. G'luck, Peter -- Nostalgia ain't what it used to be. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1:49:15 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 82B5837B413; Wed, 22 Aug 2001 01:49:00 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f7M8n0M78097; Wed, 22 Aug 2001 01:49:00 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 4306738FD; Wed, 22 Aug 2001 01:49:00 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: tlambert2@mindspring.com Cc: Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <3B836737.9C15EA8@mindspring.com> Date: Wed, 22 Aug 2001 01:49:00 -0700 From: Peter Wemm Message-Id: <20010822084900.4306738FD@overcee.netplex.com.au> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: [the other part] > To me, it seems that this will load the PGE bit enabled > entries for the 4K pages into core exceptionally early, and > that doing this will conflict with the later 4M page entry, > which will end up having its own mapping (since 4M pages have > their own, seperate table), and thus I will end up with two > mappings for the same pages, neither of which can be easily > invalidated on a P3 or P4 without toggling PGE off first, > since they all have the PG_G bit set in them. While this is true, we do not change the wiring of the text+data+bss virtual -> physical pages that are double-mapped when we round up to the 4MB boundary. (see pmap_choose_addr() for the roundup) While they should never conflict and are never changed, I could imagine that having 4K and 4MB tlb's matching on the same virtual address could possibly cause some odd behavior, I'm a little doubtful. I would have expected it to turn up on other cpu brands (eg: athlon, transmeta etc) by now. > I can tell you from personal experience on a Tyan Tiger > with 1G of RAM and on a Super Micro with 4G of RAM that > this can lead to very bad problems, unless you have enough > entries being made in the KVA space to cause the invalidations > to LRU out the pages... specifically, I saw some very > interesting faults with mbufs, until I grew some kernel > structures large enough to force the shootdown during the > normal boot process, and it wasn't until later that I > recognized the origin of the problem. It would be cleaner to make a decision once in pmap_bootstrap() that went through and flipped PG_G on either the the 4MB page or the underlying 4K pages. That way there would be no possible overlapping PG_G tlb entries. > It used to be that you could just reload CR3 with the same > value to force an invalidation of pages without PG_G set > with PGE enabled, or with PG_G set, without PGE enabled, > but that's no longer true on newer systems, which will > forego the invalidation if you are reloading the same value > (for obvious performance reasons). I dont think we did this anyway. Once set, PG_G and PGE stayed set forever. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "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-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1:50:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 57E5B37B401 for ; Wed, 22 Aug 2001 01:50:44 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f7M8oOL24892; Wed, 22 Aug 2001 11:50:24 +0300 (EEST) (envelope-from ru) Date: Wed, 22 Aug 2001 11:50:24 +0300 From: Ruslan Ermilov To: cjclark@alum.mit.edu Cc: freebsd-audit@FreeBSD.ORG Subject: Re: syslogd(8) Hostname Upgrade Message-ID: <20010822115024.A23430@sunbay.com> References: <20010822013841.A76483@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010822013841.A76483@blossom.cjclark.org>; from cristjc@earthlink.net on Wed, Aug 22, 2001 at 01:38:41AM -0700 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 22, 2001 at 01:38:41AM -0700, Crist J. Clark wrote: [...] > + if (gethostname(LocalHostName, sizeof(LocalHostName))) Check explicitly against -1. > + err(EX_OSERR, "gethostname failed"); Add "()" after "gethostname". > + if (signo && strcmp(oldLocalHostName, LocalHostName)) { I'm always confused when seeing this. IMHO, ``strcmp(...) != 0'' is much better. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 1:58:59 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harrier.mail.pas.earthlink.net (harrier.mail.pas.earthlink.net [207.217.121.12]) by hub.freebsd.org (Postfix) with ESMTP id C4C6937B406; Wed, 22 Aug 2001 01:58:47 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.135.228.Dial1.SanJose1.Level3.net [209.245.135.228]) by harrier.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id BAA23034; Wed, 22 Aug 2001 01:57:18 -0700 (PDT) Message-ID: <3B837418.2D5529E5@mindspring.com> Date: Wed, 22 Aug 2001 01:58:00 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Peter Wemm Cc: Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit References: <20010822082749.ED86038FD@overcee.netplex.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Wemm wrote: > Page Global Enable (bit 7 of CR4). (Introduced in the P6 family > processors.) Enables the global page feature when set; disables the > global page feature when clear. [snip] In addition, the bit must not > ^^^^^^^^^^^^^^^^ > be enabled before paging is enabled via CR0.PG. Program correctness > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > may be affected by reversing this sequence, and processor performance > will be impacted. > ---- > > Currently, we enable CR4.PGE bit in create_pagetables, then enable > CR0.PG in locore.s. This seems to violate Intel's note. Ah. It looked like an inverted patch to me... it moved the code from line 725 or so in locore.s to line 375. I think moving this to _much_ later would not be a bad idea, since the only effect will be that the PG_G bit is ignored until it's actually enabled, right? FWIW: The message you quoted was from a cross-post from -audit to -arch, which I guess originally came from -audit? So the answer is "no, I didn't see the whole thread", and I only became interested enough to read it when I saw the assemply patch fly by on -arch. So since it's moving the enable to much later in the process (but earlier in the file -- in the old days, we used to program in order 8-)), I definitely don't object, unless I can talk you guys into delaying it until the 4M page for the kernel is being enabled... > .. which is why I asked if you read the entire thread. I thought that > quote was quite clear that we were in violation. I don't subscribe to audit, and the quoted stuff didn't look that important, so I didn't see it until now... sorry. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 2: 6:11 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (dialmess.nanolink.com [217.75.135.246]) by hub.freebsd.org (Postfix) with SMTP id 2BD1F37B401 for ; Wed, 22 Aug 2001 02:05:43 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 9040 invoked by uid 1000); 22 Aug 2001 09:04:02 -0000 Date: Wed, 22 Aug 2001 12:04:02 +0300 From: Peter Pentchev To: Terry Lambert Cc: Peter Wemm , Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit Message-ID: <20010822120402.A8694@ringworld.oblivion.bg> Mail-Followup-To: Terry Lambert , Peter Wemm , Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp References: <20010822082749.ED86038FD@overcee.netplex.com.au> <3B837418.2D5529E5@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B837418.2D5529E5@mindspring.com>; from tlambert2@mindspring.com on Wed, Aug 22, 2001 at 01:58:00AM -0700 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 22, 2001 at 01:58:00AM -0700, Terry Lambert wrote: > Peter Wemm wrote: > > Page Global Enable (bit 7 of CR4). (Introduced in the P6 family > > processors.) Enables the global page feature when set; disables the > > global page feature when clear. [snip] In addition, the bit must not > > ^^^^^^^^^^^^^^^^ > > be enabled before paging is enabled via CR0.PG. Program correctness > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > may be affected by reversing this sequence, and processor performance > > will be impacted. > > ---- > > > > Currently, we enable CR4.PGE bit in create_pagetables, then enable > > CR0.PG in locore.s. This seems to violate Intel's note. > > Ah. It looked like an inverted patch to me... it moved the > code from line 725 or so in locore.s to line 375. > > I think moving this to _much_ later would not be a bad idea, > since the only effect will be that the PG_G bit is ignored > until it's actually enabled, right? > > FWIW: The message you quoted was from a cross-post from -audit > to -arch, which I guess originally came from -audit? So the > answer is "no, I didn't see the whole thread", and I only > became interested enough to read it when I saw the assemply > patch fly by on -arch. The message he quoted was the original message in the thread, addressed to *both* -arch and -audit. Here are the relevant headers: To: arch@FreeBSD.ORG Cc: audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: CFR: Timing to enable CR4.PGE bit Date: Thu, 09 Aug 2001 03:58:01 +0900 From: Mitsuru IWASAKI G'luck, Peter -- No language can express every thought unambiguously, least of all this one. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 2:15:59 2001 Delivered-To: freebsd-audit@freebsd.org Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id AEC7A37B403; Wed, 22 Aug 2001 02:15:53 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from blossom.cjclark.org (dialup-209.245.133.160.Dial1.SanJose1.Level3.net [209.245.133.160]) by falcon.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id CAA10809; Wed, 22 Aug 2001 02:15:51 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.4/8.11.3) id f7M9FoK76940; Wed, 22 Aug 2001 02:15:50 -0700 (PDT) (envelope-from cjc) Date: Wed, 22 Aug 2001 02:15:50 -0700 From: "Crist J. Clark" To: Ruslan Ermilov Cc: freebsd-audit@FreeBSD.ORG Subject: Re: syslogd(8) Hostname Upgrade Message-ID: <20010822021550.L313@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <20010822013841.A76483@blossom.cjclark.org> <20010822115024.A23430@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010822115024.A23430@sunbay.com>; from ru@FreeBSD.ORG on Wed, Aug 22, 2001 at 11:50:24AM +0300 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 22, 2001 at 11:50:24AM +0300, Ruslan Ermilov wrote: > On Wed, Aug 22, 2001 at 01:38:41AM -0700, Crist J. Clark wrote: > [...] > > + if (gethostname(LocalHostName, sizeof(LocalHostName))) > > Check explicitly against -1. Since, gethostname(3) says, RETURN VALUES If the call succeeds a value of 0 is returned. I figured the safest way was to verify that the return value was zero rather than look for a specific failure mode (of course, -1 is listed as the only one). > > + err(EX_OSERR, "gethostname failed"); > > Add "()" after "gethostname". 'K. > > + if (signo && strcmp(oldLocalHostName, LocalHostName)) { > > I'm always confused when seeing this. IMHO, ``strcmp(...) != 0'' > is much better. I had done it that way because earlier lines wrapped in un-pretty ways. But I personally prefer, if (signo != 0 && strcmp(oldLocalHostName, LocalHostName) != 0) { For clarity too (and IIRC K&R recommend that style ;), and it fits on one line. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 2:19: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from robin.mail.pas.earthlink.net (robin.mail.pas.earthlink.net [207.217.120.65]) by hub.freebsd.org (Postfix) with ESMTP id 6017137B40F for ; Wed, 22 Aug 2001 02:18:55 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from blossom.cjclark.org (dialup-209.245.133.160.Dial1.SanJose1.Level3.net [209.245.133.160]) by robin.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id CAA24059; Wed, 22 Aug 2001 02:18:52 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.4/8.11.3) id f7M9Iml76954; Wed, 22 Aug 2001 02:18:48 -0700 (PDT) (envelope-from cjc) Date: Wed, 22 Aug 2001 02:18:48 -0700 From: "Crist J. Clark" To: Peter Pentchev Cc: freebsd-audit@FreeBSD.ORG Subject: Re: syslogd(8) Hostname Upgrade Message-ID: <20010822021848.M313@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <20010822013841.A76483@blossom.cjclark.org> <20010822114241.C8189@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010822114241.C8189@ringworld.oblivion.bg>; from roam@ringlet.net on Wed, Aug 22, 2001 at 11:42:41AM +0300 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 22, 2001 at 11:42:41AM +0300, Peter Pentchev wrote: > On Wed, Aug 22, 2001 at 01:38:41AM -0700, Crist J. Clark wrote: > > I brought this up as a PR (bin/24444) some months ago. I figured I'd > > finally close the PR and add this. > > > > This patch makes syslogd(8) update the hostname when the daemon is > > reinitialized. Before anyone points it out, this is not meant to be a > > security feature. It allows syslogd(8) to update the hostname without > > terminating and restarting the daemon and generates a message logging > > the change, nothing more, nothing less. > > > > I've been running with it for months on -CURRENT and -STABLE with no > > problems. Nit picks anyone? > > Just one, and not a major one at that :) > > [snip] > > /* > > + * Load hostname (may have changed). > > + */ > > + if (signo) > > + (void)strlcpy(oldLocalHostName, LocalHostName, > > + sizeof(oldLocalHostName)); > > Do you really need the (void) here? If you want to make lint and friends > happy, you should put the (void) in a couple of other places, too - like > snprintf(), logmsg(), dprintf().. IMHO, just drop it. No, don't _need_ it. I'll add one to snprintf(3), good catch. However, logmsg() is already a void and dprintf is a macro. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 2:23: 7 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id E706837B407; Wed, 22 Aug 2001 02:22:56 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f7M9MuM78491; Wed, 22 Aug 2001 02:22:56 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 9D3F73905; Wed, 22 Aug 2001 02:22:56 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: tlambert2@mindspring.com Cc: Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <3B837418.2D5529E5@mindspring.com> Date: Wed, 22 Aug 2001 02:22:56 -0700 From: Peter Wemm Message-Id: <20010822092256.9D3F73905@overcee.netplex.com.au> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > FWIW: The message you quoted was from a cross-post from -audit > to -arch, which I guess originally came from -audit? So the > answer is "no, I didn't see the whole thread", and I only > became interested enough to read it when I saw the assemply > patch fly by on -arch. No, it was To: arch, cc: audit. It was just about a week ago. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "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-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 2:53:34 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.121.85]) by hub.freebsd.org (Postfix) with ESMTP id 7DB5237B40A; Wed, 22 Aug 2001 02:53:29 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.245.135.228.Dial1.SanJose1.Level3.net [209.245.135.228]) by gull.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id CAA22320; Wed, 22 Aug 2001 02:51:57 -0700 (PDT) Message-ID: <3B8380E6.E4FC07B3@mindspring.com> Date: Wed, 22 Aug 2001 02:52:38 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Peter Pentchev Cc: Peter Wemm , Mitsuru IWASAKI , arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit References: <20010822082749.ED86038FD@overcee.netplex.com.au> <3B837418.2D5529E5@mindspring.com> <20010822120402.A8694@ringworld.oblivion.bg> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Pentchev wrote: > > FWIW: The message you quoted was from a cross-post from -audit > > to -arch, which I guess originally came from -audit? So the > > answer is "no, I didn't see the whole thread", and I only > > became interested enough to read it when I saw the assemply > > patch fly by on -arch. > > The message he quoted was the original message in the thread, > addressed to *both* -arch and -audit. Here are the relevant > headers: > > To: arch@FreeBSD.ORG > Cc: audit@FreeBSD.ORG, kumabu@t3.rim.or.jp > Subject: CFR: Timing to enable CR4.PGE bit > Date: Thu, 09 Aug 2001 03:58:01 +0900 > From: Mitsuru IWASAKI Sorry; it did not arrive here that way: it did not arrive here at all. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 7:24:57 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 1AD6037B425; Wed, 22 Aug 2001 07:24:48 -0700 (PDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.5/8.11.5) with SMTP id f7MEOj266577; Wed, 22 Aug 2001 10:24:45 -0400 (EDT) (envelope-from arr@watson.org) Date: Wed, 22 Aug 2001 10:24:44 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@FreeBSD.org Cc: freebsd-security@FreeBSD.org Subject: setlogincontext() modifications. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I plan on doing some patches for adding setlogincontext() calls to: libexec/: atrun/atrun.c ftpd/ftpd.c rshd/rshd.c uucpd/uucpd.c as an initial step towards seeing how people react. If people can perhaps recommend a couple more from other parts of the tree that I could write patches for, that would be great. I ask this so that I can perhaps get a bit more of a reaction from some people as this type of patch will effect some network daemons etc... Thanks, Andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 7:39:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 5C15437B40E; Wed, 22 Aug 2001 07:39:36 -0700 (PDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.5/8.11.5) with SMTP id f7MEdYh66692; Wed, 22 Aug 2001 10:39:34 -0400 (EDT) (envelope-from arr@watson.org) Date: Wed, 22 Aug 2001 10:39:33 -0400 (EDT) From: "Andrew R. Reiter" To: freebsd-audit@FreeBSD.ORG Cc: freebsd-security@FreeBSD.ORG Subject: Re: setlogincontext() modifications. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG As a quick follow-up :-) I wonder if at the same time, I should work on auth_* patches as well? Thoughts? On Wed, 22 Aug 2001, Andrew R. Reiter wrote: :Hi, : :I plan on doing some patches for adding setlogincontext() calls to: : :libexec/: : atrun/atrun.c : ftpd/ftpd.c : rshd/rshd.c : uucpd/uucpd.c : :as an initial step towards seeing how people react. If people can perhaps :recommend a couple more from other parts of the tree that I could write :patches for, that would be great. I ask this so that I can perhaps get a :bit more of a reaction from some people as this type of patch will effect :some network daemons etc... : :Thanks, : :Andrew : :*-------------................................................. :| Andrew R. Reiter :| arr@fledge.watson.org :| "It requires a very unusual mind :| to undertake the analysis of the obvious" -- A.N. Whitehead : : :To Unsubscribe: send mail to majordomo@FreeBSD.org :with "unsubscribe freebsd-audit" in the body of the message : *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 9:41: 2 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id E164D37B41A; Wed, 22 Aug 2001 09:40:49 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare/smtpfeed 1.12) with ESMTP/inet id f7MGeRI50789; Thu, 23 Aug 2001 01:40:27 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: tlambert2@mindspring.com Cc: peter@wemm.org, iwasaki@jp.FreeBSD.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <3B837418.2D5529E5@mindspring.com> References: <20010822082749.ED86038FD@overcee.netplex.com.au> <3B837418.2D5529E5@mindspring.com> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010823014025T.iwasaki@jp.FreeBSD.org> Date: Thu, 23 Aug 2001 01:40:25 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 35 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, thanks folks for comments and sorry for my late reply. Terry Lambert wrote: > Peter Wemm wrote: > > Page Global Enable (bit 7 of CR4). (Introduced in the P6 family > > processors.) Enables the global page feature when set; disables the > > global page feature when clear. [snip] In addition, the bit must not > > ^^^^^^^^^^^^^^^^ > > be enabled before paging is enabled via CR0.PG. Program correctness > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > may be affected by reversing this sequence, and processor performance > > will be impacted. > > ---- > > > > Currently, we enable CR4.PGE bit in create_pagetables, then enable > > CR0.PG in locore.s. This seems to violate Intel's note. > > Ah. It looked like an inverted patch to me... it moved the > code from line 725 or so in locore.s to line 375. I've just committed only part of moving CR4.PGE enabling code after paging is enabled. It was my primary goal to avoid violating the rules in the CPU developer's manual. Thanks folks! Another part of my original post was just for my curiosity, it's not so important. I thought it would be valuable to be considered if we can get better performance by moving CR4.PGE bit on to later stage without a lot of efforts. But I'm not sure how effective it is. There may be hardly effect. Does anyone test and measure it under suitable environment? If we get good result by this without any problems, then we can consider this issue again (including how to fire PGE enabling code as Bruce suggested), I think. Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Wed Aug 22 9:55: 2 2001 Delivered-To: freebsd-audit@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id BF85A37B43B; Wed, 22 Aug 2001 09:54:17 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare/smtpfeed 1.12) with ESMTP/inet id f7MGsEI53226; Thu, 23 Aug 2001 01:54:14 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: bde@zeta.org.au Cc: iwasaki@jp.FreeBSD.org, peter@wemm.org, arch@FreeBSD.ORG, audit@FreeBSD.ORG, kumabu@t3.rim.or.jp Subject: Re: CFR: Timing to enable CR4.PGE bit In-Reply-To: <20010822154635.P6058-100000@besplex.bde.org> References: <20010822020634P.iwasaki@jp.FreeBSD.org> <20010822154635.P6058-100000@besplex.bde.org> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010823015412F.iwasaki@jp.FreeBSD.org> Date: Thu, 23 Aug 2001 01:54:12 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 21 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, > > 3.7. TRANSLATION LOOKASIDE BUFFERS (TLBS) > > [snip] > > When the processor loads a page-directory or page-table entry for a > > global page into a TLB, the entry will remain in the TLB indefinitely. > ^^^^^^^^^^^^ > > The only way to deterministically invalidate global page entries is to > > clear the PGE flag and then invalidate the TLBs or to use the INVLPG > > instruction to invalidate individual page-directory or page-table > > entries in the TLBs. > > ---- > > I think this just means that it is hard to say how long the entries remain > in the TLB, not thatthey remain there forever. Ah, understood. Japanese version of this document said it's something like `forever' in Japanese translation for this meaning :-) This is why I worried about this too much. Sorry about that. Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Aug 24 4:26:37 2001 Delivered-To: freebsd-audit@freebsd.org Received: from cip1.melaten.rwth-aachen.de (cip1.melaten.RWTH-Aachen.DE [134.130.92.100]) by hub.freebsd.org (Postfix) with ESMTP id 3849737B408 for ; Fri, 24 Aug 2001 04:26:09 -0700 (PDT) (envelope-from tg@melaten.rwth-aachen.de) Received: from cip12.melaten.rwth-aachen.de (cip12.melaten.RWTH-Aachen.DE [134.130.92.12]) by cip1.melaten.rwth-aachen.de (8.11.5/8.11.1) with ESMTP id f7OBTgU50601 for ; Fri, 24 Aug 2001 13:29:42 +0200 (CEST) (envelope-from tg@melaten.rwth-aachen.de) Received: (from tg@localhost) by cip12.melaten.rwth-aachen.de (8.11.3/8.9.3) id f7OBR0w30403; Fri, 24 Aug 2001 13:27:00 +0200 (CEST) (envelope-from tg@melaten.rwth-aachen.de) X-Authentication-Warning: cip12.melaten.rwth-aachen.de: tg set sender to tg@melaten.rwth-aachen.de using -f To: freebsd-audit@FreeBSD.org Subject: RFC: statvfs(3) From: Thomas Gellekum Date: 24 Aug 2001 13:26:59 +0200 Message-ID: Lines: 18 User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Moin, here's a simple implementation of statvfs(3), which is mandated by SUSV2. I'd welcome suggestions on how to deal with the f_namemax member of struct statvfs. Currently the functions return PATH_MAX for it, but this is probably wrong for some filesystem types. We could convert one of the f_spare* members in struct statfs (I'd prefer 'long f_spare[2]' -> 'long f_namemax; long f_spare') and define a _PATH_MAX (in ?) to initialize that for every filesystem type. Comments? tg --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=statvfs.diff Index: lib/libc/gen/Makefile.inc =================================================================== RCS file: /usr/cvs/src/lib/libc/gen/Makefile.inc,v retrieving revision 1.80 diff -u -r1.80 Makefile.inc --- lib/libc/gen/Makefile.inc 2001/08/17 22:09:15 1.80 +++ lib/libc/gen/Makefile.inc 2001/08/22 19:03:57 @@ -25,7 +25,7 @@ setdomainname.c sethostname.c setjmperr.c setmode.c setprogname.c \ setproctitle.c \ shmat.c shmctl.c shmdt.c shmget.c siginterrupt.c siglist.c signal.c \ - sigsetops.c sleep.c srand48.c stringlist.c strtofflags.c \ + sigsetops.c sleep.c srand48.c statvfs.c stringlist.c strtofflags.c \ sysconf.c sysctl.c sysctlbyname.c sysctlnametomib.c \ syslog.c telldir.c termios.c time.c times.c timezone.c ttyname.c \ ttyslot.c ualarm.c uname.c unvis.c usleep.c utime.c valloc.c vis.c \ @@ -53,7 +53,7 @@ nice.3 nlist.3 pause.3 popen.3 psignal.3 pwcache.3 \ raise.3 rand48.3 rfork_thread.3 \ scandir.3 setjmp.3 setmode.3 setproctitle.3 shm_open.3 \ - siginterrupt.3 signal.3 sigsetops.3 sleep.3 stringlist.3 \ + siginterrupt.3 signal.3 sigsetops.3 sleep.3 statvfs.3 stringlist.3 \ strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 \ tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 timezone.3 \ ttyname.3 tzset.3 ualarm.3 uname.3 unvis.3 usleep.3 utime.3 \ @@ -115,6 +115,7 @@ MLINKS+=sigsetops.3 sigaddset.3 sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 sigsetops.3 sigfillset.3 \ sigsetops.3 sigismember.3 +MLINKS+=statvfs.3 fstatvfs.3 MLINKS+=stringlist.3 sl_add.3 stringlist.3 sl_find.3 \ stringlist.3 sl_free.3 stringlist.3 sl_init.3 MLINKS+=sysctl.3 sysctlbyname.3 sysctl.3 sysctlnametomib.3 --- /dev/null Fri Aug 24 07:51:38 2001 +++ lib/libc/gen/statvfs.3 Mon Aug 20 09:00:06 2001 @@ -0,0 +1,152 @@ +.\" Copyright (c) 2001 +.\" The FreeBSD Project, Inc. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY The FreeBSD Project, Inc. AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL The FreeBSD Project, Inc. OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 19, 2001 +.Dt STATVFS 3 +.Os +.Sh NAME +.Nm statvfs +.Nd get file system statistics +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fn statvfs "const char *path" "struct statvfs *buf" +.Ft int +.Fn fstatvfs "int fd" "struct statvfs *buf" +.Sh DESCRIPTION +.Fn Statvfs +returns information about a mounted file system. +.Fa Path +is the path name of any file within the mounted filesystem. +.Fa Buf +is a pointer to a +.Fn statvfs +structure defined as follows: +.Bd -literal +typedef u_int32_t fsblkcnt_t; /* file system block count */ +typedef u_int32_t fsfilcnt_t; /* file system file count */ + +struct statvfs { +unsigned long f_bsize; /* file system block size */ +unsigned long f_frsize; /* fundamental file system + block size */ +fsblkcnt_t f_blocks; /* total number of blocks on file + system in units of f_frsize */ +fsblkcnt_t f_bfree; /* total number of free blocks */ +fsblkcnt_t f_bavail; /* number of free blocks available to + non-privileged process */ +fsfilcnt_t f_files; /* total number of file + serial numbers */ +fsfilcnt_t f_ffree; /* total number of free file + serial numbers */ +fsfilcnt_t f_favail; /* number of file serial numbers + available to non-privileged + process */ +unsigned long f_fsid; /* file system id */ +unsigned long f_flag; /* bit mask of f_flag values */ +unsigned long f_namemax; /* maximum filename length */ +}; +.Ed +The flags that may be returned include: +.Bl -tag -width ST_RDONLY +.It Dv ST_RDONLY +The filesystem is mounted read-only; +Even the super-user may not write on it. +.It Dv ST_NOSUID +Setuid and setgid bits on files are not honored when they are executed. +.El +.Pp +Fields that are undefined for a particular file system are set to -1. +.Fn Fstatvfs +returns the same information about an open file referenced by descriptor +.Fa fd . +.Sh RETURN VALUES +Upon successful completion, a value of 0 is returned. +Otherwise, -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Fn Statvfs +fails if one or more of the following are true: +.Bl -tag -width Er +.It Bq Er ENOTDIR +A component of the path prefix of +.Fa Path +is not a directory. +.It Bq Er ENAMETOOLONG +The length of a component of +.Fa path +exceeds 255 characters, +or the length of +.Fa path +exceeds 1023 characters. +.It Bq Er ENOENT +The file referred to by +.Fa path +does not exist. +.It Bq Er EACCES +Search permission is denied for a component of the path prefix of +.Fa path . +.It Bq Er ELOOP +Too many symbolic links were encountered in translating +.Fa path . +.It Bq Er EFAULT +.Fa Buf +or +.Fa path +points to an invalid address. +.It Bq Er EIO +An +.Tn I/O +error occurred while reading from or writing to the file system. +.El +.Pp +.Fn Fstatvfs +fails if one or more of the following are true: +.Bl -tag -width Er +.It Bq Er EBADF +.Fa fd +is not a valid open file descriptor. +.It Bq Er EFAULT +.Fa Buf +points to an invalid address. +.It Bq Er EIO +An +.Tn I/O +error occurred while reading from or writing to the file system. +.El +.Sh SEE ALSO +.Xr fstatfs 2 , +.Xr statfs 2 +.Sh BUGS +The +.Fa f_namemax +member will always return +.Dv PATH_MAX +for now. --- /dev/null Fri Aug 24 07:51:38 2001 +++ lib/libc/gen/statvfs.c Mon Aug 20 10:57:05 2001 @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2001 The FreeBSD Project, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY The FreeBSD Project, Inc. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL The FreeBSD Project, Inc. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +/* + * fstatvfs -- + * get information about the file system containing the file referenced + * by 'filedes'. + * + * Currently, there does not seem to be a way to find out about the + * maximum file length for a particular file system type, so we simply + * return 'PATH_MAX'. + */ +int +fstatvfs(int filedes, struct statvfs *buf) +{ + struct statfs st; + + if (buf == NULL) { + errno = EFAULT; + return -1; + } + + if (fstatfs(filedes, &st) == -1) + return -1; + + buf->f_bsize = (unsigned long)st.f_iosize; + buf->f_frsize = (unsigned long)st.f_bsize; + buf->f_blocks = (fsblkcnt_t)st.f_blocks; + buf->f_bfree = (fsblkcnt_t)st.f_bfree; + buf->f_bavail = (fsblkcnt_t)st.f_bavail; + buf->f_files = (fsfilcnt_t)st.f_files; + buf->f_ffree = (fsfilcnt_t)st.f_ffree; + buf->f_favail = (fsfilcnt_t)st.f_ffree; + buf->f_fsid = (unsigned long)st.f_fsid.val[0]; + buf->f_flag = (unsigned long)st.f_flags; + buf->f_namemax = PATH_MAX; /* XXX */ + + return 0; +} + +/* + * statvfs -- + * get information about the file system containing the file named by + * 'path'. + * + * Currently, there does not seem to be a way to find out about the + * maximum file length for a particular file system type, so we simply + * return 'PATH_MAX'. + */ +int +statvfs(const char *path, struct statvfs *buf) +{ + struct statfs st; + + if (buf == NULL) { + errno = EFAULT; + return -1; + } + + if (statfs(path, &st) == -1) + return -1; + + buf->f_bsize = (unsigned long)st.f_iosize; + buf->f_frsize = (unsigned long)st.f_bsize; + buf->f_blocks = (fsblkcnt_t)st.f_blocks; + buf->f_bfree = (fsblkcnt_t)st.f_bfree; + buf->f_bavail = (fsblkcnt_t)st.f_bavail; + buf->f_files = (fsfilcnt_t)st.f_files; + buf->f_ffree = (fsfilcnt_t)st.f_ffree; + buf->f_favail = (fsfilcnt_t)st.f_ffree; + buf->f_fsid = (unsigned long)st.f_fsid.val[0]; + buf->f_flag = (unsigned long)st.f_flags; + buf->f_namemax = PATH_MAX; /* XXX */ + + return 0; +} Index: sys/sys/types.h =================================================================== RCS file: /usr/cvs/src/sys/sys/types.h,v retrieving revision 1.44 diff -u -r1.44 types.h --- sys/sys/types.h 2001/07/16 00:55:26 1.44 +++ sys/sys/types.h 2001/08/19 15:25:23 @@ -72,6 +72,8 @@ typedef int32_t daddr_t; /* disk address */ typedef u_int32_t u_daddr_t; /* unsigned disk address */ typedef u_int32_t fixpt_t; /* fixed point number */ +typedef u_int32_t fsblkcnt_t; /* file system block count */ +typedef u_int32_t fsfilcnt_t; /* file system file count */ typedef u_int32_t gid_t; /* group id */ typedef u_int32_t in_addr_t; /* base type for internet address */ typedef u_int16_t in_port_t; --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Sat Aug 25 13:16:23 2001 Delivered-To: freebsd-audit@freebsd.org Received: from leviathan.inethouston.net (leviathan.inethouston.net [66.64.12.249]) by hub.freebsd.org (Postfix) with ESMTP id 649F137B406; Sat, 25 Aug 2001 13:16:12 -0700 (PDT) (envelope-from dwcjr@inethouston.net) Received: by leviathan.inethouston.net (Postfix, from userid 1001) id 9D1E310F431; Sat, 25 Aug 2001 15:16:15 -0500 (CDT) Date: Sat, 25 Aug 2001 15:16:15 -0500 From: "David W. Chapman Jr." To: current@freebsd.org, audit@freebsd.org Cc: obrien@freebsd.org Subject: ports diskcheckd patch Message-ID: <20010825151615.K53260@leviathan.inethouston.net> Reply-To: "David W. Chapman Jr." Mail-Followup-To: current@freebsd.org, audit@freebsd.org, obrien@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline User-Agent: Mutt/1.3.21i X-Operating-System: FreeBSD 4.3-STABLE i386 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline After the repo copy of the diskcheckd.conf gets done this patch should be the last one I need to make ports/sysutils/diskcheckd to work properly. Any comments/problems would be appreciated. I would especially appreciate some patches to pkg-descr for a more detailed description if possible. Thanks. -- David W. Chapman Jr. dwcjr@inethouston.net Raintree Network Services, Inc. dwcjr@freebsd.org FreeBSD Committer --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diskcheckd.patch" Index: Makefile =================================================================== RCS file: /home/ncvs/ports/sysutils/diskcheckd/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- Makefile 2001/08/24 14:33:09 1.1 +++ Makefile 2001/08/25 20:13:23 @@ -20,12 +20,21 @@ NO_WRKSUBDIR= yes +CFLAGS+= -D_PATH_CONF='\"${PREFIX}/etc\"' + + +.include + +.if ${OSVERSION} < 500000 +BROKEN= "Only runs on 5.0 or higher (-current)" +.endif + do-extract: @${MKDIR} ${WRKSRC} @(cd ${FILESDIR} && pax -r -w * ${WRKSRC}) -do-build: - cd ${WRKSRC} && ${CC} ${CFLAGS} -DCONFPATH=\"${PREFIX}/etc\" -o diskcheckd diskcheckd.c +do-patch: + @${PERL} -pi.fbsd -e 's|/usr/sbin|${PREFIX}/sbin|g' ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/diskcheckd ${PREFIX}/sbin @@ -33,4 +42,4 @@ ${INSTALL_SCRIPT} ${WRKSRC}/diskcheckd.sh ${PREFIX}/etc/rc.d ${INSTALL_MAN} ${WRKSRC}/diskcheckd.8 ${PREFIX}/man/man8 -.include +.include Index: files/diskcheckd.c =================================================================== RCS file: /home/ncvs/ports/sysutils/diskcheckd/files/diskcheckd.c,v retrieving revision 1.4 diff -u -r1.4 diskcheckd.c --- files/diskcheckd.c 2001/08/20 15:09:33 1.4 +++ files/diskcheckd.c 2001/08/25 20:13:23 @@ -47,7 +47,10 @@ #define DKTYPENAMES #include -#define _PATH_CONF "/etc/diskcheckd.conf" +#ifndef _PATH_CONF +#define _PATH_CONF "/usr/local/etc/diskcheckd.conf" +#endif + #define _PATH_SAVE _PATH_VARDB"diskcheckd.offsets" #define READ_SIZE (64 << 10) --TRYliJ5NKNqkz5bu-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message