From owner-p4-projects Sun Sep 15 19:42: 1 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B64937B401; Sun, 15 Sep 2002 19:41:37 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD69C37B400 for ; Sun, 15 Sep 2002 19:41:36 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D96A943E65 for ; Sun, 15 Sep 2002 19:41:35 -0700 (PDT) (envelope-from julian@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g8G2fZJU002943 for ; Sun, 15 Sep 2002 19:41:35 -0700 (PDT) (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g8G2fVkK002878 for perforce@freebsd.org; Sun, 15 Sep 2002 19:41:31 -0700 (PDT) Date: Sun, 15 Sep 2002 19:41:31 -0700 (PDT) Message-Id: <200209160241.g8G2fVkK002878@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer Subject: PERFORCE change 17550 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17550 Change 17550 by julian@julian_jules1 on 2002/09/15 19:41:24 IFC, including the independent KSE and KSEGRP changes. This should allow kse_new() to be finished to allow the creation of new KSEs and KSEGRPs. Affected files ... .. //depot/projects/kse/bin/ps/print.c#14 integrate .. //depot/projects/kse/include/wchar.h#6 integrate .. //depot/projects/kse/lib/libc/locale/Makefile.inc#7 integrate .. //depot/projects/kse/lib/libc/locale/wcsftime.c#2 integrate .. //depot/projects/kse/lib/libc/locale/wcstod.3#1 branch .. //depot/projects/kse/lib/libc/locale/wcstod.c#1 branch .. //depot/projects/kse/lib/libc/net/getaddrinfo.c#5 integrate .. //depot/projects/kse/lib/libc/net/gethostbydns.c#3 integrate .. //depot/projects/kse/lib/libc/net/getnetbydns.c#3 integrate .. //depot/projects/kse/lib/libc/net/hesiod.c#2 integrate .. //depot/projects/kse/lib/libc/net/name6.c#3 integrate .. //depot/projects/kse/lib/libc/net/res_mkquery.c#2 integrate .. //depot/projects/kse/lib/libc/net/res_query.c#3 integrate .. //depot/projects/kse/lib/libc/net/res_update.c#3 integrate .. //depot/projects/kse/lib/libc/sparc64/gen/Makefile.inc#3 integrate .. //depot/projects/kse/lib/libc/sparc64/gen/fpgetmask.c#1 branch .. //depot/projects/kse/lib/libc/sparc64/gen/fpgetround.c#1 branch .. //depot/projects/kse/lib/libc/sparc64/gen/fpgetsticky.c#1 branch .. //depot/projects/kse/lib/libc/sparc64/gen/fpsetmask.c#2 integrate .. //depot/projects/kse/lib/libc/sparc64/gen/fpsetround.c#1 branch .. //depot/projects/kse/lib/libc/sparc64/gen/fpsetsticky.c#1 branch .. //depot/projects/kse/lib/libkvm/kvm_proc.c#23 integrate .. //depot/projects/kse/sys/alpha/alpha/interrupt.c#15 integrate .. //depot/projects/kse/sys/alpha/alpha/machdep.c#43 integrate .. //depot/projects/kse/sys/coda/coda_vnops.c#10 integrate .. //depot/projects/kse/sys/ddb/db_elf.c#3 integrate .. //depot/projects/kse/sys/dev/ata/ata-card.c#5 integrate .. //depot/projects/kse/sys/dev/ata/ata-dma.c#24 integrate .. //depot/projects/kse/sys/dev/ata/ata-isa.c#7 integrate .. //depot/projects/kse/sys/dev/ata/ata-pci.c#25 integrate .. //depot/projects/kse/sys/dev/sound/pcm/sound.h#8 integrate .. //depot/projects/kse/sys/dev/usb/usb.c#17 integrate .. //depot/projects/kse/sys/fs/deadfs/dead_vnops.c#5 integrate .. //depot/projects/kse/sys/fs/devfs/devfs_vnops.c#16 integrate .. //depot/projects/kse/sys/fs/fdescfs/fdesc_vnops.c#10 integrate .. //depot/projects/kse/sys/fs/fifofs/fifo_vnops.c#16 integrate .. //depot/projects/kse/sys/fs/hpfs/hpfs_vfsops.c#12 integrate .. //depot/projects/kse/sys/fs/hpfs/hpfs_vnops.c#12 integrate .. //depot/projects/kse/sys/fs/msdosfs/msdosfs_denode.c#9 integrate .. //depot/projects/kse/sys/fs/msdosfs/msdosfs_vfsops.c#12 integrate .. //depot/projects/kse/sys/fs/msdosfs/msdosfs_vnops.c#10 integrate .. //depot/projects/kse/sys/fs/ntfs/ntfs_vfsops.c#13 integrate .. //depot/projects/kse/sys/fs/nullfs/null_subr.c#5 integrate .. //depot/projects/kse/sys/fs/nullfs/null_vnops.c#10 integrate .. //depot/projects/kse/sys/fs/nwfs/nwfs_node.c#7 integrate .. //depot/projects/kse/sys/fs/portalfs/portal_vfsops.c#8 integrate .. //depot/projects/kse/sys/fs/portalfs/portal_vnops.c#12 integrate .. //depot/projects/kse/sys/fs/pseudofs/pseudofs.c#12 integrate .. //depot/projects/kse/sys/fs/pseudofs/pseudofs_vncache.c#14 integrate .. //depot/projects/kse/sys/fs/smbfs/smbfs_node.c#6 integrate .. //depot/projects/kse/sys/fs/smbfs/smbfs_vnops.c#12 integrate .. //depot/projects/kse/sys/fs/specfs/spec_vnops.c#16 integrate .. //depot/projects/kse/sys/fs/udf/udf_vnops.c#6 integrate .. //depot/projects/kse/sys/fs/umapfs/umap_subr.c#6 integrate .. //depot/projects/kse/sys/fs/umapfs/umap_vnops.c#5 integrate .. //depot/projects/kse/sys/fs/unionfs/union_subr.c#10 integrate .. //depot/projects/kse/sys/fs/unionfs/union_vnops.c#7 integrate .. //depot/projects/kse/sys/gnu/ext2fs/ext2_vfsops.c#11 integrate .. //depot/projects/kse/sys/gnu/ext2fs/ext2_vnops.c#8 integrate .. //depot/projects/kse/sys/i386/conf/makeLINT.sh#2 delete .. //depot/projects/kse/sys/i386/i386/i686_mem.c#3 integrate .. //depot/projects/kse/sys/i386/i386/k6_mem.c#2 integrate .. //depot/projects/kse/sys/i386/i386/machdep.c#58 integrate .. //depot/projects/kse/sys/i386/linux/linux_ptrace.c#7 integrate .. //depot/projects/kse/sys/ia64/ia64/machdep.c#39 integrate .. //depot/projects/kse/sys/isa/fd.c#11 integrate .. //depot/projects/kse/sys/isofs/cd9660/cd9660_vfsops.c#10 integrate .. //depot/projects/kse/sys/isofs/cd9660/cd9660_vnops.c#7 integrate .. //depot/projects/kse/sys/kern/init_main.c#49 integrate .. //depot/projects/kse/sys/kern/kern_descrip.c#38 integrate .. //depot/projects/kse/sys/kern/kern_exec.c#40 integrate .. //depot/projects/kse/sys/kern/kern_exit.c#62 integrate .. //depot/projects/kse/sys/kern/kern_fork.c#81 integrate .. //depot/projects/kse/sys/kern/kern_lockf.c#12 integrate .. //depot/projects/kse/sys/kern/kern_mac.c#5 integrate .. //depot/projects/kse/sys/kern/kern_proc.c#86 integrate .. //depot/projects/kse/sys/kern/kern_resource.c#23 integrate .. //depot/projects/kse/sys/kern/kern_sig.c#67 integrate .. //depot/projects/kse/sys/kern/kern_switch.c#67 integrate .. //depot/projects/kse/sys/kern/kern_thread.c#110 integrate .. //depot/projects/kse/sys/kern/subr_bus.c#13 integrate .. //depot/projects/kse/sys/kern/vfs_bio.c#25 integrate .. //depot/projects/kse/sys/kern/vfs_subr.c#43 integrate .. //depot/projects/kse/sys/net/if_gre.c#2 integrate .. //depot/projects/kse/sys/netgraph/ng_ksocket.c#18 integrate .. //depot/projects/kse/sys/nfsclient/nfs_node.c#8 integrate .. //depot/projects/kse/sys/nfsclient/nfs_vnops.c#12 integrate .. //depot/projects/kse/sys/pc98/i386/machdep.c#34 integrate .. //depot/projects/kse/sys/pci/agp_i810.c#6 integrate .. //depot/projects/kse/sys/powerpc/powerpc/machdep.c#24 integrate .. //depot/projects/kse/sys/security/lomac/lomacfs_subr.c#4 integrate .. //depot/projects/kse/sys/security/lomac/lomacfs_vnops.c#7 integrate .. //depot/projects/kse/sys/sparc64/include/fsr.h#3 integrate .. //depot/projects/kse/sys/sparc64/include/ieeefp.h#2 integrate .. //depot/projects/kse/sys/sparc64/sparc64/machdep.c#39 integrate .. //depot/projects/kse/sys/sys/bio.h#9 integrate .. //depot/projects/kse/sys/sys/bus.h#7 integrate .. //depot/projects/kse/sys/sys/cdefs.h#16 integrate .. //depot/projects/kse/sys/sys/devicestat.h#3 integrate .. //depot/projects/kse/sys/sys/malloc.h#9 integrate .. //depot/projects/kse/sys/sys/memrange.h#3 integrate .. //depot/projects/kse/sys/sys/proc.h#134 integrate .. //depot/projects/kse/sys/sys/vnode.h#32 integrate .. //depot/projects/kse/sys/ufs/ffs/ffs_vfsops.c#25 integrate .. //depot/projects/kse/sys/ufs/ufs/ufs_vnops.c#18 integrate .. //depot/projects/kse/sys/vm/vm_swap.c#11 integrate Differences ... ==== //depot/projects/kse/bin/ps/print.c#14 (text+ko) ==== ==== //depot/projects/kse/include/wchar.h#6 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/include/wchar.h,v 1.25 2002/09/12 23:33:17 tjr Exp $ + * $FreeBSD: src/include/wchar.h,v 1.26 2002/09/15 08:38:50 tjr Exp $ */ /*- @@ -144,6 +144,7 @@ size_t wcsspn(const wchar_t *, const wchar_t *); wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict); int wctob(wint_t); +double wcstod(const wchar_t * __restrict, wchar_t ** __restrict); wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict, wchar_t ** __restrict); long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int); ==== //depot/projects/kse/lib/libc/locale/Makefile.inc#7 (text+ko) ==== @@ -1,5 +1,5 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/locale/Makefile.inc,v 1.37 2002/09/11 08:57:11 tjr Exp $ +# $FreeBSD: src/lib/libc/locale/Makefile.inc,v 1.38 2002/09/15 08:38:51 tjr Exp $ # locale sources .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/locale ${.CURDIR}/../libc/locale @@ -11,7 +11,8 @@ mbrtowc.c mbrune.c mbsinit.c mbsrtowcs.c mbtowc.c mbstowcs.c \ mskanji.c nl_langinfo.c nomacros.c none.c rune.c \ runetype.c setinvalidrune.c setlocale.c setrunelocale.c table.c \ - tolower.c toupper.c utf2.c wcrtomb.c wcsrtombs.c wcsftime.c wcstol.c \ + tolower.c toupper.c utf2.c wcrtomb.c wcsrtombs.c wcsftime.c wcstod.c \ + wcstol.c \ wcstombs.c \ wcstoul.c wctob.c wctomb.c wctrans.c wctype.c wcwidth.c @@ -25,7 +26,7 @@ rune.3 \ setlocale.3 toascii.3 tolower.3 toupper.3 towlower.3 wcsftime.3 \ wcrtomb.3 \ - wcsrtombs.3 wcstol.3 \ + wcsrtombs.3 wcstod.3 wcstol.3 \ wctrans.3 wctype.3 wcwidth.3 MAN+= euc.4 utf2.4 ==== //depot/projects/kse/lib/libc/locale/wcsftime.c#2 (text+ko) ==== @@ -25,8 +25,9 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/locale/wcsftime.c,v 1.1 2002/09/11 08:57:11 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/wcsftime.c,v 1.2 2002/09/15 08:06:17 tjr Exp $"); +#include #include #include #include @@ -51,8 +52,11 @@ { static const mbstate_t initial; mbstate_t state; - char *dst, *sformat; + char *dst, *dstp, *sformat; size_t n, sflen; + int sverrno; + + sformat = dst = NULL; /* * Convert the supplied format string to a multibyte representation @@ -61,8 +65,9 @@ state = initial; sflen = wcsrtombs(NULL, &format, 0, &state); if (sflen == (size_t)-1) - return (0); - sformat = alloca(sflen + 1); + goto error; + if ((sformat = malloc(sflen + 1)) == NULL) + goto error; state = initial; wcsrtombs(sformat, &format, sflen + 1, &state); @@ -72,16 +77,29 @@ * Then, copy and convert the result back into wide characters in * the caller's buffer. */ - if (SIZE_T_MAX / MB_CUR_MAX <= maxsize) + if (SIZE_T_MAX / MB_CUR_MAX <= maxsize) { /* maxsize is prepostorously large - avoid int. overflow. */ - return (0); - dst = alloca(maxsize * MB_CUR_MAX); + errno = EINVAL; + goto error; + } + if ((dst = malloc(maxsize * MB_CUR_MAX)) == NULL) + goto error; if (strftime(dst, maxsize, sformat, timeptr) == 0) - return (0); + goto error; state = initial; - n = mbsrtowcs(wcs, (const char **)&dst, maxsize, &state); - if (n == (size_t)-2 || n == (size_t)-1 || dst != NULL) - return (0); + dstp = dst; + n = mbsrtowcs(wcs, (const char **)&dstp, maxsize, &state); + if (n == (size_t)-2 || n == (size_t)-1 || dstp != NULL) + goto error; + free(sformat); + free(dst); return (n); + +error: + sverrno = errno; + free(sformat); + free(dst); + errno = sverrno; + return (0); } ==== //depot/projects/kse/lib/libc/net/getaddrinfo.c#5 (text+ko) ==== @@ -83,7 +83,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/getaddrinfo.c,v 1.30 2002/09/13 20:31:29 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/getaddrinfo.c,v 1.33 2002/09/15 20:36:38 ume Exp $"); #include "namespace.h" #include @@ -201,7 +201,7 @@ { 0 } }; -#define MAXPACKET 65536 +#define MAXPACKET (64*1024) typedef union { HEADER hdr; @@ -1411,7 +1411,7 @@ va_list ap; { struct addrinfo *ai; - querybuf buf, buf2; + querybuf *buf, *buf2; const char *name; const struct addrinfo *pai; struct addrinfo sentinel, *cur; @@ -1425,47 +1425,66 @@ memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + buf = malloc(sizeof(*buf)); + if (!buf) { + h_errno = NETDB_INTERNAL; + return NS_NOTFOUND; + } + buf2 = malloc(sizeof(*buf2)); + if (!buf2) { + free(buf); + h_errno = NETDB_INTERNAL; + return NS_NOTFOUND; + } + switch (pai->ai_family) { case AF_UNSPEC: /* prefer IPv6 */ q.qclass = C_IN; q.qtype = T_AAAA; - q.answer = buf.buf; - q.anslen = sizeof(buf); + q.answer = buf->buf; + q.anslen = sizeof(buf->buf); q.next = &q2; q2.qclass = C_IN; q2.qtype = T_A; - q2.answer = buf2.buf; - q2.anslen = sizeof(buf2); + q2.answer = buf2->buf; + q2.anslen = sizeof(buf2->buf); break; case AF_INET: q.qclass = C_IN; q.qtype = T_A; - q.answer = buf.buf; - q.anslen = sizeof(buf); + q.answer = buf->buf; + q.anslen = sizeof(buf->buf); break; case AF_INET6: q.qclass = C_IN; q.qtype = T_AAAA; - q.answer = buf.buf; - q.anslen = sizeof(buf); + q.answer = buf->buf; + q.anslen = sizeof(buf->buf); break; default: + free(buf); + free(buf2); return NS_UNAVAIL; } - if (res_searchN(name, &q) < 0) + if (res_searchN(name, &q) < 0) { + free(buf); + free(buf2); return NS_NOTFOUND; - ai = getanswer(&buf, q.n, q.name, q.qtype, pai); + } + ai = getanswer(buf, q.n, q.name, q.qtype, pai); if (ai) { cur->ai_next = ai; while (cur && cur->ai_next) cur = cur->ai_next; } if (q.next) { - ai = getanswer(&buf2, q2.n, q2.name, q2.qtype, pai); + ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai); if (ai) cur->ai_next = ai; } + free(buf); + free(buf2); if (sentinel.ai_next == NULL) switch (h_errno) { case HOST_NOT_FOUND: @@ -1768,7 +1787,7 @@ const char *name; /* domain name */ struct res_target *target; { - u_char buf[MAXPACKET]; + u_char *buf; HEADER *hp; int n; struct res_target *t; @@ -1783,6 +1802,12 @@ return (-1); } + buf = malloc(MAXPACKET); + if (!buf) { + h_errno = NETDB_INTERNAL; + return -1; + } + for (t = target; t; t = t->next) { int class, type; u_char *answer; @@ -1802,14 +1827,15 @@ #endif n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, - buf, sizeof(buf)); + buf, MAXPACKET); if (n > 0 && (_res.options & RES_USE_EDNS0) != 0) - n = res_opt(n, buf, sizeof(buf), anslen); + n = res_opt(n, buf, MAXPACKET, anslen); if (n <= 0) { #ifdef DEBUG if (_res.options & RES_DEBUG) printf(";; res_query: mkquery failed\n"); #endif + free(buf); h_errno = NO_RECOVERY; return (n); } @@ -1820,12 +1846,15 @@ if (_res.options & RES_DEBUG) printf(";; res_query: send error\n"); #endif + free(buf); h_errno = TRY_AGAIN; return (n); } #endif - if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { + if (n < 0 || n > anslen) + hp->rcode = FORMERR; /* XXX not very informative */ + if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { rcode = hp->rcode; /* record most recent error */ #ifdef DEBUG if (_res.options & RES_DEBUG) @@ -1840,6 +1869,8 @@ t->n = n; } + free(buf); + if (ancount == 0) { switch (rcode) { case NXDOMAIN: ==== //depot/projects/kse/lib/libc/net/gethostbydns.c#3 (text+ko) ==== @@ -58,7 +58,7 @@ static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/gethostbydns.c,v 1.37 2002/09/13 20:31:29 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/gethostbydns.c,v 1.39 2002/09/15 16:51:09 nectar Exp $"); #include #include @@ -103,7 +103,11 @@ static void dprintf(char *, int) __printflike(1, 0); #endif -#define MAXPACKET 65536 +#if PACKETSZ > 1024 +#define MAXPACKET PACKETSZ +#else +#define MAXPACKET 1024 +#endif typedef union { HEADER hdr; @@ -583,9 +587,13 @@ break; } - if ((n = res_search(name, C_IN, type, buf.buf, sizeof(buf))) < 0) { + n = res_search(name, C_IN, type, buf.buf, sizeof(buf.buf)); + if (n < 0) { dprintf("res_search failed (%d)\n", n); - return NS_UNAVAIL; + return (NULL); + } else if (n > sizeof(buf.buf)) { + dprintf("static buffer is too small (%d)\n", n); + return (NULL); } *(struct hostent **)rval = gethostanswer(&buf, n, name, type); return (*(struct hostent **)rval != NULL) ? NS_SUCCESS : NS_NOTFOUND; ==== //depot/projects/kse/lib/libc/net/getnetbydns.c#3 (text+ko) ==== @@ -62,7 +62,7 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/getnetbydns.c,v 1.22 2002/09/13 20:31:29 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/getnetbydns.c,v 1.24 2002/09/15 16:51:09 nectar Exp $"); #include #include @@ -88,7 +88,11 @@ #define BYNAME 1 #define MAXALIASES 35 -#define MAXPACKET 65536 +#if PACKETSZ > 1024 +#define MAXPACKET PACKETSZ +#else +#define MAXPACKET 1024 +#endif typedef union { HEADER hdr; @@ -259,7 +263,13 @@ if (anslen < 0) { #ifdef DEBUG if (_res.options & RES_DEBUG) - printf("res_query failed\n"); + printf("res_search failed\n"); +#endif + return NS_UNAVAIL; + } else if (anslen > sizeof(buf)) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_search static buffer too small"); #endif return NS_UNAVAIL; } @@ -299,7 +309,13 @@ if (anslen < 0) { #ifdef DEBUG if (_res.options & RES_DEBUG) - printf("res_query failed\n"); + printf("res_search failed\n"); +#endif + return NS_UNAVAIL; + } else if (anslen > sizeof(buf)) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_search static buffer too small"); #endif return NS_UNAVAIL; } ==== //depot/projects/kse/lib/libc/net/hesiod.c#2 (text+ko) ==== @@ -49,7 +49,7 @@ static char *orig_rcsid = "$NetBSD: hesiod.c,v 1.9 1999/02/11 06:16:38 simonb Exp $"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/net/hesiod.c,v 1.6 2002/03/22 21:52:29 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/hesiod.c,v 1.7 2002/09/15 16:51:09 nectar Exp $"); #include #include @@ -386,8 +386,8 @@ /* Send the query. */ n = res_send(qbuf, n, abuf, MAX_HESRESP); - if (n < 0) { - errno = ECONNREFUSED; + if (n < 0 || n > MAX_HESRESP) { + errno = ECONNREFUSED; /* XXX */ return NULL; } /* Parse the header of the result. */ ==== //depot/projects/kse/lib/libc/net/name6.c#3 (text+ko) ==== @@ -94,7 +94,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/name6.c,v 1.25 2002/09/13 20:31:29 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/name6.c,v 1.27 2002/09/15 16:51:09 nectar Exp $"); #include "namespace.h" #include @@ -967,7 +967,11 @@ int rtl_type; }; -#define MAXPACKET 65536 +#if PACKETSZ > 1024 +#define MAXPACKET PACKETSZ +#else +#define MAXPACKET 1024 +#endif typedef union { HEADER hdr; @@ -1283,7 +1287,7 @@ rtl = SLIST_NEXT(rtl, rtl_entry)) { ret = res_query(cp, C_IN, rtl->rtl_type, buf.buf, sizeof(buf.buf)); - if (ret > 0) { + if (ret > 0 && ret < sizeof(buf.buf)) { hpbuf.h_addrtype = (rtl->rtl_type == T_AAAA) ? AF_INET6 : AF_INET; hpbuf.h_length = ADDRLEN(hpbuf.h_addrtype); @@ -1308,7 +1312,7 @@ rtl = SLIST_NEXT(rtl, rtl_entry)) { ret = res_querydomain(name, NULL, C_IN, rtl->rtl_type, buf.buf, sizeof(buf.buf)); - if (ret > 0) { + if (ret > 0 && ret < sizeof(buf.buf)) { hpbuf.h_addrtype = (rtl->rtl_type == T_AAAA) ? AF_INET6 : AF_INET; hpbuf.h_length = ADDRLEN(hpbuf.h_addrtype); @@ -1345,7 +1349,7 @@ ret = res_querydomain(name, *domain, C_IN, rtl->rtl_type, buf.buf, sizeof(buf.buf)); - if (ret > 0) { + if (ret > 0 && ret < sizeof(buf.buf)) { hpbuf.h_addrtype = (rtl->rtl_type == T_AAAA) ? AF_INET6 : AF_INET; hpbuf.h_length = ADDRLEN(hpbuf.h_addrtype); @@ -1415,7 +1419,7 @@ rtl = SLIST_NEXT(rtl, rtl_entry)) { ret = res_querydomain(name, NULL, C_IN, rtl->rtl_type, buf.buf, sizeof(buf.buf)); - if (ret > 0) { + if (ret > 0 && ret < sizeof(buf.buf)) { hpbuf.h_addrtype = (rtl->rtl_type == T_AAAA) ? AF_INET6 : AF_INET; hpbuf.h_length = ADDRLEN(hpbuf.h_addrtype); @@ -1566,6 +1570,12 @@ if (n < 0) { *errp = h_errno; return NS_UNAVAIL; + } else if (n > sizeof(buf.buf)) { +#if 0 + errno = ERANGE; /* XXX is it OK to set errno here? */ +#endif + *errp = NETDB_INTERNAL; + return NS_UNAVAIL; } hp = getanswer(&buf, n, qbuf, T_PTR, &hbuf, errp); if (!hp) ==== //depot/projects/kse/lib/libc/net/res_mkquery.c#2 (text+ko) ==== @@ -73,7 +73,7 @@ static char orig_rcsid[] = "From: Id: res_mkquery.c,v 8.9 1997/04/24 22:22:36 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/res_mkquery.c,v 1.18 2002/03/22 21:52:30 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/res_mkquery.c,v 1.19 2002/09/14 17:28:40 ume Exp $"); #include #include @@ -229,6 +229,8 @@ __putshort(T_OPT, cp); /* TYPE */ cp += INT16SZ; + if (anslen > 0xffff) + anslen = 0xffff; /* limit to 16bit value */ __putshort(anslen & 0xffff, cp); /* CLASS = UDP payload size */ cp += INT16SZ; *cp++ = NOERROR; /* extended RCODE */ ==== //depot/projects/kse/lib/libc/net/res_query.c#3 (text+ko) ==== @@ -73,7 +73,7 @@ static char orig_rcsid[] = "From: Id: res_query.c,v 8.14 1997/06/09 17:47:05 halley Exp $"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/res_query.c,v 1.24 2002/09/13 20:31:29 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/res_query.c,v 1.25 2002/09/15 04:23:20 nectar Exp $"); #include #include @@ -90,7 +90,11 @@ #include "res_config.h" -#define MAXPACKET 65536 +#if PACKETSZ > 1024 +#define MAXPACKET PACKETSZ +#else +#define MAXPACKET 1024 +#endif /* * Formulate a normal query, send, and await answer. ==== //depot/projects/kse/lib/libc/net/res_update.c#3 (text+ko) ==== @@ -21,7 +21,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/res_update.c,v 1.5 2002/09/13 20:31:29 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/res_update.c,v 1.7 2002/09/15 16:51:09 nectar Exp $"); #include #include @@ -51,7 +51,6 @@ */ #define NSMAX 16 -#define MAXPACKET 65536 struct ns1 { char nsname[MAXDNAME]; @@ -72,7 +71,7 @@ int res_update(ns_updrec *rrecp_in) { ns_updrec *rrecp, *tmprrecp; - u_char buf[PACKETSZ], answer[MAXPACKET], packet[2*PACKETSZ]; + u_char buf[PACKETSZ], answer[PACKETSZ], packet[2*PACKETSZ]; char name[MAXDNAME], zname[MAXDNAME], primary[MAXDNAME], mailaddr[MAXDNAME]; u_char soardata[2*MAXCDNAME+5*INT32SZ]; @@ -160,6 +159,9 @@ fprintf(stderr, "res_update: send error for %s\n", rrecp->r_dname); return (n); + } else if (n > sizeof(answer)) { + fprintf(stderr, "res_update: buffer too small\n"); + return (-1); } if (n < HFIXEDSZ) return (-1); @@ -499,7 +501,10 @@ if (n < 0) { fprintf(stderr, "res_send: send error, n=%d\n", n); break; - } else + } else if (n > sizeof(answer)) { + fprintf(stderr, "res_send: buffer too small\n"); + break; + } numzones++; } ==== //depot/projects/kse/lib/libc/sparc64/gen/Makefile.inc#3 (text+ko) ==== @@ -1,4 +1,5 @@ -# $FreeBSD: src/lib/libc/sparc64/gen/Makefile.inc,v 1.5 2002/09/13 16:01:26 tmm Exp $ +# $FreeBSD: src/lib/libc/sparc64/gen/Makefile.inc,v 1.6 2002/09/14 18:06:21 tmm Exp $ -SRCS+= _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpsetmask.c frexp.c \ +SRCS+= _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpgetmask.c fpgetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c frexp.c \ infinity.c isinf.c ldexp.c modf.S setjmp.S sigsetjmp.S ==== //depot/projects/kse/lib/libc/sparc64/gen/fpsetmask.c#2 (text+ko) ==== @@ -4,8 +4,9 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/sparc64/gen/fpsetmask.c,v 1.1 2002/03/05 04:03:57 jake Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/sparc64/gen/fpsetmask.c,v 1.2 2002/09/14 18:07:03 tmm Exp $"); +#include #include fp_except_t @@ -15,13 +16,13 @@ fp_except_t old; fp_except_t new; - __asm__("st %%fsr,%0" : "=m" (*&old)); + __asm__("st %%fsr,%0" : "=m" (old)); new = old; - new &= ~(0x1f << 23); - new |= ((mask & 0x1f) << 23); + new &= ~FSR_TEM_MASK; + new |= FSR_TEM(mask & FSR_EXC_MASK); - __asm__("ld %0,%%fsr" : : "m" (*&new)); + __asm__("ld %0,%%fsr" : : "m" (new)); - return (old >> 23) & 0x1f; + return (FSR_GET_TEM(old)); } ==== //depot/projects/kse/lib/libkvm/kvm_proc.c#23 (text+ko) ==== @@ -34,11 +34,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.55 2002/09/11 08:13:56 julian Exp $ + * $FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.56 2002/09/15 23:52:25 julian Exp $ */ #include -__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.55 2002/09/11 08:13:56 julian Exp $"); +__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.56 2002/09/15 23:52:25 julian Exp $"); #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"; @@ -120,6 +120,8 @@ struct pstats pstats; struct ucred ucred; struct thread mtd; + struct kse mke; + struct ksegrp mkg; struct proc proc; struct proc pproc; struct timeval tv; @@ -140,6 +142,23 @@ TAILQ_FIRST(&proc.p_threads)); return (-1); } + if (proc.p_flag & P_KSES == 0) { + if (KREAD(kd, + (u_long)TAILQ_FIRST(&proc.p_ksegrps), + &mkg)) { + _kvm_err(kd, kd->program, + "can't read ksegrp at %x", + TAILQ_FIRST(&proc.p_ksegrps)); + return (-1); + } + if (KREAD(kd, + (u_long)TAILQ_FIRST(&mkg.kg_kseq), &mke)) { + _kvm_err(kd, kd->program, + "can't read kse at %x", + TAILQ_FIRST(&mkg.kg_kseq)); + return (-1); + } + } } if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { kp->ki_ruid = ucred.cr_ruid; @@ -328,24 +347,23 @@ kp->ki_sigmask = proc.p_sigmask; kp->ki_xstat = proc.p_xstat; kp->ki_acflag = proc.p_acflag; + kp->ki_lock = proc.p_lock; if (proc.p_state != PRS_ZOMBIE) { - kp->ki_pctcpu = proc.p_kse.ke_pctcpu; - kp->ki_estcpu = proc.p_ksegrp.kg_estcpu; - kp->ki_slptime = proc.p_ksegrp.kg_slptime; kp->ki_swtime = proc.p_swtime; kp->ki_flag = proc.p_flag; kp->ki_sflag = proc.p_sflag; - kp->ki_wchan = mtd.td_wchan; kp->ki_traceflag = proc.p_traceflag; if (proc.p_state == PRS_NORMAL) { if (TD_ON_RUNQ(&mtd) || TD_CAN_RUN(&mtd) || TD_IS_RUNNING(&mtd)) { kp->ki_stat = SRUN; - } else if (mtd.td_state == TDS_INHIBITED) { + } else if (mtd.td_state == + TDS_INHIBITED) { if (P_SHOULDSTOP(&proc)) { kp->ki_stat = SSTOP; - } else if (TD_IS_SLEEPING(&mtd)) { + } else if ( + TD_IS_SLEEPING(&mtd)) { kp->ki_stat = SSLEEP; } else if (TD_ON_MUTEX(&mtd)) { kp->ki_stat = SMTX; @@ -356,15 +374,30 @@ } else { kp->ki_stat = SIDL; } - kp->ki_pri.pri_class = proc.p_ksegrp.kg_pri_class; - kp->ki_pri.pri_user = proc.p_ksegrp.kg_user_pri; + /* Stuff from the thread */ kp->ki_pri.pri_level = mtd.td_priority; kp->ki_pri.pri_native = mtd.td_base_pri; - kp->ki_nice = proc.p_ksegrp.kg_nice; - kp->ki_lock = proc.p_lock; - kp->ki_rqindex = proc.p_kse.ke_rqindex; - kp->ki_oncpu = proc.p_kse.ke_oncpu; kp->ki_lastcpu = mtd.td_lastcpu; + kp->ki_wchan = mtd.td_wchan; + + if (!(proc.p_flag & P_KSES)) { + /* stuff from the ksegrp */ + kp->ki_slptime = mkg.kg_slptime; + kp->ki_pri.pri_class = mkg.kg_pri_class; + kp->ki_pri.pri_user = mkg.kg_user_pri; + kp->ki_nice = mkg.kg_nice; + kp->ki_estcpu = mkg.kg_estcpu; + + /* Stuff from the kse */ + kp->ki_pctcpu = mke.ke_pctcpu; + kp->ki_rqindex = mke.ke_rqindex; + kp->ki_oncpu = mke.ke_oncpu; + } else { + kp->ki_oncpu = -1; + kp->ki_lastcpu = -1; + kp->ki_tdflags = -1; + /* All the rest are 0 for now */ + } } else { kp->ki_stat = SZOMB; } ==== //depot/projects/kse/sys/alpha/alpha/interrupt.c#15 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.68 2002/04/04 21:03:13 jhb Exp $ */ +/* $FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.69 2002/09/14 16:54:46 scottl Exp $ */ /* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */ /* @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include ==== //depot/projects/kse/sys/alpha/alpha/machdep.c#43 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.184 2002/09/07 19:12:27 jmallett Exp $ + * $FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.185 2002/09/15 23:52:23 julian Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -884,7 +884,7 @@ } - proc_linkup(&proc0, &proc0.p_ksegrp, &proc0.p_kse, &thread0); + proc_linkup(&proc0, &ksegrp0, &kse0, &thread0); /* * Init mapping for u page(s) for proc 0 */ ==== //depot/projects/kse/sys/coda/coda_vnops.c#10 (text+ko) ==== @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $FreeBSD: src/sys/coda/coda_vnops.c,v 1.42 2002/05/16 21:25:34 trhodes Exp $ + * $FreeBSD: src/sys/coda/coda_vnops.c,v 1.43 2002/09/14 09:02:20 njl Exp $ * */ @@ -1959,7 +1959,7 @@ lockinit(&cp->c_lock, PINOD, "cnode", 0, 0); cp->c_fid = *fid; - err = getnewvnode(VT_CODA, vfsp, coda_vnodeop_p, &vp); + err = getnewvnode("coda", vfsp, coda_vnodeop_p, &vp); if (err) { panic("coda: getnewvnode returned error %d\n", err); } ==== //depot/projects/kse/sys/ddb/db_elf.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/ddb/db_elf.c,v 1.11 2002/06/29 02:32:33 peter Exp $ */ +/* $FreeBSD: src/sys/ddb/db_elf.c,v 1.15 2002/09/15 22:28:39 bde Exp $ */ /* $NetBSD: db_elf.c,v 1.4 1998/05/03 18:49:54 thorpej Exp $ */ /*- @@ -38,24 +38,26 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __ELF__ - #include "opt_ddb.h" #ifdef DDB_NOKLDSYM -#include #include -#include -#include +#include -#include +#ifdef __i386__ +#include +#endif +#include #include -#include #include +#ifndef _ALIGNED_POINTER +#define _ALIGNED_POINTER(ptr, type) 1 +#endif + static char *db_elf_find_strtab(db_symtab_t *); #define STAB_TO_SYMSTART(stab) ((Elf_Sym *)((stab)->start)) @@ -82,7 +84,7 @@ char *strtab_start, *strtab_end; int i; - if (ALIGNED_POINTER(symtab, long) == 0) { + if (_ALIGNED_POINTER(symtab, long) == 0) { printf("DDB: bad symbol table start address %p\n", symtab); return; } @@ -145,7 +147,7 @@ strtab_end = (char *)symtab + shp[i].sh_offset + shp[i].sh_size; break; - + case SHT_SYMTAB: if (symtab_start != NULL) goto multiple_symtab; @@ -164,8 +166,8 @@ * Now, sanity check the symbols against the string table. */ if (symtab_start == NULL || strtab_start == NULL || - ALIGNED_POINTER(symtab_start, long) == 0 || - ALIGNED_POINTER(strtab_start, long) == 0) + _ALIGNED_POINTER(symtab_start, long) == 0 || + _ALIGNED_POINTER(strtab_start, long) == 0) goto badheader; for (symp = symtab_start; symp < symtab_end; symp++) if (symp->st_name + strtab_start > strtab_end) >>> TRUNCATED FOR MAIL (1000 lines) <<< To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message