CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Jun 29 06:02:09 UTC 2009 Modified Files: src/share/man/man9: namei.9 Log Message: Use more markup. Punctuation nit. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/namei.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/namei.9 diff -u src/share/man/man9/namei.9:1.20 src/share/man/man9/namei.9:1.21 --- src/share/man/man9/namei.9:1.20 Mon Jun 29 05:49:28 2009 +++ src/share/man/man9/namei.9 Mon Jun 29 06:02:09 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: namei.9,v 1.20 2009/06/29 05:49:28 dholland Exp $ +.\ $NetBSD: namei.9,v 1.21 2009/06/29 06:02:09 wiz Exp $ .\ .\ Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -35,7 +35,7 @@ .Nm lookup , .Nm relookup , .Nm NDINIT , -.Nm namei_simple_kernel, +.Nm namei_simple_kernel , .Nm namei_simple_user .Nd pathname lookup .Sh SYNOPSIS @@ -155,34 +155,34 @@ The additional flags are: .Pp .Bl -tag -offset indent -width NOCROSSMOUNT -compact -.It NOCROSSMOUNT +.It Dv NOCROSSMOUNT do not cross mount points -.It RDONLY +.It Dv RDONLY lookup with read-only semantics -.It HASBUF +.It Dv HASBUF caller has allocated pathname buffer .Em ni_cnd.cn_pnbuf -.It SAVENAME +.It Dv SAVENAME save pathname buffer -.It SAVESTART +.It Dv SAVESTART save starting directory -.It ISDOTDOT +.It Dv ISDOTDOT current pathname component is .. -.It MAKEENTRY +.It Dv MAKEENTRY add entry to the name cache -.It ISLASTCN +.It Dv ISLASTCN this is last component of pathname -.It ISSYMLINK +.It Dv ISSYMLINK symlink needs interpretation -.It ISWHITEOUT +.It Dv ISWHITEOUT found whiteout -.It DOWHITEOUT +.It Dv DOWHITEOUT do whiteouts -.It REQUIREDIR +.It Dv REQUIREDIR must be a directory -.It CREATEDIR +.It Dv CREATEDIR trailing slashes are ok -.It PARAMASK +.It Dv PARAMASK mask of parameter descriptors .El .Pp @@ -195,9 +195,13 @@ routine or the .Fn VOP_ABORT routine. -The SAVESTART flag is set only by the callers of +The +.Dv SAVESTART +flag is set only by the callers of .Fn namei . -It implies SAVENAME plus the addition of saving the parent directory +It implies +.Dv SAVENAME +plus the addition of saving the parent directory that contains the name in .Em ni_startdir . It allows repeated calls to @@ -224,18 +228,24 @@ .Em ndp-\*[Gt]segflg flags defines whether the name in .Em ndp-\*[Gt]ni_dirp -is an address in kernel space (UIO_SYSSPACE) or an address in user -space (UIO_USERSPACE). +is an address in kernel space +.Pq Dv UIO_SYSSPACE +or an address in user space +.Pq Dv UIO_USERSPACE . .Pp The vnode for the pathname is returned in .Em ndp-\*[Gt]ni_vp . The parent directory is returned locked in .Em ndp-\*[Gt]ni_dvp -iff LOCKPARENT is specified. +iff +.Dv LOCKPARENT +is specified. .Pp If .Em ndp-\*[Gt]ni_cnd.cn_flags -has the FOLLOW flag set then symbolic links are followed when they +has the +.Dv FOLLOW +flag set then symbolic links are followed when they occur at the end of the name translation process. Symbolic links are always followed for all other pathname components other than the last. @@ -256,7 +266,12 @@ .Fn lookup are altered by the operation specified by .Em ndp-\*[Gt]ni_cnd.cn_nameiop . -When CREATE, RENAME, or DELETE is specified, information usable in +When +.Dv CREATE , +.Dv RENAME , +or +.Dv DELETE +is specified, information usable in creating, renaming, or deleting a directory entry may be calculated. .Pp If the target of the pathname exists and LOCKLEAF is set, the target @@ -315,18 +330,24 @@ .Fa ret . The .Fa path -argument must be a kernel (UIO_SYSSPACE) pointer. +argument must be a kernel +.Pq Dv UIO_SYSSPACE +pointer. The .Fa sflags argument chooses the precise behavior. It may be set to one of the following symbols: .Bl -tag -offset indent -width NSM_NOFOLLOW_TRYEMULROOT -compact -.It NSM_NOFOLLOW_NOEMULROOT -.It NSM_NOFOLLOW_TRYEMULROOT -.It NSM_FOLLOW_NOEMULROOT -.It NSM_FOLLOW_TRYEMULROOT +.It Dv NSM_NOFOLLOW_NOEMULROOT +.It Dv NSM_NOFOLLOW_TRYEMULROOT +.It Dv NSM_FOLLOW_NOEMULROOT +.It Dv NSM_FOLLOW_TRYEMULROOT .El -These select (or not) the FOLLOW/NOFOLLOW and TRYEMULROOT flags. +These select (or not) the +.Dv FOLLOW/NOFOLLOW +and +.Dv TRYEMULROOT +flags. Other flags are not available through this interface, which is nonetheless sufficient for more than half the .Fn namei @@ -343,8 +364,9 @@ .Fn namei_simple_kernel except that the .Fa path -argument shall be a user pointer (UIO_USERSPACE) rather than a kernel -pointer. +argument shall be a user pointer +.Pq Dv UIO_USERSPACE +rather than a kernel pointer. .El .Sh CODE REFERENCES This section describes places within the
CVS commit: src/lib/libc/sys
Module Name:src Committed By: plunky Date: Mon Jun 29 06:22:13 UTC 2009 Modified Files: src/lib/libc/sys: getsockopt.2 Log Message: add mention of SO_ACCEPTFILTERS, language largely from FreeBSD manpage To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/lib/libc/sys/getsockopt.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/getsockopt.2 diff -u src/lib/libc/sys/getsockopt.2:1.32 src/lib/libc/sys/getsockopt.2:1.33 --- src/lib/libc/sys/getsockopt.2:1.32 Mon May 18 14:51:55 2009 +++ src/lib/libc/sys/getsockopt.2 Mon Jun 29 06:22:13 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: getsockopt.2,v 1.32 2009/05/18 14:51:55 wiz Exp $ +.\ $NetBSD: getsockopt.2,v 1.33 2009/06/29 06:22:13 plunky Exp $ .\ .\ Copyright (c) 1983, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\ .\ @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\ -.Dd December 16, 2007 +.Dd June 28, 2009 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -149,7 +149,7 @@ .Fn getsockopt and set with .Fn setsockopt . -.Bl -column SO_OOBINLINE data -offset indent +.Bl -column SO_ACCEPTFILTER data -offset indent .It Dv SO_DEBUG Ta enables recording of debugging information .It Dv SO_REUSEADDR Ta enables local address reuse .It Dv SO_REUSEPORT Ta enables duplicate address and port bindings @@ -165,6 +165,7 @@ .It Dv SO_SNDTIMEO Ta set timeout value for output .It Dv SO_RCVTIMEO Ta set timeout value for input .It Dv SO_TIMESTAMP Ta enables reception of a timestamp with datagrams +.It Dv SO_ACCEPTFILTER Ta set accept filter on listening socket .It Dv SO_TYPE Ta get the type of the socket (get only) .It Dv SO_ERROR Ta get and clear error on the socket (get only) .El @@ -327,6 +328,45 @@ cmsg_type = SCM_TIMESTAMP .Ed .Pp +.Dv SO_ACCEPTFILTER +places an +.Xr accept_filter 9 +on the socket, which will filter incoming connections on a listening +socket before being presented for +.Xr accept 2 . +The +.Fn setsockopt +system call will fail if the socket already has a filter set, and +.Xr listen 2 +must be called on the socket before trying to install a filter. +The +.Fa optval +argument +should point to a +.Fa struct accept_filter_arg +that will select and configure the +.Xr accept_filter 9 , +defined as follows: +.Bd -literal +struct accept_filter_arg { +charaf_name[16]; +charaf_arg[256-16]; +}; +.Ed +.Lp +The +.Fa af_name +argument should be filled with the name of the accept filter +that the application wishes to place on the listening socket. +The optional argument +.Fa af_arg +can be passed to the accept filter specified by +.Fa af_name +to provide additional configuration options at attach time. +Passing in an +.Fa optval +of NULL will remove the filter. +.Pp Finally, .Dv SO_TYPE and @@ -360,6 +400,11 @@ this error may also be returned if .Fa optlen is not in a valid part of the process address space. +.It Bq Er EINVAL +The socket +.Fa s +was not suitable for installing an +.Xr accept_filter 9 . .It Bq Er ENOPROTOOPT The option is unknown at the level indicated. .It Bq Er ENOTSOCK @@ -385,7 +430,8 @@ .Xr tcp 4 , .Xr tp 4 , .Xr unix 4 , -.Xr protocols 5 +.Xr protocols 5 , +.Xr accept_filter 9 .Sh HISTORY The .Fn getsockopt
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: dholland Date: Mon Jun 29 07:11:06 UTC 2009 Modified Files: src/sys/rump/librump/rumpvfs: rump_vfs.c Log Message: Another namei_simple like the previous ones; was added after I did the initial sweep and I guess I missed it while merging. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/rump/librump/rumpvfs/rump_vfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpvfs/rump_vfs.c diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.22 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.23 --- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.22 Fri May 22 08:26:52 2009 +++ src/sys/rump/librump/rumpvfs/rump_vfs.c Mon Jun 29 07:11:06 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_vfs.c,v 1.22 2009/05/22 08:26:52 pooka Exp $ */ +/* $NetBSD: rump_vfs.c,v 1.23 2009/06/29 07:11:06 dholland Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.22 2009/05/22 08:26:52 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.23 2009/06/29 07:11:06 dholland Exp $); #include sys/param.h #include sys/buf.h @@ -363,14 +363,11 @@ int rump_vfs_getmp(const char *path, struct mount **mpp) { - struct nameidata nd; struct vnode *vp; int rv; - NDINIT(nd, LOOKUP, FOLLOW | TRYEMULROOT, UIO_USERSPACE, path); - if ((rv = namei(nd)) != 0) + if ((rv = namei_simple_user(path, NSM_FOLLOW_TRYEMULROOT, vp)) != 0) return rv; - vp = nd.ni_vp; *mpp = vp-v_mount; vrele(vp);
CVS commit: src/lib/libc/sys
Module Name:src Committed By: wiz Date: Mon Jun 29 08:38:07 UTC 2009 Modified Files: src/lib/libc/sys: getsockopt.2 Log Message: Mark up NULL with Dv. Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/getsockopt.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/getsockopt.2 diff -u src/lib/libc/sys/getsockopt.2:1.33 src/lib/libc/sys/getsockopt.2:1.34 --- src/lib/libc/sys/getsockopt.2:1.33 Mon Jun 29 06:22:13 2009 +++ src/lib/libc/sys/getsockopt.2 Mon Jun 29 08:38:07 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: getsockopt.2,v 1.33 2009/06/29 06:22:13 plunky Exp $ +.\ $NetBSD: getsockopt.2,v 1.34 2009/06/29 08:38:07 wiz Exp $ .\ .\ Copyright (c) 1983, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -94,7 +94,8 @@ the value returned. If no option value is to be supplied or returned, .Fa optval -may be NULL. +may be +.Dv NULL . .Pp .Fa optname and any specified options are passed uninterpreted to the appropriate @@ -365,7 +366,9 @@ to provide additional configuration options at attach time. Passing in an .Fa optval -of NULL will remove the filter. +of +.Dv NULL +will remove the filter. .Pp Finally, .Dv SO_TYPE @@ -402,7 +405,7 @@ is not in a valid part of the process address space. .It Bq Er EINVAL The socket -.Fa s +.Fa s was not suitable for installing an .Xr accept_filter 9 . .It Bq Er ENOPROTOOPT
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: mbalmer Date: Mon Jun 29 09:23:16 UTC 2009 Modified Files: src/sys/arch/i386/stand/lib: pcio.c Log Message: Have the boot countdown on i386 display starting in N seconds. instead of starting in N and eliminate a use of sprintf. Note that on some rare machines it can be that the BIOS does not provide the delay function. On such machines the countdown will almost immediately count down to zero display starting in 0 seconds.; apparently the net4801 is such a machine. Feedback, ideas, and inspiration from tron, ok tron/tonnerre To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/stand/lib/pcio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/pcio.c diff -u src/sys/arch/i386/stand/lib/pcio.c:1.25 src/sys/arch/i386/stand/lib/pcio.c:1.26 --- src/sys/arch/i386/stand/lib/pcio.c:1.25 Sun Dec 14 18:46:33 2008 +++ src/sys/arch/i386/stand/lib/pcio.c Mon Jun 29 09:23:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pcio.c,v 1.25 2008/12/14 18:46:33 christos Exp $ */ +/* $NetBSD: pcio.c,v 1.26 2009/06/29 09:23:16 mbalmer Exp $ */ /* * Copyright (c) 1996, 1997 @@ -323,15 +323,19 @@ for (;;) { if (tell (i % POLL_FREQ) == 0) { - char numbuf[20]; - int len, j; + char numbuf[32]; + int len; - sprintf(numbuf, %d , i/POLL_FREQ); - len = strlen(numbuf); - for (j = 0; j len; j++) -numbuf[len + j] = '\b'; - numbuf[len + j] = '\0'; - printf(numbuf); + len = snprintf(numbuf, sizeof(numbuf), %d seconds. , + i/POLL_FREQ); + if (len 0 len sizeof(numbuf)) { +char *p = numbuf; + +printf(%s, numbuf); +while (*p) + *p++ = '\b'; +printf(%s, numbuf); + } } if (iskey(1)) { /* flush input buffer */ @@ -349,7 +353,7 @@ out: if (tell) - printf(0 \n); + printf(0 seconds. \n); return c; }
CVS commit: src/sys/dev/pci
Module Name:src Committed By: hubertf Date: Mon Jun 29 11:02:44 UTC 2009 Modified Files: src/sys/dev/pci: pcidevs Log Message: add a few sdhc(4) devices To generate a diff of this commit: cvs rdiff -u -r1.992 -r1.993 src/sys/dev/pci/pcidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/pcidevs diff -u src/sys/dev/pci/pcidevs:1.992 src/sys/dev/pci/pcidevs:1.993 --- src/sys/dev/pci/pcidevs:1.992 Fri Jun 12 23:00:24 2009 +++ src/sys/dev/pci/pcidevs Mon Jun 29 11:02:43 2009 @@ -1,4 +1,4 @@ -$NetBSD: pcidevs,v 1.992 2009/06/12 23:00:24 rjs Exp $ +$NetBSD: pcidevs,v 1.993 2009/06/29 11:02:43 hubertf Exp $ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -1849,6 +1849,7 @@ /* ENE Technology products */ product ENE MCR510 0x0510 MCR510 PCI Memory Card Reader Controller +product ENE CB712 0x0550 CB712/714/810 PCI SD Card Reader Controller product ENE CB1211 0x1211 CB1211 CardBus Controller product ENE CB1225 0x1225 CB1225 CardBus Controller product ENE CB1410 0x1410 CB1410 CardBus Controller @@ -3899,6 +3900,8 @@ product TI PCI72111CB 0x8031 PCI7x21/7x11 Cardbus Controller product TI PCI72111FW 0x8032 PCI7x21/7x11 IEEE 1394 Host Controller product TI PCI72111FM 0x8033 PCI7x21/7x11 Integrated FlashMedia Controller +product TI PCI72111SD 0x8034 PCI7x21/7x11 SD Card Controller +product TI PCI72111SM 0x8035 PCI7x21/7x11 SM Card Controller product TI PCI6515A 0x8036 PCI6515A Cardbus Controller product TI PCI6515ASM 0x8038 PCI6515A Cardbus Controller (Smart Card mode) product TI PCIXX12CB 0x8039 PCIXX12 Cardbus Controller
CVS commit: src/sys/dev/pci
Module Name:src Committed By: hubertf Date: Mon Jun 29 11:05:12 UTC 2009 Modified Files: src/sys/dev/pci: sdhc_pci.c Log Message: Use PCI IDs from pcidevs, instead of storing them in here. Compile tested and OK'd by NONAKA Kimihiro. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/sdhc_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/sdhc_pci.c diff -u src/sys/dev/pci/sdhc_pci.c:1.1 src/sys/dev/pci/sdhc_pci.c:1.2 --- src/sys/dev/pci/sdhc_pci.c:1.1 Tue Apr 21 03:00:29 2009 +++ src/sys/dev/pci/sdhc_pci.c Mon Jun 29 11:05:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sdhc_pci.c,v 1.1 2009/04/21 03:00:29 nonaka Exp $ */ +/* $NetBSD: sdhc_pci.c,v 1.2 2009/06/29 11:05:12 hubertf Exp $ */ /* $OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $ */ /* @@ -18,7 +18,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sdhc_pci.c,v 1.1 2009/04/21 03:00:29 nonaka Exp $); +__KERNEL_RCSID(0, $NetBSD: sdhc_pci.c,v 1.2 2009/06/29 11:05:12 hubertf Exp $); #include sys/param.h #include sys/device.h @@ -67,11 +67,6 @@ #define DPRINTF(s) /**/ #endif -/* XXX */ -#define PCI_PRODUCT_TI_PCI7XX1_FLASH 0x8033 -#define PCI_PRODUCT_TI_PCI7XX1_SD 0x8034 -#define PCI_PRODUCT_ENE_SDCARD 0x0550 - static const struct sdhc_pci_quirk { pci_vendor_id_t vendor; pci_product_id_t product; @@ -86,7 +81,7 @@ } sdhc_pci_quirk_table[] = { { PCI_VENDOR_TI, - PCI_PRODUCT_TI_PCI7XX1_SD, + PCI_PRODUCT_TI_PCI72111SD, 0x, 0x, 4, @@ -95,7 +90,7 @@ { PCI_VENDOR_ENE, - PCI_PRODUCT_ENE_SDCARD, + PCI_PRODUCT_ENE_CB712, 0x, 0x, 0, @@ -286,7 +281,7 @@ /* Look at func 3 for the flash device */ tag = pci_make_tag(pc, pa-pa_bus, pa-pa_device, 3); id = pci_conf_read(pc, tag, PCI_ID_REG); - if (PCI_PRODUCT(id) != PCI_PRODUCT_TI_PCI7XX1_FLASH) + if (PCI_PRODUCT(id) != PCI_PRODUCT_TI_PCI72111FM) return; /*
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: pgoyette Date: Mon Jun 29 12:30:09 UTC 2009 Modified Files: src/sys/arch/x86/x86: ipmi.c Log Message: Adapt to new features available in sysmon_envsys: 1) expose the built-in limits to user-land (via envstat(8)), and 2) allow user-specified limits to override the built-in limits. No comments received from current-users@ over 2-week period. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/x86/ipmi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/ipmi.c diff -u src/sys/arch/x86/x86/ipmi.c:1.35 src/sys/arch/x86/x86/ipmi.c:1.36 --- src/sys/arch/x86/x86/ipmi.c:1.35 Mon Jun 1 20:36:43 2009 +++ src/sys/arch/x86/x86/ipmi.c Mon Jun 29 12:30:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ipmi.c,v 1.35 2009/06/01 20:36:43 pgoyette Exp $ */ +/* $NetBSD: ipmi.c,v 1.36 2009/06/29 12:30:09 pgoyette Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -57,7 +57,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.35 2009/06/01 20:36:43 pgoyette Exp $); +__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.36 2009/06/29 12:30:09 pgoyette Exp $); #include sys/types.h #include sys/param.h @@ -89,6 +89,7 @@ char i_envdesc[64]; int i_envtype; /* envsys compatible type */ int i_envnum; /* envsys index */ + sysmon_envsys_lim_t *i_limits; SLIST_ENTRY(ipmi_sensor) i_list; }; @@ -214,8 +215,11 @@ void *scan_sig(long, long, int, int, const void *); -int ipmi_test_threshold_lo(uint8_t, uint8_t, uint8_t); -int ipmi_test_threshold_hi(uint8_t, uint8_t, uint8_t); +int32_t ipmi_convert_sensor(uint8_t *, struct ipmi_sensor *); +void ipmi_get_limits(struct sysmon_envsys *, envsys_data_t *, + sysmon_envsys_lim_t *); +int ipmi_get_sensor_limits(struct ipmi_softc *, struct ipmi_sensor *, + sysmon_envsys_lim_t *); int ipmi_sensor_status(struct ipmi_softc *, struct ipmi_sensor *, envsys_data_t *, uint8_t *); @@ -1307,46 +1311,104 @@ return (val); } -int -ipmi_test_threshold_hi(uint8_t v, uint8_t valid, uint8_t hi) -{ - dbg_printf(10, thresh_hi: %.2x %.2x %d\n, v, hi, valid); - return (valid 8 hi != 0xFF v = hi); -} - -int -ipmi_test_threshold_lo(uint8_t v, uint8_t valid, uint8_t lo) -{ - dbg_printf(10, thresh_lo: %.2x %.2x %d\n, v, lo, valid); - return (valid 1 lo != 0x00 v = lo); -} - -int -ipmi_sensor_status(struct ipmi_softc *sc, struct ipmi_sensor *psensor, -envsys_data_t *edata, uint8_t *reading) +int32_t +ipmi_convert_sensor(uint8_t *reading, struct ipmi_sensor *psensor) { - uint8_t data[32]; struct sdrtype1 *s1 = (struct sdrtype1 *)psensor-i_sdr; - int rxlen, etype; - /* Get reading of sensor */ - switch (edata-units) { + int32_t val; + + switch (psensor-i_envtype) { case ENVSYS_STEMP: - edata-value_cur = ipmi_convert(reading[0], s1, 6); - edata-value_cur += 27315; + val = ipmi_convert(reading[0], s1, 6) + 27315; break; case ENVSYS_SVOLTS_DC: - edata-value_cur = ipmi_convert(reading[0], s1, 6); + val = ipmi_convert(reading[0], s1, 6); break; case ENVSYS_SFANRPM: - edata-value_cur = ipmi_convert(reading[0], s1, 0); + val = ipmi_convert(reading[0], s1, 0); if (((s1-units13)0x7) == 0x3) - edata-value_cur *= 60; /* RPS - RPM */ + val *= 60; /* RPS - RPM */ break; default: + val = 0; break; } + return val; +} + +void +ipmi_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata, + sysmon_envsys_lim_t *limits) +{ + struct ipmi_sensor *ipmi_s; + struct ipmi_softc *sc = sme-sme_cookie; + + /* Find the ipmi_sensor corresponding to this edata */ + SLIST_FOREACH(ipmi_s, ipmi_sensor_list, i_list) { + if (ipmi_s-i_envnum == edata-sensor) { + (void)ipmi_get_sensor_limits(sc, ipmi_s, limits); + ipmi_s-i_limits = limits; + return; + } + } + return; +} + +int +ipmi_get_sensor_limits(struct ipmi_softc *sc, struct ipmi_sensor *psensor, + sysmon_envsys_lim_t *limits) +{ + struct sdrtype1 *s1 = (struct sdrtype1 *)psensor-i_sdr; + int rxlen; + uint8_t data[32]; + + data[0] = psensor-i_num; + if (ipmi_sendcmd(sc, s1-owner_id, s1-owner_lun, + SE_NETFN, SE_GET_SENSOR_THRESHOLD, 1, data) || + ipmi_recvcmd(sc, sizeof(data), rxlen, data)) + return -1; + + dbg_printf(25, recvdata: %.2x %.2x %.2x %.2x %.2x %.2x %.2x\n, + data[0], data[1], data[2], data[3], data[4], data[5], data[6]); + + limits-sel_flags = 0; + if (data[0] 0x20) { + limits-sel_critmax = ipmi_convert_sensor(data[6], psensor); + limits-sel_flags |= PROP_CRITMAX; + } + if (data[0] 0x10) { + limits-sel_critmax = ipmi_convert_sensor(data[5], psensor); + limits-sel_flags |= PROP_CRITMAX; + } + if (data[0] 0x08) { + limits-sel_warnmax = ipmi_convert_sensor(data[4], psensor); + limits-sel_flags |= PROP_WARNMAX; + } + if (data[0] 0x04) { + limits-sel_critmin = ipmi_convert_sensor(data[3], psensor); + limits-sel_flags |= PROP_CRITMIN; + } + if (data[0] 0x02)
CVS commit: src/sys/arch/mips
Module Name:src Committed By: tsutsui Date: Mon Jun 29 13:22:52 UTC 2009 Modified Files: src/sys/arch/mips/include: pmap.h src/sys/arch/mips/mips: pmap.c Log Message: Since pmap.c rev 1.163, page attributes of PV_MODIFIED and PV_REFERENCED have beem moved from pv_flags in struct pv_entry to pvh_attrs in struct vm_page_md, so no need to copy pv_flags to keep these flags in pv header in pmap_remove_pv(). Pointed out by uebayasi@ on port-mips. Also rename those page attribute flags from PV_FOO to PGA_FOO like alpha. While here, make pv_flags unsigned. Briefly tested on sgimips O2. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mips/include/pmap.h cvs rdiff -u -r1.182 -r1.183 src/sys/arch/mips/mips/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/pmap.h diff -u src/sys/arch/mips/include/pmap.h:1.55 src/sys/arch/mips/include/pmap.h:1.56 --- src/sys/arch/mips/include/pmap.h:1.55 Tue Dec 9 20:45:45 2008 +++ src/sys/arch/mips/include/pmap.h Mon Jun 29 13:22:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.55 2008/12/09 20:45:45 pooka Exp $ */ +/* $NetBSD: pmap.h,v 1.56 2009/06/29 13:22:51 tsutsui Exp $ */ /* * Copyright (c) 1992, 1993 @@ -131,12 +131,13 @@ struct pv_entry *pv_next; /* next pv_entry */ struct pmap *pv_pmap; /* pmap where mapping lies */ vaddr_t pv_va; /* virtual address for mapping */ - int pv_flags; /* some flags for the mapping */ + u_int pv_flags; /* some flags for the mapping */ +#define PV_UNCACHED 0x0001 /* page is mapped uncached */ } *pv_entry_t; -#define PV_UNCACHED 0x0001 /* page is mapped uncached */ -#define PV_MODIFIED 0x0002 /* page has been modified */ -#define PV_REFERENCED 0x0004 /* page has been recently referenced */ +/* pvh_attrs flags in struct vm_page_md */ +#define PGA_MODIFIED 0x0001 /* page has been modified */ +#define PGA_REFERENCED 0x0002 /* page has been recently referenced */ #ifdef _KERNEL Index: src/sys/arch/mips/mips/pmap.c diff -u src/sys/arch/mips/mips/pmap.c:1.182 src/sys/arch/mips/mips/pmap.c:1.183 --- src/sys/arch/mips/mips/pmap.c:1.182 Tue Apr 21 21:29:59 2009 +++ src/sys/arch/mips/mips/pmap.c Mon Jun 29 13:22:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.182 2009/04/21 21:29:59 cegger Exp $ */ +/* $NetBSD: pmap.c,v 1.183 2009/06/29 13:22:51 tsutsui Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.182 2009/04/21 21:29:59 cegger Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.183 2009/06/29 13:22:51 tsutsui Exp $); /* * Manages physical address maps. @@ -1156,9 +1156,9 @@ /* Set page referenced/modified status based on flags */ if (flags VM_PROT_WRITE) - *attrs |= PV_MODIFIED | PV_REFERENCED; + *attrs |= PGA_MODIFIED | PGA_REFERENCED; else if (flags VM_PROT_ALL) - *attrs |= PV_REFERENCED; + *attrs |= PGA_REFERENCED; if (!(prot VM_PROT_WRITE)) /* * If page is not yet referenced, we could emulate this @@ -1171,14 +1171,14 @@ else { #if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64) if (cached == 0) { -if (*attrs PV_MODIFIED) { +if (*attrs PGA_MODIFIED) { npte = mips_pg_rwncpage_bit(); } else { npte = mips_pg_cwncpage_bit(); } } else { #endif -if (*attrs PV_MODIFIED) { +if (*attrs PGA_MODIFIED) { npte = mips_pg_rwpage_bit(); } else { npte = mips_pg_cwpage_bit(); @@ -1712,8 +1712,8 @@ (u_long)VM_PAGE_TO_PHYS(pg)); #endif attrp = pg-mdpage.pvh_attrs; - rv = *attrp PV_REFERENCED; - *attrp = ~PV_REFERENCED; + rv = *attrp PGA_REFERENCED; + *attrp = ~PGA_REFERENCED; return rv; } @@ -1727,7 +1727,7 @@ pmap_is_referenced(struct vm_page *pg) { - return pg-mdpage.pvh_attrs PV_REFERENCED; + return pg-mdpage.pvh_attrs PGA_REFERENCED; } /* @@ -1749,8 +1749,8 @@ printf(pmap_clear_modify(%lx)\n, (u_long)VM_PAGE_TO_PHYS(pg)); #endif attrp = pg-mdpage.pvh_attrs; - rv = *attrp PV_MODIFIED; - *attrp = ~PV_MODIFIED; + rv = *attrp PGA_MODIFIED; + *attrp = ~PGA_MODIFIED; if (!rv) { return rv; } @@ -1805,7 +1805,7 @@ pmap_is_modified(struct vm_page *pg) { - return pg-mdpage.pvh_attrs PV_MODIFIED; + return pg-mdpage.pvh_attrs PGA_MODIFIED; } /* @@ -1819,7 +1819,7 @@ struct vm_page *pg; pg = PHYS_TO_VM_PAGE(pa); - pg-mdpage.pvh_attrs |= PV_MODIFIED | PV_REFERENCED; + pg-mdpage.pvh_attrs |= PGA_MODIFIED | PGA_REFERENCED; } / misc. functions / @@ -2043,14 +2043,6 @@ if (pmap == pv-pv_pmap va == pv-pv_va) { npv = pv-pv_next; if (npv) { - - /* - * Copy current modified and referenced status to - * the following entry before copying. - */ - - npv-pv_flags |= - pv-pv_flags (PV_MODIFIED | PV_REFERENCED); *pv = *npv;
CVS commit: src/external/mit/xorg/server/drivers/xf86-video-savage
Module Name:src Committed By: mrg Date: Mon Jun 29 15:40:10 UTC 2009 Modified Files: src/external/mit/xorg/server/drivers/xf86-video-savage: Makefile Log Message: add files needed for DRI. should fix a problem reported by Matthew Mondor. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/mit/xorg/server/drivers/xf86-video-savage/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/server/drivers/xf86-video-savage/Makefile diff -u src/external/mit/xorg/server/drivers/xf86-video-savage/Makefile:1.4 src/external/mit/xorg/server/drivers/xf86-video-savage/Makefile:1.5 --- src/external/mit/xorg/server/drivers/xf86-video-savage/Makefile:1.4 Sun Aug 3 14:47:26 2008 +++ src/external/mit/xorg/server/drivers/xf86-video-savage/Makefile Mon Jun 29 15:40:10 2009 @@ -1,13 +1,23 @@ -# $NetBSD: Makefile,v 1.4 2008/08/03 14:47:26 rtr Exp $ +# $NetBSD: Makefile,v 1.5 2009/06/29 15:40:10 mrg Exp $ DRIVER= xf86-video-savage DRIVER_NAME= savage_drv -SRCS= savage_accel.c savage_xaa.c savage_exa.c -SRCS+= savage_cursor.c savage_dga.c savage_driver.c -SRCS+= savage_i2c.c savage_shadow.c savage_streams.c -SRCS+= savage_vbe.c savage_video.c -MAN= savage.4 +SRCS= \ + savage_accel.c \ + savage_xaa.c \ + savage_exa.c \ + savage_cursor.c \ + savage_dga.c \ + savage_driver.c \ + savage_i2c.c \ + savage_shadow.c \ + savage_streams.c \ + savage_vbe.c \ + savage_video.c \ + savage_hwmc.c \ + savage_dri.c +MAN= savage.4 CPPFLAGS+= -I${DESTDIR}${X11INCDIR}/X11 CPPFLAGS+= -I${DESTDIR}${X11INCDIR}/X11/dri
CVS commit: src/sys/kern
Module Name:src Committed By: dyoung Date: Mon Jun 29 18:03:37 UTC 2009 Modified Files: src/sys/kern: Make.tags.inc Log Message: Fix a typo in last (coda/ exclusion). To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/kern/Make.tags.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/Make.tags.inc diff -u src/sys/kern/Make.tags.inc:1.19 src/sys/kern/Make.tags.inc:1.20 --- src/sys/kern/Make.tags.inc:1.19 Fri Jun 26 22:59:25 2009 +++ src/sys/kern/Make.tags.inc Mon Jun 29 18:03:37 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Make.tags.inc,v 1.19 2009/06/26 22:59:25 dyoung Exp $ +# $NetBSD: Make.tags.inc,v 1.20 2009/06/29 18:03:37 dyoung Exp $ # # from: @(#)Make.tags.inc 8.1 (Berkeley) 6/11/93 @@ -15,7 +15,7 @@ # This promises to be easier to maintain, considering how often the directory # structure of the kernel sources has been changing recently. SYSDIR?= ${.CURDIR:H:H} -FINDCOMM= find -H ${SYSDIR} \( -path '*/dist/ipf' -o -name arch -o -name rump -o name coda \) -prune -o -type f -name *.[ch] \( \! -name 'altq.h' \! -name 'nbcompat.h' \! -name 'pf_osfp.c' \! -name 'unichromereg.h' \! -name 'usb_port.h' \! -name 'midway*' \! -name 'if_lmc.[ch]' \) -print | \ +FINDCOMM= find -H ${SYSDIR} \( -path '*/dist/ipf' -o -name arch -o -name rump -o -name coda \) -prune -o -type f -name *.[ch] \( \! -name 'altq.h' \! -name 'nbcompat.h' \! -name 'pf_osfp.c' \! -name 'unichromereg.h' \! -name 'usb_port.h' \! -name 'midway*' \! -name 'if_lmc.[ch]' \) -print | \ sort -t / -u COMM!= ${FINDCOMM} .endif
CVS commit: src/sys/arch/mipsco/obio
Module Name:src Committed By: mbalmer Date: Mon Jun 29 20:49:25 UTC 2009 Modified Files: src/sys/arch/mipsco/obio: rambo.h Log Message: Fix integer constant RB_FREQUENC, 25MHz/4 is 625L, not 625000L This fixes PR 39931 PR and fix from Miod Vallat m...@online.fr, many thanks! To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mipsco/obio/rambo.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mipsco/obio/rambo.h diff -u src/sys/arch/mipsco/obio/rambo.h:1.6 src/sys/arch/mipsco/obio/rambo.h:1.7 --- src/sys/arch/mipsco/obio/rambo.h:1.6 Mon Apr 28 20:23:28 2008 +++ src/sys/arch/mipsco/obio/rambo.h Mon Jun 29 20:49:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rambo.h,v 1.6 2008/04/28 20:23:28 martin Exp $ */ +/* $NetBSD: rambo.h,v 1.7 2009/06/29 20:49:25 mbalmer Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. @@ -109,7 +109,7 @@ #define RB_BOUNDRY (1RB_BSIZE) /* Rambo cycle counter is fed by 25MHz clock then divided by 4 */ -#define RB_FREQUENCY 625000L +#define RB_FREQUENCY 625L #define HZ_TO_TICKS(hz) (RB_FREQUENCY/(hz)) #define TICKS_TO_USECS(t) (((t)*4)/25) #endif
CVS commit: src/crypto/dist/ssh
Module Name:src Committed By: tonnerre Date: Mon Jun 29 22:52:13 UTC 2009 Modified Files: src/crypto/dist/ssh: cipher.c cipher.h packet.c Log Message: Add special handling for CBC cipher modes to make them appear less favorable than CTR modes. Also, in order to avoid creating oracles unnecessarily, change behavior in various situations from Drop connection to Ignore packets up to 256kB. This affects CBC mode ciphers only. Patch from OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/crypto/dist/ssh/cipher.c cvs rdiff -u -r1.2 -r1.3 src/crypto/dist/ssh/cipher.h cvs rdiff -u -r1.31 -r1.32 src/crypto/dist/ssh/packet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ssh/cipher.c diff -u src/crypto/dist/ssh/cipher.c:1.21 src/crypto/dist/ssh/cipher.c:1.22 --- src/crypto/dist/ssh/cipher.c:1.21 Mon Jun 23 14:51:31 2008 +++ src/crypto/dist/ssh/cipher.c Mon Jun 29 22:52:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cipher.c,v 1.21 2008/06/23 14:51:31 christos Exp $ */ +/* $NetBSD: cipher.c,v 1.22 2009/06/29 22:52:13 tonnerre Exp $ */ /* $OpenBSD: cipher.c,v 1.81 2006/08/03 03:34:42 deraadt Exp $ */ /* * Author: Tatu Ylonen y...@cs.hut.fi @@ -37,7 +37,7 @@ */ #include includes.h -__RCSID($NetBSD: cipher.c,v 1.21 2008/06/23 14:51:31 christos Exp $); +__RCSID($NetBSD: cipher.c,v 1.22 2009/06/29 22:52:13 tonnerre Exp $); #include sys/types.h #include openssl/md5.h @@ -62,38 +62,39 @@ u_int block_size; u_int key_len; u_int discard_len; + u_int cbc_mode; const EVP_CIPHER *(*evptype)(void); } ciphers[] = { - { none, SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null }, - { des, SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc }, - { 3des, SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des }, - { blowfish, SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf }, - - { 3des-cbc, SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc }, - { blowfish-cbc, SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc }, - { cast128-cbc, SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc }, - { arcfour, SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 }, - { arcfour128, SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 }, - { arcfour256, SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 }, - { aes128-cbc, SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc }, - { aes192-cbc, SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc }, - { aes256-cbc, SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc }, + { none, SSH_CIPHER_NONE, 8, 0, 0, 0, EVP_enc_null }, + { des, SSH_CIPHER_DES, 8, 8, 0, 1, EVP_des_cbc }, + { 3des, SSH_CIPHER_3DES, 8, 16, 0, 1, evp_ssh1_3des }, + { blowfish, SSH_CIPHER_BLOWFISH, 8, 32, 0, 0, evp_ssh1_bf }, + + { 3des-cbc, SSH_CIPHER_SSH2, 8, 24, 0, 1, EVP_des_ede3_cbc }, + { blowfish-cbc, SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_bf_cbc }, + { cast128-cbc, SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_cast5_cbc }, + { arcfour, SSH_CIPHER_SSH2, 8, 16, 0, 0, EVP_rc4 }, + { arcfour128, SSH_CIPHER_SSH2, 8, 16, 1536, 0, EVP_rc4 }, + { arcfour256, SSH_CIPHER_SSH2, 8, 32, 1536, 0, EVP_rc4 }, + { aes128-cbc, SSH_CIPHER_SSH2, 16, 16, 0, 1, EVP_aes_128_cbc }, + { aes192-cbc, SSH_CIPHER_SSH2, 16, 24, 0, 1, EVP_aes_192_cbc }, + { aes256-cbc, SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc }, { rijndael-...@lysator.liu.se, -SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc }, +SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc }, #ifdef AES_CTR_MT - { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_ctr_mt }, - { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_ctr_mt }, - { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_ctr_mt }, + { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_ctr_mt }, + { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_ctr_mt }, + { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_ctr_mt }, #else - { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr }, - { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr }, - { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr }, + { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_128_ctr }, + { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_128_ctr }, + { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_128_ctr }, #endif #ifdef ACSS - { a...@openssh.org, SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss }, + { a...@openssh.org, SSH_CIPHER_SSH2, 16, 5, 0, 0, EVP_acss }, #endif - { NULL, SSH_CIPHER_INVALID, 0, 0, 0, NULL } + { NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, NULL } }; #ifndef ACSS @@ -121,6 +122,12 @@ } u_int +cipher_is_cbc(const Cipher *c) +{ + return (c-cbc_mode); +} + +u_int cipher_mask_ssh1(int client) { u_int mask = 0; Index: src/crypto/dist/ssh/cipher.h diff -u src/crypto/dist/ssh/cipher.h:1.2 src/crypto/dist/ssh/cipher.h:1.3 --- src/crypto/dist/ssh/cipher.h:1.2 Thu Sep 28 21:22:14 2006 +++ src/crypto/dist/ssh/cipher.h Mon Jun 29 22:52:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cipher.h,v 1.2 2006/09/28 21:22:14 christos Exp $ */ +/* $NetBSD: cipher.h,v 1.3 2009/06/29 22:52:13 tonnerre
CVS commit: [netbsd-5] src/crypto/dist/ssh
Module Name:src Committed By: snj Date: Mon Jun 29 22:58:38 UTC 2009 Modified Files: src/crypto/dist/ssh [netbsd-5]: cipher.c cipher.h packet.c Log Message: Pull up following revision(s) (requested by tonnerre in ticket #843): crypto/dist/ssh/cipher.c: revision 1.22 crypto/dist/ssh/cipher.h: revision 1.3 crypto/dist/ssh/packet.c: revision 1.32 Add special handling for CBC cipher modes to make them appear less favorable than CTR modes. Also, in order to avoid creating oracles unnecessarily, change behavior in various situations from Drop connection to Ignore packets up to 256kB. This affects CBC mode ciphers only. Patch from OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.4.1 src/crypto/dist/ssh/cipher.c cvs rdiff -u -r1.2 -r1.2.24.1 src/crypto/dist/ssh/cipher.h cvs rdiff -u -r1.30 -r1.30.4.1 src/crypto/dist/ssh/packet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ssh/cipher.c diff -u src/crypto/dist/ssh/cipher.c:1.21 src/crypto/dist/ssh/cipher.c:1.21.4.1 --- src/crypto/dist/ssh/cipher.c:1.21 Mon Jun 23 14:51:31 2008 +++ src/crypto/dist/ssh/cipher.c Mon Jun 29 22:58:38 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cipher.c,v 1.21 2008/06/23 14:51:31 christos Exp $ */ +/* $NetBSD: cipher.c,v 1.21.4.1 2009/06/29 22:58:38 snj Exp $ */ /* $OpenBSD: cipher.c,v 1.81 2006/08/03 03:34:42 deraadt Exp $ */ /* * Author: Tatu Ylonen y...@cs.hut.fi @@ -37,7 +37,7 @@ */ #include includes.h -__RCSID($NetBSD: cipher.c,v 1.21 2008/06/23 14:51:31 christos Exp $); +__RCSID($NetBSD: cipher.c,v 1.21.4.1 2009/06/29 22:58:38 snj Exp $); #include sys/types.h #include openssl/md5.h @@ -62,38 +62,39 @@ u_int block_size; u_int key_len; u_int discard_len; + u_int cbc_mode; const EVP_CIPHER *(*evptype)(void); } ciphers[] = { - { none, SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null }, - { des, SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc }, - { 3des, SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des }, - { blowfish, SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf }, - - { 3des-cbc, SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc }, - { blowfish-cbc, SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc }, - { cast128-cbc, SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc }, - { arcfour, SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 }, - { arcfour128, SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 }, - { arcfour256, SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 }, - { aes128-cbc, SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc }, - { aes192-cbc, SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc }, - { aes256-cbc, SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc }, + { none, SSH_CIPHER_NONE, 8, 0, 0, 0, EVP_enc_null }, + { des, SSH_CIPHER_DES, 8, 8, 0, 1, EVP_des_cbc }, + { 3des, SSH_CIPHER_3DES, 8, 16, 0, 1, evp_ssh1_3des }, + { blowfish, SSH_CIPHER_BLOWFISH, 8, 32, 0, 0, evp_ssh1_bf }, + + { 3des-cbc, SSH_CIPHER_SSH2, 8, 24, 0, 1, EVP_des_ede3_cbc }, + { blowfish-cbc, SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_bf_cbc }, + { cast128-cbc, SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_cast5_cbc }, + { arcfour, SSH_CIPHER_SSH2, 8, 16, 0, 0, EVP_rc4 }, + { arcfour128, SSH_CIPHER_SSH2, 8, 16, 1536, 0, EVP_rc4 }, + { arcfour256, SSH_CIPHER_SSH2, 8, 32, 1536, 0, EVP_rc4 }, + { aes128-cbc, SSH_CIPHER_SSH2, 16, 16, 0, 1, EVP_aes_128_cbc }, + { aes192-cbc, SSH_CIPHER_SSH2, 16, 24, 0, 1, EVP_aes_192_cbc }, + { aes256-cbc, SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc }, { rijndael-...@lysator.liu.se, -SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc }, +SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc }, #ifdef AES_CTR_MT - { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_ctr_mt }, - { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_ctr_mt }, - { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_ctr_mt }, + { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_ctr_mt }, + { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_ctr_mt }, + { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_ctr_mt }, #else - { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr }, - { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr }, - { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr }, + { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_128_ctr }, + { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_128_ctr }, + { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_128_ctr }, #endif #ifdef ACSS - { a...@openssh.org, SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss }, + { a...@openssh.org, SSH_CIPHER_SSH2, 16, 5, 0, 0, EVP_acss }, #endif - { NULL, SSH_CIPHER_INVALID, 0, 0, 0, NULL } + { NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, NULL } }; #ifndef ACSS @@ -121,6 +122,12 @@ } u_int +cipher_is_cbc(const Cipher *c) +{ + return (c-cbc_mode); +} + +u_int cipher_mask_ssh1(int client) { u_int mask = 0; Index: src/crypto/dist/ssh/cipher.h diff -u src/crypto/dist/ssh/cipher.h:1.2 src/crypto/dist/ssh/cipher.h:1.2.24.1 ---
CVS commit: [netbsd-5-0] src/crypto/dist/ssh
Module Name:src Committed By: snj Date: Mon Jun 29 23:01:24 UTC 2009 Modified Files: src/crypto/dist/ssh [netbsd-5-0]: cipher.c cipher.h packet.c Log Message: Pull up following revision(s) (requested by tonnerre in ticket #843): crypto/dist/ssh/cipher.c: revision 1.22 crypto/dist/ssh/cipher.h: revision 1.3 crypto/dist/ssh/packet.c: revision 1.32 Add special handling for CBC cipher modes to make them appear less favorable than CTR modes. Also, in order to avoid creating oracles unnecessarily, change behavior in various situations from Drop connection to Ignore packets up to 256kB. This affects CBC mode ciphers only. Patch from OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.8.1 src/crypto/dist/ssh/cipher.c cvs rdiff -u -r1.2 -r1.2.28.1 src/crypto/dist/ssh/cipher.h cvs rdiff -u -r1.30 -r1.30.8.1 src/crypto/dist/ssh/packet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ssh/cipher.c diff -u src/crypto/dist/ssh/cipher.c:1.21 src/crypto/dist/ssh/cipher.c:1.21.8.1 --- src/crypto/dist/ssh/cipher.c:1.21 Mon Jun 23 14:51:31 2008 +++ src/crypto/dist/ssh/cipher.c Mon Jun 29 23:01:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cipher.c,v 1.21 2008/06/23 14:51:31 christos Exp $ */ +/* $NetBSD: cipher.c,v 1.21.8.1 2009/06/29 23:01:24 snj Exp $ */ /* $OpenBSD: cipher.c,v 1.81 2006/08/03 03:34:42 deraadt Exp $ */ /* * Author: Tatu Ylonen y...@cs.hut.fi @@ -37,7 +37,7 @@ */ #include includes.h -__RCSID($NetBSD: cipher.c,v 1.21 2008/06/23 14:51:31 christos Exp $); +__RCSID($NetBSD: cipher.c,v 1.21.8.1 2009/06/29 23:01:24 snj Exp $); #include sys/types.h #include openssl/md5.h @@ -62,38 +62,39 @@ u_int block_size; u_int key_len; u_int discard_len; + u_int cbc_mode; const EVP_CIPHER *(*evptype)(void); } ciphers[] = { - { none, SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null }, - { des, SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc }, - { 3des, SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des }, - { blowfish, SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf }, - - { 3des-cbc, SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc }, - { blowfish-cbc, SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc }, - { cast128-cbc, SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc }, - { arcfour, SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 }, - { arcfour128, SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 }, - { arcfour256, SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 }, - { aes128-cbc, SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc }, - { aes192-cbc, SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc }, - { aes256-cbc, SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc }, + { none, SSH_CIPHER_NONE, 8, 0, 0, 0, EVP_enc_null }, + { des, SSH_CIPHER_DES, 8, 8, 0, 1, EVP_des_cbc }, + { 3des, SSH_CIPHER_3DES, 8, 16, 0, 1, evp_ssh1_3des }, + { blowfish, SSH_CIPHER_BLOWFISH, 8, 32, 0, 0, evp_ssh1_bf }, + + { 3des-cbc, SSH_CIPHER_SSH2, 8, 24, 0, 1, EVP_des_ede3_cbc }, + { blowfish-cbc, SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_bf_cbc }, + { cast128-cbc, SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_cast5_cbc }, + { arcfour, SSH_CIPHER_SSH2, 8, 16, 0, 0, EVP_rc4 }, + { arcfour128, SSH_CIPHER_SSH2, 8, 16, 1536, 0, EVP_rc4 }, + { arcfour256, SSH_CIPHER_SSH2, 8, 32, 1536, 0, EVP_rc4 }, + { aes128-cbc, SSH_CIPHER_SSH2, 16, 16, 0, 1, EVP_aes_128_cbc }, + { aes192-cbc, SSH_CIPHER_SSH2, 16, 24, 0, 1, EVP_aes_192_cbc }, + { aes256-cbc, SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc }, { rijndael-...@lysator.liu.se, -SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc }, +SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc }, #ifdef AES_CTR_MT - { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_ctr_mt }, - { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_ctr_mt }, - { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_ctr_mt }, + { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_ctr_mt }, + { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_ctr_mt }, + { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_ctr_mt }, #else - { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr }, - { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr }, - { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr }, + { aes128-ctr, SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_128_ctr }, + { aes192-ctr, SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_128_ctr }, + { aes256-ctr, SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_128_ctr }, #endif #ifdef ACSS - { a...@openssh.org, SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss }, + { a...@openssh.org, SSH_CIPHER_SSH2, 16, 5, 0, 0, EVP_acss }, #endif - { NULL, SSH_CIPHER_INVALID, 0, 0, 0, NULL } + { NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, NULL } }; #ifndef ACSS @@ -121,6 +122,12 @@ } u_int +cipher_is_cbc(const Cipher *c) +{ + return (c-cbc_mode); +} + +u_int cipher_mask_ssh1(int client) { u_int mask = 0; Index: src/crypto/dist/ssh/cipher.h diff -u src/crypto/dist/ssh/cipher.h:1.2 src/crypto/dist/ssh/cipher.h:1.2.28.1 ---
CVS commit: src/games/hack
Module Name:src Committed By: dholland Date: Mon Jun 29 23:05:33 UTC 2009 Modified Files: src/games/hack: hack.do_name.c hack.h hack.invent.c hack.main.c hack.rip.c hack.topl.c hack.unix.c Log Message: Fix two serious string-handling bugs (one exploitable, one probably exploitable) and also add proper checking/paranoia in several other places. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/games/hack/hack.do_name.c cvs rdiff -u -r1.12 -r1.13 src/games/hack/hack.h src/games/hack/hack.invent.c \ src/games/hack/hack.main.c src/games/hack/hack.unix.c cvs rdiff -u -r1.10 -r1.11 src/games/hack/hack.rip.c \ src/games/hack/hack.topl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.9 src/games/hack/hack.do_name.c:1.10 --- src/games/hack/hack.do_name.c:1.9 Sun Jun 7 20:13:18 2009 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:05:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.9 2009/06/07 20:13:18 dholland Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.9 2009/06/07 20:13:18 dholland Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $); #endif/* not lint */ #include stdlib.h @@ -279,7 +279,7 @@ gn = ghostnames[rn2(SIZE(ghostnames))]; if (!rn2(2)) (void) - strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); + strlcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn, mtmp-mxlth); } (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } Index: src/games/hack/hack.h diff -u src/games/hack/hack.h:1.12 src/games/hack/hack.h:1.13 --- src/games/hack/hack.h:1.12 Sun Jun 7 21:04:54 2009 +++ src/games/hack/hack.h Mon Jun 29 23:05:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.h,v 1.12 2009/06/07 21:04:54 dholland Exp $ */ +/* $NetBSD: hack.h,v 1.13 2009/06/29 23:05:33 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -202,7 +202,7 @@ extern char SAVEF[]; extern char fut_geno[60]; /* idem */ extern char genocided[60]; /* defined in Decl.c */ -extern char lock[]; +extern char lock[PL_NSIZ + 4]; extern const char mlarge[]; extern char morc; extern const char nul[]; Index: src/games/hack/hack.invent.c diff -u src/games/hack/hack.invent.c:1.12 src/games/hack/hack.invent.c:1.13 --- src/games/hack/hack.invent.c:1.12 Sun Jun 7 20:13:18 2009 +++ src/games/hack/hack.invent.c Mon Jun 29 23:05:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.invent.c,v 1.12 2009/06/07 20:13:18 dholland Exp $ */ +/* $NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,9 +63,10 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.invent.c,v 1.12 2009/06/07 20:13:18 dholland Exp $); +__RCSID($NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $); #endif/* not lint */ +#include assert.h #include stdlib.h #include hack.h #include extern.h @@ -555,7 +556,7 @@ charbuf[BUFSZ]; char *ip; charsym; - int oletct = 0, iletct = 0; + unsignedoletct = 0, iletct = 0; boolean allflag = FALSE; charolets[20], ilets[20]; int (*ckfn)(struct obj *) = @@ -586,6 +587,7 @@ if (invent) ilets[iletct++] = 'a'; ilets[iletct] = 0; + assert(iletct sizeof(ilets)); } pline(What kinds of thing do you want to %s? [%s] , word, ilets); @@ -614,6 +616,7 @@ olets[oletct++] = sym; olets[oletct] = 0; } + assert(oletct sizeof(olets)); } else pline(You don't have any %c's., sym); } @@ -723,7 +726,7 @@ { struct obj *otmp; charilet; - int ct = 0; + unsignedct = 0; charany[BUFSZ]; morc = 0; /* just to be sure */ @@ -746,6 +749,7 @@ ilet = 'A'; } any[ct] = 0; + assert(ct sizeof(any)); cornline(2, any); } @@ -755,7 +759,7 @@ /* Changed to one type only, so he doesnt have to type cr */ charc, ilet; charstuff[BUFSZ]; - int stct; + unsignedstct; struct obj *otmp; boolean billx = inshop() doinvbill(0); boolean unpd = FALSE; @@ -781,6 +785,7 @@ if (billx) stuff[stct++] = 'x'; stuff[stct] = 0; + assert(stct sizeof(stuff)); if (stct 1) { pline(What type of object [%s] do you want an inventory of? , @@ -817,6 +822,8 @@ ilet = 'A'; } stuff[stct] = '\0'; + assert(stct sizeof(stuff)); + if (stct == 0) pline(You have no such objects.); else Index: src/games/hack/hack.main.c diff -u src/games/hack/hack.main.c:1.12
CVS commit: [netbsd-5-0] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:22:24 UTC 2009 Modified Files: src/games/hack [netbsd-5-0]: extern.h hack.do_name.c hack.eat.c hack.end.c hack.fight.c hack.invent.c hack.main.c hack.objnam.c hack.options.c hack.pri.c hack.rip.c hack.shk.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #844): games/hack/extern.h: revision 1.11 games/hack/hack.pri.c: revision 1.11 games/hack/hack.do_name.c: revision 1.9 games/hack/hack.fight.c: revision 1.10 games/hack/hack.topl.c: revision 1.10 games/hack/hack.invent.c: revision 1.12 games/hack/hack.rip.c: revision 1.10 games/hack/hack.options.c: revision 1.9 games/hack/hack.main.c: revision 1.12 games/hack/hack.eat.c: revision 1.8 games/hack/hack.shk.c: revision 1.10 games/hack/hack.end.c: revision 1.12 games/hack/hack.objnam.c: revision 1.9 games/hack/hack.unix.c: revision 1.12 sprintf - snprintf, plus some use of strlcpy/strlcat where appropriate XXX: there's still one sprintf left which will take some hacking to expunge. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.8.8.1 src/games/hack/extern.h cvs rdiff -u -r1.7 -r1.7.14.1 src/games/hack/hack.do_name.c \ src/games/hack/hack.objnam.c cvs rdiff -u -r1.6 -r1.6.42.1 src/games/hack/hack.eat.c cvs rdiff -u -r1.9 -r1.9.14.1 src/games/hack/hack.end.c \ src/games/hack/hack.pri.c cvs rdiff -u -r1.8 -r1.8.14.1 src/games/hack/hack.fight.c \ src/games/hack/hack.rip.c src/games/hack/hack.topl.c cvs rdiff -u -r1.10 -r1.10.30.1 src/games/hack/hack.invent.c cvs rdiff -u -r1.10 -r1.10.14.1 src/games/hack/hack.main.c cvs rdiff -u -r1.7 -r1.7.42.1 src/games/hack/hack.options.c cvs rdiff -u -r1.8 -r1.8.30.1 src/games/hack/hack.shk.c cvs rdiff -u -r1.9 -r1.9.42.1 src/games/hack/hack.unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/extern.h diff -u src/games/hack/extern.h:1.8 src/games/hack/extern.h:1.8.8.1 --- src/games/hack/extern.h:1.8 Mon Apr 28 20:22:54 2008 +++ src/games/hack/extern.h Mon Jun 29 23:22:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.8 2008/04/28 20:22:54 martin Exp $ */ +/* $NetBSD: extern.h,v 1.8.8.1 2009/06/29 23:22:24 snj Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -356,7 +356,7 @@ char *typename(int); char *xname(struct obj *); char *doname(struct obj *); -void setan(const char *, char *); +void setan(const char *, char *, size_t); char *aobjnam(struct obj *, const char *); char *Doname(struct obj *); struct obj *readobjnam(char *); Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.7 src/games/hack/hack.do_name.c:1.7.14.1 --- src/games/hack/hack.do_name.c:1.7 Mon Jan 28 06:55:41 2008 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:22:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.7 2008/01/28 06:55:41 dholland Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.7.14.1 2009/06/29 23:22:24 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.7 2008/01/28 06:55:41 dholland Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.7.14.1 2009/06/29 23:22:24 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -274,7 +274,7 @@ { static char buf[BUFSZ]; /* %% */ if (mtmp-mnamelth !vb) { - (void) strcpy(buf, NAME(mtmp)); + (void) strlcpy(buf, NAME(mtmp), sizeof(buf)); return (buf); } switch (mtmp-data-mlet) { @@ -287,23 +287,23 @@ (void) strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); } - (void) sprintf(buf, %s's ghost, gn); + (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } break; case '@': if (mtmp-isshk) { - (void) strcpy(buf, shkname(mtmp)); + (void) strlcpy(buf, shkname(mtmp), sizeof(buf)); break; } /* fall into next case */ default: - (void) sprintf(buf, the %s%s, + (void) snprintf(buf, sizeof(buf), the %s%s, mtmp-minvis ? invisible : , mtmp-data-mname); } if (vb mtmp-mnamelth) { - (void) strcat(buf, called ); - (void) strcat(buf, NAME(mtmp)); + (void) strlcat(buf, called , sizeof(buf)); + (void) strlcat(buf, NAME(mtmp), sizeof(buf)); } return (buf); } @@ -342,7 +342,7 @@ if (!strncmp(bp, the , 4)) bp += 4; - (void) sprintf(buf, the %s %s, adj, bp); + (void) snprintf(buf, sizeof(buf), the %s %s, adj, bp); return (buf); } Index: src/games/hack/hack.objnam.c diff -u src/games/hack/hack.objnam.c:1.7 src/games/hack/hack.objnam.c:1.7.14.1 --- src/games/hack/hack.objnam.c:1.7 Mon Jan 28 06:55:42 2008 +++ src/games/hack/hack.objnam.c Mon Jun 29 23:22:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.objnam.c,v 1.7 2008/01/28 06:55:42 dholland
CVS commit: [netbsd-5-0] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:25:09 UTC 2009 Modified Files: src/games/hack [netbsd-5-0]: hack.do_name.c hack.h hack.invent.c hack.main.c hack.rip.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #844): games/hack/hack.unix.c: revision 1.13 games/hack/hack.topl.c: revision 1.11 games/hack/hack.invent.c: revision 1.13 games/hack/hack.rip.c: revision 1.11 games/hack/hack.main.c: revision 1.13 games/hack/hack.h: revision 1.13 via patch games/hack/hack.do_name.c: revision 1.10 Fix two serious string-handling bugs (one exploitable, one probably exploitable) and also add proper checking/paranoia in several other places. To generate a diff of this commit: cvs rdiff -u -r1.7.14.1 -r1.7.14.2 src/games/hack/hack.do_name.c cvs rdiff -u -r1.10 -r1.10.42.1 src/games/hack/hack.h cvs rdiff -u -r1.10.30.1 -r1.10.30.2 src/games/hack/hack.invent.c cvs rdiff -u -r1.10.14.1 -r1.10.14.2 src/games/hack/hack.main.c cvs rdiff -u -r1.8.14.1 -r1.8.14.2 src/games/hack/hack.rip.c \ src/games/hack/hack.topl.c cvs rdiff -u -r1.9.42.1 -r1.9.42.2 src/games/hack/hack.unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.7.14.1 src/games/hack/hack.do_name.c:1.7.14.2 --- src/games/hack/hack.do_name.c:1.7.14.1 Mon Jun 29 23:22:24 2009 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:25:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.7.14.1 2009/06/29 23:22:24 snj Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.7.14.2 2009/06/29 23:25:09 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.7.14.1 2009/06/29 23:22:24 snj Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.7.14.2 2009/06/29 23:25:09 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -285,7 +285,7 @@ gn = ghostnames[rn2(SIZE(ghostnames))]; if (!rn2(2)) (void) - strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); + strlcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn, mtmp-mxlth); } (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } Index: src/games/hack/hack.h diff -u src/games/hack/hack.h:1.10 src/games/hack/hack.h:1.10.42.1 --- src/games/hack/hack.h:1.10 Tue Jan 27 20:30:29 2004 +++ src/games/hack/hack.h Mon Jun 29 23:25:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.h,v 1.10 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: hack.h,v 1.10.42.1 2009/06/29 23:25:09 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -202,7 +202,7 @@ extern char SAVEF[]; extern char fut_geno[60]; /* idem */ extern char genocided[60]; /* defined in Decl.c */ -extern char lock[]; +extern char lock[PL_NSIZ + 4]; extern char mlarge[]; extern char morc; extern char nul[]; Index: src/games/hack/hack.invent.c diff -u src/games/hack/hack.invent.c:1.10.30.1 src/games/hack/hack.invent.c:1.10.30.2 --- src/games/hack/hack.invent.c:1.10.30.1 Mon Jun 29 23:22:24 2009 +++ src/games/hack/hack.invent.c Mon Jun 29 23:25:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.invent.c,v 1.10.30.1 2009/06/29 23:22:24 snj Exp $ */ +/* $NetBSD: hack.invent.c,v 1.10.30.2 2009/06/29 23:25:09 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,9 +63,10 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.invent.c,v 1.10.30.1 2009/06/29 23:22:24 snj Exp $); +__RCSID($NetBSD: hack.invent.c,v 1.10.30.2 2009/06/29 23:25:09 snj Exp $); #endif/* not lint */ +#include assert.h #include stdlib.h #include hack.h #include extern.h @@ -578,7 +579,7 @@ charbuf[BUFSZ]; char *ip; charsym; - int oletct = 0, iletct = 0; + unsignedoletct = 0, iletct = 0; boolean allflag = FALSE; charolets[20], ilets[20]; int (*ckfn)(struct obj *) = @@ -609,6 +610,7 @@ if (invent) ilets[iletct++] = 'a'; ilets[iletct] = 0; + assert(iletct sizeof(ilets)); } pline(What kinds of thing do you want to %s? [%s] , word, ilets); @@ -637,6 +639,7 @@ olets[oletct++] = sym; olets[oletct] = 0; } + assert(oletct sizeof(olets)); } else pline(You don't have any %c's., sym); } @@ -754,7 +757,7 @@ { struct obj *otmp; charilet; - int ct = 0; + unsignedct = 0; charany[BUFSZ]; morc = 0; /* just to be sure */ @@ -777,6 +780,7 @@ ilet = 'A'; } any[ct] = 0; + assert(ct sizeof(any)); cornline(2, any); } @@ -786,7 +790,7 @@ /* Changed to one type only, so he doesnt have to type cr */ charc, ilet; charstuff[BUFSZ]; - int stct; +
CVS commit: [netbsd-5] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:31:28 UTC 2009 Modified Files: src/games/hack [netbsd-5]: extern.h hack.do_name.c hack.eat.c hack.end.c hack.fight.c hack.invent.c hack.main.c hack.objnam.c hack.options.c hack.pri.c hack.rip.c hack.shk.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #844): games/hack/hack.fight.c: revision 1.10 games/hack/hack.topl.c: revision 1.10 games/hack/hack.invent.c: revision 1.12 games/hack/hack.rip.c: revision 1.10 games/hack/hack.options.c: revision 1.9 games/hack/hack.main.c: revision 1.12 games/hack/hack.eat.c: revision 1.8 games/hack/hack.do_name.c: revision 1.9 games/hack/hack.shk.c: revision 1.10 games/hack/hack.end.c: revision 1.12 games/hack/extern.h: revision 1.11 games/hack/hack.pri.c: revision 1.11 games/hack/hack.objnam.c: revision 1.9 games/hack/hack.unix.c: revision 1.12 sprintf - snprintf, plus some use of strlcpy/strlcat where appropriate XXX: there's still one sprintf left which will take some hacking to expunge. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.8.6.1 src/games/hack/extern.h cvs rdiff -u -r1.7 -r1.7.10.1 src/games/hack/hack.do_name.c \ src/games/hack/hack.objnam.c cvs rdiff -u -r1.6 -r1.6.38.1 src/games/hack/hack.eat.c cvs rdiff -u -r1.9 -r1.9.10.1 src/games/hack/hack.end.c \ src/games/hack/hack.pri.c cvs rdiff -u -r1.8 -r1.8.10.1 src/games/hack/hack.fight.c \ src/games/hack/hack.rip.c src/games/hack/hack.topl.c cvs rdiff -u -r1.10 -r1.10.26.1 src/games/hack/hack.invent.c cvs rdiff -u -r1.10 -r1.10.10.1 src/games/hack/hack.main.c cvs rdiff -u -r1.7 -r1.7.38.1 src/games/hack/hack.options.c cvs rdiff -u -r1.8 -r1.8.26.1 src/games/hack/hack.shk.c cvs rdiff -u -r1.9 -r1.9.38.1 src/games/hack/hack.unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/extern.h diff -u src/games/hack/extern.h:1.8 src/games/hack/extern.h:1.8.6.1 --- src/games/hack/extern.h:1.8 Mon Apr 28 20:22:54 2008 +++ src/games/hack/extern.h Mon Jun 29 23:31:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.8 2008/04/28 20:22:54 martin Exp $ */ +/* $NetBSD: extern.h,v 1.8.6.1 2009/06/29 23:31:28 snj Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -356,7 +356,7 @@ char *typename(int); char *xname(struct obj *); char *doname(struct obj *); -void setan(const char *, char *); +void setan(const char *, char *, size_t); char *aobjnam(struct obj *, const char *); char *Doname(struct obj *); struct obj *readobjnam(char *); Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.7 src/games/hack/hack.do_name.c:1.7.10.1 --- src/games/hack/hack.do_name.c:1.7 Mon Jan 28 06:55:41 2008 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:31:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.7 2008/01/28 06:55:41 dholland Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.7.10.1 2009/06/29 23:31:28 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.7 2008/01/28 06:55:41 dholland Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.7.10.1 2009/06/29 23:31:28 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -274,7 +274,7 @@ { static char buf[BUFSZ]; /* %% */ if (mtmp-mnamelth !vb) { - (void) strcpy(buf, NAME(mtmp)); + (void) strlcpy(buf, NAME(mtmp), sizeof(buf)); return (buf); } switch (mtmp-data-mlet) { @@ -287,23 +287,23 @@ (void) strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); } - (void) sprintf(buf, %s's ghost, gn); + (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } break; case '@': if (mtmp-isshk) { - (void) strcpy(buf, shkname(mtmp)); + (void) strlcpy(buf, shkname(mtmp), sizeof(buf)); break; } /* fall into next case */ default: - (void) sprintf(buf, the %s%s, + (void) snprintf(buf, sizeof(buf), the %s%s, mtmp-minvis ? invisible : , mtmp-data-mname); } if (vb mtmp-mnamelth) { - (void) strcat(buf, called ); - (void) strcat(buf, NAME(mtmp)); + (void) strlcat(buf, called , sizeof(buf)); + (void) strlcat(buf, NAME(mtmp), sizeof(buf)); } return (buf); } @@ -342,7 +342,7 @@ if (!strncmp(bp, the , 4)) bp += 4; - (void) sprintf(buf, the %s %s, adj, bp); + (void) snprintf(buf, sizeof(buf), the %s %s, adj, bp); return (buf); } Index: src/games/hack/hack.objnam.c diff -u src/games/hack/hack.objnam.c:1.7 src/games/hack/hack.objnam.c:1.7.10.1 --- src/games/hack/hack.objnam.c:1.7 Mon Jan 28 06:55:42 2008 +++ src/games/hack/hack.objnam.c Mon Jun 29 23:31:28 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.objnam.c,v 1.7 2008/01/28 06:55:42 dholland
CVS commit: [netbsd-5] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:33:53 UTC 2009 Modified Files: src/games/hack [netbsd-5]: hack.do_name.c hack.h hack.invent.c hack.main.c hack.rip.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #844): games/hack/hack.unix.c: revision 1.13 games/hack/hack.topl.c: revision 1.11 games/hack/hack.invent.c: revision 1.13 games/hack/hack.rip.c: revision 1.11 games/hack/hack.main.c: revision 1.13 games/hack/hack.h: revision 1.13 via patch games/hack/hack.do_name.c: revision 1.10 Fix two serious string-handling bugs (one exploitable, one probably exploitable) and also add proper checking/paranoia in several other places. To generate a diff of this commit: cvs rdiff -u -r1.7.10.1 -r1.7.10.2 src/games/hack/hack.do_name.c cvs rdiff -u -r1.10 -r1.10.38.1 src/games/hack/hack.h cvs rdiff -u -r1.10.26.1 -r1.10.26.2 src/games/hack/hack.invent.c cvs rdiff -u -r1.10.10.1 -r1.10.10.2 src/games/hack/hack.main.c cvs rdiff -u -r1.8.10.1 -r1.8.10.2 src/games/hack/hack.rip.c \ src/games/hack/hack.topl.c cvs rdiff -u -r1.9.38.1 -r1.9.38.2 src/games/hack/hack.unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.7.10.1 src/games/hack/hack.do_name.c:1.7.10.2 --- src/games/hack/hack.do_name.c:1.7.10.1 Mon Jun 29 23:31:28 2009 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:33:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.7.10.1 2009/06/29 23:31:28 snj Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.7.10.2 2009/06/29 23:33:53 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.7.10.1 2009/06/29 23:31:28 snj Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.7.10.2 2009/06/29 23:33:53 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -285,7 +285,7 @@ gn = ghostnames[rn2(SIZE(ghostnames))]; if (!rn2(2)) (void) - strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); + strlcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn, mtmp-mxlth); } (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } Index: src/games/hack/hack.h diff -u src/games/hack/hack.h:1.10 src/games/hack/hack.h:1.10.38.1 --- src/games/hack/hack.h:1.10 Tue Jan 27 20:30:29 2004 +++ src/games/hack/hack.h Mon Jun 29 23:33:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.h,v 1.10 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: hack.h,v 1.10.38.1 2009/06/29 23:33:53 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -202,7 +202,7 @@ extern char SAVEF[]; extern char fut_geno[60]; /* idem */ extern char genocided[60]; /* defined in Decl.c */ -extern char lock[]; +extern char lock[PL_NSIZ + 4]; extern char mlarge[]; extern char morc; extern char nul[]; Index: src/games/hack/hack.invent.c diff -u src/games/hack/hack.invent.c:1.10.26.1 src/games/hack/hack.invent.c:1.10.26.2 --- src/games/hack/hack.invent.c:1.10.26.1 Mon Jun 29 23:31:28 2009 +++ src/games/hack/hack.invent.c Mon Jun 29 23:33:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.invent.c,v 1.10.26.1 2009/06/29 23:31:28 snj Exp $ */ +/* $NetBSD: hack.invent.c,v 1.10.26.2 2009/06/29 23:33:53 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,9 +63,10 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.invent.c,v 1.10.26.1 2009/06/29 23:31:28 snj Exp $); +__RCSID($NetBSD: hack.invent.c,v 1.10.26.2 2009/06/29 23:33:53 snj Exp $); #endif/* not lint */ +#include assert.h #include stdlib.h #include hack.h #include extern.h @@ -578,7 +579,7 @@ charbuf[BUFSZ]; char *ip; charsym; - int oletct = 0, iletct = 0; + unsignedoletct = 0, iletct = 0; boolean allflag = FALSE; charolets[20], ilets[20]; int (*ckfn)(struct obj *) = @@ -609,6 +610,7 @@ if (invent) ilets[iletct++] = 'a'; ilets[iletct] = 0; + assert(iletct sizeof(ilets)); } pline(What kinds of thing do you want to %s? [%s] , word, ilets); @@ -637,6 +639,7 @@ olets[oletct++] = sym; olets[oletct] = 0; } + assert(oletct sizeof(olets)); } else pline(You don't have any %c's., sym); } @@ -754,7 +757,7 @@ { struct obj *otmp; charilet; - int ct = 0; + unsignedct = 0; charany[BUFSZ]; morc = 0; /* just to be sure */ @@ -777,6 +780,7 @@ ilet = 'A'; } any[ct] = 0; + assert(ct sizeof(any)); cornline(2, any); } @@ -786,7 +790,7 @@ /* Changed to one type only, so he doesnt have to type cr */ charc, ilet; charstuff[BUFSZ]; - int stct; +
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: snj Date: Mon Jun 29 23:36:13 UTC 2009 Modified Files: src/doc [netbsd-5]: CHANGES-5.1 Log Message: Tickets 843 and 844. To generate a diff of this commit: cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-5.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1 diff -u src/doc/CHANGES-5.1:1.1.2.40 src/doc/CHANGES-5.1:1.1.2.41 --- src/doc/CHANGES-5.1:1.1.2.40 Sun Jun 28 19:55:12 2009 +++ src/doc/CHANGES-5.1 Mon Jun 29 23:36:13 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1,v 1.1.2.40 2009/06/28 19:55:12 snj Exp $ +# $NetBSD: CHANGES-5.1,v 1.1.2.41 2009/06/29 23:36:13 snj Exp $ A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1 release: @@ -1388,3 +1388,37 @@ a possible theoretical attack involving = 1 billion ammo. [dholland, ticket #834] +crypto/dist/ssh/cipher.c 1.22 +crypto/dist/ssh/cipher.h 1.3 +crypto/dist/ssh/packet.c 1.32 + + Add special handling for CBC cipher modes to make them appear + less favorable than CTR modes. Also, in order to avoid creating + oracles unnecessarily, change behavior in various situations + from Drop connection to Ignore packets up to 256kB. This + affects CBC mode ciphers only. + [tonnerre, ticket #843] + +games/hack/extern.h1.11 +games/hack/hack.do_name.c 1.9, 1.10 +games/hack/hack.eat.c1.8 +games/hack/hack.end.c1.12 via patch +games/hack/hack.fight.c1.10 +games/hack/hack.h1.13 via patch +games/hack/hack.invent.c 1.12, 1.13 +games/hack/hack.main.c1.12, 1.13 +games/hack/hack.objnam.c 1.9 +games/hack/hack.options.c 1.9 +games/hack/hack.pri.c1.11 +games/hack/hack.rip.c1.10, 1.11 +games/hack/hack.shk.c1.10 +games/hack/hack.topl.c1.10, 1.11 +games/hack/hack.unix.c1.12, 1.13 + + sprintf - snprintf, plus some use of strlcpy/strlcat where + appropriate. + Fix two serious string-handling bugs (one exploitable, one + probably exploitable) and also add proper checking/paranoia in + several other places. + [dholland, ticket #844] +
CVS commit: [netbsd-5-0] src/doc
Module Name:src Committed By: snj Date: Mon Jun 29 23:36:37 UTC 2009 Modified Files: src/doc [netbsd-5-0]: CHANGES-5.0.1 Log Message: Tickets 843 and 844. To generate a diff of this commit: cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-5.0.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.0.1 diff -u src/doc/CHANGES-5.0.1:1.1.2.27 src/doc/CHANGES-5.0.1:1.1.2.28 --- src/doc/CHANGES-5.0.1:1.1.2.27 Sun Jun 28 19:54:18 2009 +++ src/doc/CHANGES-5.0.1 Mon Jun 29 23:36:37 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.0.1,v 1.1.2.27 2009/06/28 19:54:18 snj Exp $ +# $NetBSD: CHANGES-5.0.1,v 1.1.2.28 2009/06/29 23:36:37 snj Exp $ A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.0.1 release: @@ -466,3 +466,37 @@ a possible theoretical attack involving = 1 billion ammo. [dholland, ticket #834] +crypto/dist/ssh/cipher.c 1.22 +crypto/dist/ssh/cipher.h 1.3 +crypto/dist/ssh/packet.c 1.32 + + Add special handling for CBC cipher modes to make them appear + less favorable than CTR modes. Also, in order to avoid creating + oracles unnecessarily, change behavior in various situations + from Drop connection to Ignore packets up to 256kB. This + affects CBC mode ciphers only. + [tonnerre, ticket #843] + +games/hack/extern.h1.11 +games/hack/hack.do_name.c 1.9, 1.10 +games/hack/hack.eat.c1.8 +games/hack/hack.end.c1.12 via patch +games/hack/hack.fight.c1.10 +games/hack/hack.h1.13 via patch +games/hack/hack.invent.c 1.12, 1.13 +games/hack/hack.main.c1.12, 1.13 +games/hack/hack.objnam.c 1.9 +games/hack/hack.options.c 1.9 +games/hack/hack.pri.c1.11 +games/hack/hack.rip.c1.10, 1.11 +games/hack/hack.shk.c1.10 +games/hack/hack.topl.c1.10, 1.11 +games/hack/hack.unix.c1.12, 1.13 + + sprintf - snprintf, plus some use of strlcpy/strlcat where + appropriate. + Fix two serious string-handling bugs (one exploitable, one + probably exploitable) and also add proper checking/paranoia in + several other places. + [dholland, ticket #844] +
CVS commit: src/sys/kern
Module Name:src Committed By: yamt Date: Mon Jun 29 23:39:00 UTC 2009 Modified Files: src/sys/kern: kern_synch.c Log Message: update a comment To generate a diff of this commit: cvs rdiff -u -r1.265 -r1.266 src/sys/kern/kern_synch.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_synch.c diff -u src/sys/kern/kern_synch.c:1.265 src/sys/kern/kern_synch.c:1.266 --- src/sys/kern/kern_synch.c:1.265 Sun Jun 28 15:18:50 2009 +++ src/sys/kern/kern_synch.c Mon Jun 29 23:39:00 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_synch.c,v 1.265 2009/06/28 15:18:50 rmind Exp $ */ +/* $NetBSD: kern_synch.c,v 1.266 2009/06/29 23:39:00 yamt Exp $ */ /*- * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009 @@ -69,7 +69,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_synch.c,v 1.265 2009/06/28 15:18:50 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_synch.c,v 1.266 2009/06/29 23:39:00 yamt Exp $); #include opt_kstack.h #include opt_perfctrs.h @@ -1001,7 +1001,7 @@ /* * suspendsched: * - * Convert all non-L_SYSTEM LSSLEEP or LSRUN LWPs to LSSUSPENDED. + * Convert all non-LW_SYSTEM LSSLEEP or LSRUN LWPs to LSSUSPENDED. */ void suspendsched(void)
CVS commit: [netbsd-4-0] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:43:48 UTC 2009 Modified Files: src/games/hack [netbsd-4-0]: extern.h hack.do_name.c hack.eat.c hack.end.c hack.fight.c hack.invent.c hack.main.c hack.objnam.c hack.options.c hack.pri.c hack.rip.c hack.shk.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1331): games/hack/extern.h: revision 1.11 games/hack/hack.do_name.c: revision 1.9 games/hack/hack.eat.c: revision 1.8 games/hack/hack.end.c: revision 1.12 via patch games/hack/hack.fight.c: revision 1.10 via patch games/hack/hack.invent.c: revision 1.12 games/hack/hack.main.c: revision 1.12 games/hack/hack.objnam.c: revision 1.9 games/hack/hack.options.c: revision 1.9 games/hack/hack.pri.c: revision 1.11 games/hack/hack.rip.c: revision 1.10 games/hack/hack.shk.c: revision 1.10 games/hack/hack.topl.c: revision 1.10 games/hack/hack.unix.c: revision 1.12 sprintf - snprintf, plus some use of strlcpy/strlcat where appropriate XXX: there's still one sprintf left which will take some hacking to expunge. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.26.1 src/games/hack/extern.h \ src/games/hack/hack.do_name.c src/games/hack/hack.eat.c \ src/games/hack/hack.objnam.c cvs rdiff -u -r1.7 -r1.7.14.1 src/games/hack/hack.end.c \ src/games/hack/hack.fight.c cvs rdiff -u -r1.10 -r1.10.14.1 src/games/hack/hack.invent.c cvs rdiff -u -r1.9 -r1.9.26.1 src/games/hack/hack.main.c \ src/games/hack/hack.unix.c cvs rdiff -u -r1.7 -r1.7.26.1 src/games/hack/hack.options.c \ src/games/hack/hack.rip.c src/games/hack/hack.topl.c cvs rdiff -u -r1.8 -r1.8.26.1 src/games/hack/hack.pri.c cvs rdiff -u -r1.8 -r1.8.14.1 src/games/hack/hack.shk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/extern.h diff -u src/games/hack/extern.h:1.6 src/games/hack/extern.h:1.6.26.1 --- src/games/hack/extern.h:1.6 Tue Jan 27 20:30:29 2004 +++ src/games/hack/extern.h Mon Jun 29 23:43:48 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.6 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: extern.h,v 1.6.26.1 2009/06/29 23:43:48 snj Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -363,7 +363,7 @@ char *typename(int); char *xname(struct obj *); char *doname(struct obj *); -void setan(const char *, char *); +void setan(const char *, char *, size_t); char *aobjnam(struct obj *, const char *); char *Doname(struct obj *); struct obj *readobjnam(char *); Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.6 src/games/hack/hack.do_name.c:1.6.26.1 --- src/games/hack/hack.do_name.c:1.6 Wed Apr 2 18:36:36 2003 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:43:48 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.6 2003/04/02 18:36:36 jsm Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.6.26.1 2009/06/29 23:43:48 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.6 2003/04/02 18:36:36 jsm Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.6.26.1 2009/06/29 23:43:48 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -273,7 +273,7 @@ { static char buf[BUFSZ]; /* %% */ if (mtmp-mnamelth !vb) { - (void) strcpy(buf, NAME(mtmp)); + (void) strlcpy(buf, NAME(mtmp), sizeof(buf)); return (buf); } switch (mtmp-data-mlet) { @@ -286,23 +286,23 @@ (void) strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); } - (void) sprintf(buf, %s's ghost, gn); + (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } break; case '@': if (mtmp-isshk) { - (void) strcpy(buf, shkname(mtmp)); + (void) strlcpy(buf, shkname(mtmp), sizeof(buf)); break; } /* fall into next case */ default: - (void) sprintf(buf, the %s%s, + (void) snprintf(buf, sizeof(buf), the %s%s, mtmp-minvis ? invisible : , mtmp-data-mname); } if (vb mtmp-mnamelth) { - (void) strcat(buf, called ); - (void) strcat(buf, NAME(mtmp)); + (void) strlcat(buf, called , sizeof(buf)); + (void) strlcat(buf, NAME(mtmp), sizeof(buf)); } return (buf); } @@ -341,7 +341,7 @@ if (!strncmp(bp, the , 4)) bp += 4; - (void) sprintf(buf, the %s %s, adj, bp); + (void) snprintf(buf, sizeof(buf), the %s %s, adj, bp); return (buf); } Index: src/games/hack/hack.eat.c diff -u src/games/hack/hack.eat.c:1.6 src/games/hack/hack.eat.c:1.6.26.1 --- src/games/hack/hack.eat.c:1.6 Wed Apr 2 18:36:36 2003 +++ src/games/hack/hack.eat.c Mon Jun 29 23:43:48 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.eat.c,v 1.6 2003/04/02 18:36:36 jsm Exp $ */ +/* $NetBSD: hack.eat.c,v 1.6.26.1 2009/06/29 23:43:48 snj Exp $ */ /* *
CVS commit: [netbsd-4-0] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:46:51 UTC 2009 Modified Files: src/games/hack [netbsd-4-0]: hack.do_name.c hack.h hack.invent.c hack.main.c hack.rip.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1331): games/hack/hack.do_name.c: revision 1.10 games/hack/hack.h: revision 1.13 via patch games/hack/hack.invent.c: revision 1.13 games/hack/hack.main.c: revision 1.13 games/hack/hack.rip.c: revision 1.11 games/hack/hack.topl.c: revision 1.11 games/hack/hack.unix.c: revision 1.13 Fix two serious string-handling bugs (one exploitable, one probably exploitable) and also add proper checking/paranoia in several other places. To generate a diff of this commit: cvs rdiff -u -r1.6.26.1 -r1.6.26.2 src/games/hack/hack.do_name.c cvs rdiff -u -r1.10 -r1.10.26.1 src/games/hack/hack.h cvs rdiff -u -r1.10.14.1 -r1.10.14.2 src/games/hack/hack.invent.c cvs rdiff -u -r1.9.26.1 -r1.9.26.2 src/games/hack/hack.main.c \ src/games/hack/hack.unix.c cvs rdiff -u -r1.7.26.1 -r1.7.26.2 src/games/hack/hack.rip.c \ src/games/hack/hack.topl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.6.26.1 src/games/hack/hack.do_name.c:1.6.26.2 --- src/games/hack/hack.do_name.c:1.6.26.1 Mon Jun 29 23:43:48 2009 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:46:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.6.26.1 2009/06/29 23:43:48 snj Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.6.26.2 2009/06/29 23:46:51 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.6.26.1 2009/06/29 23:43:48 snj Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.6.26.2 2009/06/29 23:46:51 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -284,7 +284,7 @@ gn = ghostnames[rn2(SIZE(ghostnames))]; if (!rn2(2)) (void) - strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); + strlcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn, mtmp-mxlth); } (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } Index: src/games/hack/hack.h diff -u src/games/hack/hack.h:1.10 src/games/hack/hack.h:1.10.26.1 --- src/games/hack/hack.h:1.10 Tue Jan 27 20:30:29 2004 +++ src/games/hack/hack.h Mon Jun 29 23:46:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.h,v 1.10 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: hack.h,v 1.10.26.1 2009/06/29 23:46:51 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -202,7 +202,7 @@ extern char SAVEF[]; extern char fut_geno[60]; /* idem */ extern char genocided[60]; /* defined in Decl.c */ -extern char lock[]; +extern char lock[PL_NSIZ + 4]; extern char mlarge[]; extern char morc; extern char nul[]; Index: src/games/hack/hack.invent.c diff -u src/games/hack/hack.invent.c:1.10.14.1 src/games/hack/hack.invent.c:1.10.14.2 --- src/games/hack/hack.invent.c:1.10.14.1 Mon Jun 29 23:43:48 2009 +++ src/games/hack/hack.invent.c Mon Jun 29 23:46:51 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.invent.c,v 1.10.14.1 2009/06/29 23:43:48 snj Exp $ */ +/* $NetBSD: hack.invent.c,v 1.10.14.2 2009/06/29 23:46:51 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,9 +63,10 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.invent.c,v 1.10.14.1 2009/06/29 23:43:48 snj Exp $); +__RCSID($NetBSD: hack.invent.c,v 1.10.14.2 2009/06/29 23:46:51 snj Exp $); #endif/* not lint */ +#include assert.h #include stdlib.h #include hack.h #include extern.h @@ -578,7 +579,7 @@ charbuf[BUFSZ]; char *ip; charsym; - int oletct = 0, iletct = 0; + unsignedoletct = 0, iletct = 0; boolean allflag = FALSE; charolets[20], ilets[20]; int (*ckfn)(struct obj *) = @@ -609,6 +610,7 @@ if (invent) ilets[iletct++] = 'a'; ilets[iletct] = 0; + assert(iletct sizeof(ilets)); } pline(What kinds of thing do you want to %s? [%s] , word, ilets); @@ -637,6 +639,7 @@ olets[oletct++] = sym; olets[oletct] = 0; } + assert(oletct sizeof(olets)); } else pline(You don't have any %c's., sym); } @@ -754,7 +757,7 @@ { struct obj *otmp; charilet; - int ct = 0; + unsignedct = 0; charany[BUFSZ]; morc = 0; /* just to be sure */ @@ -777,6 +780,7 @@ ilet = 'A'; } any[ct] = 0; + assert(ct sizeof(any)); cornline(2, any); } @@ -786,7 +790,7 @@ /* Changed to one type only, so he doesnt have to type cr */ charc, ilet; charstuff[BUFSZ]; - int stct; + unsignedstct; struct
CVS commit: [netbsd-4-0] src/doc
Module Name:src Committed By: snj Date: Mon Jun 29 23:48:53 UTC 2009 Modified Files: src/doc [netbsd-4-0]: CHANGES-4.0.2 Log Message: Ticket 1331. To generate a diff of this commit: cvs rdiff -u -r1.1.2.39 -r1.1.2.40 src/doc/CHANGES-4.0.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.0.2 diff -u src/doc/CHANGES-4.0.2:1.1.2.39 src/doc/CHANGES-4.0.2:1.1.2.40 --- src/doc/CHANGES-4.0.2:1.1.2.39 Sun Jun 28 19:51:33 2009 +++ src/doc/CHANGES-4.0.2 Mon Jun 29 23:48:53 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.0.2,v 1.1.2.39 2009/06/28 19:51:33 snj Exp $ +# $NetBSD: CHANGES-4.0.2,v 1.1.2.40 2009/06/29 23:48:53 snj Exp $ A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2 release: @@ -651,3 +651,26 @@ a possible theoretical attack involving = 1 billion ammo. [dholland, ticket #1330] +games/hack/extern.h1.11 +games/hack/hack.do_name.c 1.9, 1.10 +games/hack/hack.eat.c1.8 +games/hack/hack.end.c1.12 via patch +games/hack/hack.fight.c1.10 via patch +games/hack/hack.h1.13 +games/hack/hack.invent.c 1.12, 1.13 +games/hack/hack.main.c1.12, 1.13 +games/hack/hack.objnam.c 1.9 +games/hack/hack.options.c 1.9 +games/hack/hack.pri.c1.11 +games/hack/hack.rip.c1.10, 1.11 +games/hack/hack.shk.c1.10 +games/hack/hack.topl.c1.10, 1.11 +games/hack/hack.unix.c1.12, 1.13 + + sprintf - snprintf, plus some use of strlcpy/strlcat where + appropriate. + Fix two serious string-handling bugs (one exploitable, one + probably exploitable) and also add proper checking/paranoia + in several other places. + [dholland, ticket #1331] +
CVS commit: [netbsd-4] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:53:01 UTC 2009 Modified Files: src/games/hack [netbsd-4]: extern.h hack.do_name.c hack.eat.c hack.end.c hack.fight.c hack.invent.c hack.main.c hack.objnam.c hack.options.c hack.pri.c hack.rip.c hack.shk.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1331): games/hack/extern.h: revision 1.11 games/hack/hack.do_name.c: revision 1.9 games/hack/hack.eat.c: revision 1.8 games/hack/hack.end.c: revision 1.12 via patch games/hack/hack.fight.c: revision 1.10 via patch games/hack/hack.invent.c: revision 1.12 games/hack/hack.main.c: revision 1.12 games/hack/hack.objnam.c: revision 1.9 games/hack/hack.options.c: revision 1.9 games/hack/hack.pri.c: revision 1.11 games/hack/hack.rip.c: revision 1.10 games/hack/hack.shk.c: revision 1.10 games/hack/hack.topl.c: revision 1.10 games/hack/hack.unix.c: revision 1.12 sprintf - snprintf, plus some use of strlcpy/strlcat where appropriate XXX: there's still one sprintf left which will take some hacking to expunge. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.16.1 src/games/hack/extern.h \ src/games/hack/hack.do_name.c src/games/hack/hack.eat.c \ src/games/hack/hack.objnam.c cvs rdiff -u -r1.7 -r1.7.4.1 src/games/hack/hack.end.c \ src/games/hack/hack.fight.c cvs rdiff -u -r1.10 -r1.10.4.1 src/games/hack/hack.invent.c cvs rdiff -u -r1.9 -r1.9.16.1 src/games/hack/hack.main.c \ src/games/hack/hack.unix.c cvs rdiff -u -r1.7 -r1.7.16.1 src/games/hack/hack.options.c \ src/games/hack/hack.rip.c src/games/hack/hack.topl.c cvs rdiff -u -r1.8 -r1.8.16.1 src/games/hack/hack.pri.c cvs rdiff -u -r1.8 -r1.8.4.1 src/games/hack/hack.shk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/extern.h diff -u src/games/hack/extern.h:1.6 src/games/hack/extern.h:1.6.16.1 --- src/games/hack/extern.h:1.6 Tue Jan 27 20:30:29 2004 +++ src/games/hack/extern.h Mon Jun 29 23:53:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.6 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: extern.h,v 1.6.16.1 2009/06/29 23:53:01 snj Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -363,7 +363,7 @@ char *typename(int); char *xname(struct obj *); char *doname(struct obj *); -void setan(const char *, char *); +void setan(const char *, char *, size_t); char *aobjnam(struct obj *, const char *); char *Doname(struct obj *); struct obj *readobjnam(char *); Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.6 src/games/hack/hack.do_name.c:1.6.16.1 --- src/games/hack/hack.do_name.c:1.6 Wed Apr 2 18:36:36 2003 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:53:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.6 2003/04/02 18:36:36 jsm Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.6.16.1 2009/06/29 23:53:01 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.6 2003/04/02 18:36:36 jsm Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.6.16.1 2009/06/29 23:53:01 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -273,7 +273,7 @@ { static char buf[BUFSZ]; /* %% */ if (mtmp-mnamelth !vb) { - (void) strcpy(buf, NAME(mtmp)); + (void) strlcpy(buf, NAME(mtmp), sizeof(buf)); return (buf); } switch (mtmp-data-mlet) { @@ -286,23 +286,23 @@ (void) strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); } - (void) sprintf(buf, %s's ghost, gn); + (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } break; case '@': if (mtmp-isshk) { - (void) strcpy(buf, shkname(mtmp)); + (void) strlcpy(buf, shkname(mtmp), sizeof(buf)); break; } /* fall into next case */ default: - (void) sprintf(buf, the %s%s, + (void) snprintf(buf, sizeof(buf), the %s%s, mtmp-minvis ? invisible : , mtmp-data-mname); } if (vb mtmp-mnamelth) { - (void) strcat(buf, called ); - (void) strcat(buf, NAME(mtmp)); + (void) strlcat(buf, called , sizeof(buf)); + (void) strlcat(buf, NAME(mtmp), sizeof(buf)); } return (buf); } @@ -341,7 +341,7 @@ if (!strncmp(bp, the , 4)) bp += 4; - (void) sprintf(buf, the %s %s, adj, bp); + (void) snprintf(buf, sizeof(buf), the %s %s, adj, bp); return (buf); } Index: src/games/hack/hack.eat.c diff -u src/games/hack/hack.eat.c:1.6 src/games/hack/hack.eat.c:1.6.16.1 --- src/games/hack/hack.eat.c:1.6 Wed Apr 2 18:36:36 2003 +++ src/games/hack/hack.eat.c Mon Jun 29 23:53:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.eat.c,v 1.6 2003/04/02 18:36:36 jsm Exp $ */ +/* $NetBSD: hack.eat.c,v 1.6.16.1 2009/06/29 23:53:01 snj Exp $ */ /* * Copyright
CVS commit: [netbsd-4] src/games/hack
Module Name:src Committed By: snj Date: Mon Jun 29 23:55:23 UTC 2009 Modified Files: src/games/hack [netbsd-4]: hack.do_name.c hack.h hack.invent.c hack.main.c hack.rip.c hack.topl.c hack.unix.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1331): games/hack/hack.do_name.c: revision 1.10 games/hack/hack.h: revision 1.13 via patch games/hack/hack.invent.c: revision 1.13 games/hack/hack.main.c: revision 1.13 games/hack/hack.rip.c: revision 1.11 games/hack/hack.topl.c: revision 1.11 games/hack/hack.unix.c: revision 1.13 Fix two serious string-handling bugs (one exploitable, one probably exploitable) and also add proper checking/paranoia in several other places. To generate a diff of this commit: cvs rdiff -u -r1.6.16.1 -r1.6.16.2 src/games/hack/hack.do_name.c cvs rdiff -u -r1.10 -r1.10.16.1 src/games/hack/hack.h cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/games/hack/hack.invent.c cvs rdiff -u -r1.9.16.1 -r1.9.16.2 src/games/hack/hack.main.c \ src/games/hack/hack.unix.c cvs rdiff -u -r1.7.16.1 -r1.7.16.2 src/games/hack/hack.rip.c \ src/games/hack/hack.topl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/hack.do_name.c diff -u src/games/hack/hack.do_name.c:1.6.16.1 src/games/hack/hack.do_name.c:1.6.16.2 --- src/games/hack/hack.do_name.c:1.6.16.1 Mon Jun 29 23:53:01 2009 +++ src/games/hack/hack.do_name.c Mon Jun 29 23:55:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.do_name.c,v 1.6.16.1 2009/06/29 23:53:01 snj Exp $ */ +/* $NetBSD: hack.do_name.c,v 1.6.16.2 2009/06/29 23:55:23 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.do_name.c,v 1.6.16.1 2009/06/29 23:53:01 snj Exp $); +__RCSID($NetBSD: hack.do_name.c,v 1.6.16.2 2009/06/29 23:55:23 snj Exp $); #endif/* not lint */ #include stdlib.h @@ -284,7 +284,7 @@ gn = ghostnames[rn2(SIZE(ghostnames))]; if (!rn2(2)) (void) - strcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn); + strlcpy((char *) mtmp-mextra, !rn2(5) ? plname : gn, mtmp-mxlth); } (void) snprintf(buf, sizeof(buf), %s's ghost, gn); } Index: src/games/hack/hack.h diff -u src/games/hack/hack.h:1.10 src/games/hack/hack.h:1.10.16.1 --- src/games/hack/hack.h:1.10 Tue Jan 27 20:30:29 2004 +++ src/games/hack/hack.h Mon Jun 29 23:55:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.h,v 1.10 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: hack.h,v 1.10.16.1 2009/06/29 23:55:23 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -202,7 +202,7 @@ extern char SAVEF[]; extern char fut_geno[60]; /* idem */ extern char genocided[60]; /* defined in Decl.c */ -extern char lock[]; +extern char lock[PL_NSIZ + 4]; extern char mlarge[]; extern char morc; extern char nul[]; Index: src/games/hack/hack.invent.c diff -u src/games/hack/hack.invent.c:1.10.4.1 src/games/hack/hack.invent.c:1.10.4.2 --- src/games/hack/hack.invent.c:1.10.4.1 Mon Jun 29 23:53:01 2009 +++ src/games/hack/hack.invent.c Mon Jun 29 23:55:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hack.invent.c,v 1.10.4.1 2009/06/29 23:53:01 snj Exp $ */ +/* $NetBSD: hack.invent.c,v 1.10.4.2 2009/06/29 23:55:23 snj Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,9 +63,10 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: hack.invent.c,v 1.10.4.1 2009/06/29 23:53:01 snj Exp $); +__RCSID($NetBSD: hack.invent.c,v 1.10.4.2 2009/06/29 23:55:23 snj Exp $); #endif/* not lint */ +#include assert.h #include stdlib.h #include hack.h #include extern.h @@ -578,7 +579,7 @@ charbuf[BUFSZ]; char *ip; charsym; - int oletct = 0, iletct = 0; + unsignedoletct = 0, iletct = 0; boolean allflag = FALSE; charolets[20], ilets[20]; int (*ckfn)(struct obj *) = @@ -609,6 +610,7 @@ if (invent) ilets[iletct++] = 'a'; ilets[iletct] = 0; + assert(iletct sizeof(ilets)); } pline(What kinds of thing do you want to %s? [%s] , word, ilets); @@ -637,6 +639,7 @@ olets[oletct++] = sym; olets[oletct] = 0; } + assert(oletct sizeof(olets)); } else pline(You don't have any %c's., sym); } @@ -754,7 +757,7 @@ { struct obj *otmp; charilet; - int ct = 0; + unsignedct = 0; charany[BUFSZ]; morc = 0; /* just to be sure */ @@ -777,6 +780,7 @@ ilet = 'A'; } any[ct] = 0; + assert(ct sizeof(any)); cornline(2, any); } @@ -786,7 +790,7 @@ /* Changed to one type only, so he doesnt have to type cr */ charc, ilet; charstuff[BUFSZ]; - int stct; + unsignedstct; struct obj
CVS commit: [netbsd-4] src/doc
Module Name:src Committed By: snj Date: Mon Jun 29 23:57:49 UTC 2009 Modified Files: src/doc [netbsd-4]: CHANGES-4.1 Log Message: Ticket 1331. To generate a diff of this commit: cvs rdiff -u -r1.1.2.160 -r1.1.2.161 src/doc/CHANGES-4.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.1 diff -u src/doc/CHANGES-4.1:1.1.2.160 src/doc/CHANGES-4.1:1.1.2.161 --- src/doc/CHANGES-4.1:1.1.2.160 Sun Jun 28 19:52:37 2009 +++ src/doc/CHANGES-4.1 Mon Jun 29 23:57:49 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.1,v 1.1.2.160 2009/06/28 19:52:37 snj Exp $ +# $NetBSD: CHANGES-4.1,v 1.1.2.161 2009/06/29 23:57:49 snj Exp $ A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1 release: @@ -3501,3 +3501,26 @@ a possible theoretical attack involving = 1 billion ammo. [dholland, ticket #1330] +games/hack/extern.h1.11 +games/hack/hack.do_name.c 1.9, 1.10 +games/hack/hack.eat.c1.8 +games/hack/hack.end.c1.12 via patch +games/hack/hack.fight.c1.10 via patch +games/hack/hack.h1.13 via patch +games/hack/hack.invent.c 1.12, 1.13 +games/hack/hack.main.c1.12, 1.13 +games/hack/hack.objnam.c 1.9 +games/hack/hack.options.c 1.9 +games/hack/hack.pri.c1.11 +games/hack/hack.rip.c1.10, 1.11 +games/hack/hack.shk.c1.10 +games/hack/hack.topl.c1.10, 1.11 +games/hack/hack.unix.c1.12, 1.13 + + sprintf - snprintf, plus some use of strlcpy/strlcat where + appropriate. + Fix two serious string-handling bugs (one exploitable, one + probably exploitable) and also add proper checking/paranoia + in several other places. + [dholland, ticket #1331] +
CVS commit: [netbsd-4-0] src/doc
Module Name:src Committed By: snj Date: Mon Jun 29 23:58:25 UTC 2009 Modified Files: src/doc [netbsd-4-0]: CHANGES-4.0.2 Log Message: Slight correction to ticket 1331's entry. To generate a diff of this commit: cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-4.0.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.0.2 diff -u src/doc/CHANGES-4.0.2:1.1.2.40 src/doc/CHANGES-4.0.2:1.1.2.41 --- src/doc/CHANGES-4.0.2:1.1.2.40 Mon Jun 29 23:48:53 2009 +++ src/doc/CHANGES-4.0.2 Mon Jun 29 23:58:25 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.0.2,v 1.1.2.40 2009/06/29 23:48:53 snj Exp $ +# $NetBSD: CHANGES-4.0.2,v 1.1.2.41 2009/06/29 23:58:25 snj Exp $ A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2 release: @@ -656,7 +656,7 @@ games/hack/hack.eat.c1.8 games/hack/hack.end.c1.12 via patch games/hack/hack.fight.c1.10 via patch -games/hack/hack.h1.13 +games/hack/hack.h1.13 via patch games/hack/hack.invent.c 1.12, 1.13 games/hack/hack.main.c1.12, 1.13 games/hack/hack.objnam.c 1.9
CVS commit: [netbsd-4-0] src/doc
Module Name:src Committed By: snj Date: Tue Jun 30 00:25:22 UTC 2009 Modified Files: src/doc [netbsd-4-0]: CHANGES-4.0.2 Log Message: Ticket 1332. To generate a diff of this commit: cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/doc/CHANGES-4.0.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-4.0.2 diff -u src/doc/CHANGES-4.0.2:1.1.2.41 src/doc/CHANGES-4.0.2:1.1.2.42 --- src/doc/CHANGES-4.0.2:1.1.2.41 Mon Jun 29 23:58:25 2009 +++ src/doc/CHANGES-4.0.2 Tue Jun 30 00:25:22 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-4.0.2,v 1.1.2.41 2009/06/29 23:58:25 snj Exp $ +# $NetBSD: CHANGES-4.0.2,v 1.1.2.42 2009/06/30 00:25:22 snj Exp $ A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2 release: @@ -674,3 +674,14 @@ in several other places. [dholland, ticket #1331] +crypto/dist/ssh/cipher.c 1.22 via patch +crypto/dist/ssh/cipher.h 1.3 via patch +crypto/dist/ssh/packet.c 1.32 via patch + + Add special handling for CBC cipher modes to make them appear + less favorable than CTR modes. Also, in order to avoid creating + oracles unnecessarily, change behavior in various situations + from Drop connection to Ignore packets up to 256kB. This + affects CBC mode ciphers only. + [tonnerre, ticket #1332] +
CVS commit: src/external/bsd/iscsi/lib
Module Name:src Committed By: agc Date: Tue Jun 30 02:59:15 UTC 2009 Modified Files: src/external/bsd/iscsi/lib: Makefile Log Message: catch up with change of filename To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/iscsi/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/iscsi/lib/Makefile diff -u src/external/bsd/iscsi/lib/Makefile:1.2 src/external/bsd/iscsi/lib/Makefile:1.3 --- src/external/bsd/iscsi/lib/Makefile:1.2 Thu Jun 25 13:47:12 2009 +++ src/external/bsd/iscsi/lib/Makefile Tue Jun 30 02:59:15 2009 @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.2 2009/06/25 13:47:12 agc Exp $ +# $NetBSD: Makefile,v 1.3 2009/06/30 02:59:15 agc Exp $ .include bsd.own.mk USE_FORT?= yes # network protocol library LIB= iscsi -SRCS= conffile.c disk.c iscsi.c util.c parameters.c storage.c +SRCS= conffile.c disk.c util.c parameters.c protocol.c storage.c SRCS+= netmask.c md5c.c md5hl.c uuid.c SRCS+= initiator.c target.c CPPFLAGS+= -DCONFIG_ISCSI_DEBUG -DHAVE_CONFIG_H