CVS commit: src/etc/etc.next68k
Module Name:src Committed By: tsutsui Date: Sun Jul 9 05:58:13 UTC 2017 Modified Files: src/etc/etc.next68k: MAKEDEV.conf Log Message: Revert the previous changes for PR/52377. - the names "ttya" and "ttyb" in zs(4) man page were leftover of the orignal sparc/sun3 ports which used the same name for their native SunOS users - symlinks ttya -> tty00 -> ttyZ0 (by "lndev tty00 ttya") are awful anyway (symlinks tty0? -> ttyZ? are handled in MI MAKEDEV.tmpl) See details on discussion on source-changes-d@: http://mail-index.netbsd.org/source-changes-d/2017/07/thread1.html#009301 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/etc/etc.next68k/MAKEDEV.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/etc/etc.next68k
Module Name:src Committed By: tsutsui Date: Sun Jul 9 05:58:13 UTC 2017 Modified Files: src/etc/etc.next68k: MAKEDEV.conf Log Message: Revert the previous changes for PR/52377. - the names "ttya" and "ttyb" in zs(4) man page were leftover of the orignal sparc/sun3 ports which used the same name for their native SunOS users - symlinks ttya -> tty00 -> ttyZ0 (by "lndev tty00 ttya") are awful anyway (symlinks tty0? -> ttyZ? are handled in MI MAKEDEV.tmpl) See details on discussion on source-changes-d@: http://mail-index.netbsd.org/source-changes-d/2017/07/thread1.html#009301 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/etc/etc.next68k/MAKEDEV.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/etc.next68k/MAKEDEV.conf diff -u src/etc/etc.next68k/MAKEDEV.conf:1.4 src/etc/etc.next68k/MAKEDEV.conf:1.5 --- src/etc/etc.next68k/MAKEDEV.conf:1.4 Fri Jul 7 23:48:34 2017 +++ src/etc/etc.next68k/MAKEDEV.conf Sun Jul 9 05:58:13 2017 @@ -1,4 +1,4 @@ -# $NetBSD: MAKEDEV.conf,v 1.4 2017/07/07 23:48:34 christos Exp $ +# $NetBSD: MAKEDEV.conf,v 1.5 2017/07/09 05:58:13 tsutsui Exp $ all_md) makedev wscons sd0 sd1 sd2 sd3 tty0 tty1 @@ -7,14 +7,10 @@ all_md) makedev bpf8 bpf9 bpf10 bpf11 makedev scsibus0 scsibus1 scsibus2 scsibus3 makedev ses0 ses1 ses2 ses3 - lndev tty00 ttya - lndev tty01 ttyb ;; raminst) makedev std makedev sd0 sd1 sd2 sd3 st0 st1 cd0 cd1 makedev tty0 tty1 opty - lndev tty00 ttya - lndev tty01 ttyb ;;
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Sun Jul 9 04:54:00 UTC 2017 Modified Files: src/usr.bin/make: meta.c Log Message: Ensure that command output is always followed by newline, even when filemon is not being used. Tweak MAKE_META_IGNORE_PATTERNS matching to avoid using path name with :L as it does not handle ':' in path names. fgetLine: an extra check to avoid shrinking the buffer. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/usr.bin/make/meta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.67 src/usr.bin/make/meta.c:1.68 --- src/usr.bin/make/meta.c:1.67 Wed Aug 17 15:52:42 2016 +++ src/usr.bin/make/meta.c Sun Jul 9 04:54:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.67 2016/08/17 15:52:42 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.68 2017/07/09 04:54:00 sjg Exp $ */ /* * Implement 'meta' mode. @@ -723,7 +723,7 @@ meta_job_error(Job *job, GNode *gn, int pbm = } if (pbm->mfp != NULL) { - fprintf(pbm->mfp, "*** Error code %d%s\n", + fprintf(pbm->mfp, "\n*** Error code %d%s\n", status, (flags & JOB_IGNERR) ? "(ignored)" : ""); @@ -778,13 +778,13 @@ int meta_cmd_finish(void *pbmp) { int error = 0; -#ifdef USE_FILEMON BuildMon *pbm = pbmp; int x; if (!pbm) pbm = +#ifdef USE_FILEMON if (pbm->filemon_fd >= 0) { if (close(pbm->filemon_fd) < 0) error = errno; @@ -792,8 +792,9 @@ meta_cmd_finish(void *pbmp) if (error == 0 && x != 0) error = x; pbm->filemon_fd = pbm->mon_fd = -1; -} +} else #endif + fprintf(pbm->mfp, "\n"); /* ensure end with newline */ return error; } @@ -857,6 +858,8 @@ fgetLine(char **bufp, size_t *szp, int o newsz = ROUNDUP((fs.st_size / 2), BUFSIZ); if (newsz <= bufsz) newsz = ROUNDUP(fs.st_size, BUFSIZ); + if (newsz <= bufsz) + return x; /* truncated */ if (DEBUG(META)) fprintf(debug_file, "growing buffer %zu -> %zu\n", bufsz, newsz); @@ -944,10 +947,10 @@ meta_ignore(GNode *gn, const char *p) if (metaIgnorePatterns) { char *pm; - snprintf(fname, sizeof(fname), - "${%s:@m@${%s:L:M$m}@}", - MAKE_META_IGNORE_PATTERNS, p); - pm = Var_Subst(NULL, fname, gn, VARF_WANTRES); + Var_Set(".p.", p, gn, 0); + pm = Var_Subst(NULL, + "${" MAKE_META_IGNORE_PATTERNS ":@m@${.p.:M$m}@}", + gn, VARF_WANTRES); if (*pm) { #ifdef DEBUG_META_MODE if (DEBUG(META))
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Sun Jul 9 04:54:00 UTC 2017 Modified Files: src/usr.bin/make: meta.c Log Message: Ensure that command output is always followed by newline, even when filemon is not being used. Tweak MAKE_META_IGNORE_PATTERNS matching to avoid using path name with :L as it does not handle ':' in path names. fgetLine: an extra check to avoid shrinking the buffer. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/usr.bin/make/meta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Sun Jul 9 04:37:41 UTC 2017 Modified Files: src/doc [netbsd-7]: CHANGES-7.2 Log Message: 1411 To generate a diff of this commit: cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-7.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-7.2 diff -u src/doc/CHANGES-7.2:1.1.2.25 src/doc/CHANGES-7.2:1.1.2.26 --- src/doc/CHANGES-7.2:1.1.2.25 Sat Jul 8 17:19:31 2017 +++ src/doc/CHANGES-7.2 Sun Jul 9 04:37:40 2017 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.2,v 1.1.2.25 2017/07/08 17:19:31 snj Exp $ +# $NetBSD: CHANGES-7.2,v 1.1.2.26 2017/07/09 04:37:40 snj Exp $ A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2 release: @@ -2468,3 +2468,12 @@ xsrc/xfree/xc/programs/Xserver/Xi/sendex Fix CVE-2017-10971 and CVE-2017-10972. [mrg, ticket #1446] +libexec/ld.elf_so/reloc.c 1.110 + + PR port-macppc/47464 - Old binutils generated bogus zero-sized + COPY relocations for _SDA_BASE_ and _SDA2_BASE_ that happened + to work by accident. They no longer happen to work when old + binaries are run on newer systems. Explicitly ignore these + bogus relocations. + [uwe, ticket #1411] +
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Sun Jul 9 04:37:41 UTC 2017 Modified Files: src/doc [netbsd-7]: CHANGES-7.2 Log Message: 1411 To generate a diff of this commit: cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-7.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/libexec/ld.elf_so
Module Name:src Committed By: snj Date: Sun Jul 9 04:35:00 UTC 2017 Modified Files: src/libexec/ld.elf_so [netbsd-7]: reloc.c Log Message: Pull up following revision(s) (requested by uwe in ticket #1411): libexec/ld.elf_so/reloc.c: revision 1.110 PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by accident. They no longer happen to work when old binaries are run on newer systems. Explicitly ignore these bogus relocations. To generate a diff of this commit: cvs rdiff -u -r1.106.18.1 -r1.106.18.2 src/libexec/ld.elf_so/reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/reloc.c diff -u src/libexec/ld.elf_so/reloc.c:1.106.18.1 src/libexec/ld.elf_so/reloc.c:1.106.18.2 --- src/libexec/ld.elf_so/reloc.c:1.106.18.1 Sun Mar 6 18:17:55 2016 +++ src/libexec/ld.elf_so/reloc.c Sun Jul 9 04:35:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: reloc.c,v 1.106.18.1 2016/03/06 18:17:55 martin Exp $ */ +/* $NetBSD: reloc.c,v 1.106.18.2 2017/07/09 04:35:00 snj Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -39,7 +39,7 @@ #include #ifndef lint -__RCSID("$NetBSD: reloc.c,v 1.106.18.1 2016/03/06 18:17:55 martin Exp $"); +__RCSID("$NetBSD: reloc.c,v 1.106.18.2 2017/07/09 04:35:00 snj Exp $"); #endif /* not lint */ #include @@ -73,6 +73,22 @@ _rtld_do_copy_relocation(const Obj_Entry const Elf_Sym *srcsym = NULL; Obj_Entry *srcobj; + if (__predict_false(size == 0)) { +#if defined(__powerpc__) && !defined(__LP64) /* PR port-macppc/47464 */ + if (strcmp(name, "_SDA_BASE_") == 0 + || strcmp(name, "_SDA2_BASE_") == 0) + { + rdbg(("COPY %s %s --> ignoring old binutils bug", + dstobj->path, name)); + return 0; + } +#endif +#if 0 /* shall we warn? */ + xwarnx("%s: zero size COPY relocation for \"%s\"", + dstobj->path, name); +#endif + } + for (srcobj = dstobj->next; srcobj != NULL; srcobj = srcobj->next) { srcsym = _rtld_symlook_obj(name, hash, srcobj, 0, _rtld_fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)));
CVS commit: [netbsd-7] src/libexec/ld.elf_so
Module Name:src Committed By: snj Date: Sun Jul 9 04:35:00 UTC 2017 Modified Files: src/libexec/ld.elf_so [netbsd-7]: reloc.c Log Message: Pull up following revision(s) (requested by uwe in ticket #1411): libexec/ld.elf_so/reloc.c: revision 1.110 PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by accident. They no longer happen to work when old binaries are run on newer systems. Explicitly ignore these bogus relocations. To generate a diff of this commit: cvs rdiff -u -r1.106.18.1 -r1.106.18.2 src/libexec/ld.elf_so/reloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: christos Date: Sat Jul 8 22:56:15 UTC 2017 Modified Files: src/sys/netinet: ip_input.c Log Message: Reorder the controls to the ones that need an interface and the ones that don't; process the ones that don't first. Add a DIAGNOSTIC if there is no interface; really this should be a KASSERT/panic because it is a bug if the interface is not set at this point. To generate a diff of this commit: cvs rdiff -u -r1.357 -r1.358 src/sys/netinet/ip_input.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/netinet/ip_input.c diff -u src/sys/netinet/ip_input.c:1.357 src/sys/netinet/ip_input.c:1.358 --- src/sys/netinet/ip_input.c:1.357 Thu Jul 6 13:12:34 2017 +++ src/sys/netinet/ip_input.c Sat Jul 8 18:56:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.357 2017/07/06 17:12:34 christos Exp $ */ +/* $NetBSD: ip_input.c,v 1.358 2017/07/08 22:56:15 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.357 2017/07/06 17:12:34 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.358 2017/07/08 22:56:15 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1515,13 +1515,7 @@ ip_savecontrol(struct inpcb *inp, struct struct mbuf *m) { struct socket *so = inp->inp_socket; - ifnet_t *ifp; int inpflags = inp->inp_flags; - struct psref psref; - - ifp = m_get_rcvif_psref(m, ); - if (__predict_false(ifp == NULL)) - return; /* XXX should report error? */ if (SOOPT_TIMESTAMP(so->so_options)) mp = sbsavetimestamp(so->so_options, m, mp); @@ -1532,6 +1526,23 @@ ip_savecontrol(struct inpcb *inp, struct if (*mp) mp = &(*mp)->m_next; } + + if (inpflags & INP_RECVTTL) { + *mp = sbcreatecontrol(>ip_ttl, + sizeof(uint8_t), IP_RECVTTL, IPPROTO_IP); + if (*mp) + mp = &(*mp)->m_next; + } + + struct psref psref; + ifnet_t *ifp = m_get_rcvif_psref(m, ); + if (__predict_false(ifp == NULL)) { +#ifdef DIAGNOSTIC + printf("%s: missing receive interface\n", __func__); +#endif + return; /* XXX should report error? */ + } + if (inpflags & INP_RECVPKTINFO) { struct in_pktinfo ipi; ipi.ipi_addr = ip->ip_src; @@ -1559,12 +1570,6 @@ ip_savecontrol(struct inpcb *inp, struct if (*mp) mp = &(*mp)->m_next; } - if (inpflags & INP_RECVTTL) { - *mp = sbcreatecontrol(>ip_ttl, - sizeof(uint8_t), IP_RECVTTL, IPPROTO_IP); - if (*mp) - mp = &(*mp)->m_next; - } m_put_rcvif_psref(ifp, ); }
CVS commit: src/sys/netinet
Module Name:src Committed By: christos Date: Sat Jul 8 22:56:15 UTC 2017 Modified Files: src/sys/netinet: ip_input.c Log Message: Reorder the controls to the ones that need an interface and the ones that don't; process the ones that don't first. Add a DIAGNOSTIC if there is no interface; really this should be a KASSERT/panic because it is a bug if the interface is not set at this point. To generate a diff of this commit: cvs rdiff -u -r1.357 -r1.358 src/sys/netinet/ip_input.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev
Module Name:src Committed By: jmcneill Date: Sat Jul 8 19:25:37 UTC 2017 Modified Files: src/sys/dev: led.c Log Message: Use unsigned char for ctype functions, suggested by christos To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/led.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/led.c diff -u src/sys/dev/led.c:1.1 src/sys/dev/led.c:1.2 --- src/sys/dev/led.c:1.1 Sat Jul 8 00:54:37 2017 +++ src/sys/dev/led.c Sat Jul 8 19:25:37 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: led.c,v 1.1 2017/07/08 00:54:37 jmcneill Exp $ */ +/* $NetBSD: led.c,v 1.2 2017/07/08 19:25:37 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill@@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: led.c,v 1.1 2017/07/08 00:54:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: led.c,v 1.2 2017/07/08 19:25:37 jmcneill Exp $"); #include #include @@ -79,9 +79,9 @@ led_lookup(const char *name) static void led_normalize_name(char *name) { - char *p; + unsigned char *p; - for (p = name; *p; p++) + for (p = (unsigned char *)name; *p; p++) if (!isalpha(*p) && !isdigit(*p) && *p != '-' && *p != '_') *p = '_'; }
CVS commit: src/sys/dev
Module Name:src Committed By: jmcneill Date: Sat Jul 8 19:25:37 UTC 2017 Modified Files: src/sys/dev: led.c Log Message: Use unsigned char for ctype functions, suggested by christos To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/led.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/sdmmc
Module Name:src Committed By: jmcneill Date: Sat Jul 8 18:38:57 UTC 2017 Modified Files: src/sys/dev/sdmmc: ld_sdmmc.c Log Message: The config_* APIs are not MPSAFE, so make sure the deferred attach thread holds KERNEL_LOCK. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sdmmc/ld_sdmmc.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/sdmmc/ld_sdmmc.c diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.28 src/sys/dev/sdmmc/ld_sdmmc.c:1.29 --- src/sys/dev/sdmmc/ld_sdmmc.c:1.28 Sat Jun 24 11:27:33 2017 +++ src/sys/dev/sdmmc/ld_sdmmc.c Sat Jul 8 18:38:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ld_sdmmc.c,v 1.28 2017/06/24 11:27:33 jmcneill Exp $ */ +/* $NetBSD: ld_sdmmc.c,v 1.29 2017/07/08 18:38:57 jmcneill Exp $ */ /* * Copyright (c) 2008 KIYOHARA Takashi @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.28 2017/06/24 11:27:33 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.29 2017/07/08 18:38:57 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_sdmmc.h" @@ -157,7 +157,7 @@ ld_sdmmc_attach(device_t parent, device_ * when wedge is supported. */ config_pending_incr(self); - if (kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL, + if (kthread_create(PRI_NONE, 0, NULL, ld_sdmmc_doattach, sc, , "%sattach", device_xname(self))) { aprint_error_dev(self, "couldn't create thread\n"); }
CVS commit: src/sys/dev/sdmmc
Module Name:src Committed By: jmcneill Date: Sat Jul 8 18:38:57 UTC 2017 Modified Files: src/sys/dev/sdmmc: ld_sdmmc.c Log Message: The config_* APIs are not MPSAFE, so make sure the deferred attach thread holds KERNEL_LOCK. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sdmmc/ld_sdmmc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Sat Jul 8 17:19:31 UTC 2017 Modified Files: src/doc [netbsd-7]: CHANGES-7.2 Log Message: tickets 1427-1431, 1433, 1442-1446 To generate a diff of this commit: cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-7.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Sat Jul 8 17:19:31 UTC 2017 Modified Files: src/doc [netbsd-7]: CHANGES-7.2 Log Message: tickets 1427-1431, 1433, 1442-1446 To generate a diff of this commit: cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-7.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-7.2 diff -u src/doc/CHANGES-7.2:1.1.2.24 src/doc/CHANGES-7.2:1.1.2.25 --- src/doc/CHANGES-7.2:1.1.2.24 Thu Jun 29 12:25:04 2017 +++ src/doc/CHANGES-7.2 Sat Jul 8 17:19:31 2017 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.2,v 1.1.2.24 2017/06/29 12:25:04 sborrill Exp $ +# $NetBSD: CHANGES-7.2,v 1.1.2.25 2017/07/08 17:19:31 snj Exp $ A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2 release: @@ -2399,3 +2399,72 @@ sys/external/bsd/ipf/netinet/ip_frag.c eventually panic. [christos, ticket #1412] +usr.sbin/service/service 1.8 + + Only match first instance of name and rcvar in file. + [sborrill, ticket #1427] + +sys/gdbscripts/cpus1.2, 1.3 + + Make cpus gdb script MI. + [skrll, ticket #1428] + +sys/dev/cgd.c patch + + Avoid crashes by checking if a cgd device has been configured + before processing most ioctls, and failing with ENXIO if the + device is not configured. + [chs, ticket #1429] + +external/bsd/dhcp/dist/relay/dhcrelay.c 1.7 + + Fix buggy dhcrelay(8) requirement to stay in foreground + [manu, ticket #1430] + +sys/dev/pci/ehci_pci.c1.65 + + Deal with broken BIOSes that leave PCI interrupts disabled. + [sborrill, ticket #1431] + +sys/dev/audio.c patch + + Fix occasional stuttering that can be caused by + ringbuffer overflow. + [nat, ticket #1433] + +sys/kern/kern_event.c1.92 via patch +sys/miscfs/genfs/genfs_vnops.c 1.198 +sys/sys/event.h 1.30 via patch + + Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. + Makes go unit tests pass. + + Fix file descriptor locking. Fixes kernel crashes by running go. + [christos, ticket #1442] + +external/bsd/tcpdump/bin/Makefile patch + + netbsd-7 clang doesn't support -Wno-error=address-of-packed-member + [maya, ticket #1443] + +sys/arch/arm/cortex/a9_mpsubr.S 1.48 + + Make fp 0 on entry to idle_stack to ensure we mark that + we're top of stack + [skrll, ticket #1444] + +sys/arch/amd64/conf/XEN3_DOM0 1.136 +sys/arch/i386/conf/XEN3_DOM0 1.113 +sys/arch/xen/conf/files.xen 1.148 + + Register support for SD card readers with Xen DOM0 kernels + [khorben, ticket #1445] + +xsrc/external/mit/xorg-server/dist/Xi/sendexev.c patch +xsrc/external/mit/xorg-server/dist/dix/events.c patch +xsrc/external/mit/xorg-server/dist/dix/swapreq.c patch +xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c patch + + Fix CVE-2017-10971 and CVE-2017-10972. + [mrg, ticket #1446] +
CVS commit: [netbsd-7-1] src/doc
Module Name:src Committed By: snj Date: Sat Jul 8 17:17:58 UTC 2017 Modified Files: src/doc [netbsd-7-1]: CHANGES-7.1.1 Log Message: 1429, 1430, 1442, 1446 To generate a diff of this commit: cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-7.1.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-7.1.1 diff -u src/doc/CHANGES-7.1.1:1.1.2.12 src/doc/CHANGES-7.1.1:1.1.2.13 --- src/doc/CHANGES-7.1.1:1.1.2.12 Wed Jun 21 17:18:06 2017 +++ src/doc/CHANGES-7.1.1 Sat Jul 8 17:17:58 2017 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.1.1,v 1.1.2.12 2017/06/21 17:18:06 snj Exp $ +# $NetBSD: CHANGES-7.1.1,v 1.1.2.13 2017/07/08 17:17:58 snj Exp $ A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1 release: @@ -1650,3 +1650,33 @@ external/mit/expat/dist/xmlwf/xmlwf.dsp Update expat to 2.2.1. [spz, ticket #1437] +sys/dev/cgd.c patch + + Avoid crashes by checking if a cgd device has been configured + before processing most ioctls, and failing with ENXIO if the + device is not configured. + [chs, ticket #1429] + +external/bsd/dhcp/dist/relay/dhcrelay.c 1.7 + + Fix buggy dhcrelay(8) requirement to stay in foreground + [manu, ticket #1430] + +sys/kern/kern_event.c1.92 via patch +sys/miscfs/genfs/genfs_vnops.c 1.198 +sys/sys/event.h 1.30 via patch + + Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. + Makes go unit tests pass. + + Fix file descriptor locking. Fixes kernel crashes by running go. + [christos, ticket #1442] + +xsrc/external/mit/xorg-server/dist/Xi/sendexev.c patch +xsrc/external/mit/xorg-server/dist/dix/events.c patch +xsrc/external/mit/xorg-server/dist/dix/swapreq.c patch +xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c patch + + Fix CVE-2017-10971 and CVE-2017-10972. + [mrg, ticket #1446] +
CVS commit: [netbsd-7-1] src/doc
Module Name:src Committed By: snj Date: Sat Jul 8 17:17:58 UTC 2017 Modified Files: src/doc [netbsd-7-1]: CHANGES-7.1.1 Log Message: 1429, 1430, 1442, 1446 To generate a diff of this commit: cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-7.1.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-0] src/doc
Module Name:src Committed By: snj Date: Sat Jul 8 17:17:41 UTC 2017 Modified Files: src/doc [netbsd-7-0]: CHANGES-7.0.3 Log Message: tickets 1429, 1430, 1442, 1446 To generate a diff of this commit: cvs rdiff -u -r1.1.2.45 -r1.1.2.46 src/doc/CHANGES-7.0.3 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-7.0.3 diff -u src/doc/CHANGES-7.0.3:1.1.2.45 src/doc/CHANGES-7.0.3:1.1.2.46 --- src/doc/CHANGES-7.0.3:1.1.2.45 Wed Jun 21 17:09:53 2017 +++ src/doc/CHANGES-7.0.3 Sat Jul 8 17:17:41 2017 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0.3,v 1.1.2.45 2017/06/21 17:09:53 snj Exp $ +# $NetBSD: CHANGES-7.0.3,v 1.1.2.46 2017/07/08 17:17:41 snj Exp $ A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3 release: @@ -2957,3 +2957,33 @@ external/mit/expat/dist/xmlwf/xmlwf.dsp Update expat to 2.2.1. [spz, ticket #1437] +sys/dev/cgd.c patch + + Avoid crashes by checking if a cgd device has been configured + before processing most ioctls, and failing with ENXIO if the + device is not configured. + [chs, ticket #1429] + +external/bsd/dhcp/dist/relay/dhcrelay.c 1.7 + + Fix buggy dhcrelay(8) requirement to stay in foreground + [manu, ticket #1430] + +sys/kern/kern_event.c1.92 via patch +sys/miscfs/genfs/genfs_vnops.c 1.198 +sys/sys/event.h 1.30 via patch + + Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. + Makes go unit tests pass. + + Fix file descriptor locking. Fixes kernel crashes by running go. + [christos, ticket #1442] + +xsrc/external/mit/xorg-server/dist/Xi/sendexev.c patch +xsrc/external/mit/xorg-server/dist/dix/events.c patch +xsrc/external/mit/xorg-server/dist/dix/swapreq.c patch +xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c patch + + Fix CVE-2017-10971 and CVE-2017-10972. + [mrg, ticket #1446] +
CVS commit: [netbsd-7-0] src/doc
Module Name:src Committed By: snj Date: Sat Jul 8 17:17:41 UTC 2017 Modified Files: src/doc [netbsd-7-0]: CHANGES-7.0.3 Log Message: tickets 1429, 1430, 1442, 1446 To generate a diff of this commit: cvs rdiff -u -r1.1.2.45 -r1.1.2.46 src/doc/CHANGES-7.0.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-1] xsrc
Module Name:xsrc Committed By: snj Date: Sat Jul 8 17:14:58 UTC 2017 Modified Files: xsrc/external/mit/xorg-server/dist/Xi [netbsd-7-1]: sendexev.c xsrc/external/mit/xorg-server/dist/dix [netbsd-7-1]: events.c swapreq.c xsrc/xfree/xc/programs/Xserver/Xi [netbsd-7-1]: sendexev.c Log Message: Apply patch (requested by mrg in ticket #1446): Fix CVE-2017-10971 and CVE-2017-10972. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.10.1 -r1.1.1.3.10.1.4.1 \ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c cvs rdiff -u -r1.1.1.8 -r1.1.1.8.8.1 \ xsrc/external/mit/xorg-server/dist/dix/events.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.14.1 \ xsrc/external/mit/xorg-server/dist/dix/swapreq.c cvs rdiff -u -r1.1.1.4.38.1 -r1.1.1.4.38.1.4.1 \ xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xorg-server/dist/Xi/sendexev.c diff -u xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1 xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1.4.1 --- xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1 Tue Dec 9 19:36:57 2014 +++ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c Sat Jul 8 17:14:58 2017 @@ -79,7 +79,7 @@ SProcXSendExtensionEvent(ClientPtr clien char n; CARD32 *p; int i; -xEvent eventT; +xEvent eventT = { .u.u.type = 0 }; xEvent *eventP; EventSwapPtr proc; @@ -95,9 +95,17 @@ SProcXSendExtensionEvent(ClientPtr clien eventP = (xEvent *) & stuff[1]; for (i = 0; i < stuff->num_events; i++, eventP++) { +if (eventP->u.u.type == GenericEvent) { +client->errorValue = eventP->u.u.type; +return BadValue; +} + proc = EventSwapVector[eventP->u.u.type & 0177]; - if (proc == NotImplemented) /* no swapping proc; invalid event type? */ +/* no swapping proc; invalid event type? */ +if (proc == NotImplemented) { +client->errorValue = eventP->u.u.type; return BadValue; +} (*proc) (eventP, ); *eventP = eventT; } @@ -117,7 +125,7 @@ SProcXSendExtensionEvent(ClientPtr clien int ProcXSendExtensionEvent(ClientPtr client) { -int ret; +int ret, i; DeviceIntPtr dev; xEvent *first; XEventClass *list; @@ -140,10 +148,12 @@ ProcXSendExtensionEvent(ClientPtr client /* The client's event type must be one defined by an extension. */ first = ((xEvent *) & stuff[1]); -if (!((EXTENSION_EVENT_BASE <= first->u.u.type) && - (first->u.u.type < lastEvent))) { - client->errorValue = first->u.u.type; - return BadValue; +for (i = 0; i < stuff->num_events; i++) { +if (!((EXTENSION_EVENT_BASE <= first[i].u.u.type) && +(first[i].u.u.type < lastEvent))) { +client->errorValue = first[i].u.u.type; +return BadValue; +} } list = (XEventClass *) (first + stuff->num_events); Index: xsrc/external/mit/xorg-server/dist/dix/events.c diff -u xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8 xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8.8.1 --- xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8 Mon Jun 3 07:34:19 2013 +++ xsrc/external/mit/xorg-server/dist/dix/events.c Sat Jul 8 17:14:58 2017 @@ -5021,6 +5021,12 @@ ProcSendEvent(ClientPtr client) client->errorValue = stuff->event.u.u.type; return BadValue; } +/* Generic events can have variable size, but SendEvent request holds + exactly 32B of event data. */ +if (stuff->event.u.u.type == GenericEvent) { +client->errorValue = stuff->event.u.u.type; +return BadValue; +} if (stuff->event.u.u.type == ClientMessage && stuff->event.u.u.detail != 8 && stuff->event.u.u.detail != 16 && Index: xsrc/external/mit/xorg-server/dist/dix/swapreq.c diff -u xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2 xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2.14.1 --- xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2 Tue Nov 23 05:21:00 2010 +++ xsrc/external/mit/xorg-server/dist/dix/swapreq.c Sat Jul 8 17:14:58 2017 @@ -315,6 +315,13 @@ SProcSendEvent(ClientPtr client) swapl(>destination, n); swapl(>eventMask, n); +/* Generic events can have variable size, but SendEvent request holds + exactly 32B of event data. */ +if (stuff->event.u.u.type == GenericEvent) { +client->errorValue = stuff->event.u.u.type; +return BadValue; +} + /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; if (!proc || proc == NotImplemented)/* no swapping proc; invalid event type? */ Index: xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c diff -u xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.1 xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.1.4.1 ---
CVS commit: [netbsd-7] xsrc
Module Name:xsrc Committed By: snj Date: Sat Jul 8 17:15:29 UTC 2017 Modified Files: xsrc/external/mit/xorg-server/dist/Xi [netbsd-7]: sendexev.c xsrc/external/mit/xorg-server/dist/dix [netbsd-7]: events.c swapreq.c xsrc/xfree/xc/programs/Xserver/Xi [netbsd-7]: sendexev.c Log Message: Apply patch (requested by mrg in ticket #1446): Fix CVE-2017-10971 and CVE-2017-10972. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.10.1 -r1.1.1.3.10.2 \ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c cvs rdiff -u -r1.1.1.8 -r1.1.1.8.4.1 \ xsrc/external/mit/xorg-server/dist/dix/events.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.10.1 \ xsrc/external/mit/xorg-server/dist/dix/swapreq.c cvs rdiff -u -r1.1.1.4.38.1 -r1.1.1.4.38.2 \ xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] xsrc
Module Name:xsrc Committed By: snj Date: Sat Jul 8 17:15:29 UTC 2017 Modified Files: xsrc/external/mit/xorg-server/dist/Xi [netbsd-7]: sendexev.c xsrc/external/mit/xorg-server/dist/dix [netbsd-7]: events.c swapreq.c xsrc/xfree/xc/programs/Xserver/Xi [netbsd-7]: sendexev.c Log Message: Apply patch (requested by mrg in ticket #1446): Fix CVE-2017-10971 and CVE-2017-10972. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.10.1 -r1.1.1.3.10.2 \ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c cvs rdiff -u -r1.1.1.8 -r1.1.1.8.4.1 \ xsrc/external/mit/xorg-server/dist/dix/events.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.10.1 \ xsrc/external/mit/xorg-server/dist/dix/swapreq.c cvs rdiff -u -r1.1.1.4.38.1 -r1.1.1.4.38.2 \ xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xorg-server/dist/Xi/sendexev.c diff -u xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1 xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.2 --- xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1 Tue Dec 9 19:36:57 2014 +++ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c Sat Jul 8 17:15:29 2017 @@ -79,7 +79,7 @@ SProcXSendExtensionEvent(ClientPtr clien char n; CARD32 *p; int i; -xEvent eventT; +xEvent eventT = { .u.u.type = 0 }; xEvent *eventP; EventSwapPtr proc; @@ -95,9 +95,17 @@ SProcXSendExtensionEvent(ClientPtr clien eventP = (xEvent *) & stuff[1]; for (i = 0; i < stuff->num_events; i++, eventP++) { +if (eventP->u.u.type == GenericEvent) { +client->errorValue = eventP->u.u.type; +return BadValue; +} + proc = EventSwapVector[eventP->u.u.type & 0177]; - if (proc == NotImplemented) /* no swapping proc; invalid event type? */ +/* no swapping proc; invalid event type? */ +if (proc == NotImplemented) { +client->errorValue = eventP->u.u.type; return BadValue; +} (*proc) (eventP, ); *eventP = eventT; } @@ -117,7 +125,7 @@ SProcXSendExtensionEvent(ClientPtr clien int ProcXSendExtensionEvent(ClientPtr client) { -int ret; +int ret, i; DeviceIntPtr dev; xEvent *first; XEventClass *list; @@ -140,10 +148,12 @@ ProcXSendExtensionEvent(ClientPtr client /* The client's event type must be one defined by an extension. */ first = ((xEvent *) & stuff[1]); -if (!((EXTENSION_EVENT_BASE <= first->u.u.type) && - (first->u.u.type < lastEvent))) { - client->errorValue = first->u.u.type; - return BadValue; +for (i = 0; i < stuff->num_events; i++) { +if (!((EXTENSION_EVENT_BASE <= first[i].u.u.type) && +(first[i].u.u.type < lastEvent))) { +client->errorValue = first[i].u.u.type; +return BadValue; +} } list = (XEventClass *) (first + stuff->num_events); Index: xsrc/external/mit/xorg-server/dist/dix/events.c diff -u xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8 xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8.4.1 --- xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8 Mon Jun 3 07:34:19 2013 +++ xsrc/external/mit/xorg-server/dist/dix/events.c Sat Jul 8 17:15:29 2017 @@ -5021,6 +5021,12 @@ ProcSendEvent(ClientPtr client) client->errorValue = stuff->event.u.u.type; return BadValue; } +/* Generic events can have variable size, but SendEvent request holds + exactly 32B of event data. */ +if (stuff->event.u.u.type == GenericEvent) { +client->errorValue = stuff->event.u.u.type; +return BadValue; +} if (stuff->event.u.u.type == ClientMessage && stuff->event.u.u.detail != 8 && stuff->event.u.u.detail != 16 && Index: xsrc/external/mit/xorg-server/dist/dix/swapreq.c diff -u xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2 xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2.10.1 --- xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2 Tue Nov 23 05:21:00 2010 +++ xsrc/external/mit/xorg-server/dist/dix/swapreq.c Sat Jul 8 17:15:29 2017 @@ -315,6 +315,13 @@ SProcSendEvent(ClientPtr client) swapl(>destination, n); swapl(>eventMask, n); +/* Generic events can have variable size, but SendEvent request holds + exactly 32B of event data. */ +if (stuff->event.u.u.type == GenericEvent) { +client->errorValue = stuff->event.u.u.type; +return BadValue; +} + /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; if (!proc || proc == NotImplemented)/* no swapping proc; invalid event type? */ Index: xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c diff -u xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.1 xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.2 --- xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.1 Thu Dec
CVS commit: [netbsd-7-1] xsrc
Module Name:xsrc Committed By: snj Date: Sat Jul 8 17:14:58 UTC 2017 Modified Files: xsrc/external/mit/xorg-server/dist/Xi [netbsd-7-1]: sendexev.c xsrc/external/mit/xorg-server/dist/dix [netbsd-7-1]: events.c swapreq.c xsrc/xfree/xc/programs/Xserver/Xi [netbsd-7-1]: sendexev.c Log Message: Apply patch (requested by mrg in ticket #1446): Fix CVE-2017-10971 and CVE-2017-10972. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.10.1 -r1.1.1.3.10.1.4.1 \ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c cvs rdiff -u -r1.1.1.8 -r1.1.1.8.8.1 \ xsrc/external/mit/xorg-server/dist/dix/events.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.14.1 \ xsrc/external/mit/xorg-server/dist/dix/swapreq.c cvs rdiff -u -r1.1.1.4.38.1 -r1.1.1.4.38.1.4.1 \ xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-0] xsrc
Module Name:xsrc Committed By: snj Date: Sat Jul 8 17:14:33 UTC 2017 Modified Files: xsrc/external/mit/xorg-server/dist/Xi [netbsd-7-0]: sendexev.c xsrc/external/mit/xorg-server/dist/dix [netbsd-7-0]: events.c swapreq.c xsrc/xfree/xc/programs/Xserver/Xi [netbsd-7-0]: sendexev.c Log Message: Apply patch (requested by mrg in ticket #1446): Fix CVE-2017-10971 and CVE-2017-10972. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.10.1 -r1.1.1.3.10.1.2.1 \ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c cvs rdiff -u -r1.1.1.8 -r1.1.1.8.6.1 \ xsrc/external/mit/xorg-server/dist/dix/events.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.12.1 \ xsrc/external/mit/xorg-server/dist/dix/swapreq.c cvs rdiff -u -r1.1.1.4.38.1 -r1.1.1.4.38.1.2.1 \ xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xorg-server/dist/Xi/sendexev.c diff -u xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1 xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1.2.1 --- xsrc/external/mit/xorg-server/dist/Xi/sendexev.c:1.1.1.3.10.1 Tue Dec 9 19:36:57 2014 +++ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c Sat Jul 8 17:14:32 2017 @@ -79,7 +79,7 @@ SProcXSendExtensionEvent(ClientPtr clien char n; CARD32 *p; int i; -xEvent eventT; +xEvent eventT = { .u.u.type = 0 }; xEvent *eventP; EventSwapPtr proc; @@ -95,9 +95,17 @@ SProcXSendExtensionEvent(ClientPtr clien eventP = (xEvent *) & stuff[1]; for (i = 0; i < stuff->num_events; i++, eventP++) { +if (eventP->u.u.type == GenericEvent) { +client->errorValue = eventP->u.u.type; +return BadValue; +} + proc = EventSwapVector[eventP->u.u.type & 0177]; - if (proc == NotImplemented) /* no swapping proc; invalid event type? */ +/* no swapping proc; invalid event type? */ +if (proc == NotImplemented) { +client->errorValue = eventP->u.u.type; return BadValue; +} (*proc) (eventP, ); *eventP = eventT; } @@ -117,7 +125,7 @@ SProcXSendExtensionEvent(ClientPtr clien int ProcXSendExtensionEvent(ClientPtr client) { -int ret; +int ret, i; DeviceIntPtr dev; xEvent *first; XEventClass *list; @@ -140,10 +148,12 @@ ProcXSendExtensionEvent(ClientPtr client /* The client's event type must be one defined by an extension. */ first = ((xEvent *) & stuff[1]); -if (!((EXTENSION_EVENT_BASE <= first->u.u.type) && - (first->u.u.type < lastEvent))) { - client->errorValue = first->u.u.type; - return BadValue; +for (i = 0; i < stuff->num_events; i++) { +if (!((EXTENSION_EVENT_BASE <= first[i].u.u.type) && +(first[i].u.u.type < lastEvent))) { +client->errorValue = first[i].u.u.type; +return BadValue; +} } list = (XEventClass *) (first + stuff->num_events); Index: xsrc/external/mit/xorg-server/dist/dix/events.c diff -u xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8 xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8.6.1 --- xsrc/external/mit/xorg-server/dist/dix/events.c:1.1.1.8 Mon Jun 3 07:34:19 2013 +++ xsrc/external/mit/xorg-server/dist/dix/events.c Sat Jul 8 17:14:32 2017 @@ -5021,6 +5021,12 @@ ProcSendEvent(ClientPtr client) client->errorValue = stuff->event.u.u.type; return BadValue; } +/* Generic events can have variable size, but SendEvent request holds + exactly 32B of event data. */ +if (stuff->event.u.u.type == GenericEvent) { +client->errorValue = stuff->event.u.u.type; +return BadValue; +} if (stuff->event.u.u.type == ClientMessage && stuff->event.u.u.detail != 8 && stuff->event.u.u.detail != 16 && Index: xsrc/external/mit/xorg-server/dist/dix/swapreq.c diff -u xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2 xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2.12.1 --- xsrc/external/mit/xorg-server/dist/dix/swapreq.c:1.1.1.2 Tue Nov 23 05:21:00 2010 +++ xsrc/external/mit/xorg-server/dist/dix/swapreq.c Sat Jul 8 17:14:32 2017 @@ -315,6 +315,13 @@ SProcSendEvent(ClientPtr client) swapl(>destination, n); swapl(>eventMask, n); +/* Generic events can have variable size, but SendEvent request holds + exactly 32B of event data. */ +if (stuff->event.u.u.type == GenericEvent) { +client->errorValue = stuff->event.u.u.type; +return BadValue; +} + /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; if (!proc || proc == NotImplemented)/* no swapping proc; invalid event type? */ Index: xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c diff -u xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.1 xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c:1.1.1.4.38.1.2.1 ---
CVS commit: [netbsd-7-0] xsrc
Module Name:xsrc Committed By: snj Date: Sat Jul 8 17:14:33 UTC 2017 Modified Files: xsrc/external/mit/xorg-server/dist/Xi [netbsd-7-0]: sendexev.c xsrc/external/mit/xorg-server/dist/dix [netbsd-7-0]: events.c swapreq.c xsrc/xfree/xc/programs/Xserver/Xi [netbsd-7-0]: sendexev.c Log Message: Apply patch (requested by mrg in ticket #1446): Fix CVE-2017-10971 and CVE-2017-10972. To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.10.1 -r1.1.1.3.10.1.2.1 \ xsrc/external/mit/xorg-server/dist/Xi/sendexev.c cvs rdiff -u -r1.1.1.8 -r1.1.1.8.6.1 \ xsrc/external/mit/xorg-server/dist/dix/events.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.12.1 \ xsrc/external/mit/xorg-server/dist/dix/swapreq.c cvs rdiff -u -r1.1.1.4.38.1 -r1.1.1.4.38.1.2.1 \ xsrc/xfree/xc/programs/Xserver/Xi/sendexev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/arch
Module Name:src Committed By: snj Date: Sat Jul 8 17:04:22 UTC 2017 Modified Files: src/sys/arch/amd64/conf [netbsd-7]: XEN3_DOM0 src/sys/arch/i386/conf [netbsd-7]: XEN3_DOM0 src/sys/arch/xen/conf [netbsd-7]: files.xen Log Message: Pull up following revision(s) (requested by khorben in ticket #1445): sys/arch/amd64/conf/XEN3_DOM0: revision 1.136 sys/arch/i386/conf/XEN3_DOM0: revision 1.113 sys/arch/xen/conf/files.xen: revision 1.148 Register support for SD card readers with Xen DOM0 kernels Tested on a Lenovo ThinkPad T440s (amd64) To generate a diff of this commit: cvs rdiff -u -r1.103.2.8 -r1.103.2.9 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.85.2.8 -r1.85.2.9 src/sys/arch/i386/conf/XEN3_DOM0 cvs rdiff -u -r1.133.4.2 -r1.133.4.3 src/sys/arch/xen/conf/files.xen Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/arch
Module Name:src Committed By: snj Date: Sat Jul 8 17:04:22 UTC 2017 Modified Files: src/sys/arch/amd64/conf [netbsd-7]: XEN3_DOM0 src/sys/arch/i386/conf [netbsd-7]: XEN3_DOM0 src/sys/arch/xen/conf [netbsd-7]: files.xen Log Message: Pull up following revision(s) (requested by khorben in ticket #1445): sys/arch/amd64/conf/XEN3_DOM0: revision 1.136 sys/arch/i386/conf/XEN3_DOM0: revision 1.113 sys/arch/xen/conf/files.xen: revision 1.148 Register support for SD card readers with Xen DOM0 kernels Tested on a Lenovo ThinkPad T440s (amd64) To generate a diff of this commit: cvs rdiff -u -r1.103.2.8 -r1.103.2.9 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.85.2.8 -r1.85.2.9 src/sys/arch/i386/conf/XEN3_DOM0 cvs rdiff -u -r1.133.4.2 -r1.133.4.3 src/sys/arch/xen/conf/files.xen 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/amd64/conf/XEN3_DOM0 diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.8 src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.9 --- src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.8 Sat May 13 06:28:59 2017 +++ src/sys/arch/amd64/conf/XEN3_DOM0 Sat Jul 8 17:04:21 2017 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.103.2.8 2017/05/13 06:28:59 snj Exp $ +# $NetBSD: XEN3_DOM0,v 1.103.2.9 2017/07/08 17:04:21 snj Exp $ include "arch/amd64/conf/std.xen" @@ -786,6 +786,19 @@ wsmouse* at btmagic? mux 0 # Bluetooth Audio support btsco* at bthub? + +# SD/MMC/SDIO Controller and Device support + +# SD/MMC controller +sdhc* at pci? # SD Host Controller +rtsx* at pci? # Realtek RTS5209/RTS5229 Card Reader +#sdhc* at cardbus? # SD Host Controller +sdmmc* at sdhc? # SD/MMC bus +sdmmc* at rtsx? # SD/MMC bus + +ld* at sdmmc? + + # Cryptographic Devices # PCI cryptographic devices Index: src/sys/arch/i386/conf/XEN3_DOM0 diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.8 src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.9 --- src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.8 Tue Apr 18 19:53:50 2017 +++ src/sys/arch/i386/conf/XEN3_DOM0 Sat Jul 8 17:04:21 2017 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.85.2.8 2017/04/18 19:53:50 snj Exp $ +# $NetBSD: XEN3_DOM0,v 1.85.2.9 2017/07/08 17:04:21 snj Exp $ # # XEN3_0: Xen 3.0 domain0 kernel @@ -684,6 +684,23 @@ ieee1394if* at fwohci? fwip* at ieee1394if? # IP over IEEE1394 sbp* at ieee1394if? euihi ? euilo ? # SCSI over IEEE1394 + +# SD/MMC/SDIO Controller and Device support + +# PCI SD/MMC controller +sdhc* at pci?# SD Host Controller +rtsx* at pci?# Realtek RTS5209/RTS5229 Card Reader + +# CardBus SD/MMC controller +#sdhc* at cardbus? function ? # SD Host Controller + +sdmmc* at sdhc? # SD/MMC bus +sdmmc* at rtsx? # SD/MMC bus +ld* at sdmmc? + + +# Audio Devices + # PCI audio devices auacer* at pci? dev ? function ? # ALi M5455 integrated AC'97 Audio auich* at pci? dev ? function ? # Intel ICH integrated AC'97 Audio @@ -761,6 +778,7 @@ wsmouse* at btmagic? mux 0 # Bluetooth Audio support btsco* at bthub? + # Cryptographic Devices # PCI cryptographic devices Index: src/sys/arch/xen/conf/files.xen diff -u src/sys/arch/xen/conf/files.xen:1.133.4.2 src/sys/arch/xen/conf/files.xen:1.133.4.3 --- src/sys/arch/xen/conf/files.xen:1.133.4.2 Sun Dec 18 07:50:37 2016 +++ src/sys/arch/xen/conf/files.xen Sat Jul 8 17:04:22 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.xen,v 1.133.4.2 2016/12/18 07:50:37 snj Exp $ +# $NetBSD: files.xen,v 1.133.4.3 2017/07/08 17:04:22 snj Exp $ # NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp # NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp @@ -368,6 +368,8 @@ include "compat/ossaudio/files.ossaudio" # Bluetooth include "dev/bluetooth/files.bluetooth" +include "dev/sdmmc/files.sdmmc" + # # CARDBUS #
CVS commit: [netbsd-7] src/sys/arch/arm/cortex
Module Name:src Committed By: snj Date: Sat Jul 8 17:01:52 UTC 2017 Modified Files: src/sys/arch/arm/cortex [netbsd-7]: a9_mpsubr.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1444): sys/arch/arm/cortex/a9_mpsubr.S: revision 1.48 Make fp 0 on entry to idle_stack to ensure we mark that we're top of stack To generate a diff of this commit: cvs rdiff -u -r1.18.2.4 -r1.18.2.5 src/sys/arch/arm/cortex/a9_mpsubr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/arch/arm/cortex
Module Name:src Committed By: snj Date: Sat Jul 8 17:01:52 UTC 2017 Modified Files: src/sys/arch/arm/cortex [netbsd-7]: a9_mpsubr.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1444): sys/arch/arm/cortex/a9_mpsubr.S: revision 1.48 Make fp 0 on entry to idle_stack to ensure we mark that we're top of stack To generate a diff of this commit: cvs rdiff -u -r1.18.2.4 -r1.18.2.5 src/sys/arch/arm/cortex/a9_mpsubr.S 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/arm/cortex/a9_mpsubr.S diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.18.2.4 src/sys/arch/arm/cortex/a9_mpsubr.S:1.18.2.5 --- src/sys/arch/arm/cortex/a9_mpsubr.S:1.18.2.4 Fri Feb 26 22:52:53 2016 +++ src/sys/arch/arm/cortex/a9_mpsubr.S Sat Jul 8 17:01:52 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: a9_mpsubr.S,v 1.18.2.4 2016/02/26 22:52:53 snj Exp $ */ +/* $NetBSD: a9_mpsubr.S,v 1.18.2.5 2017/07/08 17:01:52 snj Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -736,6 +736,7 @@ cortex_mpcontinuation: movw r2, #:lower16:MD_CPU_HATCH // pass md_cpu_hatch movt r2, #:upper16:MD_CPU_HATCH // pass md_cpu_hatch bl _C_LABEL(cpu_hatch) + mov fp, #0// top stack frame b _C_LABEL(idle_loop) // never to return ASEND(cortex_mpcontinuation)
CVS commit: [netbsd-7] src/external/bsd/tcpdump/bin
Module Name:src Committed By: snj Date: Sat Jul 8 16:57:35 UTC 2017 Modified Files: src/external/bsd/tcpdump/bin [netbsd-7]: Makefile Log Message: Apply patch (requested by manu in ticket #1443): netbsd-7 clang doesn't support -Wno-error=address-of-packed-member To generate a diff of this commit: cvs rdiff -u -r1.10.4.2 -r1.10.4.3 src/external/bsd/tcpdump/bin/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/tcpdump/bin/Makefile diff -u src/external/bsd/tcpdump/bin/Makefile:1.10.4.2 src/external/bsd/tcpdump/bin/Makefile:1.10.4.3 --- src/external/bsd/tcpdump/bin/Makefile:1.10.4.2 Sun Feb 19 05:01:15 2017 +++ src/external/bsd/tcpdump/bin/Makefile Sat Jul 8 16:57:35 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10.4.2 2017/02/19 05:01:15 snj Exp $ +# $NetBSD: Makefile,v 1.10.4.3 2017/07/08 16:57:35 snj Exp $ WARNS?= 1 # XXX: need to cleanup later @@ -207,6 +207,4 @@ tcpdump.8: tcpdump.1.in @rm -f ${.TARGET} cp ${.ALLSRC} ${.TARGET} -CWARNFLAGS.clang+= -Wno-error=address-of-packed-member - .include
CVS commit: [netbsd-7] src/external/bsd/tcpdump/bin
Module Name:src Committed By: snj Date: Sat Jul 8 16:57:35 UTC 2017 Modified Files: src/external/bsd/tcpdump/bin [netbsd-7]: Makefile Log Message: Apply patch (requested by manu in ticket #1443): netbsd-7 clang doesn't support -Wno-error=address-of-packed-member To generate a diff of this commit: cvs rdiff -u -r1.10.4.2 -r1.10.4.3 src/external/bsd/tcpdump/bin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys
Module Name:src Committed By: snj Date: Sat Jul 8 16:53:24 UTC 2017 Modified Files: src/sys/kern [netbsd-7]: kern_event.c src/sys/miscfs/genfs [netbsd-7]: genfs_vnops.c src/sys/sys [netbsd-7]: event.h Log Message: Pull up following revision(s) (requested by christos in ticket #1442): sys/kern/kern_event.c: revision 1.92 via patch sys/miscfs/genfs/genfs_vnops.c: revision 1.198 via patch sys/sys/event.h: revision 1.30 via patch Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. Makes go unit tests pass. -- fix file descriptor locking (from joerg). fixes kernel crashes by running go To generate a diff of this commit: cvs rdiff -u -r1.80.2.1 -r1.80.2.2 src/sys/kern/kern_event.c cvs rdiff -u -r1.192 -r1.192.4.1 src/sys/miscfs/genfs/genfs_vnops.c cvs rdiff -u -r1.23 -r1.23.28.1 src/sys/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys
Module Name:src Committed By: snj Date: Sat Jul 8 16:53:24 UTC 2017 Modified Files: src/sys/kern [netbsd-7]: kern_event.c src/sys/miscfs/genfs [netbsd-7]: genfs_vnops.c src/sys/sys [netbsd-7]: event.h Log Message: Pull up following revision(s) (requested by christos in ticket #1442): sys/kern/kern_event.c: revision 1.92 via patch sys/miscfs/genfs/genfs_vnops.c: revision 1.198 via patch sys/sys/event.h: revision 1.30 via patch Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. Makes go unit tests pass. -- fix file descriptor locking (from joerg). fixes kernel crashes by running go To generate a diff of this commit: cvs rdiff -u -r1.80.2.1 -r1.80.2.2 src/sys/kern/kern_event.c cvs rdiff -u -r1.192 -r1.192.4.1 src/sys/miscfs/genfs/genfs_vnops.c cvs rdiff -u -r1.23 -r1.23.28.1 src/sys/sys/event.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/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.80.2.1 src/sys/kern/kern_event.c:1.80.2.2 --- src/sys/kern/kern_event.c:1.80.2.1 Tue Apr 14 04:39:58 2015 +++ src/sys/kern/kern_event.c Sat Jul 8 16:53:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $ */ +/* $NetBSD: kern_event.c,v 1.80.2.2 2017/07/08 16:53:24 snj Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,11 +58,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.2 2017/07/08 16:53:24 snj Exp $"); #include #include #include +#include #include #include #include @@ -779,7 +780,7 @@ sys_kqueue1(struct lwp *l, const struct * kevent(2) system call. */ int -kevent_fetch_changes(void *private, const struct kevent *changelist, +kevent_fetch_changes(void *ctx, const struct kevent *changelist, struct kevent *changes, size_t index, int n) { @@ -787,7 +788,7 @@ kevent_fetch_changes(void *private, cons } int -kevent_put_events(void *private, struct kevent *events, +kevent_put_events(void *ctx, struct kevent *events, struct kevent *eventlist, size_t index, int n) { @@ -851,7 +852,7 @@ kevent1(register_t *retval, int fd, timeout = } - kq = (struct kqueue *)fp->f_data; + kq = fp->f_data; nerrors = 0; ichange = 0; @@ -867,21 +868,19 @@ kevent1(register_t *retval, int fd, kevp->flags &= ~EV_SYSFLAGS; /* register each knote */ error = kqueue_register(kq, kevp); - if (error) { -if (nevents != 0) { - kevp->flags = EV_ERROR; - kevp->data = error; - error = (*keops->keo_put_events) - (keops->keo_private, kevp, - eventlist, nerrors, 1); - if (error) - goto done; - nevents--; - nerrors++; -} else { - goto done; -} - } + if (!error && !(kevp->flags & EV_RECEIPT)) +continue; + if (nevents == 0) +goto done; + kevp->flags = EV_ERROR; + kevp->data = error; + error = (*keops->keo_put_events) +(keops->keo_private, kevp, + eventlist, nerrors, 1); + if (error) +goto done; + nevents--; + nerrors++; } nchanges -= n; /* update the results */ ichange += n; @@ -934,8 +933,9 @@ kqueue_register(struct kqueue *kq, struc /* search if knote already exists */ if (kfilter->filtops->f_isfd) { /* monitoring a file descriptor */ - fd = kev->ident; - if ((fp = fd_getfile(fd)) == NULL) { + /* validate descriptor */ + if (kev->ident > INT_MAX + || (fp = fd_getfile(fd = kev->ident)) == NULL) { rw_exit(_filter_lock); kmem_free(newkn, sizeof(*newkn)); return EBADF; @@ -986,6 +986,7 @@ kqueue_register(struct kqueue *kq, struc kev->data = 0; kn->kn_kevent = *kev; + KASSERT(kn->kn_fop != NULL); /* * apply reference count to knote structure, and * do not release it at the end of this routine. @@ -1019,8 +1020,11 @@ kqueue_register(struct kqueue *kq, struc KERNEL_UNLOCK_ONE(NULL); /* XXXSMP */ if (error != 0) { #ifdef DIAGNOSTIC -printf("%s: event not supported for file type" -" %d\n", __func__, fp ? fp->f_type : -1); + +printf("%s: event type %d not supported for " +"file type %d (error %d)\n", __func__, +kn->kn_filter, kn->kn_obj ? +((file_t *)kn->kn_obj)->f_type : -1, error); #endif /* knote_detach() drops fdp->fd_lock */ knote_detach(kn, fdp, false); @@ -1043,6 +1047,7 @@ kqueue_register(struct kqueue *kq, struc * support events, and the attach routine is * broken and does not return an error. */ + KASSERT(kn->kn_fop != NULL); KASSERT(kn->kn_fop->f_event != NULL); KERNEL_LOCK(1, NULL); /* XXXSMP */ rv = (*kn->kn_fop->f_event)(kn, 0); @@ -1150,7 +1155,7 @@ kqueue_scan(file_t *fp, size_t maxevents struct kqueue *kq; struct kevent *kevp; struct timespec ats, sleepts; - struct knote *kn,
CVS commit: [netbsd-7-1] src/sys
Module Name:src Committed By: snj Date: Sat Jul 8 16:52:27 UTC 2017 Modified Files: src/sys/kern [netbsd-7-1]: kern_event.c src/sys/miscfs/genfs [netbsd-7-1]: genfs_vnops.c src/sys/sys [netbsd-7-1]: event.h Log Message: Pull up following revision(s) (requested by christos in ticket #1442): sys/kern/kern_event.c: revision 1.92 via patch sys/miscfs/genfs/genfs_vnops.c: revision 1.198 via patch sys/sys/event.h: revision 1.30 via patch Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. Makes go unit tests pass. -- fix file descriptor locking (from joerg). fixes kernel crashes by running go To generate a diff of this commit: cvs rdiff -u -r1.80.2.1 -r1.80.2.1.6.1 src/sys/kern/kern_event.c cvs rdiff -u -r1.192 -r1.192.14.1 src/sys/miscfs/genfs/genfs_vnops.c cvs rdiff -u -r1.23 -r1.23.36.1 src/sys/sys/event.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/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.80.2.1 src/sys/kern/kern_event.c:1.80.2.1.6.1 --- src/sys/kern/kern_event.c:1.80.2.1 Tue Apr 14 04:39:58 2015 +++ src/sys/kern/kern_event.c Sat Jul 8 16:52:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $ */ +/* $NetBSD: kern_event.c,v 1.80.2.1.6.1 2017/07/08 16:52:27 snj Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,11 +58,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.1.6.1 2017/07/08 16:52:27 snj Exp $"); #include #include #include +#include #include #include #include @@ -779,7 +780,7 @@ sys_kqueue1(struct lwp *l, const struct * kevent(2) system call. */ int -kevent_fetch_changes(void *private, const struct kevent *changelist, +kevent_fetch_changes(void *ctx, const struct kevent *changelist, struct kevent *changes, size_t index, int n) { @@ -787,7 +788,7 @@ kevent_fetch_changes(void *private, cons } int -kevent_put_events(void *private, struct kevent *events, +kevent_put_events(void *ctx, struct kevent *events, struct kevent *eventlist, size_t index, int n) { @@ -851,7 +852,7 @@ kevent1(register_t *retval, int fd, timeout = } - kq = (struct kqueue *)fp->f_data; + kq = fp->f_data; nerrors = 0; ichange = 0; @@ -867,21 +868,19 @@ kevent1(register_t *retval, int fd, kevp->flags &= ~EV_SYSFLAGS; /* register each knote */ error = kqueue_register(kq, kevp); - if (error) { -if (nevents != 0) { - kevp->flags = EV_ERROR; - kevp->data = error; - error = (*keops->keo_put_events) - (keops->keo_private, kevp, - eventlist, nerrors, 1); - if (error) - goto done; - nevents--; - nerrors++; -} else { - goto done; -} - } + if (!error && !(kevp->flags & EV_RECEIPT)) +continue; + if (nevents == 0) +goto done; + kevp->flags = EV_ERROR; + kevp->data = error; + error = (*keops->keo_put_events) +(keops->keo_private, kevp, + eventlist, nerrors, 1); + if (error) +goto done; + nevents--; + nerrors++; } nchanges -= n; /* update the results */ ichange += n; @@ -934,8 +933,9 @@ kqueue_register(struct kqueue *kq, struc /* search if knote already exists */ if (kfilter->filtops->f_isfd) { /* monitoring a file descriptor */ - fd = kev->ident; - if ((fp = fd_getfile(fd)) == NULL) { + /* validate descriptor */ + if (kev->ident > INT_MAX + || (fp = fd_getfile(fd = kev->ident)) == NULL) { rw_exit(_filter_lock); kmem_free(newkn, sizeof(*newkn)); return EBADF; @@ -986,6 +986,7 @@ kqueue_register(struct kqueue *kq, struc kev->data = 0; kn->kn_kevent = *kev; + KASSERT(kn->kn_fop != NULL); /* * apply reference count to knote structure, and * do not release it at the end of this routine. @@ -1019,8 +1020,11 @@ kqueue_register(struct kqueue *kq, struc KERNEL_UNLOCK_ONE(NULL); /* XXXSMP */ if (error != 0) { #ifdef DIAGNOSTIC -printf("%s: event not supported for file type" -" %d\n", __func__, fp ? fp->f_type : -1); + +printf("%s: event type %d not supported for " +"file type %d (error %d)\n", __func__, +kn->kn_filter, kn->kn_obj ? +((file_t *)kn->kn_obj)->f_type : -1, error); #endif /* knote_detach() drops fdp->fd_lock */ knote_detach(kn, fdp, false); @@ -1043,6 +1047,7 @@ kqueue_register(struct kqueue *kq, struc * support events, and the attach routine is * broken and does not return an error. */ + KASSERT(kn->kn_fop != NULL); KASSERT(kn->kn_fop->f_event != NULL); KERNEL_LOCK(1, NULL); /* XXXSMP */ rv = (*kn->kn_fop->f_event)(kn, 0); @@ -1150,7 +1155,7 @@ kqueue_scan(file_t *fp, size_t maxevents struct kqueue *kq; struct kevent *kevp; struct timespec ats, sleepts; -
CVS commit: [netbsd-7-1] src/sys
Module Name:src Committed By: snj Date: Sat Jul 8 16:52:27 UTC 2017 Modified Files: src/sys/kern [netbsd-7-1]: kern_event.c src/sys/miscfs/genfs [netbsd-7-1]: genfs_vnops.c src/sys/sys [netbsd-7-1]: event.h Log Message: Pull up following revision(s) (requested by christos in ticket #1442): sys/kern/kern_event.c: revision 1.92 via patch sys/miscfs/genfs/genfs_vnops.c: revision 1.198 via patch sys/sys/event.h: revision 1.30 via patch Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. Makes go unit tests pass. -- fix file descriptor locking (from joerg). fixes kernel crashes by running go To generate a diff of this commit: cvs rdiff -u -r1.80.2.1 -r1.80.2.1.6.1 src/sys/kern/kern_event.c cvs rdiff -u -r1.192 -r1.192.14.1 src/sys/miscfs/genfs/genfs_vnops.c cvs rdiff -u -r1.23 -r1.23.36.1 src/sys/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-0] src/sys
Module Name:src Committed By: snj Date: Sat Jul 8 16:51:56 UTC 2017 Modified Files: src/sys/kern [netbsd-7-0]: kern_event.c src/sys/miscfs/genfs [netbsd-7-0]: genfs_vnops.c src/sys/sys [netbsd-7-0]: event.h Log Message: Pull up following revision(s) (requested by christos in ticket #1442): sys/kern/kern_event.c: revision 1.92 via patch sys/miscfs/genfs/genfs_vnops.c: revision 1.198 via patch sys/sys/event.h: revision 1.30 via patch Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. Makes go unit tests pass. -- fix file descriptor locking (from joerg). fixes kernel crashes by running go To generate a diff of this commit: cvs rdiff -u -r1.80.2.1 -r1.80.2.1.2.1 src/sys/kern/kern_event.c cvs rdiff -u -r1.192 -r1.192.8.1 src/sys/miscfs/genfs/genfs_vnops.c cvs rdiff -u -r1.23 -r1.23.32.1 src/sys/sys/event.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/kern/kern_event.c diff -u src/sys/kern/kern_event.c:1.80.2.1 src/sys/kern/kern_event.c:1.80.2.1.2.1 --- src/sys/kern/kern_event.c:1.80.2.1 Tue Apr 14 04:39:58 2015 +++ src/sys/kern/kern_event.c Sat Jul 8 16:51:56 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $ */ +/* $NetBSD: kern_event.c,v 1.80.2.1.2.1 2017/07/08 16:51:56 snj Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,11 +58,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.80.2.1.2.1 2017/07/08 16:51:56 snj Exp $"); #include #include #include +#include #include #include #include @@ -779,7 +780,7 @@ sys_kqueue1(struct lwp *l, const struct * kevent(2) system call. */ int -kevent_fetch_changes(void *private, const struct kevent *changelist, +kevent_fetch_changes(void *ctx, const struct kevent *changelist, struct kevent *changes, size_t index, int n) { @@ -787,7 +788,7 @@ kevent_fetch_changes(void *private, cons } int -kevent_put_events(void *private, struct kevent *events, +kevent_put_events(void *ctx, struct kevent *events, struct kevent *eventlist, size_t index, int n) { @@ -851,7 +852,7 @@ kevent1(register_t *retval, int fd, timeout = } - kq = (struct kqueue *)fp->f_data; + kq = fp->f_data; nerrors = 0; ichange = 0; @@ -867,21 +868,19 @@ kevent1(register_t *retval, int fd, kevp->flags &= ~EV_SYSFLAGS; /* register each knote */ error = kqueue_register(kq, kevp); - if (error) { -if (nevents != 0) { - kevp->flags = EV_ERROR; - kevp->data = error; - error = (*keops->keo_put_events) - (keops->keo_private, kevp, - eventlist, nerrors, 1); - if (error) - goto done; - nevents--; - nerrors++; -} else { - goto done; -} - } + if (!error && !(kevp->flags & EV_RECEIPT)) +continue; + if (nevents == 0) +goto done; + kevp->flags = EV_ERROR; + kevp->data = error; + error = (*keops->keo_put_events) +(keops->keo_private, kevp, + eventlist, nerrors, 1); + if (error) +goto done; + nevents--; + nerrors++; } nchanges -= n; /* update the results */ ichange += n; @@ -934,8 +933,9 @@ kqueue_register(struct kqueue *kq, struc /* search if knote already exists */ if (kfilter->filtops->f_isfd) { /* monitoring a file descriptor */ - fd = kev->ident; - if ((fp = fd_getfile(fd)) == NULL) { + /* validate descriptor */ + if (kev->ident > INT_MAX + || (fp = fd_getfile(fd = kev->ident)) == NULL) { rw_exit(_filter_lock); kmem_free(newkn, sizeof(*newkn)); return EBADF; @@ -986,6 +986,7 @@ kqueue_register(struct kqueue *kq, struc kev->data = 0; kn->kn_kevent = *kev; + KASSERT(kn->kn_fop != NULL); /* * apply reference count to knote structure, and * do not release it at the end of this routine. @@ -1019,8 +1020,11 @@ kqueue_register(struct kqueue *kq, struc KERNEL_UNLOCK_ONE(NULL); /* XXXSMP */ if (error != 0) { #ifdef DIAGNOSTIC -printf("%s: event not supported for file type" -" %d\n", __func__, fp ? fp->f_type : -1); + +printf("%s: event type %d not supported for " +"file type %d (error %d)\n", __func__, +kn->kn_filter, kn->kn_obj ? +((file_t *)kn->kn_obj)->f_type : -1, error); #endif /* knote_detach() drops fdp->fd_lock */ knote_detach(kn, fdp, false); @@ -1043,6 +1047,7 @@ kqueue_register(struct kqueue *kq, struc * support events, and the attach routine is * broken and does not return an error. */ + KASSERT(kn->kn_fop != NULL); KASSERT(kn->kn_fop->f_event != NULL); KERNEL_LOCK(1, NULL); /* XXXSMP */ rv = (*kn->kn_fop->f_event)(kn, 0); @@ -1150,7 +1155,7 @@ kqueue_scan(file_t *fp, size_t maxevents struct kqueue *kq; struct kevent *kevp; struct timespec ats, sleepts; -
CVS commit: [netbsd-7-0] src/sys
Module Name:src Committed By: snj Date: Sat Jul 8 16:51:56 UTC 2017 Modified Files: src/sys/kern [netbsd-7-0]: kern_event.c src/sys/miscfs/genfs [netbsd-7-0]: genfs_vnops.c src/sys/sys [netbsd-7-0]: event.h Log Message: Pull up following revision(s) (requested by christos in ticket #1442): sys/kern/kern_event.c: revision 1.92 via patch sys/miscfs/genfs/genfs_vnops.c: revision 1.198 via patch sys/sys/event.h: revision 1.30 via patch Provide EVFILT_WRITE; this is what FreeBSD does and go wants it. Makes go unit tests pass. -- fix file descriptor locking (from joerg). fixes kernel crashes by running go To generate a diff of this commit: cvs rdiff -u -r1.80.2.1 -r1.80.2.1.2.1 src/sys/kern/kern_event.c cvs rdiff -u -r1.192 -r1.192.8.1 src/sys/miscfs/genfs/genfs_vnops.c cvs rdiff -u -r1.23 -r1.23.32.1 src/sys/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:37:54 UTC 2017 Modified Files: src/sys/dev [netbsd-7]: audio.c Log Message: Apply patch (requested by nat in ticket #1433): Fix occasional stuttering that can be caused by ringbuffer overflow. To generate a diff of this commit: cvs rdiff -u -r1.263.2.1 -r1.263.2.2 src/sys/dev/audio.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/audio.c diff -u src/sys/dev/audio.c:1.263.2.1 src/sys/dev/audio.c:1.263.2.2 --- src/sys/dev/audio.c:1.263.2.1 Sun Nov 23 13:07:05 2014 +++ src/sys/dev/audio.c Sat Jul 8 16:37:54 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.263.2.1 2014/11/23 13:07:05 martin Exp $ */ +/* $NetBSD: audio.c,v 1.263.2.2 2017/07/08 16:37:54 snj Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -155,7 +155,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.263.2.1 2014/11/23 13:07:05 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.263.2.2 2017/07/08 16:37:54 snj Exp $"); #include "audio.h" #if NAUDIO > 0 @@ -2960,6 +2960,9 @@ audio_pint(void *v) return; } + if (audio_stream_get_used(>s) > (cb->usedhigh - cb->blksize)) + goto done; + #ifdef AUDIO_INTR_TIME { struct timeval tv; @@ -3038,6 +3041,7 @@ audio_pint(void *v) } DPRINTFN(5, ("audio_pint: outp=%p cc=%d\n", cb->s.outp, blksize)); +done: if (hw->trigger_output == NULL) { error = hw->start_output(sc->hw_hdl, __UNCONST(cb->s.outp), blksize, audio_pint, (void *)sc);
CVS commit: [netbsd-7] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:37:54 UTC 2017 Modified Files: src/sys/dev [netbsd-7]: audio.c Log Message: Apply patch (requested by nat in ticket #1433): Fix occasional stuttering that can be caused by ringbuffer overflow. To generate a diff of this commit: cvs rdiff -u -r1.263.2.1 -r1.263.2.2 src/sys/dev/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev/pci
Module Name:src Committed By: snj Date: Sat Jul 8 16:34:35 UTC 2017 Modified Files: src/sys/dev/pci [netbsd-7]: ehci_pci.c Log Message: Pull up following revision(s) (requested by sborrill in ticket #1431): sys/dev/pci/ehci_pci.c: revision 1.65 Deal with broken BIOSes that leave PCI interrupts disabled. Thanks to nick@ To generate a diff of this commit: cvs rdiff -u -r1.58.4.1 -r1.58.4.2 src/sys/dev/pci/ehci_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/dev/pci
Module Name:src Committed By: snj Date: Sat Jul 8 16:34:35 UTC 2017 Modified Files: src/sys/dev/pci [netbsd-7]: ehci_pci.c Log Message: Pull up following revision(s) (requested by sborrill in ticket #1431): sys/dev/pci/ehci_pci.c: revision 1.65 Deal with broken BIOSes that leave PCI interrupts disabled. Thanks to nick@ To generate a diff of this commit: cvs rdiff -u -r1.58.4.1 -r1.58.4.2 src/sys/dev/pci/ehci_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/ehci_pci.c diff -u src/sys/dev/pci/ehci_pci.c:1.58.4.1 src/sys/dev/pci/ehci_pci.c:1.58.4.2 --- src/sys/dev/pci/ehci_pci.c:1.58.4.1 Wed Apr 5 19:54:19 2017 +++ src/sys/dev/pci/ehci_pci.c Sat Jul 8 16:34:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_pci.c,v 1.58.4.1 2017/04/05 19:54:19 snj Exp $ */ +/* $NetBSD: ehci_pci.c,v 1.58.4.2 2017/07/08 16:34:35 snj Exp $ */ /* * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.58.4.1 2017/04/05 19:54:19 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.58.4.2 2017/07/08 16:34:35 snj Exp $"); #include #include @@ -163,10 +163,14 @@ ehci_pci_attach(device_t parent, device_ break; } + pcireg_t intr = pci_conf_read(pc, tag, PCI_INTERRUPT_REG); + int pin = PCI_INTERRUPT_PIN(intr); + /* Enable the device. */ csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); - pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, - csr | PCI_COMMAND_MASTER_ENABLE); + csr |= PCI_COMMAND_MASTER_ENABLE; + csr &= ~(pin ? PCI_COMMAND_INTERRUPT_DISABLE : 0); + pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr); /* Map and establish the interrupt. */ if (pci_intr_map(pa, )) {
CVS commit: [netbsd-7-0] src/external/bsd/dhcp/dist/relay
Module Name:src Committed By: snj Date: Sat Jul 8 16:32:05 UTC 2017 Modified Files: src/external/bsd/dhcp/dist/relay [netbsd-7-0]: dhcrelay.c Log Message: Pull up following revision(s) (requested by manu in ticket #1430): external/bsd/dhcp/dist/relay/dhcrelay.c: revision 1.7 Fix buggy dhcrelay(8) requirement to stay in foreground This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.4.1 src/external/bsd/dhcp/dist/relay/dhcrelay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-1] src/external/bsd/dhcp/dist/relay
Module Name:src Committed By: snj Date: Sat Jul 8 16:32:28 UTC 2017 Modified Files: src/external/bsd/dhcp/dist/relay [netbsd-7-1]: dhcrelay.c Log Message: Pull up following revision(s) (requested by manu in ticket #1430): external/bsd/dhcp/dist/relay/dhcrelay.c: revision 1.7 Fix buggy dhcrelay(8) requirement to stay in foreground This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.8.1 src/external/bsd/dhcp/dist/relay/dhcrelay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-1] src/external/bsd/dhcp/dist/relay
Module Name:src Committed By: snj Date: Sat Jul 8 16:32:28 UTC 2017 Modified Files: src/external/bsd/dhcp/dist/relay [netbsd-7-1]: dhcrelay.c Log Message: Pull up following revision(s) (requested by manu in ticket #1430): external/bsd/dhcp/dist/relay/dhcrelay.c: revision 1.7 Fix buggy dhcrelay(8) requirement to stay in foreground This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.8.1 src/external/bsd/dhcp/dist/relay/dhcrelay.c 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/dhcp/dist/relay/dhcrelay.c diff -u src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5 src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5.8.1 --- src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5 Sat Jul 12 12:09:37 2014 +++ src/external/bsd/dhcp/dist/relay/dhcrelay.c Sat Jul 8 16:32:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $ */ +/* $NetBSD: dhcrelay.c,v 1.5.8.1 2017/07/08 16:32:28 snj Exp $ */ /* dhcrelay.c DHCP/BOOTP Relay Agent. */ @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $"); +__RCSID("$NetBSD: dhcrelay.c,v 1.5.8.1 2017/07/08 16:32:28 snj Exp $"); #include "dhcpd.h" #include @@ -207,13 +207,6 @@ main(int argc, char **argv) { setlogmask(LOG_UPTO(LOG_INFO)); #endif - /* Set up the isc and dns library managers */ - status = dhcp_context_create(DHCP_CONTEXT_PRE_DB | DHCP_CONTEXT_POST_DB, - NULL, NULL); - if (status != ISC_R_SUCCESS) - log_fatal("Can't initialize context: %s", - isc_result_totext(status)); - /* Set up the OMAPI. */ status = omapi_init(); if (status != ISC_R_SUCCESS) @@ -536,17 +529,6 @@ main(int argc, char **argv) { } #endif - /* Get the current time... */ - gettimeofday(_tv, NULL); - - /* Discover all the network interfaces. */ - discover_interfaces(DISCOVER_RELAY); - -#ifdef DHCPv6 - if (local_family == AF_INET6) - setup_streams(); -#endif - /* Become a daemon... */ if (!no_daemon) { int pid; @@ -587,6 +569,24 @@ main(int argc, char **argv) { IGNORE_RET (chdir("/")); } + /* Set up the isc and dns library managers */ + status = dhcp_context_create(DHCP_CONTEXT_PRE_DB | DHCP_CONTEXT_POST_DB, + NULL, NULL); + if (status != ISC_R_SUCCESS) + log_fatal("Can't initialize context: %s", + isc_result_totext(status)); + + /* Get the current time... */ + gettimeofday(_tv, NULL); + + /* Discover all the network interfaces. */ + discover_interfaces(DISCOVER_RELAY); + +#ifdef DHCPv6 + if (local_family == AF_INET6) + setup_streams(); +#endif + /* Set up the packet handler... */ if (local_family == AF_INET) bootp_packet_handler = do_relay4; @@ -945,7 +945,7 @@ find_interface_by_agent_option(struct dh */ #include -__RCSID("$NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $"); +__RCSID("$NetBSD: dhcrelay.c,v 1.5.8.1 2017/07/08 16:32:28 snj Exp $"); static int add_relay_agent_options(struct interface_info *ip, struct dhcp_packet *packet, unsigned length, struct in_addr giaddr) {
CVS commit: [netbsd-7] src/external/bsd/dhcp/dist/relay
Module Name:src Committed By: snj Date: Sat Jul 8 16:32:48 UTC 2017 Modified Files: src/external/bsd/dhcp/dist/relay [netbsd-7]: dhcrelay.c Log Message: Pull up following revision(s) (requested by manu in ticket #1430): external/bsd/dhcp/dist/relay/dhcrelay.c: revision 1.7 Fix buggy dhcrelay(8) requirement to stay in foreground This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.2.1 src/external/bsd/dhcp/dist/relay/dhcrelay.c 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/dhcp/dist/relay/dhcrelay.c diff -u src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5 src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5.2.1 --- src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5 Sat Jul 12 12:09:37 2014 +++ src/external/bsd/dhcp/dist/relay/dhcrelay.c Sat Jul 8 16:32:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $ */ +/* $NetBSD: dhcrelay.c,v 1.5.2.1 2017/07/08 16:32:48 snj Exp $ */ /* dhcrelay.c DHCP/BOOTP Relay Agent. */ @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $"); +__RCSID("$NetBSD: dhcrelay.c,v 1.5.2.1 2017/07/08 16:32:48 snj Exp $"); #include "dhcpd.h" #include @@ -207,13 +207,6 @@ main(int argc, char **argv) { setlogmask(LOG_UPTO(LOG_INFO)); #endif - /* Set up the isc and dns library managers */ - status = dhcp_context_create(DHCP_CONTEXT_PRE_DB | DHCP_CONTEXT_POST_DB, - NULL, NULL); - if (status != ISC_R_SUCCESS) - log_fatal("Can't initialize context: %s", - isc_result_totext(status)); - /* Set up the OMAPI. */ status = omapi_init(); if (status != ISC_R_SUCCESS) @@ -536,17 +529,6 @@ main(int argc, char **argv) { } #endif - /* Get the current time... */ - gettimeofday(_tv, NULL); - - /* Discover all the network interfaces. */ - discover_interfaces(DISCOVER_RELAY); - -#ifdef DHCPv6 - if (local_family == AF_INET6) - setup_streams(); -#endif - /* Become a daemon... */ if (!no_daemon) { int pid; @@ -587,6 +569,24 @@ main(int argc, char **argv) { IGNORE_RET (chdir("/")); } + /* Set up the isc and dns library managers */ + status = dhcp_context_create(DHCP_CONTEXT_PRE_DB | DHCP_CONTEXT_POST_DB, + NULL, NULL); + if (status != ISC_R_SUCCESS) + log_fatal("Can't initialize context: %s", + isc_result_totext(status)); + + /* Get the current time... */ + gettimeofday(_tv, NULL); + + /* Discover all the network interfaces. */ + discover_interfaces(DISCOVER_RELAY); + +#ifdef DHCPv6 + if (local_family == AF_INET6) + setup_streams(); +#endif + /* Set up the packet handler... */ if (local_family == AF_INET) bootp_packet_handler = do_relay4; @@ -945,7 +945,7 @@ find_interface_by_agent_option(struct dh */ #include -__RCSID("$NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $"); +__RCSID("$NetBSD: dhcrelay.c,v 1.5.2.1 2017/07/08 16:32:48 snj Exp $"); static int add_relay_agent_options(struct interface_info *ip, struct dhcp_packet *packet, unsigned length, struct in_addr giaddr) {
CVS commit: [netbsd-7] src/external/bsd/dhcp/dist/relay
Module Name:src Committed By: snj Date: Sat Jul 8 16:32:48 UTC 2017 Modified Files: src/external/bsd/dhcp/dist/relay [netbsd-7]: dhcrelay.c Log Message: Pull up following revision(s) (requested by manu in ticket #1430): external/bsd/dhcp/dist/relay/dhcrelay.c: revision 1.7 Fix buggy dhcrelay(8) requirement to stay in foreground This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.2.1 src/external/bsd/dhcp/dist/relay/dhcrelay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-0] src/external/bsd/dhcp/dist/relay
Module Name:src Committed By: snj Date: Sat Jul 8 16:32:05 UTC 2017 Modified Files: src/external/bsd/dhcp/dist/relay [netbsd-7-0]: dhcrelay.c Log Message: Pull up following revision(s) (requested by manu in ticket #1430): external/bsd/dhcp/dist/relay/dhcrelay.c: revision 1.7 Fix buggy dhcrelay(8) requirement to stay in foreground This version of dhcrelay(8) needed to stay inforeground with -d flag in order to service requests. Running inbackground turned it deaf to DHCP requests. This was caused by wrong kqueue(2) usage, where kevent(2) was used with a file descriptor obtained by a kqueue(2) call done before fork(2). kqueue(2) man page says "The queue is not inherited by a child created with fork(2)". As a result, kevent(2) calls always got EBADF. The fix is to reorder function calls in dhcrelay(8) main() function. dhcp_context_create(), which causes kqueue(2) to be invoked, is moved with its dependencies after fork(2). This matches the code layout of dhclient(8) and dhcpd(8), which do not have the bug. The fix was not submitted upstream since latest ISC DHCP code was refactored and does not have the bug anymore. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.4.1 src/external/bsd/dhcp/dist/relay/dhcrelay.c 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/dhcp/dist/relay/dhcrelay.c diff -u src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5 src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5.4.1 --- src/external/bsd/dhcp/dist/relay/dhcrelay.c:1.5 Sat Jul 12 12:09:37 2014 +++ src/external/bsd/dhcp/dist/relay/dhcrelay.c Sat Jul 8 16:32:05 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $ */ +/* $NetBSD: dhcrelay.c,v 1.5.4.1 2017/07/08 16:32:05 snj Exp $ */ /* dhcrelay.c DHCP/BOOTP Relay Agent. */ @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $"); +__RCSID("$NetBSD: dhcrelay.c,v 1.5.4.1 2017/07/08 16:32:05 snj Exp $"); #include "dhcpd.h" #include @@ -207,13 +207,6 @@ main(int argc, char **argv) { setlogmask(LOG_UPTO(LOG_INFO)); #endif - /* Set up the isc and dns library managers */ - status = dhcp_context_create(DHCP_CONTEXT_PRE_DB | DHCP_CONTEXT_POST_DB, - NULL, NULL); - if (status != ISC_R_SUCCESS) - log_fatal("Can't initialize context: %s", - isc_result_totext(status)); - /* Set up the OMAPI. */ status = omapi_init(); if (status != ISC_R_SUCCESS) @@ -536,17 +529,6 @@ main(int argc, char **argv) { } #endif - /* Get the current time... */ - gettimeofday(_tv, NULL); - - /* Discover all the network interfaces. */ - discover_interfaces(DISCOVER_RELAY); - -#ifdef DHCPv6 - if (local_family == AF_INET6) - setup_streams(); -#endif - /* Become a daemon... */ if (!no_daemon) { int pid; @@ -587,6 +569,24 @@ main(int argc, char **argv) { IGNORE_RET (chdir("/")); } + /* Set up the isc and dns library managers */ + status = dhcp_context_create(DHCP_CONTEXT_PRE_DB | DHCP_CONTEXT_POST_DB, + NULL, NULL); + if (status != ISC_R_SUCCESS) + log_fatal("Can't initialize context: %s", + isc_result_totext(status)); + + /* Get the current time... */ + gettimeofday(_tv, NULL); + + /* Discover all the network interfaces. */ + discover_interfaces(DISCOVER_RELAY); + +#ifdef DHCPv6 + if (local_family == AF_INET6) + setup_streams(); +#endif + /* Set up the packet handler... */ if (local_family == AF_INET) bootp_packet_handler = do_relay4; @@ -945,7 +945,7 @@ find_interface_by_agent_option(struct dh */ #include -__RCSID("$NetBSD: dhcrelay.c,v 1.5 2014/07/12 12:09:37 spz Exp $"); +__RCSID("$NetBSD: dhcrelay.c,v 1.5.4.1 2017/07/08 16:32:05 snj Exp $"); static int add_relay_agent_options(struct interface_info *ip, struct dhcp_packet *packet, unsigned length, struct in_addr giaddr) {
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jul 8 16:20:21 UTC 2017 Modified Files: src/sys/arch/evbarm/conf: SUNXI Log Message: Remove pass numbers for ehci/ohci now that the attach order no longer matters To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/SUNXI 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/evbarm/conf/SUNXI diff -u src/sys/arch/evbarm/conf/SUNXI:1.15 src/sys/arch/evbarm/conf/SUNXI:1.16 --- src/sys/arch/evbarm/conf/SUNXI:1.15 Sat Jul 8 12:37:34 2017 +++ src/sys/arch/evbarm/conf/SUNXI Sat Jul 8 16:20:21 2017 @@ -1,5 +1,5 @@ # -# $NetBSD: SUNXI,v 1.15 2017/07/08 12:37:34 jmcneill Exp $ +# $NetBSD: SUNXI,v 1.16 2017/07/08 16:20:21 jmcneill Exp $ # # Allwinner sunxi family # @@ -119,9 +119,9 @@ ld3 at sdmmc3 ld* at sdmmc? # USB 2.0 -sunxiusbphy* at fdt? pass 5 # USB PHY -ehci* at fdt? pass 9 # EHCI -ohci* at fdt? pass 8 # OHCI +sunxiusbphy* at fdt? pass 9 # USB PHY +ehci* at fdt? # EHCI +ohci* at fdt? # OHCI usb* at ehci? usb* at ohci?
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jul 8 16:20:21 UTC 2017 Modified Files: src/sys/arch/evbarm/conf: SUNXI Log Message: Remove pass numbers for ehci/ohci now that the attach order no longer matters To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/SUNXI Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sat Jul 8 16:19:56 UTC 2017 Modified Files: src/sys/dev/fdt: ehci_fdt.c Log Message: Remove the hack to find companion devices and just assume 1 companion if ETTF flag is not set. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/ehci_fdt.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/fdt/ehci_fdt.c diff -u src/sys/dev/fdt/ehci_fdt.c:1.1 src/sys/dev/fdt/ehci_fdt.c:1.2 --- src/sys/dev/fdt/ehci_fdt.c:1.1 Thu Jun 29 17:04:53 2017 +++ src/sys/dev/fdt/ehci_fdt.c Sat Jul 8 16:19:56 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_fdt.c,v 1.1 2017/06/29 17:04:53 jmcneill Exp $ */ +/* $NetBSD: ehci_fdt.c,v 1.2 2017/07/08 16:19:56 jmcneill Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill@@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.1 2017/06/29 17:04:53 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.2 2017/07/08 16:19:56 jmcneill Exp $"); #include #include @@ -52,23 +52,6 @@ CFATTACH_DECL2_NEW(ehci_fdt, sizeof(stru ehci_fdt_match, ehci_fdt_attach, NULL, ehci_activate, NULL, ehci_childdet); -static void -ehci_fdt_find_companions(struct ehci_softc *sc) -{ - const char * drivers[] = { "ohci", "uhci", NULL }; - device_t comp_dev; - int unit, n; - - /* XXX find an ohci or uhci with the same unit as us */ - unit = device_unit(sc->sc_dev); - - for (n = 0; drivers[n] != NULL; n++) { - comp_dev = device_find_by_driver_unit(drivers[n], unit); - if (comp_dev != NULL) - sc->sc_comps[sc->sc_ncomp++] = comp_dev; - } -} - static int ehci_fdt_match(device_t parent, cfdata_t cf, void *aux) { @@ -129,7 +112,7 @@ ehci_fdt_attach(device_t parent, device_ if (of_hasprop(phandle, "has-transaction-translator")) sc->sc_flags |= EHCIF_ETTF; else - ehci_fdt_find_companions(sc); + sc->sc_ncomp = 1; sc->sc_id_vendor = 0; strlcpy(sc->sc_vendor, "Generic", sizeof(sc->sc_vendor)); sc->sc_size = size;
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sat Jul 8 16:19:56 UTC 2017 Modified Files: src/sys/dev/fdt: ehci_fdt.c Log Message: Remove the hack to find companion devices and just assume 1 companion if ETTF flag is not set. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/ehci_fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Sat Jul 8 16:19:20 UTC 2017 Modified Files: src/sys/dev/usb: ehci.c Log Message: Remove the requirement for ehci to attach after companion devices. "go for it" - skrll@ To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/sys/dev/usb/ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Sat Jul 8 16:19:20 UTC 2017 Modified Files: src/sys/dev/usb: ehci.c Log Message: Remove the requirement for ehci to attach after companion devices. "go for it" - skrll@ To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/sys/dev/usb/ehci.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/usb/ehci.c diff -u src/sys/dev/usb/ehci.c:1.254 src/sys/dev/usb/ehci.c:1.255 --- src/sys/dev/usb/ehci.c:1.254 Mon Oct 3 00:32:37 2016 +++ src/sys/dev/usb/ehci.c Sat Jul 8 16:19:20 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.254 2016/10/03 00:32:37 dholland Exp $ */ +/* $NetBSD: ehci.c,v 1.255 2017/07/08 16:19:20 jmcneill Exp $ */ /* * Copyright (c) 2004-2012 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.254 2016/10/03 00:32:37 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.255 2017/07/08 16:19:20 jmcneill Exp $"); #include "ohci.h" #include "uhci.h" @@ -447,12 +447,18 @@ ehci_init(ehci_softc_t *sc) } if (sc->sc_ncomp > 0) { KASSERT(!(sc->sc_flags & EHCIF_ETTF)); - aprint_normal("%s: companion controller%s, %d port%s each:", - device_xname(sc->sc_dev), sc->sc_ncomp!=1 ? "s" : "", + aprint_normal("%s: %d companion controller%s, %d port%s%s", + device_xname(sc->sc_dev), sc->sc_ncomp, + sc->sc_ncomp!=1 ? "s" : "", EHCI_HCS_N_PCC(sparams), - EHCI_HCS_N_PCC(sparams)!=1 ? "s" : ""); - for (i = 0; i < sc->sc_ncomp; i++) - aprint_normal(" %s", device_xname(sc->sc_comps[i])); + EHCI_HCS_N_PCC(sparams)!=1 ? "s" : "", + sc->sc_ncomp!=1 ? " each" : ""); + if (sc->sc_comps[0]) { + aprint_normal(":"); + for (i = 0; i < sc->sc_ncomp; i++) +aprint_normal(" %s", +device_xname(sc->sc_comps[i])); + } aprint_normal("\n"); } sc->sc_noport = EHCI_HCS_N_PORTS(sparams); @@ -2594,7 +2600,9 @@ ehci_disown(ehci_softc_t *sc, int index, "port %d to %s\n", device_xname(sc->sc_dev), lowspeed ? "low" : "full", - index, device_xname(sc->sc_comps[i])); + index, sc->sc_comps[i] ? + device_xname(sc->sc_comps[i]) : + "companion controller"); } else { printf("%s: npcomp == 0\n", device_xname(sc->sc_dev)); }
CVS commit: [netbsd-7] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:14:19 UTC 2017 Modified Files: src/sys/dev [netbsd-7]: cgd.c Log Message: Apply patch (requested by chs in ticket #1429): Avoid crashes by checking if a cgd device has been configured before processing most ioctls, and failing with ENXIO if the device is not configured. To generate a diff of this commit: cvs rdiff -u -r1.90.2.1 -r1.90.2.2 src/sys/dev/cgd.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/cgd.c diff -u src/sys/dev/cgd.c:1.90.2.1 src/sys/dev/cgd.c:1.90.2.2 --- src/sys/dev/cgd.c:1.90.2.1 Wed Nov 4 16:25:17 2015 +++ src/sys/dev/cgd.c Sat Jul 8 16:14:19 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cgd.c,v 1.90.2.1 2015/11/04 16:25:17 riz Exp $ */ +/* $NetBSD: cgd.c,v 1.90.2.2 2017/07/08 16:14:19 snj Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.90.2.1 2015/11/04 16:25:17 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.90.2.2 2017/07/08 16:14:19 snj Exp $"); #include #include @@ -586,12 +586,16 @@ cgdioctl(dev_t dev, u_long cmd, void *da */ if ((flag & FWRITE) == 0) return (EBADF); + if ((dksc->sc_flags & DKF_INITED) == 0) + return ENXIO; /* * We pass this call down to the underlying disk. */ return VOP_IOCTL(cs->sc_tvn, cmd, data, flag, l->l_cred); default: + if ((dksc->sc_flags & DKF_INITED) == 0) + return ENXIO; return dk_ioctl(di, dksc, dev, cmd, data, flag, l); } }
CVS commit: [netbsd-7] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:14:19 UTC 2017 Modified Files: src/sys/dev [netbsd-7]: cgd.c Log Message: Apply patch (requested by chs in ticket #1429): Avoid crashes by checking if a cgd device has been configured before processing most ioctls, and failing with ENXIO if the device is not configured. To generate a diff of this commit: cvs rdiff -u -r1.90.2.1 -r1.90.2.2 src/sys/dev/cgd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-1] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:13:55 UTC 2017 Modified Files: src/sys/dev [netbsd-7-1]: cgd.c Log Message: Apply patch (requested by chs in ticket #1429): Avoid crashes by checking if a cgd device has been configured before processing most ioctls, and failing with ENXIO if the device is not configured. To generate a diff of this commit: cvs rdiff -u -r1.90.2.1 -r1.90.2.1.4.1 src/sys/dev/cgd.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/cgd.c diff -u src/sys/dev/cgd.c:1.90.2.1 src/sys/dev/cgd.c:1.90.2.1.4.1 --- src/sys/dev/cgd.c:1.90.2.1 Wed Nov 4 16:25:17 2015 +++ src/sys/dev/cgd.c Sat Jul 8 16:13:55 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cgd.c,v 1.90.2.1 2015/11/04 16:25:17 riz Exp $ */ +/* $NetBSD: cgd.c,v 1.90.2.1.4.1 2017/07/08 16:13:55 snj Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.90.2.1 2015/11/04 16:25:17 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.90.2.1.4.1 2017/07/08 16:13:55 snj Exp $"); #include #include @@ -586,12 +586,16 @@ cgdioctl(dev_t dev, u_long cmd, void *da */ if ((flag & FWRITE) == 0) return (EBADF); + if ((dksc->sc_flags & DKF_INITED) == 0) + return ENXIO; /* * We pass this call down to the underlying disk. */ return VOP_IOCTL(cs->sc_tvn, cmd, data, flag, l->l_cred); default: + if ((dksc->sc_flags & DKF_INITED) == 0) + return ENXIO; return dk_ioctl(di, dksc, dev, cmd, data, flag, l); } }
CVS commit: [netbsd-7-1] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:13:55 UTC 2017 Modified Files: src/sys/dev [netbsd-7-1]: cgd.c Log Message: Apply patch (requested by chs in ticket #1429): Avoid crashes by checking if a cgd device has been configured before processing most ioctls, and failing with ENXIO if the device is not configured. To generate a diff of this commit: cvs rdiff -u -r1.90.2.1 -r1.90.2.1.4.1 src/sys/dev/cgd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7-0] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:12:44 UTC 2017 Modified Files: src/sys/dev [netbsd-7-0]: cgd.c Log Message: Apply patch (requested by chs in ticket #1429): Avoid crashes by checking if a cgd device has been configured before processing most ioctls, and failing with ENXIO if the device is not configured. To generate a diff of this commit: cvs rdiff -u -r1.90.4.1 -r1.90.4.2 src/sys/dev/cgd.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/cgd.c diff -u src/sys/dev/cgd.c:1.90.4.1 src/sys/dev/cgd.c:1.90.4.2 --- src/sys/dev/cgd.c:1.90.4.1 Wed Nov 4 16:24:38 2015 +++ src/sys/dev/cgd.c Sat Jul 8 16:12:44 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cgd.c,v 1.90.4.1 2015/11/04 16:24:38 riz Exp $ */ +/* $NetBSD: cgd.c,v 1.90.4.2 2017/07/08 16:12:44 snj Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.90.4.1 2015/11/04 16:24:38 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.90.4.2 2017/07/08 16:12:44 snj Exp $"); #include #include @@ -586,12 +586,16 @@ cgdioctl(dev_t dev, u_long cmd, void *da */ if ((flag & FWRITE) == 0) return (EBADF); + if ((dksc->sc_flags & DKF_INITED) == 0) + return ENXIO; /* * We pass this call down to the underlying disk. */ return VOP_IOCTL(cs->sc_tvn, cmd, data, flag, l->l_cred); default: + if ((dksc->sc_flags & DKF_INITED) == 0) + return ENXIO; return dk_ioctl(di, dksc, dev, cmd, data, flag, l); } }
CVS commit: [netbsd-7-0] src/sys/dev
Module Name:src Committed By: snj Date: Sat Jul 8 16:12:44 UTC 2017 Modified Files: src/sys/dev [netbsd-7-0]: cgd.c Log Message: Apply patch (requested by chs in ticket #1429): Avoid crashes by checking if a cgd device has been configured before processing most ioctls, and failing with ENXIO if the device is not configured. To generate a diff of this commit: cvs rdiff -u -r1.90.4.1 -r1.90.4.2 src/sys/dev/cgd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/gdbscripts
Module Name:src Committed By: snj Date: Sat Jul 8 16:07:34 UTC 2017 Modified Files: src/sys/gdbscripts [netbsd-7]: cpus Log Message: Pull up following revision(s) (requested by skrll in ticket #1428): sys/gdbscripts/cpus: 1.2, 1.3 Make cpus MI -- Typo in previous To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.76.1 src/sys/gdbscripts/cpus Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/gdbscripts
Module Name:src Committed By: snj Date: Sat Jul 8 16:07:34 UTC 2017 Modified Files: src/sys/gdbscripts [netbsd-7]: cpus Log Message: Pull up following revision(s) (requested by skrll in ticket #1428): sys/gdbscripts/cpus: 1.2, 1.3 Make cpus MI -- Typo in previous To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.76.1 src/sys/gdbscripts/cpus Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/gdbscripts/cpus diff -u src/sys/gdbscripts/cpus:1.1 src/sys/gdbscripts/cpus:1.1.76.1 --- src/sys/gdbscripts/cpus:1.1 Wed Feb 20 21:01:23 2008 +++ src/sys/gdbscripts/cpus Sat Jul 8 16:07:34 2017 @@ -1,10 +1,11 @@ -# $NetBSD: cpus,v 1.1 2008/02/20 21:01:23 ad Exp $ +# $NetBSD: cpus,v 1.1.76.1 2017/07/08 16:07:34 snj Exp $ define cpus - set $ci = _info_primary + set $cpu = 0 printf "\t cpu id curlwp\n" - while ($ci != 0) + while ($cpu < ncpu) + set $ci = cpu_infos[$cpu] printf "%16lx %2d %16lx\n", $ci, $ci->ci_cpuid, $ci->ci_curlwp - set $ci = $ci->ci_next + set $cpu++ end end
CVS commit: [netbsd-7] src/usr.sbin/service
Module Name:src Committed By: snj Date: Sat Jul 8 16:06:01 UTC 2017 Modified Files: src/usr.sbin/service [netbsd-7]: service Log Message: Pull up following revision(s) (requested by sborrill in ticket #1427): usr.sbin/service/service: revision 1.8 Only match first instance of name and rcvar in file. To generate a diff of this commit: cvs rdiff -u -r1.7.2.2 -r1.7.2.3 src/usr.sbin/service/service Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/usr.sbin/service
Module Name:src Committed By: snj Date: Sat Jul 8 16:06:01 UTC 2017 Modified Files: src/usr.sbin/service [netbsd-7]: service Log Message: Pull up following revision(s) (requested by sborrill in ticket #1427): usr.sbin/service/service: revision 1.8 Only match first instance of name and rcvar in file. To generate a diff of this commit: cvs rdiff -u -r1.7.2.2 -r1.7.2.3 src/usr.sbin/service/service Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/service/service diff -u src/usr.sbin/service/service:1.7.2.2 src/usr.sbin/service/service:1.7.2.3 --- src/usr.sbin/service/service:1.7.2.2 Tue Apr 21 05:22:58 2015 +++ src/usr.sbin/service/service Sat Jul 8 16:06:00 2017 @@ -1,5 +1,5 @@ #!/bin/sh -#$NetBSD: service,v 1.7.2.2 2015/04/21 05:22:58 snj Exp $ +#$NetBSD: service,v 1.7.2.3 2017/07/08 16:06:00 snj Exp $ #service -- run or list system services # # Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098 @@ -84,8 +84,8 @@ if [ -n "${ENABLED}" ]; then _rc_files | $flt | while read file do if grep -q ^rcvar "$file"; then -eval $( grep ^name= "$file" ) -eval $( grep ^rcvar "$file" ) +eval $( grep -m 1 ^name= "$file" ) +eval $( grep -m 1 ^rcvar "$file" ) if [ -n "${rcvar}" ]; then load_rc_config ${rcvar} checkyesno ${rcvar} 2>/dev/null && echo ${file}
Re: CVS commit: src/etc/etc.next68k
On Jul 8, 12:47pm, tsut...@ceres.dti.ne.jp (Izumi Tsutsui) wrote: -- Subject: Re: CVS commit: src/etc/etc.next68k | > | The PR says: | > | > This information should be fixed to reflect reality, or etc/etc.next68k/MAKEDEV.conf should build tty[ab] as done on e.g. sparc. | > | | > | What makes you choose the latter? | > | > That every arch except alpha uses ttya and ttyb for zstty? | | In which file? zs(4) man page? Yes. christos
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sat Jul 8 15:15:43 UTC 2017 Modified Files: src/sys/kern: sched_4bsd.c Log Message: explain a bit To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/kern/sched_4bsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sat Jul 8 15:15:43 UTC 2017 Modified Files: src/sys/kern: sched_4bsd.c Log Message: explain a bit To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/kern/sched_4bsd.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/sched_4bsd.c diff -u src/sys/kern/sched_4bsd.c:1.30 src/sys/kern/sched_4bsd.c:1.31 --- src/sys/kern/sched_4bsd.c:1.30 Tue Jun 24 10:08:45 2014 +++ src/sys/kern/sched_4bsd.c Sat Jul 8 15:15:43 2017 @@ -1,6 +1,6 @@ -/* $NetBSD: sched_4bsd.c,v 1.30 2014/06/24 10:08:45 maxv Exp $ */ +/* $NetBSD: sched_4bsd.c,v 1.31 2017/07/08 15:15:43 maxv Exp $ */ -/*- +/* * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc. * All rights reserved. * @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/*- +/* * Copyright (c) 1982, 1986, 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c,v 1.30 2014/06/24 10:08:45 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c,v 1.31 2017/07/08 15:15:43 maxv Exp $"); #include "opt_ddb.h" #include "opt_lockdebug.h" @@ -80,13 +80,10 @@ __KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c #include #include #include -#include #include #include #include -#include #include -#include #include static void updatepri(struct lwp *); @@ -95,7 +92,7 @@ static void resetpriority(struct lwp *); extern unsigned int sched_pstats_ticks; /* defined in kern_synch.c */ /* Number of hardclock ticks per sched_tick() */ -static int rrticks; +static int rrticks __read_mostly; /* * Force switch among equal priority processes every 100ms. @@ -133,7 +130,7 @@ sched_tick(struct cpu_info *ci) if (spc->spc_flags & SPCF_SHOULDYIELD) { /* * Process is stuck in kernel somewhere, probably - * due to buggy or inefficient code. Force a + * due to buggy or inefficient code. Force a * kernel preemption. */ cpu_need_resched(ci, RESCHED_KPREEMPT); @@ -170,71 +167,90 @@ sched_tick(struct cpu_info *ci) #define ESTCPULIM(e) min((e), ESTCPU_MAX) /* - * Constants for digital decay and forget: - * 90% of (l_estcpu) usage in 5 * loadav time - * 95% of (l_pctcpu) usage in 60 seconds (load insensitive) - * Note that, as ps(1) mentions, this can let percentages - * total over 100% (I've seen 137.9% for 3 processes). + * The main parameter used by this algorithm is 'l_estcpu'. It is an estimate + * of the recent CPU utilization of the thread. + * + * l_estcpu is: + * - increased each time the hardclock ticks and the thread is found to + *be executing, in sched_schedclock() called from hardclock() + * - decreased (filtered) on each sched tick, in sched_pstats_hook() + * If the lwp is sleeping for more than a second, we don't touch l_estcpu: it + * will be updated in sched_setrunnable() when the lwp wakes up, in burst mode + * (ie, we decrease it n times). * * Note that hardclock updates l_estcpu and l_cpticks independently. * - * We wish to decay away 90% of l_estcpu in (5 * loadavg) seconds. - * That is, the system wants to compute a value of decay such - * that the following for loop: - * for (i = 0; i < (5 * loadavg); i++) - * l_estcpu *= decay; - * will compute - * l_estcpu *= 0.1; - * for all values of loadavg: + * - + * + * Here we describe how l_estcpu is decreased. + * + * Constants for digital decay (filter): + * 90% of l_estcpu usage in (5 * loadavg) seconds + * + * We wish to decay away 90% of l_estcpu in (5 * loadavg) seconds. That is, we + * want to compute a value of decay such that the following loop: + * for (i = 0; i < (5 * loadavg); i++) + * l_estcpu *= decay; + * will result in + * l_estcpu *= 0.1; + * for all values of loadavg. * * Mathematically this loop can be expressed by saying: - * decay ** (5 * loadavg) ~= .1 + * decay ** (5 * loadavg) ~= .1 + * + * And finally, the corresponding value of decay we're using is: + * decay = (2 * loadavg) / (2 * loadavg + 1) * - * The system computes decay as: - * decay = (2 * loadavg) / (2 * loadavg + 1) + * - * - * We wish to prove that the system's computation of decay - * will always fulfill the equation: - * decay ** (5 * loadavg) ~= .1 + * Now, let's prove that the value of decay stated above will always fulfill + * the equation: + * decay ** (5 * loadavg) ~= .1 * * If we compute b as: - * b = 2 * loadavg + * b = 2 * loadavg * then - * decay = b / (b + 1) + * decay = b / (b + 1) * * We now need to prove two things: - * 1) Given factor ** (5 * loadavg) ~= .1, prove factor ==
CVS commit: src/sys/arch/cats/conf
Module Name:src Committed By: skrll Date: Sat Jul 8 15:14:49 UTC 2017 Removed Files: src/sys/arch/cats/conf: kern.ldscript Log Message: Remove unused script To generate a diff of this commit: cvs rdiff -u -r1.5 -r0 src/sys/arch/cats/conf/kern.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/cats/conf
Module Name:src Committed By: skrll Date: Sat Jul 8 15:14:49 UTC 2017 Removed Files: src/sys/arch/cats/conf: kern.ldscript Log Message: Remove unused script To generate a diff of this commit: cvs rdiff -u -r1.5 -r0 src/sys/arch/cats/conf/kern.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: nonaka Date: Sat Jul 8 14:35:33 UTC 2017 Modified Files: src/sys/arch/x86/x86: lapic.c Log Message: PR/52266: use rdmsr_safe(9) instead of rdmsr(9) for old machine. tested by simonb@ To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x86/x86/lapic.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/lapic.c diff -u src/sys/arch/x86/x86/lapic.c:1.58 src/sys/arch/x86/x86/lapic.c:1.59 --- src/sys/arch/x86/x86/lapic.c:1.58 Tue May 23 08:54:39 2017 +++ src/sys/arch/x86/x86/lapic.c Sat Jul 8 14:35:33 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: lapic.c,v 1.58 2017/05/23 08:54:39 nonaka Exp $ */ +/* $NetBSD: lapic.c,v 1.59 2017/07/08 14:35:33 nonaka Exp $ */ /*- * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.58 2017/05/23 08:54:39 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.59 2017/07/08 14:35:33 nonaka Exp $"); #include "acpica.h" #include "ioapic.h" @@ -235,10 +235,12 @@ lapic_enable_x2apic(void) bool lapic_is_x2apic(void) { - uint64_t r; + uint64_t msr; - r = rdmsr(MSR_APICBASE); - return (r & (APICBASE_EN | APICBASE_EXTD)) == (APICBASE_EN | APICBASE_EXTD); + if (rdmsr_safe(MSR_APICBASE, ) == EFAULT) + return false; + return (msr & (APICBASE_EN | APICBASE_EXTD)) == + (APICBASE_EN | APICBASE_EXTD); } /*
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: nonaka Date: Sat Jul 8 14:35:33 UTC 2017 Modified Files: src/sys/arch/x86/x86: lapic.c Log Message: PR/52266: use rdmsr_safe(9) instead of rdmsr(9) for old machine. tested by simonb@ To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x86/x86/lapic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jul 8 12:37:34 UTC 2017 Modified Files: src/sys/arch/evbarm/conf: SUNXI Log Message: Add ffclock To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/SUNXI Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Jul 8 12:37:34 UTC 2017 Modified Files: src/sys/arch/evbarm/conf: SUNXI Log Message: Add ffclock To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/SUNXI 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/evbarm/conf/SUNXI diff -u src/sys/arch/evbarm/conf/SUNXI:1.14 src/sys/arch/evbarm/conf/SUNXI:1.15 --- src/sys/arch/evbarm/conf/SUNXI:1.14 Sat Jul 8 11:12:24 2017 +++ src/sys/arch/evbarm/conf/SUNXI Sat Jul 8 12:37:34 2017 @@ -1,5 +1,5 @@ # -# $NetBSD: SUNXI,v 1.14 2017/07/08 11:12:24 jmcneill Exp $ +# $NetBSD: SUNXI,v 1.15 2017/07/08 12:37:34 jmcneill Exp $ # # Allwinner sunxi family # @@ -67,7 +67,8 @@ sun8ih3ccu* at fdt? pass 4 # H3 CCU sunxiresets* at fdt? pass 1 # Misc. clock resets sunxigates* at fdt? pass 1 # Misc. clock gates -fclock* at fdt? pass 3 +fclock* at fdt? pass 1 +ffclock* at fdt? pass 1 fregulator* at fdt? pass 4 gpiokeys* at fdt? gpioleds* at fdt?
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sat Jul 8 12:36:51 UTC 2017 Modified Files: src/sys/dev/fdt: fdt_subr.c fdtvar.h Log Message: Add fdtbus_get_string_index helper. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/fdt/fdt_subr.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/fdt/fdtvar.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/dev/fdt/fdt_subr.c diff -u src/sys/dev/fdt/fdt_subr.c:1.15 src/sys/dev/fdt/fdt_subr.c:1.16 --- src/sys/dev/fdt/fdt_subr.c:1.15 Sun Jul 2 15:27:58 2017 +++ src/sys/dev/fdt/fdt_subr.c Sat Jul 8 12:36:51 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_subr.c,v 1.15 2017/07/02 15:27:58 jmcneill Exp $ */ +/* $NetBSD: fdt_subr.c,v 1.16 2017/07/08 12:36:51 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill@@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.15 2017/07/02 15:27:58 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.16 2017/07/08 12:36:51 jmcneill Exp $"); #include #include @@ -422,3 +422,23 @@ fdtbus_get_string(int phandle, const cha return fdt_getprop(fdtbus_get_data(), off, prop, NULL); } + +const char * +fdtbus_get_string_index(int phandle, const char *prop, u_int index) +{ + const char *names, *name; + int len, cur; + + if ((len = OF_getproplen(phandle, prop)) < 0) + return NULL; + + names = fdtbus_get_string(phandle, prop); + + for (name = names, cur = 0; len > 0; + name += strlen(name) + 1, cur++) { + if (index == cur) + return name; + } + + return NULL; +} Index: src/sys/dev/fdt/fdtvar.h diff -u src/sys/dev/fdt/fdtvar.h:1.23 src/sys/dev/fdt/fdtvar.h:1.24 --- src/sys/dev/fdt/fdtvar.h:1.23 Sun Jul 2 15:27:58 2017 +++ src/sys/dev/fdt/fdtvar.h Sat Jul 8 12:36:51 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdtvar.h,v 1.23 2017/07/02 15:27:58 jmcneill Exp $ */ +/* $NetBSD: fdtvar.h,v 1.24 2017/07/08 12:36:51 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -297,6 +297,7 @@ bool fdtbus_status_okay(int); const void * fdtbus_get_prop(int, const char *, int *); const char * fdtbus_get_string(int, const char *); +const char * fdtbus_get_string_index(int, const char *, u_int); int fdtbus_print(void *, const char *);
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sat Jul 8 12:37:09 UTC 2017 Modified Files: src/sys/dev/fdt: files.fdt Added Files: src/sys/dev/fdt: fixedfactorclock.c Log Message: Add driver for fixed-factor clocks. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/fdt/files.fdt cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fixedfactorclock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sat Jul 8 12:37:09 UTC 2017 Modified Files: src/sys/dev/fdt: files.fdt Added Files: src/sys/dev/fdt: fixedfactorclock.c Log Message: Add driver for fixed-factor clocks. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/fdt/files.fdt cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fixedfactorclock.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/fdt/files.fdt diff -u src/sys/dev/fdt/files.fdt:1.18 src/sys/dev/fdt/files.fdt:1.19 --- src/sys/dev/fdt/files.fdt:1.18 Sat Jul 8 00:55:02 2017 +++ src/sys/dev/fdt/files.fdt Sat Jul 8 12:37:08 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.fdt,v 1.18 2017/07/08 00:55:02 jmcneill Exp $ +# $NetBSD: files.fdt,v 1.19 2017/07/08 12:37:08 jmcneill Exp $ include "external/bsd/libfdt/conf/files.libfdt" @@ -18,6 +18,10 @@ device fclock: clk attach fclock at fdt file dev/fdt/fixedclock.c fclock +device ffclock: clk +attach ffclock at fdt +file dev/fdt/fixedfactorclock.c ffclock + device gpiokeys: sysmon_envsys, sysmon_power attach gpiokeys at fdt file dev/fdt/gpiokeys.c gpiokeys Added files: Index: src/sys/dev/fdt/fixedfactorclock.c diff -u /dev/null src/sys/dev/fdt/fixedfactorclock.c:1.1 --- /dev/null Sat Jul 8 12:37:09 2017 +++ src/sys/dev/fdt/fixedfactorclock.c Sat Jul 8 12:37:08 2017 @@ -0,0 +1,164 @@ +/* $NetBSD: fixedfactorclock.c,v 1.1 2017/07/08 12:37:08 jmcneill Exp $ */ + +/*- + * Copyright (c) 2017 Jared McNeill+ * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.1 2017/07/08 12:37:08 jmcneill Exp $"); + +#include +#include +#include +#include +#include + +#include + +#include + +static int fixedfactorclock_match(device_t, cfdata_t, void *); +static void fixedfactorclock_attach(device_t, device_t, void *); + +static struct clk *fixedfactorclock_decode(device_t, const void *, size_t); + +static const struct fdtbus_clock_controller_func fixedfactorclock_fdt_funcs = { + .decode = fixedfactorclock_decode +}; + +static struct clk *fixedfactorclock_get(void *, const char *); +static void fixedfactorclock_put(void *, struct clk *); +static u_int fixedfactorclock_get_rate(void *, struct clk *); + +static const struct clk_funcs fixedfactorclock_clk_funcs = { + .get = fixedfactorclock_get, + .put = fixedfactorclock_put, + .get_rate = fixedfactorclock_get_rate, +}; + +struct fixedfactorclock_clk { + struct clk base; + + u_int div; + u_int mult; +}; + +struct fixedfactorclock_softc { + device_t sc_dev; + int sc_phandle; + + struct clk_domain sc_clkdom; + struct fixedfactorclock_clk sc_clk; +}; + +CFATTACH_DECL_NEW(ffclock, sizeof(struct fixedfactorclock_softc), +fixedfactorclock_match, fixedfactorclock_attach, NULL, NULL); + +static int +fixedfactorclock_match(device_t parent, cfdata_t cf, void *aux) +{ + const char * const compatible[] = { "fixed-factor-clock", NULL }; + const struct fdt_attach_args *faa = aux; + + return of_match_compatible(faa->faa_phandle, compatible); +} + +static void +fixedfactorclock_attach(device_t parent, device_t self, void *aux) +{ + struct fixedfactorclock_softc * const sc = device_private(self); + const struct fdt_attach_args *faa = aux; + const int phandle = faa->faa_phandle; + const char *name; + + sc->sc_dev = self; + sc->sc_phandle = phandle; + sc->sc_clkdom.funcs = _clk_funcs; + sc->sc_clkdom.priv = sc; + + of_getprop_uint32(phandle, "clock-div", >sc_clk.div); + of_getprop_uint32(phandle, "clock-mult", >sc_clk.mult); + + if (sc->sc_clk.div == 0 || sc->sc_clk.mult == 0) { + aprint_error(": invalid
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sat Jul 8 12:36:51 UTC 2017 Modified Files: src/sys/dev/fdt: fdt_subr.c fdtvar.h Log Message: Add fdtbus_get_string_index helper. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/fdt/fdt_subr.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/fdt/fdtvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Sat Jul 8 11:12:24 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: files.sunxi sunxi_gpio.c src/sys/arch/evbarm/conf: SUNXI Added Files: src/sys/arch/arm/sunxi: sunxi_gates.c sunxi_resets.c Log Message: Add misc. gates and resets driver, and explicitly enable PIO clocks at attach. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/files.sunxi cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_gates.c \ src/sys/arch/arm/sunxi/sunxi_resets.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_gpio.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/SUNXI 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/arm/sunxi/files.sunxi diff -u src/sys/arch/arm/sunxi/files.sunxi:1.10 src/sys/arch/arm/sunxi/files.sunxi:1.11 --- src/sys/arch/arm/sunxi/files.sunxi:1.10 Fri Jul 7 13:11:31 2017 +++ src/sys/arch/arm/sunxi/files.sunxi Sat Jul 8 11:12:24 2017 @@ -1,4 +1,4 @@ -# $NetBSD: files.sunxi,v 1.10 2017/07/07 13:11:31 jmcneill Exp $ +# $NetBSD: files.sunxi,v 1.11 2017/07/08 11:12:24 jmcneill Exp $ # # Configuration info for Allwinner sunxi family SoCs # @@ -41,6 +41,16 @@ device sun8ih3ccu: sunxi_ccu attach sun8ih3ccu at fdt with sunxi_h3_ccu file arch/arm/sunxi/sun8i_h3_ccu.c sunxi_h3_ccu +# Misc. clock resets +device sunxiresets +attach sunxiresets at fdt with sunxi_resets +file arch/arm/sunxi/sunxi_resets.c sunxi_resets + +# Misc. clock gates +device sunxigates +attach sunxigates at fdt with sunxi_gates +file arch/arm/sunxi/sunxi_gates.c sunxi_gates + # GPIO device sunxigpio: gpiobus attach sunxigpio at fdt with sunxi_gpio Index: src/sys/arch/arm/sunxi/sunxi_gpio.c diff -u src/sys/arch/arm/sunxi/sunxi_gpio.c:1.7 src/sys/arch/arm/sunxi/sunxi_gpio.c:1.8 --- src/sys/arch/arm/sunxi/sunxi_gpio.c:1.7 Sat Jul 8 00:26:19 2017 +++ src/sys/arch/arm/sunxi/sunxi_gpio.c Sat Jul 8 11:12:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_gpio.c,v 1.7 2017/07/08 00:26:19 jmcneill Exp $ */ +/* $NetBSD: sunxi_gpio.c,v 1.8 2017/07/08 11:12:24 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill@@ -29,7 +29,7 @@ #include "opt_soc.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.7 2017/07/08 00:26:19 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.8 2017/07/08 11:12:24 jmcneill Exp $"); #include #include @@ -507,6 +507,8 @@ sunxi_gpio_attach(device_t parent, devic struct sunxi_gpio_softc * const sc = device_private(self); struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; + struct fdtbus_reset *rst; + struct clk *clk; bus_addr_t addr; bus_size_t size; int child; @@ -516,6 +518,18 @@ sunxi_gpio_attach(device_t parent, devic return; } + if ((clk = fdtbus_clock_get_index(phandle, 0)) != NULL) + if (clk_enable(clk) != 0) { + aprint_error(": couldn't enable clock\n"); + return; + } + + if ((rst = fdtbus_reset_get_index(phandle, 0)) != NULL) + if (fdtbus_reset_deassert(rst) != 0) { + aprint_error(": couldn't de-assert reset\n"); + return; + } + sc->sc_dev = self; sc->sc_bst = faa->faa_bst; if (bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh) != 0) { Index: src/sys/arch/evbarm/conf/SUNXI diff -u src/sys/arch/evbarm/conf/SUNXI:1.13 src/sys/arch/evbarm/conf/SUNXI:1.14 --- src/sys/arch/evbarm/conf/SUNXI:1.13 Sat Jul 8 00:55:21 2017 +++ src/sys/arch/evbarm/conf/SUNXI Sat Jul 8 11:12:24 2017 @@ -1,5 +1,5 @@ # -# $NetBSD: SUNXI,v 1.13 2017/07/08 00:55:21 jmcneill Exp $ +# $NetBSD: SUNXI,v 1.14 2017/07/08 11:12:24 jmcneill Exp $ # # Allwinner sunxi family # @@ -64,6 +64,8 @@ psci* at fdt? sun6ia31ccu* at fdt? pass 4 # A31 CCU sun8ia83tccu* at fdt? pass 4 # A83T CCU sun8ih3ccu* at fdt? pass 4 # H3 CCU +sunxiresets* at fdt? pass 1 # Misc. clock resets +sunxigates* at fdt? pass 1 # Misc. clock gates fclock* at fdt? pass 3 fregulator* at fdt? pass 4 Added files: Index: src/sys/arch/arm/sunxi/sunxi_gates.c diff -u /dev/null src/sys/arch/arm/sunxi/sunxi_gates.c:1.1 --- /dev/null Sat Jul 8 11:12:24 2017 +++ src/sys/arch/arm/sunxi/sunxi_gates.c Sat Jul 8 11:12:24 2017 @@ -0,0 +1,277 @@ +/* $NetBSD: sunxi_gates.c,v 1.1 2017/07/08 11:12:24 jmcneill Exp $ */ + +/*- + * Copyright (c) 2017 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. +
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Sat Jul 8 11:12:24 UTC 2017 Modified Files: src/sys/arch/arm/sunxi: files.sunxi sunxi_gpio.c src/sys/arch/evbarm/conf: SUNXI Added Files: src/sys/arch/arm/sunxi: sunxi_gates.c sunxi_resets.c Log Message: Add misc. gates and resets driver, and explicitly enable PIO clocks at attach. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/files.sunxi cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_gates.c \ src/sys/arch/arm/sunxi/sunxi_resets.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_gpio.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/SUNXI Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.