CVS commit: src/libexec/getty
Module Name:src Committed By: aymeric Date: Thu Feb 12 07:32:09 UTC 2015 Modified Files: src/libexec/getty: ttys.5 Log Message: Fix previous commit by using tty00 as an example of dialin peripheral instead of dialout dty00. Thanks to mrg@ for pointing it out. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/libexec/getty/ttys.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/getty/ttys.5 diff -u src/libexec/getty/ttys.5:1.19 src/libexec/getty/ttys.5:1.20 --- src/libexec/getty/ttys.5:1.19 Wed Nov 12 21:56:48 2014 +++ src/libexec/getty/ttys.5 Thu Feb 12 07:32:09 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: ttys.5,v 1.19 2014/11/12 21:56:48 aymeric Exp $ +.\" $NetBSD: ttys.5,v 1.20 2015/02/12 07:32:09 aymeric Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -199,7 +199,7 @@ program must be run for changes in those # root login on console at 1200 baud console "/usr/libexec/getty std.1200" vt100 on secure # dialup at 1200 baud, no root logins -dty00 "/usr/libexec/getty d1200" dialup on # 555-1234 +tty00 "/usr/libexec/getty d1200" dialup on # 555-1234 # Mike's terminal: hp2621 ttyh0 "/usr/libexec/getty std.9600" hp2621-nl on # 457 Evans # John's terminal: vt100
CVS commit: src/games/dab
Module Name:src Committed By: dholland Date: Thu Feb 12 06:24:21 UTC 2015 Modified Files: src/games/dab: dab.6 Log Message: typo To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/games/dab/dab.6 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/dab/dab.6 diff -u src/games/dab/dab.6:1.6 src/games/dab/dab.6:1.7 --- src/games/dab/dab.6:1.6 Sat Oct 6 19:39:51 2012 +++ src/games/dab/dab.6 Thu Feb 12 06:24:21 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: dab.6,v 1.6 2012/10/06 19:39:51 christos Exp $ +.\" $NetBSD: dab.6,v 1.7 2015/02/12 06:24:21 dholland Exp $ .\" .\" Copyright (c) 2003 Thomas Klausner. .\" @@ -70,7 +70,7 @@ redraw the screen, and .Ic q quits the game. .Pp -Support options are: +Supported options are: .Bl -tag -width XXnXngamesX .It Fl a Don't use the alternate character set.
CVS commit: src/sys/arch/sparc64
Module Name:src Committed By: palle Date: Thu Feb 12 04:48:37 UTC 2015 Modified Files: src/sys/arch/sparc64/conf: GENERIC Added Files: src/sys/arch/sparc64/dev: vpci.c vpcivar.h Log Message: sun4v: vpci driver - initial (and incomplete) version of virtual PCIe host bridge driver for sun4v systems. Based on the NetBSD pyro driver and OpenBSD vpci driver. Future work will include integrating code from the OpenBSD vpci driver. To generate a diff of this commit: cvs rdiff -u -r1.179 -r1.180 src/sys/arch/sparc64/conf/GENERIC cvs rdiff -u -r0 -r1.1 src/sys/arch/sparc64/dev/vpci.c \ src/sys/arch/sparc64/dev/vpcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/conf/GENERIC diff -u src/sys/arch/sparc64/conf/GENERIC:1.179 src/sys/arch/sparc64/conf/GENERIC:1.180 --- src/sys/arch/sparc64/conf/GENERIC:1.179 Wed Jan 7 09:50:05 2015 +++ src/sys/arch/sparc64/conf/GENERIC Thu Feb 12 04:48:37 2015 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.179 2015/01/07 09:50:05 macallan Exp $ +# $NetBSD: GENERIC,v 1.180 2015/02/12 04:48:37 palle Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/sparc64/conf/std.sparc64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.179 $" +#ident "GENERIC-$Revision: 1.180 $" maxusers 64 @@ -238,11 +238,13 @@ sbus* at mainbus0# SBus-based system psycho* at mainbus0# PCI-based systems schizo* at mainbus? pyro* at mainbus? +vpci* at mainbus0 central* at mainbus? fhc* at mainbus? pci* at psycho? pci* at schizo? pci* at pyro? +pci* at vpci? pci* at ppb? ppb* at pci? fhc* at central? Added files: Index: src/sys/arch/sparc64/dev/vpci.c diff -u /dev/null src/sys/arch/sparc64/dev/vpci.c:1.1 --- /dev/null Thu Feb 12 04:48:37 2015 +++ src/sys/arch/sparc64/dev/vpci.c Thu Feb 12 04:48:37 2015 @@ -0,0 +1,623 @@ +/* $NetBSD: vpci.c,v 1.1 2015/02/12 04:48:37 palle Exp $ */ +/* + * Copyright (c) 2015 Palle Lyckegaard + * All rights reserved. + * + * Driver for virtual PCIe host bridge on sun4v systems. + * + * Based on NetBSD pyro and OpenBSD vpci drivers. + * + * 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: vpci.c,v 1.1 2015/02/12 04:48:37 palle Exp $"); + +#include +#include +#include +#include +#include + +#define _SPARC_BUS_DMA_PRIVATE +#include +#include + +#ifdef DDB +#include +#endif + +#include +#include + +#include +#include +#include + +#include + +#ifdef DEBUG +#define VDB_PROM0x01 +#define VDB_BUSMAP 0x02 +#define VDB_INTR0x04 +#define VDB_CONF0x08 +int vpci_debug = 0xff; +#define DPRINTF(l, s) do { if (vpci_debug & l) printf s; } while (0) +#else +#define DPRINTF(l, s) +#endif + +#if 0 +FIXME +#define FIRE_RESET_GEN 0x7010 + +#define FIRE_RESET_GEN_XIR 0x0002L + +#define FIRE_INTRMAP_INT_CNTRL_NUM_MASK 0x03c0 +#define FIRE_INTRMAP_INT_CNTRL_NUM0 0x0040 +#define FIRE_INTRMAP_INT_CNTRL_NUM1 0x0080 +#define FIRE_INTRMAP_INT_CNTRL_NUM2 0x0100 +#define FIRE_INTRMAP_INT_CNTRL_NUM3 0x0200 +#define FIRE_INTRMAP_T_JPID_SHIFT 26 +#define FIRE_INTRMAP_T_JPID_MASK 0x7c00 + +#define OBERON_INTRMAP_T_DESTID_SHIFT 21 +#define OBERON_INTRMAP_T_DESTID_MASK 0x7fe0 +#endif + +extern struct sparc_pci_chipset _sparc_pci_chipset; + +int vpci_match(device_t, cfdata_t, void *); +void vpci_attach(device_t, device_t, void *); +int vpci_print(void *, const char *); + +CFATTACH_DECL_NEW(vpci, sizeof(struct vpci_softc), +vpci_match, vpci_attach, NULL, NULL); + +void vpci_init(struct vpci_softc */*FIXME, int*/, struct mainbus_attach_args
CVS commit: src/tests/net/bpfilter
Module Name:src Committed By: alnsn Date: Wed Feb 11 23:39:07 UTC 2015 Modified Files: src/tests/net/bpfilter: t_bpfilter.c Log Message: Add bpfilternegjmp test. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/net/bpfilter/t_bpfilter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/bpfilter/t_bpfilter.c diff -u src/tests/net/bpfilter/t_bpfilter.c:1.9 src/tests/net/bpfilter/t_bpfilter.c:1.10 --- src/tests/net/bpfilter/t_bpfilter.c:1.9 Wed Feb 11 19:37:37 2015 +++ src/tests/net/bpfilter/t_bpfilter.c Wed Feb 11 23:39:07 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfilter.c,v 1.9 2015/02/11 19:37:37 alnsn Exp $ */ +/* $NetBSD: t_bpfilter.c,v 1.10 2015/02/11 23:39:07 alnsn Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_bpfilter.c,v 1.9 2015/02/11 19:37:37 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfilter.c,v 1.10 2015/02/11 23:39:07 alnsn Exp $"); #include #include @@ -120,6 +120,12 @@ static struct bpf_insn badjmp_prog[] = { BPF_STMT(BPF_RET+BPF_A, 0), }; +static struct bpf_insn negjmp_prog[] = { + BPF_STMT(BPF_JMP+BPF_JA, 0), + BPF_STMT(BPF_JMP+BPF_JA, UINT32_MAX - 1), // -2 + BPF_STMT(BPF_RET+BPF_A, 0), +}; + static struct bpf_insn badret_prog[] = { BPF_STMT(BPF_RET+BPF_A+0x8000, 0), }; @@ -414,6 +420,24 @@ ATF_TC_BODY(bpfilterbadjmp, tc) ATF_CHECK_ERRNO(EINVAL, send_bpf_prog("bpfilterbadjmp", &prog) == -1); } +ATF_TC(bpfilternegjmp); +ATF_TC_HEAD(bpfilternegjmp, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Checks that bpf program that " + "jumps backwards is rejected by the kernel"); + atf_tc_set_md_var(tc, "timeout", "30"); +} + +ATF_TC_BODY(bpfilternegjmp, tc) +{ + struct bpf_program prog; + + prog.bf_len = __arraycount(negjmp_prog); + prog.bf_insns = negjmp_prog; + ATF_CHECK_ERRNO(EINVAL, send_bpf_prog("bpfilternegjmp", &prog) == -1); +} + ATF_TC(bpfilterbadret); ATF_TC_HEAD(bpfilterbadret, tc) { @@ -451,6 +475,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, bpfilternoinitA); ATF_TP_ADD_TC(tp, bpfilternoinitX); ATF_TP_ADD_TC(tp, bpfilterbadjmp); + ATF_TP_ADD_TC(tp, bpfilternegjmp); ATF_TP_ADD_TC(tp, bpfilterbadret); return atf_no_error();
CVS commit: src/tests/lib/libbpfjit
Module Name:src Committed By: alnsn Date: Wed Feb 11 23:33:16 UTC 2015 Modified Files: src/tests/lib/libbpfjit: t_bpfjit.c Log Message: Add libbpfjit_jmp_ja_overflow test. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libbpfjit/t_bpfjit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libbpfjit/t_bpfjit.c diff -u src/tests/lib/libbpfjit/t_bpfjit.c:1.10 src/tests/lib/libbpfjit/t_bpfjit.c:1.11 --- src/tests/lib/libbpfjit/t_bpfjit.c:1.10 Wed Feb 11 23:17:16 2015 +++ src/tests/lib/libbpfjit/t_bpfjit.c Wed Feb 11 23:33:16 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfjit.c,v 1.10 2015/02/11 23:17:16 alnsn Exp $ */ +/* $NetBSD: t_bpfjit.c,v 1.11 2015/02/11 23:33:16 alnsn Exp $ */ /*- * Copyright (c) 2011-2012, 2014 Alexander Nasonov. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: t_bpfjit.c,v 1.10 2015/02/11 23:17:16 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfjit.c,v 1.11 2015/02/11 23:33:16 alnsn Exp $"); #include #include @@ -1941,6 +1941,31 @@ ATF_TC_BODY(libbpfjit_jmp_ja_invalid, tc ATF_CHECK(bpfjit_generate_code(NULL, insns, insn_count) == NULL); } +ATF_TC(libbpfjit_jmp_ja_overflow); +ATF_TC_HEAD(libbpfjit_jmp_ja_overflow, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test BPF_JMP+BPF_JA with negative offset"); +} + +ATF_TC_BODY(libbpfjit_jmp_ja_overflow, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_JMP+BPF_JA, 1), + BPF_STMT(BPF_RET+BPF_K, 777), + BPF_STMT(BPF_JMP+BPF_JA, UINT32_MAX - 1), // -2 + BPF_STMT(BPF_RET+BPF_K, 0) + }; + + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + /* Jumps with negative offsets work in userspace ... */ + ATF_CHECK(bpf_validate(insns, insn_count)); + + /* .. but not for bpfjit. */ + ATF_CHECK(bpfjit_generate_code(NULL, insns, insn_count) == NULL); +} + ATF_TC(libbpfjit_jmp_jgt_k); ATF_TC_HEAD(libbpfjit_jmp_jgt_k, tc) { @@ -4578,6 +4603,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, libbpfjit_alu_neg); ATF_TP_ADD_TC(tp, libbpfjit_jmp_ja); ATF_TP_ADD_TC(tp, libbpfjit_jmp_ja_invalid); + ATF_TP_ADD_TC(tp, libbpfjit_jmp_ja_overflow); ATF_TP_ADD_TC(tp, libbpfjit_jmp_jgt_k); ATF_TP_ADD_TC(tp, libbpfjit_jmp_jge_k); ATF_TP_ADD_TC(tp, libbpfjit_jmp_jeq_k);
CVS commit: src/tests/net/bpfjit
Module Name:src Committed By: alnsn Date: Wed Feb 11 23:29:48 UTC 2015 Modified Files: src/tests/net/bpfjit: t_bpfjit.c Log Message: Add bpfjit_jmp_ja_overflow test. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/net/bpfjit/t_bpfjit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/bpfjit/t_bpfjit.c diff -u src/tests/net/bpfjit/t_bpfjit.c:1.5 src/tests/net/bpfjit/t_bpfjit.c:1.6 --- src/tests/net/bpfjit/t_bpfjit.c:1.5 Wed Feb 11 22:37:55 2015 +++ src/tests/net/bpfjit/t_bpfjit.c Wed Feb 11 23:29:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfjit.c,v 1.5 2015/02/11 22:37:55 alnsn Exp $ */ +/* $NetBSD: t_bpfjit.c,v 1.6 2015/02/11 23:29:48 alnsn Exp $ */ /*- * Copyright (c) 2011-2012, 2014 Alexander Nasonov. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_bpfjit.c,v 1.5 2015/02/11 22:37:55 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfjit.c,v 1.6 2015/02/11 23:29:48 alnsn Exp $"); #include #include @@ -1700,6 +1700,36 @@ ATF_TC_BODY(bpfjit_jmp_ja_invalid, tc) ATF_CHECK(code == NULL); } +ATF_TC(bpfjit_jmp_ja_overflow); +ATF_TC_HEAD(bpfjit_jmp_ja_overflow, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test BPF_JMP+BPF_JA with negative offset"); +} + +ATF_TC_BODY(bpfjit_jmp_ja_overflow, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_JMP+BPF_JA, 1), + BPF_STMT(BPF_RET+BPF_K, 777), + BPF_STMT(BPF_JMP+BPF_JA, UINT32_MAX - 1), // -2 + BPF_STMT(BPF_RET+BPF_K, 0) + }; + + bpfjit_func_t code; + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + RZ(rump_init()); + + /* Jumps with negative offsets work only in userspace. */ + ATF_CHECK(!prog_validate(insns, insn_count)); + + rump_schedule(); + code = rumpns_bpfjit_generate_code(NULL, insns, insn_count); + rump_unschedule(); + ATF_CHECK(code == NULL); +} + ATF_TC(bpfjit_jmp_jgt_k); ATF_TC_HEAD(bpfjit_jmp_jgt_k, tc) { @@ -4491,6 +4521,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, bpfjit_alu_neg); ATF_TP_ADD_TC(tp, bpfjit_jmp_ja); ATF_TP_ADD_TC(tp, bpfjit_jmp_ja_invalid); + ATF_TP_ADD_TC(tp, bpfjit_jmp_ja_overflow); ATF_TP_ADD_TC(tp, bpfjit_jmp_jgt_k); ATF_TP_ADD_TC(tp, bpfjit_jmp_jge_k); ATF_TP_ADD_TC(tp, bpfjit_jmp_jeq_k);
CVS commit: src/tests/lib/libbpfjit
Module Name:src Committed By: alnsn Date: Wed Feb 11 23:17:16 UTC 2015 Modified Files: src/tests/lib/libbpfjit: t_bpfjit.c Log Message: Add libbpfjit_jmp_ja_invalid test. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libbpfjit/t_bpfjit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libbpfjit/t_bpfjit.c diff -u src/tests/lib/libbpfjit/t_bpfjit.c:1.9 src/tests/lib/libbpfjit/t_bpfjit.c:1.10 --- src/tests/lib/libbpfjit/t_bpfjit.c:1.9 Wed Feb 11 23:00:41 2015 +++ src/tests/lib/libbpfjit/t_bpfjit.c Wed Feb 11 23:17:16 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfjit.c,v 1.9 2015/02/11 23:00:41 alnsn Exp $ */ +/* $NetBSD: t_bpfjit.c,v 1.10 2015/02/11 23:17:16 alnsn Exp $ */ /*- * Copyright (c) 2011-2012, 2014 Alexander Nasonov. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: t_bpfjit.c,v 1.9 2015/02/11 23:00:41 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfjit.c,v 1.10 2015/02/11 23:17:16 alnsn Exp $"); #include #include @@ -67,6 +67,7 @@ ATF_TC_BODY(libbpfjit_empty, tc) { struct bpf_insn dummy; + ATF_CHECK(!bpf_validate(&dummy, 0)); ATF_CHECK(bpfjit_generate_code(NULL, &dummy, 0) == NULL); } @@ -1917,6 +1918,29 @@ ATF_TC_BODY(libbpfjit_jmp_ja, tc) bpfjit_free_code(code); } +ATF_TC(libbpfjit_jmp_ja_invalid); +ATF_TC_HEAD(libbpfjit_jmp_ja_invalid, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test BPF_JMP+BPF_JA to invalid destination"); +} + +ATF_TC_BODY(libbpfjit_jmp_ja_invalid, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_JMP+BPF_JA, 4), + BPF_STMT(BPF_RET+BPF_K, 0), + BPF_STMT(BPF_RET+BPF_K, 1), + BPF_STMT(BPF_RET+BPF_K, 2), + BPF_STMT(BPF_RET+BPF_K, 3), + }; + + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + ATF_CHECK(!bpf_validate(insns, insn_count)); + ATF_CHECK(bpfjit_generate_code(NULL, insns, insn_count) == NULL); +} + ATF_TC(libbpfjit_jmp_jgt_k); ATF_TC_HEAD(libbpfjit_jmp_jgt_k, tc) { @@ -4553,6 +4577,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, libbpfjit_alu_modulo_x); ATF_TP_ADD_TC(tp, libbpfjit_alu_neg); ATF_TP_ADD_TC(tp, libbpfjit_jmp_ja); + ATF_TP_ADD_TC(tp, libbpfjit_jmp_ja_invalid); ATF_TP_ADD_TC(tp, libbpfjit_jmp_jgt_k); ATF_TP_ADD_TC(tp, libbpfjit_jmp_jge_k); ATF_TP_ADD_TC(tp, libbpfjit_jmp_jeq_k);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Wed Feb 11 23:07:13 UTC 2015 Modified Files: src/sys/dev/pci: if_bge.c Log Message: Fix three bugs reported by enami@: - bge_miibus_writereg(): Fix a bug that BCM5906 may leave an APE lock. - Fix hwcfg4 isn't printed correctly. - Fix a bug that BGE_PHY_TEST_CTRL_REG isn't set correctly on some PCIe devices. To generate a diff of this commit: cvs rdiff -u -r1.277 -r1.278 src/sys/dev/pci/if_bge.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/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.277 src/sys/dev/pci/if_bge.c:1.278 --- src/sys/dev/pci/if_bge.c:1.277 Sun Aug 10 16:44:36 2014 +++ src/sys/dev/pci/if_bge.c Wed Feb 11 23:07:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.277 2014/08/10 16:44:36 tls Exp $ */ +/* $NetBSD: if_bge.c,v 1.278 2015/02/11 23:07:13 msaitoh Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.277 2014/08/10 16:44:36 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.278 2015/02/11 23:07:13 msaitoh Exp $"); #include #include @@ -1397,13 +1397,13 @@ bge_miibus_writereg(device_t dev, int ph uint32_t autopoll; int i; - if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) - return; - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906 && (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) return; + if (bge_ape_lock(sc, sc->bge_phy_ape_lock) != 0) + return; + /* Reading with autopolling on may trigger PCI errors */ autopoll = CSR_READ_4(sc, BGE_MI_MODE); if (autopoll & BGE_MIMODE_AUTOPOLL) { @@ -3742,7 +3742,7 @@ bge_attach(device_t parent, device_t sel hwcfg2 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_2); if (sc->bge_flags & BGEF_PCIE) hwcfg3 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_3); - if (BGE_ASICREV(sc->bge_chipid == BGE_ASICREV_BCM5785)) + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785) hwcfg4 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_4); if (BGE_IS_5717_PLUS(sc)) hwcfg5 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_5); @@ -4170,7 +4170,7 @@ bge_reset(struct bge_softc *sc) * XXX: from FreeBSD/Linux; no documentation */ if (sc->bge_flags & BGEF_PCIE) { - if (BGE_ASICREV(sc->bge_chipid != BGE_ASICREV_BCM5785) && + if ((BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5785) && !BGE_IS_57765_PLUS(sc) && (CSR_READ_4(sc, BGE_PHY_TEST_CTRL_REG) == (BGE_PHY_PCIE_LTASS_MODE | BGE_PHY_PCIE_SCRAM_MODE))) {
CVS commit: src/tests/lib/libbpfjit
Module Name:src Committed By: alnsn Date: Wed Feb 11 23:00:41 UTC 2015 Modified Files: src/tests/lib/libbpfjit: t_bpfjit.c Log Message: Add libbpfjit_ret_k and libbpfjit_bad_ret_k tests. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libbpfjit/t_bpfjit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libbpfjit/t_bpfjit.c diff -u src/tests/lib/libbpfjit/t_bpfjit.c:1.8 src/tests/lib/libbpfjit/t_bpfjit.c:1.9 --- src/tests/lib/libbpfjit/t_bpfjit.c:1.8 Thu Nov 20 11:08:29 2014 +++ src/tests/lib/libbpfjit/t_bpfjit.c Wed Feb 11 23:00:41 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfjit.c,v 1.8 2014/11/20 11:08:29 alnsn Exp $ */ +/* $NetBSD: t_bpfjit.c,v 1.9 2015/02/11 23:00:41 alnsn Exp $ */ /*- * Copyright (c) 2011-2012, 2014 Alexander Nasonov. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: t_bpfjit.c,v 1.8 2014/11/20 11:08:29 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfjit.c,v 1.9 2015/02/11 23:00:41 alnsn Exp $"); #include #include @@ -70,6 +70,71 @@ ATF_TC_BODY(libbpfjit_empty, tc) ATF_CHECK(bpfjit_generate_code(NULL, &dummy, 0) == NULL); } +ATF_TC(libbpfjit_ret_k); +ATF_TC_HEAD(libbpfjit_ret_k, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test JIT compilation of a trivial bpf program"); +} + +ATF_TC_BODY(libbpfjit_ret_k, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_RET+BPF_K, 17) + }; + + bpfjit_func_t code; + uint8_t pkt[1]; /* the program doesn't read any data */ + + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + ATF_CHECK(bpf_validate(insns, insn_count)); + + code = bpfjit_generate_code(NULL, insns, insn_count); + ATF_REQUIRE(code != NULL); + + ATF_CHECK(jitcall(code, pkt, 1, 1) == 17); + + bpfjit_free_code(code); +} + +ATF_TC(libbpfjit_bad_ret_k); +ATF_TC_HEAD(libbpfjit_bad_ret_k, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that JIT compilation of a program with bad BPF_RET fails"); +} + +ATF_TC_BODY(libbpfjit_bad_ret_k, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_RET+BPF_K+0x8000, 13) + }; + + bpfjit_func_t code; + uint8_t pkt[1]; /* the program doesn't read any data */ + + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + /* + * The point of this test is checking a bad instruction of + * a valid class and with a valid BPF_RVAL data. + */ + const uint16_t rcode = insns[0].code; + ATF_CHECK(BPF_CLASS(rcode) == BPF_RET && + (BPF_RVAL(rcode) == BPF_K || BPF_RVAL(rcode) == BPF_A)); + + ATF_CHECK(!bpf_validate(insns, insn_count)); + + /* Current implementation generates code. */ + code = bpfjit_generate_code(NULL, insns, insn_count); + ATF_REQUIRE(code != NULL); + + ATF_CHECK(jitcall(code, pkt, 1, 1) == 13); + + bpfjit_free_code(code); +} + ATF_TC(libbpfjit_alu_add_k); ATF_TC_HEAD(libbpfjit_alu_add_k, tc) { @@ -4430,6 +4495,8 @@ ATF_TP_ADD_TCS(tp) * to ../../net/bpfjit/t_bpfjit.c */ ATF_TP_ADD_TC(tp, libbpfjit_empty); + ATF_TP_ADD_TC(tp, libbpfjit_ret_k); + ATF_TP_ADD_TC(tp, libbpfjit_bad_ret_k); ATF_TP_ADD_TC(tp, libbpfjit_alu_add_k); ATF_TP_ADD_TC(tp, libbpfjit_alu_sub_k); ATF_TP_ADD_TC(tp, libbpfjit_alu_mul_k);
CVS commit: src/tests/net/bpfjit
Module Name:src Committed By: alnsn Date: Wed Feb 11 22:37:55 UTC 2015 Modified Files: src/tests/net/bpfjit: t_bpfjit.c Log Message: Add bpfjit_ret_k, bpfjit_bad_ret_k, bpfjit_jmp_ja_invalid tests. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/net/bpfjit/t_bpfjit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/bpfjit/t_bpfjit.c diff -u src/tests/net/bpfjit/t_bpfjit.c:1.4 src/tests/net/bpfjit/t_bpfjit.c:1.5 --- src/tests/net/bpfjit/t_bpfjit.c:1.4 Thu Nov 20 11:36:13 2014 +++ src/tests/net/bpfjit/t_bpfjit.c Wed Feb 11 22:37:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfjit.c,v 1.4 2014/11/20 11:36:13 alnsn Exp $ */ +/* $NetBSD: t_bpfjit.c,v 1.5 2015/02/11 22:37:55 alnsn Exp $ */ /*- * Copyright (c) 2011-2012, 2014 Alexander Nasonov. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_bpfjit.c,v 1.4 2014/11/20 11:36:13 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfjit.c,v 1.5 2015/02/11 22:37:55 alnsn Exp $"); #include #include @@ -79,15 +79,73 @@ ATF_TC_HEAD(bpfjit_empty, tc) ATF_TC_BODY(bpfjit_empty, tc) { struct bpf_insn dummy; - bpfjit_func_t fn; + bpfjit_func_t code; RZ(rump_init()); + ATF_CHECK(!prog_validate(&dummy, 0)); + rump_schedule(); - fn = rumpns_bpfjit_generate_code(NULL, &dummy, 0); + code = rumpns_bpfjit_generate_code(NULL, &dummy, 0); rump_unschedule(); - ATF_CHECK(fn == NULL); + ATF_CHECK(code == NULL); +} + +ATF_TC(bpfjit_ret_k); +ATF_TC_HEAD(bpfjit_ret_k, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test JIT compilation of a trivial bpf program"); +} + +ATF_TC_BODY(bpfjit_ret_k, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_RET+BPF_K, 17) + }; + + uint8_t pkt[1]; /* the program doesn't read any data */ + + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + RZ(rump_init()); + + ATF_CHECK(prog_validate(insns, insn_count)); + ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 17); +} + +ATF_TC(bpfjit_bad_ret_k); +ATF_TC_HEAD(bpfjit_bad_ret_k, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test that JIT compilation of a program with bad BPF_RET fails"); +} + +ATF_TC_BODY(bpfjit_bad_ret_k, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_RET+BPF_K+0x8000, 13) + }; + + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + uint8_t pkt[1]; /* the program doesn't read any data */ + + /* + * The point of this test is checking a bad instruction of + * a valid class and with a valid BPF_RVAL data. + */ + const uint16_t rcode = insns[0].code; + ATF_CHECK(BPF_CLASS(rcode) == BPF_RET && + (BPF_RVAL(rcode) == BPF_K || BPF_RVAL(rcode) == BPF_A)); + + RZ(rump_init()); + + ATF_CHECK(!prog_validate(insns, insn_count)); + + /* Current implementation generates code. */ + ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == 13); } ATF_TC(bpfjit_alu_add_k); @@ -1612,6 +1670,36 @@ ATF_TC_BODY(bpfjit_jmp_ja, tc) ATF_CHECK(exec_prog(insns, insn_count, pkt, 1) == UINT32_MAX); } +ATF_TC(bpfjit_jmp_ja_invalid); +ATF_TC_HEAD(bpfjit_jmp_ja_invalid, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test BPF_JMP+BPF_JA to invalid destination"); +} + +ATF_TC_BODY(bpfjit_jmp_ja_invalid, tc) +{ + static struct bpf_insn insns[] = { + BPF_STMT(BPF_JMP+BPF_JA, 4), + BPF_STMT(BPF_RET+BPF_K, 0), + BPF_STMT(BPF_RET+BPF_K, 1), + BPF_STMT(BPF_RET+BPF_K, 2), + BPF_STMT(BPF_RET+BPF_K, 3), + }; + + bpfjit_func_t code; + size_t insn_count = sizeof(insns) / sizeof(insns[0]); + + RZ(rump_init()); + + ATF_CHECK(!prog_validate(insns, insn_count)); + + rump_schedule(); + code = rumpns_bpfjit_generate_code(NULL, insns, insn_count); + rump_unschedule(); + ATF_CHECK(code == NULL); +} + ATF_TC(bpfjit_jmp_jgt_k); ATF_TC_HEAD(bpfjit_jmp_jgt_k, tc) { @@ -4344,6 +4432,8 @@ ATF_TP_ADD_TCS(tp) * to ../../lib/libbpfjit/t_bpfjit.c */ ATF_TP_ADD_TC(tp, bpfjit_empty); + ATF_TP_ADD_TC(tp, bpfjit_ret_k); + ATF_TP_ADD_TC(tp, bpfjit_bad_ret_k); ATF_TP_ADD_TC(tp, bpfjit_alu_add_k); ATF_TP_ADD_TC(tp, bpfjit_alu_sub_k); ATF_TP_ADD_TC(tp, bpfjit_alu_mul_k); @@ -4400,6 +4490,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, bpfjit_alu_modulo_x); ATF_TP_ADD_TC(tp, bpfjit_alu_neg); ATF_TP_ADD_TC(tp, bpfjit_jmp_ja); + ATF_TP_ADD_TC(tp, bpfjit_jmp_ja_invalid); ATF_TP_ADD_TC(tp, bpfjit_jmp_jgt_k); ATF_TP_ADD_TC(tp, bpfjit_jmp_jge_k); ATF_TP_ADD_TC(tp, bpfjit_jmp_jeq_k);
CVS commit: src/doc
Module Name:src Committed By: riastradh Date: Wed Feb 11 20:12:22 UTC 2015 Modified Files: src/doc: 3RDPARTY Log Message: Document drm crap in 3RDPARTY. To generate a diff of this commit: cvs rdiff -u -r1.1203 -r1.1204 src/doc/3RDPARTY Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1203 src/doc/3RDPARTY:1.1204 --- src/doc/3RDPARTY:1.1203 Mon Feb 9 21:59:30 2015 +++ src/doc/3RDPARTY Wed Feb 11 20:12:22 2015 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1203 2015/02/09 21:59:30 wiz Exp $ +# $NetBSD: 3RDPARTY,v 1.1204 2015/02/11 20:12:22 riastradh Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -317,6 +317,31 @@ Notes: Please submit all changes to the author. The distribution doesn't include the Linux specific bits or build system. +Package: drm +Version: Linux 3.15 +Current Vers: ? +Maintainer:Intel, AMD, Linux kernel developers +Archive Site: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git +Home Page: http://dri.freedesktop.org/ +Mailing List: dri-de...@lists.freedesktop.org +Responsible: riastradh +License: BSD +Location: sys/external/bsd/drm2/dist +Notes: +Graphics drivers. Talk to riastradh@ about updates. When importing +from Linux, we map + drivers/gpu/drm -> sys/external/bsd/drm2/dist/drm + include/drm -> sys/external/bsd/drm2/dist/include/drm + include/uapi/drm -> sys/external/bsd/drm2/dist/uapi/drm +GPL sources are excluded. In the future, we may import them into +external/gpl2/drm2 and build them as kernel modules. Nouveau sources +(drivers/gpu/drm/nouveau in Linux) must first be processed with the +script sys/external/bsd/drm2/nouveau/nouveau2netbsd, about which see +the source for details. +Vendor tag:LINUX +Release tag: linux-X-Y(-rcZ)-drm-bsd + (nouveau got reimported as linux-3-15-drm-bsd-reimport-nouveau) + Package: gmake Version: 3.81 Current Vers: 4.0
CVS commit: src/tests/net/bpfilter
Module Name:src Committed By: alnsn Date: Wed Feb 11 19:37:37 UTC 2015 Modified Files: src/tests/net/bpfilter: t_bpfilter.c Log Message: Add bpfilterbadjmp and bpfilterbadret tests. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/net/bpfilter/t_bpfilter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/bpfilter/t_bpfilter.c diff -u src/tests/net/bpfilter/t_bpfilter.c:1.8 src/tests/net/bpfilter/t_bpfilter.c:1.9 --- src/tests/net/bpfilter/t_bpfilter.c:1.8 Tue Jun 24 11:32:36 2014 +++ src/tests/net/bpfilter/t_bpfilter.c Wed Feb 11 19:37:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfilter.c,v 1.8 2014/06/24 11:32:36 alnsn Exp $ */ +/* $NetBSD: t_bpfilter.c,v 1.9 2015/02/11 19:37:37 alnsn Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_bpfilter.c,v 1.8 2014/06/24 11:32:36 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfilter.c,v 1.9 2015/02/11 19:37:37 alnsn Exp $"); #include #include @@ -115,6 +115,15 @@ static struct bpf_insn noinitX_prog[] = BPF_STMT(BPF_RET+BPF_A, 0), }; +static struct bpf_insn badjmp_prog[] = { + BPF_STMT(BPF_JMP+BPF_JA, 5), + BPF_STMT(BPF_RET+BPF_A, 0), +}; + +static struct bpf_insn badret_prog[] = { + BPF_STMT(BPF_RET+BPF_A+0x8000, 0), +}; + static uint16_t in_cksum(void *data, size_t len) { @@ -387,6 +396,52 @@ ATF_TC_BODY(bpfilternoinitX, tc) RL(send_bpf_prog("bpfilternoinitX", &prog)); } +ATF_TC(bpfilterbadjmp); +ATF_TC_HEAD(bpfilterbadjmp, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Checks that bpf program that " + "jumps to invalid destination is rejected by the kernel"); + atf_tc_set_md_var(tc, "timeout", "30"); +} + +ATF_TC_BODY(bpfilterbadjmp, tc) +{ + struct bpf_program prog; + + prog.bf_len = __arraycount(badjmp_prog); + prog.bf_insns = badjmp_prog; + ATF_CHECK_ERRNO(EINVAL, send_bpf_prog("bpfilterbadjmp", &prog) == -1); +} + +ATF_TC(bpfilterbadret); +ATF_TC_HEAD(bpfilterbadret, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Checks that bpf program that " + "ends with invalid BPF_RET instruction is rejected by the kernel"); + atf_tc_set_md_var(tc, "timeout", "30"); +} + +ATF_TC_BODY(bpfilterbadret, tc) +{ + struct bpf_program prog; + struct bpf_insn *last; + + prog.bf_len = __arraycount(badret_prog); + prog.bf_insns = badret_prog; + + /* + * The point of this test is checking a bad instruction of + * a valid class and with a valid BPF_RVAL data. + */ + last = &prog.bf_insns[prog.bf_len - 1]; + ATF_CHECK(BPF_CLASS(last->code) == BPF_RET && + (BPF_RVAL(last->code) == BPF_K || BPF_RVAL(last->code) == BPF_A)); + + ATF_CHECK_ERRNO(EINVAL, send_bpf_prog("bpfilterbadret", &prog) == -1); +} + ATF_TP_ADD_TCS(tp) { @@ -395,6 +450,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, bpfilterbadmem); ATF_TP_ADD_TC(tp, bpfilternoinitA); ATF_TP_ADD_TC(tp, bpfilternoinitX); + ATF_TP_ADD_TC(tp, bpfilterbadjmp); + ATF_TP_ADD_TC(tp, bpfilterbadret); return atf_no_error(); }
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 15:43:38 UTC 2015 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.6 Log Message: Ticket #1948 To generate a diff of this commit: cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-5.1.6 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1.6 diff -u src/doc/CHANGES-5.1.6:1.1.2.15 src/doc/CHANGES-5.1.6:1.1.2.16 --- src/doc/CHANGES-5.1.6:1.1.2.15 Wed Feb 11 15:35:07 2015 +++ src/doc/CHANGES-5.1.6 Wed Feb 11 15:43:38 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.6,v 1.1.2.15 2015/02/11 15:35:07 martin Exp $ +# $NetBSD: CHANGES-5.1.6,v 1.1.2.16 2015/02/11 15:43:38 martin Exp $ A complete list of changes from the NetBSD 5.1.5 release to the NetBSD 5.1.6 release: @@ -2535,3 +2535,8 @@ xfree/xc/programs/Xserver/xkb/xkb.c 1.2 Information leak in the XkbSetGeometry request of X servers. [mrg, ticket #1949] +sys/dev/usb/usbdi.c1.163 (via patch) + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #1948] +
CVS commit: [netbsd-5-2] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 15:43:00 UTC 2015 Modified Files: src/doc [netbsd-5-2]: CHANGES-5.2.4 Log Message: Ticket #1948 To generate a diff of this commit: cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-5.2.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.2.4 diff -u src/doc/CHANGES-5.2.4:1.1.2.15 src/doc/CHANGES-5.2.4:1.1.2.16 --- src/doc/CHANGES-5.2.4:1.1.2.15 Wed Feb 11 15:34:30 2015 +++ src/doc/CHANGES-5.2.4 Wed Feb 11 15:43:00 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2.4,v 1.1.2.15 2015/02/11 15:34:30 martin Exp $ +# $NetBSD: CHANGES-5.2.4,v 1.1.2.16 2015/02/11 15:43:00 martin Exp $ A complete list of changes from the NetBSD 5.2.3 release to the NetBSD 5.2.4 release: @@ -2535,3 +2535,8 @@ xfree/xc/programs/Xserver/xkb/xkb.c 1.2 Information leak in the XkbSetGeometry request of X servers. [mrg, ticket #1949] +sys/dev/usb/usbdi.c1.163 (via patch) + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #1948] +
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 15:42:19 UTC 2015 Modified Files: src/doc [netbsd-5]: CHANGES-5.3 Log Message: Ticket #1948 To generate a diff of this commit: cvs rdiff -u -r1.1.2.97 -r1.1.2.98 src/doc/CHANGES-5.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-5.3 diff -u src/doc/CHANGES-5.3:1.1.2.97 src/doc/CHANGES-5.3:1.1.2.98 --- src/doc/CHANGES-5.3:1.1.2.97 Wed Feb 11 15:33:42 2015 +++ src/doc/CHANGES-5.3 Wed Feb 11 15:42:19 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.3,v 1.1.2.97 2015/02/11 15:33:42 martin Exp $ +# $NetBSD: CHANGES-5.3,v 1.1.2.98 2015/02/11 15:42:19 martin Exp $ A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3 release: @@ -3732,3 +3732,8 @@ xfree/xc/programs/Xserver/xkb/xkb.c 1.2 Information leak in the XkbSetGeometry request of X servers. [mrg, ticket #1949] +sys/dev/usb/usbdi.c1.163 (via patch) + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #1948] +
CVS commit: [netbsd-5-2] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 15:40:12 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-5-2]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #1948): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.124.4.2 -r1.124.4.2.6.1 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.124.4.2 src/sys/dev/usb/usbdi.c:1.124.4.2.6.1 --- src/sys/dev/usb/usbdi.c:1.124.4.2 Wed Jan 27 20:56:45 2010 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 15:40:12 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $ */ +/* $NetBSD: usbdi.c,v 1.124.4.2.6.1 2015/02/11 15:40:12 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.124.4.2.6.1 2015/02/11 15:40:12 martin Exp $"); #include "opt_compat_netbsd.h" @@ -773,13 +773,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("usb_transfer_complete: actlen > len %d > %d\n", xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: [netbsd-5-1] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 15:40:38 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-5-1]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #1948): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.124.4.2 -r1.124.4.2.2.1 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.124.4.2 src/sys/dev/usb/usbdi.c:1.124.4.2.2.1 --- src/sys/dev/usb/usbdi.c:1.124.4.2 Wed Jan 27 20:56:45 2010 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 15:40:38 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $ */ +/* $NetBSD: usbdi.c,v 1.124.4.2.2.1 2015/02/11 15:40:38 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.124.4.2.2.1 2015/02/11 15:40:38 martin Exp $"); #include "opt_compat_netbsd.h" @@ -773,13 +773,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("usb_transfer_complete: actlen > len %d > %d\n", xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: [netbsd-5] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 15:39:33 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-5]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #1948): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.124.4.2 -r1.124.4.3 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.124.4.2 src/sys/dev/usb/usbdi.c:1.124.4.3 --- src/sys/dev/usb/usbdi.c:1.124.4.2 Wed Jan 27 20:56:45 2010 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 15:39:33 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $ */ +/* $NetBSD: usbdi.c,v 1.124.4.3 2015/02/11 15:39:33 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.124.4.3 2015/02/11 15:39:33 martin Exp $"); #include "opt_compat_netbsd.h" @@ -773,13 +773,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("usb_transfer_complete: actlen > len %d > %d\n", xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 15:35:07 UTC 2015 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.6 Log Message: Ticket #1949 To generate a diff of this commit: cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-5.1.6 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1.6 diff -u src/doc/CHANGES-5.1.6:1.1.2.14 src/doc/CHANGES-5.1.6:1.1.2.15 --- src/doc/CHANGES-5.1.6:1.1.2.14 Wed Feb 4 04:48:10 2015 +++ src/doc/CHANGES-5.1.6 Wed Feb 11 15:35:07 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.6,v 1.1.2.14 2015/02/04 04:48:10 snj Exp $ +# $NetBSD: CHANGES-5.1.6,v 1.1.2.15 2015/02/11 15:35:07 martin Exp $ A complete list of changes from the NetBSD 5.1.5 release to the NetBSD 5.1.6 release: @@ -2528,3 +2528,10 @@ lib/libevent/buffer.cpatch Fix CVE-2014-6272. [spz, ticket #1947] +external/mit/xorg-server/dist/xkb/xkb.c 1.2 (via patch) +xfree/xc/programs/Xserver/xkb/xkb.c 1.2 (via patch) + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #1949] +
CVS commit: [netbsd-5-2] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 15:34:30 UTC 2015 Modified Files: src/doc [netbsd-5-2]: CHANGES-5.2.4 Log Message: Ticket #1949 To generate a diff of this commit: cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-5.2.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.2.4 diff -u src/doc/CHANGES-5.2.4:1.1.2.14 src/doc/CHANGES-5.2.4:1.1.2.15 --- src/doc/CHANGES-5.2.4:1.1.2.14 Wed Feb 4 04:49:53 2015 +++ src/doc/CHANGES-5.2.4 Wed Feb 11 15:34:30 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2.4,v 1.1.2.14 2015/02/04 04:49:53 snj Exp $ +# $NetBSD: CHANGES-5.2.4,v 1.1.2.15 2015/02/11 15:34:30 martin Exp $ A complete list of changes from the NetBSD 5.2.3 release to the NetBSD 5.2.4 release: @@ -2528,3 +2528,10 @@ lib/libevent/buffer.cpatch Fix CVE-2014-6272. [spz, ticket #1947] +external/mit/xorg-server/dist/xkb/xkb.c 1.2 (via patch) +xfree/xc/programs/Xserver/xkb/xkb.c 1.2 (via patch) + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #1949] +
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 15:33:42 UTC 2015 Modified Files: src/doc [netbsd-5]: CHANGES-5.3 Log Message: Ticket #1949 To generate a diff of this commit: cvs rdiff -u -r1.1.2.96 -r1.1.2.97 src/doc/CHANGES-5.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-5.3 diff -u src/doc/CHANGES-5.3:1.1.2.96 src/doc/CHANGES-5.3:1.1.2.97 --- src/doc/CHANGES-5.3:1.1.2.96 Wed Feb 4 04:47:17 2015 +++ src/doc/CHANGES-5.3 Wed Feb 11 15:33:42 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.3,v 1.1.2.96 2015/02/04 04:47:17 snj Exp $ +# $NetBSD: CHANGES-5.3,v 1.1.2.97 2015/02/11 15:33:42 martin Exp $ A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3 release: @@ -3725,3 +3725,10 @@ lib/libevent/buffer.cpatch Fix CVE-2014-6272. [spz, ticket #1947] +external/mit/xorg-server/dist/xkb/xkb.c 1.2 (via patch) +xfree/xc/programs/Xserver/xkb/xkb.c 1.2 (via patch) + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #1949] +
CVS commit: [netbsd-5-1] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 15:27:21 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-5-1]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-5-1]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1949): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.1.2.1 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.24.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1.2.1 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1 Thu Sep 17 03:35:48 2009 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 15:27:21 2015 @@ -4820,27 +4820,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= (char *)_XkbAlloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4852,6 +4855,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4901,8 +4905,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4937,7 +4947,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5172,17 +5184,19 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +for (i = 0; i < req->nProperties; i++) { + char *name, *val; +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { xfree(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { xfree(name); @@ -5211,11 +5225,11 @@ char * wire; return BadMatch;
CVS commit: [netbsd-5-2] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 15:25:55 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-5-2]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-5-2]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1949): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.1.4.1 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.30.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1.4.1 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1 Thu Sep 17 03:35:48 2009 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 15:25:55 2015 @@ -4820,27 +4820,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= (char *)_XkbAlloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4852,6 +4855,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4901,8 +4905,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4937,7 +4947,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5172,17 +5184,19 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +for (i = 0; i < req->nProperties; i++) { + char *name, *val; +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { xfree(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { xfree(name); @@ -5211,11 +5225,11 @@ char * wire; return BadMatch;
CVS commit: [netbsd-5] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 15:24:52 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-5]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-5]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1949): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.20.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.2 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.1.2.1 Thu Sep 17 03:35:48 2009 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 15:24:52 2015 @@ -4820,27 +4820,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= (char *)_XkbAlloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4852,6 +4855,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4901,8 +4905,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4937,7 +4947,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5172,17 +5184,19 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +for (i = 0; i < req->nProperties; i++) { + char *name, *val; +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { xfree(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { xfree(name); @@ -5211,11 +5225,11 @@ char * wire; return BadMatch; } -for
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: riastradh Date: Wed Feb 11 15:19:05 UTC 2015 Modified Files: src/lib/libc/stdio: fopen.3 Log Message: Use Pq to avoid space before O_EXCL. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/lib/libc/stdio/fopen.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdio/fopen.3 diff -u src/lib/libc/stdio/fopen.3:1.29 src/lib/libc/stdio/fopen.3:1.30 --- src/lib/libc/stdio/fopen.3:1.29 Thu Nov 15 03:50:36 2012 +++ src/lib/libc/stdio/fopen.3 Wed Feb 11 15:19:05 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: fopen.3,v 1.29 2012/11/15 03:50:36 christos Exp $ +.\" $NetBSD: fopen.3,v 1.30 2015/02/11 15:19:05 riastradh Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -120,8 +120,8 @@ extension. .It Sq x The letter .Sq x -in the mode turns on exclusive open mode to the file ( -.Dv O_EXCL ) +in the mode turns on exclusive open mode to the file +.Pq Dv O_EXCL which means that the file will not be created if it already exists. .El .Pp
CVS commit: [netbsd-6-0] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 14:58:57 UTC 2015 Modified Files: src/doc [netbsd-6-0]: CHANGES-6.0.7 Log Message: Ticket #1253 To generate a diff of this commit: cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-6.0.7 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-6.0.7 diff -u src/doc/CHANGES-6.0.7:1.1.2.27 src/doc/CHANGES-6.0.7:1.1.2.28 --- src/doc/CHANGES-6.0.7:1.1.2.27 Wed Feb 11 14:42:39 2015 +++ src/doc/CHANGES-6.0.7 Wed Feb 11 14:58:56 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0.7,v 1.1.2.27 2015/02/11 14:42:39 martin Exp $ +# $NetBSD: CHANGES-6.0.7,v 1.1.2.28 2015/02/11 14:58:56 martin Exp $ A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7 release: @@ -4309,3 +4309,11 @@ sys/dev/usb/usbdi.c1.163 (via patch) Clip xfer->actlen also in the !DIAGNOSTIC case. [aymeric, ticket #1250] +external/mit/xorg-server/dist/xkb/xkb.c 1.2 (via patch) +xfree/xc/programs/Xserver/xkb/xkb.c 1.2 (via patch) + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #1253] + +
CVS commit: [netbsd-6-1] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 14:57:55 UTC 2015 Modified Files: src/doc [netbsd-6-1]: CHANGES-6.1.6 Log Message: Ticket #1253 To generate a diff of this commit: cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-6.1.6 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-6.1.6 diff -u src/doc/CHANGES-6.1.6:1.1.2.27 src/doc/CHANGES-6.1.6:1.1.2.28 --- src/doc/CHANGES-6.1.6:1.1.2.27 Wed Feb 11 14:41:59 2015 +++ src/doc/CHANGES-6.1.6 Wed Feb 11 14:57:55 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.1.6,v 1.1.2.27 2015/02/11 14:41:59 martin Exp $ +# $NetBSD: CHANGES-6.1.6,v 1.1.2.28 2015/02/11 14:57:55 martin Exp $ A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6 release: @@ -4043,3 +4043,11 @@ sys/dev/usb/usbdi.c1.163 (via patch) Clip xfer->actlen also in the !DIAGNOSTIC case. [aymeric, ticket #1250] +external/mit/xorg-server/dist/xkb/xkb.c 1.2 (via patch) +xfree/xc/programs/Xserver/xkb/xkb.c 1.2 (via patch) + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #1253] + +
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 14:56:58 UTC 2015 Modified Files: src/doc [netbsd-6]: CHANGES-6.2 Log Message: Tickets #1251 and #1253 To generate a diff of this commit: cvs rdiff -u -r1.1.2.193 -r1.1.2.194 src/doc/CHANGES-6.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-6.2 diff -u src/doc/CHANGES-6.2:1.1.2.193 src/doc/CHANGES-6.2:1.1.2.194 --- src/doc/CHANGES-6.2:1.1.2.193 Wed Feb 11 14:41:03 2015 +++ src/doc/CHANGES-6.2 Wed Feb 11 14:56:58 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.2,v 1.1.2.193 2015/02/11 14:41:03 martin Exp $ +# $NetBSD: CHANGES-6.2,v 1.1.2.194 2015/02/11 14:56:58 martin Exp $ A complete list of changes from the 6.1 release until the 6.2 release: @@ -9568,3 +9568,17 @@ sys/dev/usb/usbdi.c1.163 (via patch) Clip xfer->actlen also in the !DIAGNOSTIC case. [aymeric, ticket #1250] +usr.bin/passwd/Makefile1.43-1.44 + + Don't build kpasswd; heimdal does it for us. + Keep the built-in support for passwd -k, but don't make the + kpasswd link or install the kpasswd man page. + [aymeric, ticket #1251] + +external/mit/xorg-server/dist/xkb/xkb.c 1.2 (via patch) +xfree/xc/programs/Xserver/xkb/xkb.c 1.2 (via patch) + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #1253] +
CVS commit: [netbsd-6-0] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 14:54:21 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-6-0]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-6-0]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1253): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.6 -r1.1.1.6.4.1 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.28.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6.4.1 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6 Tue Aug 2 06:57:06 2011 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 14:54:21 2015 @@ -4839,27 +4839,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= malloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4871,6 +4874,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4920,8 +4924,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4956,7 +4966,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5191,17 +5203,20 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; + +for (i = 0; i < req->nProperties; i++) { + char *name, *val; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { free(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { free(name); @@ -5230,11 +5245,11 @@ char * wire; return BadMatch; } -for (i=0;inColors;i++)
CVS commit: [netbsd-6-1] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 14:53:21 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-6-1]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-6-1]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1253): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.6 -r1.1.1.6.6.1 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.32.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6.6.1 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6 Tue Aug 2 06:57:06 2011 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 14:53:21 2015 @@ -4839,27 +4839,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= malloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4871,6 +4874,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4920,8 +4924,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4956,7 +4966,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5191,17 +5203,20 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; + +for (i = 0; i < req->nProperties; i++) { + char *name, *val; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { free(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { free(name); @@ -5230,11 +5245,11 @@ char * wire; return BadMatch; } -for (i=0;inColors;i++)
CVS commit: [netbsd-6] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 14:50:44 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-6]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-6]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1253): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.26.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6.2.1 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.6 Tue Aug 2 06:57:06 2011 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 14:50:44 2015 @@ -4839,27 +4839,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= malloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4871,6 +4874,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4920,8 +4924,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4956,7 +4966,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5191,17 +5203,20 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; + +for (i = 0; i < req->nProperties; i++) { + char *name, *val; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { free(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { free(name); @@ -5230,11 +5245,11 @@ char * wire; return BadMatch; } -for (i=0;inColors;i++) { +
CVS commit: [netbsd-6] src/usr.bin/passwd
Module Name:src Committed By: martin Date: Wed Feb 11 14:46:36 UTC 2015 Modified Files: src/usr.bin/passwd [netbsd-6]: Makefile Log Message: Pull up following revision(s) (requested by aymeric in ticket #1251): usr.bin/passwd/Makefile: revision 1.43,1.44 don't build kpasswd; heimdal does it for us. Keep the built-in support for passwd -k, but don't make the kpasswd link or install the kpasswd man page. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.42.6.1 src/usr.bin/passwd/Makefile 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/passwd/Makefile diff -u src/usr.bin/passwd/Makefile:1.42 src/usr.bin/passwd/Makefile:1.42.6.1 --- src/usr.bin/passwd/Makefile:1.42 Sun Apr 24 21:42:06 2011 +++ src/usr.bin/passwd/Makefile Wed Feb 11 14:46:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.42 2011/04/24 21:42:06 elric Exp $ +# $NetBSD: Makefile,v 1.42.6.1 2015/02/11 14:46:36 martin Exp $ # from: @(#)Makefile8.3 (Berkeley) 4/2/94 .include @@ -31,9 +31,11 @@ SRCS+= krb5_passwd.c DPADD+= ${LIBKRB5} ${LIBCRYPTO} ${LIBASN1} ${LIBCOM_ERR} ${LIBROKEN} ${LIBCRYPT} LDADD+= -lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lcrypt +.ifdef OVERRIDE_HEIMDAL_KPASSWD LINKS+= ${BINDIR}/passwd ${BINDIR}/kpasswd MAN+= kpasswd.1 .endif +.endif .if (${USE_PAM} != "no") CPPFLAGS+=-DUSE_PAM
CVS commit: [netbsd-6-0] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 14:42:40 UTC 2015 Modified Files: src/doc [netbsd-6-0]: CHANGES-6.0.7 Log Message: Ticket #1250 To generate a diff of this commit: cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/doc/CHANGES-6.0.7 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-6.0.7 diff -u src/doc/CHANGES-6.0.7:1.1.2.26 src/doc/CHANGES-6.0.7:1.1.2.27 --- src/doc/CHANGES-6.0.7:1.1.2.26 Wed Feb 4 04:55:51 2015 +++ src/doc/CHANGES-6.0.7 Wed Feb 11 14:42:39 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0.7,v 1.1.2.26 2015/02/04 04:55:51 snj Exp $ +# $NetBSD: CHANGES-6.0.7,v 1.1.2.27 2015/02/11 14:42:39 martin Exp $ A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7 release: @@ -4304,3 +4304,8 @@ external/bsd/libevent/dist/buffer.c Fix CVE-2014-6272. [spz, ticket #1243] +sys/dev/usb/usbdi.c1.163 (via patch) + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #1250] +
CVS commit: [netbsd-6-1] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 14:41:59 UTC 2015 Modified Files: src/doc [netbsd-6-1]: CHANGES-6.1.6 Log Message: Ticket #1250 To generate a diff of this commit: cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/doc/CHANGES-6.1.6 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-6.1.6 diff -u src/doc/CHANGES-6.1.6:1.1.2.26 src/doc/CHANGES-6.1.6:1.1.2.27 --- src/doc/CHANGES-6.1.6:1.1.2.26 Wed Feb 4 04:55:02 2015 +++ src/doc/CHANGES-6.1.6 Wed Feb 11 14:41:59 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.1.6,v 1.1.2.26 2015/02/04 04:55:02 snj Exp $ +# $NetBSD: CHANGES-6.1.6,v 1.1.2.27 2015/02/11 14:41:59 martin Exp $ A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6 release: @@ -4038,3 +4038,8 @@ external/bsd/libevent/dist/buffer.c pat Fix CVE-2014-6272. [spz, ticket #1243] +sys/dev/usb/usbdi.c1.163 (via patch) + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #1250] +
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 14:41:03 UTC 2015 Modified Files: src/doc [netbsd-6]: CHANGES-6.2 Log Message: Tickets #1249 and #1250 To generate a diff of this commit: cvs rdiff -u -r1.1.2.192 -r1.1.2.193 src/doc/CHANGES-6.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-6.2 diff -u src/doc/CHANGES-6.2:1.1.2.192 src/doc/CHANGES-6.2:1.1.2.193 --- src/doc/CHANGES-6.2:1.1.2.192 Wed Feb 4 11:38:31 2015 +++ src/doc/CHANGES-6.2 Wed Feb 11 14:41:03 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.2,v 1.1.2.192 2015/02/04 11:38:31 martin Exp $ +# $NetBSD: CHANGES-6.2,v 1.1.2.193 2015/02/11 14:41:03 martin Exp $ A complete list of changes from the 6.1 release until the 6.2 release: @@ -9557,3 +9557,14 @@ libexec/httpd/bozohttpd.c 1.61 EACCES as well. [snj, ticket #1246] +usr.bin/netstat/inet.c1.106 +usr.bin/netstat/inet6.c1.68 + + Allocate the right size for pcb blocks. + [christos, ticket #1249] + +sys/dev/usb/usbdi.c1.163 (via patch) + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #1250] +
CVS commit: [netbsd-6-0] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 14:38:25 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-6-0]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #1250): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.134.8.1 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.134 src/sys/dev/usb/usbdi.c:1.134.8.1 --- src/sys/dev/usb/usbdi.c:1.134 Sun Nov 27 03:25:00 2011 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 14:38:25 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.134 2011/11/27 03:25:00 jmcneill Exp $ */ +/* $NetBSD: usbdi.c,v 1.134.8.1 2015/02/11 14:38:25 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134 2011/11/27 03:25:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.8.1 2015/02/11 14:38:25 martin Exp $"); #include "opt_compat_netbsd.h" #include "opt_usb.h" @@ -780,13 +780,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("usb_transfer_complete: actlen > len %d > %d\n", xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: [netbsd-6-1] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 14:36:15 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-6-1]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #1250): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.134.10.1 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.134 src/sys/dev/usb/usbdi.c:1.134.10.1 --- src/sys/dev/usb/usbdi.c:1.134 Sun Nov 27 03:25:00 2011 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 14:36:15 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.134 2011/11/27 03:25:00 jmcneill Exp $ */ +/* $NetBSD: usbdi.c,v 1.134.10.1 2015/02/11 14:36:15 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134 2011/11/27 03:25:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.10.1 2015/02/11 14:36:15 martin Exp $"); #include "opt_compat_netbsd.h" #include "opt_usb.h" @@ -780,13 +780,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("usb_transfer_complete: actlen > len %d > %d\n", xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: [netbsd-6] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 14:35:13 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-6]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #1250): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.134.4.1 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.134 src/sys/dev/usb/usbdi.c:1.134.4.1 --- src/sys/dev/usb/usbdi.c:1.134 Sun Nov 27 03:25:00 2011 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 14:35:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.134 2011/11/27 03:25:00 jmcneill Exp $ */ +/* $NetBSD: usbdi.c,v 1.134.4.1 2015/02/11 14:35:13 martin Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134 2011/11/27 03:25:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.4.1 2015/02/11 14:35:13 martin Exp $"); #include "opt_compat_netbsd.h" #include "opt_usb.h" @@ -780,13 +780,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("usb_transfer_complete: actlen > len %d > %d\n", xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: [netbsd-6] src/usr.bin/netstat
Module Name:src Committed By: martin Date: Wed Feb 11 14:04:19 UTC 2015 Modified Files: src/usr.bin/netstat [netbsd-6]: inet.c inet6.c Log Message: Pull up following revision(s) (requested by christos in ticket #1249): usr.bin/netstat/inet.c: revision 1.106 usr.bin/netstat/inet6.c: revision 1.68 Allocate the right size for pcb blocks. To generate a diff of this commit: cvs rdiff -u -r1.101.2.1 -r1.101.2.2 src/usr.bin/netstat/inet.c cvs rdiff -u -r1.59.6.1 -r1.59.6.2 src/usr.bin/netstat/inet6.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/netstat/inet.c diff -u src/usr.bin/netstat/inet.c:1.101.2.1 src/usr.bin/netstat/inet.c:1.101.2.2 --- src/usr.bin/netstat/inet.c:1.101.2.1 Mon Jul 29 06:11:02 2013 +++ src/usr.bin/netstat/inet.c Wed Feb 11 14:04:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: inet.c,v 1.101.2.1 2013/07/29 06:11:02 msaitoh Exp $ */ +/* $NetBSD: inet.c,v 1.101.2.2 2015/02/11 14:04:19 martin Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -__RCSID("$NetBSD: inet.c,v 1.101.2.1 2013/07/29 06:11:02 msaitoh Exp $"); +__RCSID("$NetBSD: inet.c,v 1.101.2.2 2015/02/11 14:04:19 martin Exp $"); #endif #endif /* not lint */ @@ -284,7 +284,7 @@ getpcblist_kmem(u_long off, const char * (struct inpcb *)&((struct inpcbtable *)off)->inpt_queue.cqh_first; next = (struct inpcb *)table.inpt_queue.cqh_first; - if ((pcblist = malloc(size)) == NULL) + if ((pcblist = malloc(size * sizeof(*pcblist))) == NULL) err(1, "malloc"); i = 0; @@ -319,7 +319,9 @@ getpcblist_kmem(u_long off, const char * pcblist[i].ki_tstate = tcpcb.t_state; pcblist[i].ki_pflags = inpcb.inp_flags; if (i++ == size) { - struct kinfo_pcb *n = realloc(pcblist, size += 100); + size += 100; + struct kinfo_pcb *n = realloc(pcblist, + size * sizeof(*pcblist)); if (n == NULL) err(1, "realloc"); pcblist = n; Index: src/usr.bin/netstat/inet6.c diff -u src/usr.bin/netstat/inet6.c:1.59.6.1 src/usr.bin/netstat/inet6.c:1.59.6.2 --- src/usr.bin/netstat/inet6.c:1.59.6.1 Mon Jul 29 06:11:02 2013 +++ src/usr.bin/netstat/inet6.c Wed Feb 11 14:04:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: inet6.c,v 1.59.6.1 2013/07/29 06:11:02 msaitoh Exp $ */ +/* $NetBSD: inet6.c,v 1.59.6.2 2015/02/11 14:04:19 martin Exp $ */ /* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ /* @@ -64,7 +64,7 @@ #if 0 static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -__RCSID("$NetBSD: inet6.c,v 1.59.6.1 2013/07/29 06:11:02 msaitoh Exp $"); +__RCSID("$NetBSD: inet6.c,v 1.59.6.2 2015/02/11 14:04:19 martin Exp $"); #endif #endif /* not lint */ @@ -295,7 +295,7 @@ getpcblist_kmem(u_long off, const char * (struct in6pcb *)&((struct inpcbtable *)off)->inpt_queue.cqh_first; next = (struct in6pcb *)table.inpt_queue.cqh_first; - if ((pcblist = malloc(size)) == NULL) + if ((pcblist = malloc(size * sizeof(*pcblist))) == NULL) err(1, "malloc"); i = 0; @@ -334,7 +334,9 @@ getpcblist_kmem(u_long off, const char * memcpy(&pcblist[i].ki_d, &sin6, sizeof(sin6)); pcblist[i].ki_tstate = tcpcb.t_state; if (i++ == size) { - struct kinfo_pcb *n = realloc(pcblist, size += 100); + size += 100; + struct kinfo_pcb *n = realloc(pcblist, + size * sizeof(*pcblist)); if (n == NULL) err(1, "realloc"); pcblist = n;
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 13:00:59 UTC 2015 Modified Files: src/doc [netbsd-7]: CHANGES-7.0 Log Message: Ticket #508 To generate a diff of this commit: cvs rdiff -u -r1.1.2.202 -r1.1.2.203 src/doc/CHANGES-7.0 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 diff -u src/doc/CHANGES-7.0:1.1.2.202 src/doc/CHANGES-7.0:1.1.2.203 --- src/doc/CHANGES-7.0:1.1.2.202 Wed Feb 11 10:30:41 2015 +++ src/doc/CHANGES-7.0 Wed Feb 11 13:00:59 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0,v 1.1.2.202 2015/02/11 10:30:41 martin Exp $ +# $NetBSD: CHANGES-7.0,v 1.1.2.203 2015/02/11 13:00:59 martin Exp $ A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014 until the 7.0 release: @@ -15789,3 +15789,9 @@ xsrc/xfree/xc/programs/Xserver/xkb/xkb.c Information leak in the XkbSetGeometry request of X servers. [mrg, ticket #507] +libexec/getty/ttys.51.19 + + Update the example to use dty00 instead of ttyd0 to reflect + current practice. + [aymeric, ticket #508] +
CVS commit: [netbsd-7] src/libexec/getty
Module Name:src Committed By: martin Date: Wed Feb 11 12:59:50 UTC 2015 Modified Files: src/libexec/getty [netbsd-7]: ttys.5 Log Message: Pull up following revision(s) (requested by aymeric in ticket #508): libexec/getty/ttys.5: revision 1.19 update the example to use dty00 instead of ttyd0 to reflect a current practice To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.18.10.1 src/libexec/getty/ttys.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/getty/ttys.5 diff -u src/libexec/getty/ttys.5:1.18 src/libexec/getty/ttys.5:1.18.10.1 --- src/libexec/getty/ttys.5:1.18 Sat Apr 21 12:27:28 2012 +++ src/libexec/getty/ttys.5 Wed Feb 11 12:59:49 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: ttys.5,v 1.18 2012/04/21 12:27:28 roy Exp $ +.\" $NetBSD: ttys.5,v 1.18.10.1 2015/02/11 12:59:49 martin Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -199,7 +199,7 @@ program must be run for changes in those # root login on console at 1200 baud console "/usr/libexec/getty std.1200" vt100 on secure # dialup at 1200 baud, no root logins -ttyd0 "/usr/libexec/getty d1200" dialup on # 555-1234 +dty00 "/usr/libexec/getty d1200" dialup on # 555-1234 # Mike's terminal: hp2621 ttyh0 "/usr/libexec/getty std.9600" hp2621-nl on # 457 Evans # John's terminal: vt100
CVS commit: src/sys/net
Module Name:src Committed By: alnsn Date: Wed Feb 11 12:53:15 UTC 2015 Modified Files: src/sys/net: bpf_filter.c Log Message: Fix the build. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/net/bpf_filter.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/net/bpf_filter.c diff -u src/sys/net/bpf_filter.c:1.69 src/sys/net/bpf_filter.c:1.70 --- src/sys/net/bpf_filter.c:1.69 Wed Feb 11 12:03:30 2015 +++ src/sys/net/bpf_filter.c Wed Feb 11 12:53:15 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bpf_filter.c,v 1.69 2015/02/11 12:03:30 alnsn Exp $ */ +/* $NetBSD: bpf_filter.c,v 1.70 2015/02/11 12:53:15 alnsn Exp $ */ /*- * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.69 2015/02/11 12:03:30 alnsn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.70 2015/02/11 12:53:15 alnsn Exp $"); #if 0 #if !(defined(lint) || defined(KERNEL)) @@ -628,8 +628,8 @@ bpf_validate(const struct bpf_insn *f, i if (len > BPF_MAXINSNS) return 0; #endif - if (f[len - 1].code != BPF_RET|BPF_K && - f[len - 1].code != BPF_RET|BPF_A) { + if (f[len - 1].code != (BPF_RET|BPF_K) && + f[len - 1].code != (BPF_RET|BPF_A)) { return 0; }
CVS commit: src/sys/net
Module Name:src Committed By: alnsn Date: Wed Feb 11 12:03:30 UTC 2015 Modified Files: src/sys/net: bpf_filter.c Log Message: It's not enough to check that a class of the last instruction is BPF_RET. The opcodes in bpf_validate() must match opcodes understood by bpf_filter(). Found by afl-fuzz http://lcamtuf.coredump.cx/afl/. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/net/bpf_filter.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/net/bpf_filter.c diff -u src/sys/net/bpf_filter.c:1.68 src/sys/net/bpf_filter.c:1.69 --- src/sys/net/bpf_filter.c:1.68 Wed Nov 19 19:35:21 2014 +++ src/sys/net/bpf_filter.c Wed Feb 11 12:03:30 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bpf_filter.c,v 1.68 2014/11/19 19:35:21 christos Exp $ */ +/* $NetBSD: bpf_filter.c,v 1.69 2015/02/11 12:03:30 alnsn Exp $ */ /*- * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.68 2014/11/19 19:35:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.69 2015/02/11 12:03:30 alnsn Exp $"); #if 0 #if !(defined(lint) || defined(KERNEL)) @@ -628,8 +628,10 @@ bpf_validate(const struct bpf_insn *f, i if (len > BPF_MAXINSNS) return 0; #endif - if (BPF_CLASS(f[len - 1].code) != BPF_RET) + if (f[len - 1].code != BPF_RET|BPF_K && + f[len - 1].code != BPF_RET|BPF_A) { return 0; + } #if defined(KERNEL) || defined(_KERNEL) /* Note: only the pre-initialised is valid on startup */
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 10:30:41 UTC 2015 Modified Files: src/doc [netbsd-7]: CHANGES-7.0 Log Message: Ticket #507 To generate a diff of this commit: cvs rdiff -u -r1.1.2.201 -r1.1.2.202 src/doc/CHANGES-7.0 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 diff -u src/doc/CHANGES-7.0:1.1.2.201 src/doc/CHANGES-7.0:1.1.2.202 --- src/doc/CHANGES-7.0:1.1.2.201 Wed Feb 11 09:46:43 2015 +++ src/doc/CHANGES-7.0 Wed Feb 11 10:30:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0,v 1.1.2.201 2015/02/11 09:46:43 martin Exp $ +# $NetBSD: CHANGES-7.0,v 1.1.2.202 2015/02/11 10:30:41 martin Exp $ A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014 until the 7.0 release: @@ -15782,3 +15782,10 @@ external/mit/xorg/lib/freetype/freetype2 like the pkgsrc version does. [ryoon, ticket #504] +xsrc/external/mit/xorg-server/dist/xkb/xkb.c 1.2 +xsrc/xfree/xc/programs/Xserver/xkb/xkb.c 1.2 + + Apply fixes for CVE-2015-0255: + Information leak in the XkbSetGeometry request of X servers. + [mrg, ticket #507] +
CVS commit: [netbsd-7] xsrc
Module Name:xsrc Committed By: martin Date: Wed Feb 11 10:15:03 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb [netbsd-7]: xkb.c xsrc/xfree/xc/programs/Xserver/xkb [netbsd-7]: xkb.c Log Message: Pull up following revision(s) (requested by mrg in ticket #507): external/mit/xorg-server/dist/xkb/xkb.c: revision 1.2 xfree/xc/programs/Xserver/xkb/xkb.c: revision 1.2 apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.7 -r1.1.1.7.4.1 \ xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.1.1.6.36.1 \ xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.7 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.7.4.1 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.7 Mon Jun 3 07:34:30 2013 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 10:15:03 2015 @@ -4839,27 +4839,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= malloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4871,6 +4874,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4920,8 +4924,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4956,7 +4966,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5191,17 +5203,20 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; + +for (i = 0; i < req->nProperties; i++) { + char *name, *val; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { free(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { free(name); @@ -5230,11 +5245,11 @@ char * wire; return BadMatch; } -for (i=0;inColors;i++) { +
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Wed Feb 11 09:46:43 UTC 2015 Modified Files: src/doc [netbsd-7]: CHANGES-7.0 Log Message: Tickets #504 and #505 To generate a diff of this commit: cvs rdiff -u -r1.1.2.200 -r1.1.2.201 src/doc/CHANGES-7.0 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 diff -u src/doc/CHANGES-7.0:1.1.2.200 src/doc/CHANGES-7.0:1.1.2.201 --- src/doc/CHANGES-7.0:1.1.2.200 Wed Feb 11 08:37:00 2015 +++ src/doc/CHANGES-7.0 Wed Feb 11 09:46:43 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0,v 1.1.2.200 2015/02/11 08:37:00 snj Exp $ +# $NetBSD: CHANGES-7.0,v 1.1.2.201 2015/02/11 09:46:43 martin Exp $ A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014 until the 7.0 release: @@ -15768,3 +15768,17 @@ usr.bin/login/login_pam.c 1.24 the current naming anyway. [aymeric, ticket #506] +sys/dev/usb/usbdi.c1.163 + + Clip xfer->actlen also in the !DIAGNOSTIC case. + [aymeric, ticket #505] + +distrib/sets/lists/xcomp/mi 1.156 +external/mit/xorg/lib/freetype/Makefile 1.14 +external/mit/xorg/lib/freetype/freetype/Makefile 1.18 +external/mit/xorg/lib/freetype/freetype2.pc.in 1.3 + + Move the ft2build.h into the include/freetype2 subdirectory, + like the pkgsrc version does. + [ryoon, ticket #504] +
CVS commit: [netbsd-7] src
Module Name:src Committed By: martin Date: Wed Feb 11 09:43:58 UTC 2015 Modified Files: src/distrib/sets/lists/xcomp [netbsd-7]: mi src/external/mit/xorg/lib/freetype [netbsd-7]: Makefile freetype2.pc.in src/external/mit/xorg/lib/freetype/freetype [netbsd-7]: Makefile Log Message: Pull up following revision(s) (requested by ryoon in ticket #504): external/mit/xorg/lib/freetype/Makefile: revision 1.14 distrib/sets/lists/xcomp/mi: revision 1.156 external/mit/xorg/lib/freetype/freetype2.pc.in: revision 1.3 external/mit/xorg/lib/freetype/freetype/Makefile: revision 1.18 In recent freetype2 installation, ft2build.h should be located under include/freetype2. This change should fix non pkg-config build that uses freetype2, for example, pkgsrc/lang/openjdk8. To generate a diff of this commit: cvs rdiff -u -r1.152.2.2 -r1.152.2.3 src/distrib/sets/lists/xcomp/mi cvs rdiff -u -r1.12.4.1 -r1.12.4.2 \ src/external/mit/xorg/lib/freetype/Makefile cvs rdiff -u -r1.2 -r1.2.4.1 \ src/external/mit/xorg/lib/freetype/freetype2.pc.in cvs rdiff -u -r1.17 -r1.17.4.1 \ src/external/mit/xorg/lib/freetype/freetype/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/xcomp/mi diff -u src/distrib/sets/lists/xcomp/mi:1.152.2.2 src/distrib/sets/lists/xcomp/mi:1.152.2.3 --- src/distrib/sets/lists/xcomp/mi:1.152.2.2 Mon Jan 5 21:23:51 2015 +++ src/distrib/sets/lists/xcomp/mi Wed Feb 11 09:43:58 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.152.2.2 2015/01/05 21:23:51 martin Exp $ +# $NetBSD: mi,v 1.152.2.3 2015/02/11 09:43:58 martin Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -5745,6 +5745,7 @@ ./usr/X11R7/include/freetype2/freetype/tttables.h -unknown- obsolete ./usr/X11R7/include/freetype2/freetype/tttags.h -unknown- obsolete ./usr/X11R7/include/freetype2/freetype/ttunpat.h -unknown- obsolete +./usr/X11R7/include/freetype2/ft2build.h -unknown- xorg ./usr/X11R7/include/freetype2/ftadvanc.h -unknown- xorg ./usr/X11R7/include/freetype2/ftautoh.h -unknown- xorg ./usr/X11R7/include/freetype2/ftbbox.h -unknown- xorg @@ -5788,7 +5789,7 @@ ./usr/X11R7/include/freetype2/tttables.h -unknown- xorg ./usr/X11R7/include/freetype2/tttags.h -unknown- xorg ./usr/X11R7/include/freetype2/ttunpat.h -unknown- xorg -./usr/X11R7/include/ft2build.h-unknown- xorg +./usr/X11R7/include/ft2build.hxcomp-obsolete obsolete ./usr/X11R7/include/libdrm/drm.h -unknown- xorg ./usr/X11R7/include/libdrm/drm_fourcc.h -unknown- xorg ./usr/X11R7/include/libdrm/drm_mode.h -unknown- xorg Index: src/external/mit/xorg/lib/freetype/Makefile diff -u src/external/mit/xorg/lib/freetype/Makefile:1.12.4.1 src/external/mit/xorg/lib/freetype/Makefile:1.12.4.2 --- src/external/mit/xorg/lib/freetype/Makefile:1.12.4.1 Mon Jan 26 16:20:48 2015 +++ src/external/mit/xorg/lib/freetype/Makefile Wed Feb 11 09:43:58 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12.4.1 2015/01/26 16:20:48 martin Exp $ +# $NetBSD: Makefile,v 1.12.4.2 2015/02/11 09:43:58 martin Exp $ .include @@ -77,10 +77,6 @@ SRCS+= type42.c .PATH: ${FREETYPE}/src/winfonts SRCS+= winfnt.c -.PATH: ${FREETYPE}/include -INCS= ft2build.h -INCSDIR=${X11INCDIR} - CPPFLAGS+= ${X11FLAGS.THREADLIB} CPPFLAGS+= -DFT_CONFIG_OPTION_SYSTEM_ZLIB \ -DFT_CONFIG_CONFIG_H="" \ Index: src/external/mit/xorg/lib/freetype/freetype2.pc.in diff -u src/external/mit/xorg/lib/freetype/freetype2.pc.in:1.2 src/external/mit/xorg/lib/freetype/freetype2.pc.in:1.2.4.1 --- src/external/mit/xorg/lib/freetype/freetype2.pc.in:1.2 Thu Mar 20 08:57:48 2014 +++ src/external/mit/xorg/lib/freetype/freetype2.pc.in Wed Feb 11 09:43:58 2015 @@ -1,11 +1,11 @@ prefix=@prefix@ exec_prefix=${prefix} libdir=${prefix}/lib -includedir=${prefix}/include +includedir=${prefix}/include/freetype2 Name: FreeType 2 Description: A free, high-quality, and portable font engine. Version: @VERSION@ Requires: Libs: -L${libdir} -lfreetype -lz -lbz2 -Cflags: -I${includedir}/freetype2 -I${includedir} +Cflags: -I${includedir} Index: src/external/mit/xorg/lib/freetype/freetype/Makefile diff -u src/external/mit/xorg/lib/freetype/freetype/Makefile:1.17 src/external/mit/xorg/lib/freetype/freetype/Makefile:1.17.4.1 --- src/external/mit/xorg/lib/freetype/freetype/Makefile:1.17 Thu Mar 20 22:23:30 2014 +++ src/external/mit/xorg/lib/freetype/freetype/Makefile Wed Feb 11 09:43:58 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2014/03/20 22:23:30 mrg Exp $ +# $NetBSD: Makefile,v 1.17.4.1 2015/02/11 09:43:58 martin Exp $ .include @@ -15,7 +15,7 @@ INCS= freetype.h ftadvanc.h ftbbox.h ftb ftpfr.h ftrender.h ftsizes.h ftsnames.h ftstroke.h ftsynth.h \ ftsystem.h fttrigon.h fttypes.h ftwinfnt.h ftxf86.h \ t1tables.h ttnameid.h tttables.h tttags.h ttunpat.h \ - ftautoh.h ftcffdrv.h + ftautoh.h f
CVS commit: [netbsd-7] src/sys/dev/usb
Module Name:src Committed By: martin Date: Wed Feb 11 09:32:19 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-7]: usbdi.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #505): sys/dev/usb/usbdi.c: revision 1.163 clip xfer->actlen also in the !DIAGNOSTIC case To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.161.2.1 src/sys/dev/usb/usbdi.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/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.161 src/sys/dev/usb/usbdi.c:1.161.2.1 --- src/sys/dev/usb/usbdi.c:1.161 Tue Aug 5 06:35:24 2014 +++ src/sys/dev/usb/usbdi.c Wed Feb 11 09:32:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.161 2014/08/05 06:35:24 skrll Exp $ */ +/* $NetBSD: usbdi.c,v 1.161.2.1 2015/02/11 09:32:19 martin Exp $ */ /* * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.161 2014/08/05 06:35:24 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.161.2.1 2015/02/11 09:32:19 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -806,13 +806,13 @@ usb_transfer_complete(usbd_xfer_handle x if (!(xfer->flags & USBD_NO_COPY) && xfer->actlen != 0 && usbd_xfer_isread(xfer)) { -#ifdef DIAGNOSTIC if (xfer->actlen > xfer->length) { +#ifdef DIAGNOSTIC printf("%s: actlen (%d) > len (%d)\n", __func__, xfer->actlen, xfer->length); +#endif xfer->actlen = xfer->length; } -#endif memcpy(xfer->buffer, KERNADDR(dmap, 0), xfer->actlen); }
CVS commit: xsrc
Module Name:xsrc Committed By: mrg Date: Wed Feb 11 09:22:22 UTC 2015 Modified Files: xsrc/external/mit/xorg-server/dist/xkb: xkb.c xsrc/xfree/xc/programs/Xserver/xkb: xkb.c Log Message: apply fixes for CVE-2015-0255: Information leak in the XkbSetGeometry request of X servers http://www.x.org/wiki/Development/Security/Advisory-2015-02-10/ ported to xorg-server 1.10 and xfree myself. To generate a diff of this commit: cvs rdiff -u -r1.1.1.7 -r1.2 xsrc/external/mit/xorg-server/dist/xkb/xkb.c cvs rdiff -u -r1.1.1.6 -r1.2 xsrc/xfree/xc/programs/Xserver/xkb/xkb.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/xkb/xkb.c diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.7 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.2 --- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.1.1.7 Mon Jun 3 07:34:30 2013 +++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c Wed Feb 11 09:22:22 2015 @@ -4839,27 +4839,30 @@ ProcXkbGetGeometry(ClientPtr client) /******/ -static char * -_GetCountedString(char **wire_inout,Bool swap) +static Status +_GetCountedString(char **wire_inout, ClientPtr client, char **str) { -char * wire,*str; -CARD16 len,*plen; +char *wire, *next; +CARD16 len; -wire= *wire_inout; -plen= (CARD16 *)wire; -if (swap) { - register int n; - swaps(plen,n); -} -len= *plen; -str= malloc(len+1); -if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; +wire = *wire_inout; +len = *(CARD16 *) wire; +if (client->swapped) { + int n; +swaps(&len, n); } -wire+= XkbPaddedSize(len+2); -*wire_inout= wire; -return str; +next = wire + XkbPaddedSize(len + 2); +/* Check we're still within the size of the request */ +if (client->req_len < +bytes_to_int32(next - (char *) client->requestBuffer)) +return BadValue; +*str = malloc(len + 1); +if (!*str) +return BadAlloc; +memcpy(*str, &wire[2], len); +*(*str + len) = '\0'; +*wire_inout = next; +return Success; } static Status @@ -4871,6 +4874,7 @@ _CheckSetDoodad( char ** wire_inout, char * wire; xkbDoodadWireDesc * dWire; XkbDoodadPtr doodad; +Status status; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; @@ -4920,8 +4924,14 @@ XkbDoodadPtr doodad; doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->text.text); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &doodad->text.font); +if (status != Success) { +free (doodad->text.text); +return status; +} break; case XkbIndicatorDoodad: if (dWire->indicator.onColorNdx>=geom->num_colors) { @@ -4956,7 +4966,9 @@ XkbDoodadPtr doodad; } doodad->logo.color_ndx= dWire->logo.colorNdx; doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &doodad->logo.logo_name); +if (status != Success) +return status; break; default: client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); @@ -5191,17 +5203,20 @@ Status status; char * wire; wire= (char *)&req[1]; -geom->label_font= _GetCountedString(&wire,client->swapped); +status = _GetCountedString(&wire, client, &geom->label_font); +if (status != Success) +return status; + +for (i = 0; i < req->nProperties; i++) { + char *name, *val; -for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); -if (!name) -return BadAlloc; - val= _GetCountedString(&wire,client->swapped); -if (!val) { +status = _GetCountedString(&wire, client, &name); +if (status != Success) +return status; +status = _GetCountedString(&wire, client, &val); +if (status != Success) { free(name); -return BadAlloc; +return status; } if (XkbAddGeomProperty(geom,name,val)==NULL) { free(name); @@ -5230,11 +5245,11 @@ char * wire; return BadMatch; } -for (i=0;inColors;i++) { +for (i = 0; i < req->nColors; i++) { char *name; - name= _GetCountedString(&wire,client->swapped); - if (!name) -return BadAlloc; +status = _GetCountedString(&wire, client, &name); +if (status != Success) +
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Wed Feb 11 08:37:00 UTC 2015 Modified Files: src/doc [netbsd-7]: CHANGES-7.0 Log Message: 50[236] To generate a diff of this commit: cvs rdiff -u -r1.1.2.199 -r1.1.2.200 src/doc/CHANGES-7.0 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 diff -u src/doc/CHANGES-7.0:1.1.2.199 src/doc/CHANGES-7.0:1.1.2.200 --- src/doc/CHANGES-7.0:1.1.2.199 Mon Feb 9 09:46:45 2015 +++ src/doc/CHANGES-7.0 Wed Feb 11 08:37:00 2015 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0,v 1.1.2.199 2015/02/09 09:46:45 martin Exp $ +# $NetBSD: CHANGES-7.0,v 1.1.2.200 2015/02/11 08:37:00 snj Exp $ A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014 until the 7.0 release: @@ -15747,3 +15747,24 @@ sys/kern/uipc_mbuf.c1.161 Correct m_len calculation for m_dup() with mbuf clusters. [mlelstv, ticket #501] +sys/dev/usb/uhidev.c1.62 +sys/dev/usb/uhidev.h1.16 +sys/dev/usb/x1input_rdesc.h 1.1 + + Add Xbox One controller support. + [jmcneill, ticket #502] + +usr.bin/netstat/inet.c1.106 +usr.bin/netstat/inet6.c1.68 + + Allocate the right size for pcb blocks. + [christos, ticket #503] + +usr.bin/login/login.c1.105 +usr.bin/login/login_pam.c 1.24 + + Remove the syslogging of a dial out login warning based on the + tty name, because the test is sloppy and doesn't correspond to + the current naming anyway. + [aymeric, ticket #506] +
CVS commit: [netbsd-7] src/usr.bin/login
Module Name:src Committed By: snj Date: Wed Feb 11 08:34:17 UTC 2015 Modified Files: src/usr.bin/login [netbsd-7]: login.c login_pam.c Log Message: Pull up following revision(s) (requested by aymeric in ticket #506): usr.bin/login/login.c: revision 1.105 usr.bin/login/login_pam.c: revision 1.24 Remove the syslogging of a dial out login warning based on the tty name, because the test is sloppy and doesn't correspond to the current naming anyway. OK gdt@ PR#377 can remain closed. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.104.4.1 src/usr.bin/login/login.c cvs rdiff -u -r1.23 -r1.23.4.1 src/usr.bin/login/login_pam.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/login/login.c diff -u src/usr.bin/login/login.c:1.104 src/usr.bin/login/login.c:1.104.4.1 --- src/usr.bin/login/login.c:1.104 Sun Mar 16 00:33:13 2014 +++ src/usr.bin/login/login.c Wed Feb 11 08:34:17 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: login.c,v 1.104 2014/03/16 00:33:13 dholland Exp $ */ +/* $NetBSD: login.c,v 1.104.4.1 2015/02/11 08:34:17 snj Exp $ */ /*- * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; #endif -__RCSID("$NetBSD: login.c,v 1.104 2014/03/16 00:33:13 dholland Exp $"); +__RCSID("$NetBSD: login.c,v 1.104.4.1 2015/02/11 08:34:17 snj Exp $"); #endif /* not lint */ /* @@ -637,9 +637,6 @@ main(int argc, char *argv[]) (void)setenv("KRB5CCNAME", krb5tkfile_env, 1); #endif - if (tty[sizeof("tty")-1] == 'd') - syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name); - /* If fflag is on, assume caller/authenticator has logged root login. */ if (rootlogin && fflag == 0) { if (hostname) Index: src/usr.bin/login/login_pam.c diff -u src/usr.bin/login/login_pam.c:1.23 src/usr.bin/login/login_pam.c:1.23.4.1 --- src/usr.bin/login/login_pam.c:1.23 Fri Oct 18 20:47:06 2013 +++ src/usr.bin/login/login_pam.c Wed Feb 11 08:34:17 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: login_pam.c,v 1.23 2013/10/18 20:47:06 christos Exp $ */ +/* $NetBSD: login_pam.c,v 1.23.4.1 2015/02/11 08:34:17 snj Exp $ */ /*- * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; #endif -__RCSID("$NetBSD: login_pam.c,v 1.23 2013/10/18 20:47:06 christos Exp $"); +__RCSID("$NetBSD: login_pam.c,v 1.23.4.1 2015/02/11 08:34:17 snj Exp $"); #endif /* not lint */ /* @@ -467,10 +467,6 @@ skip_auth: exit(EXIT_FAILURE); } - if (tty[sizeof("tty")-1] == 'd') - syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name); - - /* * Establish groups */
CVS commit: [netbsd-7] src/usr.bin/netstat
Module Name:src Committed By: snj Date: Wed Feb 11 08:29:56 UTC 2015 Modified Files: src/usr.bin/netstat [netbsd-7]: inet.c inet6.c Log Message: Pull up following revision(s) (requested by christos in ticket #503): usr.bin/netstat/inet.c: revision 1.106 usr.bin/netstat/inet6.c: revision 1.68 Allocate the right size for pcb blocks. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.104.4.1 src/usr.bin/netstat/inet.c cvs rdiff -u -r1.66 -r1.66.4.1 src/usr.bin/netstat/inet6.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/netstat/inet.c diff -u src/usr.bin/netstat/inet.c:1.104 src/usr.bin/netstat/inet.c:1.104.4.1 --- src/usr.bin/netstat/inet.c:1.104 Sat Nov 23 22:01:12 2013 +++ src/usr.bin/netstat/inet.c Wed Feb 11 08:29:56 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: inet.c,v 1.104 2013/11/23 22:01:12 christos Exp $ */ +/* $NetBSD: inet.c,v 1.104.4.1 2015/02/11 08:29:56 snj Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -__RCSID("$NetBSD: inet.c,v 1.104 2013/11/23 22:01:12 christos Exp $"); +__RCSID("$NetBSD: inet.c,v 1.104.4.1 2015/02/11 08:29:56 snj Exp $"); #endif #endif /* not lint */ @@ -285,7 +285,7 @@ getpcblist_kmem(u_long off, const char * next = TAILQ_FIRST(head); prev = TAILQ_END(head); - if ((pcblist = malloc(size)) == NULL) + if ((pcblist = malloc(size * sizeof(*pcblist))) == NULL) err(1, "malloc"); i = 0; @@ -316,7 +316,9 @@ getpcblist_kmem(u_long off, const char * pcblist[i].ki_tstate = tcpcb.t_state; pcblist[i].ki_pflags = inpcb.inp_flags; if (i++ == size) { - struct kinfo_pcb *n = realloc(pcblist, size += 100); + size += 100; + struct kinfo_pcb *n = realloc(pcblist, + size * sizeof(*pcblist)); if (n == NULL) err(1, "realloc"); pcblist = n; Index: src/usr.bin/netstat/inet6.c diff -u src/usr.bin/netstat/inet6.c:1.66 src/usr.bin/netstat/inet6.c:1.66.4.1 --- src/usr.bin/netstat/inet6.c:1.66 Sat Nov 23 22:01:12 2013 +++ src/usr.bin/netstat/inet6.c Wed Feb 11 08:29:56 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: inet6.c,v 1.66 2013/11/23 22:01:12 christos Exp $ */ +/* $NetBSD: inet6.c,v 1.66.4.1 2015/02/11 08:29:56 snj Exp $ */ /* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ /* @@ -64,7 +64,7 @@ #if 0 static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -__RCSID("$NetBSD: inet6.c,v 1.66 2013/11/23 22:01:12 christos Exp $"); +__RCSID("$NetBSD: inet6.c,v 1.66.4.1 2015/02/11 08:29:56 snj Exp $"); #endif #endif /* not lint */ @@ -302,7 +302,7 @@ getpcblist_kmem(u_long off, const char * next = TAILQ_FIRST(head); prev = TAILQ_END(head); - if ((pcblist = malloc(size)) == NULL) + if ((pcblist = malloc(size * sizeof(*pcblist))) == NULL) err(1, "malloc"); i = 0; @@ -337,7 +337,9 @@ getpcblist_kmem(u_long off, const char * memcpy(&pcblist[i].ki_d, &sin6, sizeof(sin6)); pcblist[i].ki_tstate = tcpcb.t_state; if (i++ == size) { - struct kinfo_pcb *n = realloc(pcblist, size += 100); + size += 100; + struct kinfo_pcb *n = realloc(pcblist, + size * sizeof(*pcblist)); if (n == NULL) err(1, "realloc"); pcblist = n;
CVS commit: [netbsd-7] src/sys/dev/usb
Module Name:src Committed By: snj Date: Wed Feb 11 08:25:40 UTC 2015 Modified Files: src/sys/dev/usb [netbsd-7]: uhidev.c uhidev.h Added Files: src/sys/dev/usb [netbsd-7]: x1input_rdesc.h Log Message: Pull up following revision(s) (requested by jmcneill in ticket #502): sys/dev/usb/uhidev.c: revision 1.62 sys/dev/usb/uhidev.h: revision 1.16 sys/dev/usb/x1input_rdesc.h: revision 1.1 Add Xbox One controller support. Report descriptor from https://github.com/lloeki/xbox_one_controller To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.61.2.1 src/sys/dev/usb/uhidev.c cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/dev/usb/uhidev.h cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/usb/x1input_rdesc.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/usb/uhidev.c diff -u src/sys/dev/usb/uhidev.c:1.61 src/sys/dev/usb/uhidev.c:1.61.2.1 --- src/sys/dev/usb/uhidev.c:1.61 Sun Aug 10 16:44:36 2014 +++ src/sys/dev/usb/uhidev.c Wed Feb 11 08:25:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uhidev.c,v 1.61 2014/08/10 16:44:36 tls Exp $ */ +/* $NetBSD: uhidev.c,v 1.61.2.1 2015/02/11 08:25:40 snj Exp $ */ /* * Copyright (c) 2001, 2012 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.61 2014/08/10 16:44:36 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.61.2.1 2015/02/11 08:25:40 snj Exp $"); #include #include @@ -61,6 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1 #include /* Report descriptor for game controllers in "XInput" mode */ #include +/* Report descriptor for Xbox One controllers */ +#include #include "locators.h" @@ -95,6 +97,10 @@ uhidev_match(device_t parent, cfdata_t m /* Game controllers in "XInput" mode */ if (USBIF_IS_XINPUT(uaa)) return UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; + /* Xbox One controllers */ + if (USBIF_IS_X1INPUT(uaa) && uaa->ifaceno == 0) + return UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO; + if (uaa->class != UICLASS_HID) return (UMATCH_NONE); if (usbd_get_quirks(uaa->device)->uq_flags & UQ_HID_IGNORE) @@ -224,6 +230,11 @@ uhidev_attach(device_t parent, device_t size = sizeof uhid_xinput_report_descr; descptr = uhid_xinput_report_descr; } + if (USBIF_IS_X1INPUT(uaa)) { + sc->sc_flags |= UHIDEV_F_XB1; + size = sizeof uhid_x1input_report_descr; + descptr = uhid_x1input_report_descr; + } if (descptr) { desc = malloc(size, M_USBDEV, M_NOWAIT); @@ -595,9 +606,27 @@ uhidev_open(struct uhidev *scd) error = ENOMEM; goto out3; } + + if (sc->sc_flags & UHIDEV_F_XB1) { + uint8_t init_data[] = { 0x05, 0x20 }; + int init_data_len = sizeof(init_data); + err = usbd_intr_transfer(sc->sc_oxfer, sc->sc_opipe, 0, + USBD_NO_TIMEOUT, init_data, &init_data_len, + "uhidevxb1"); + if (err != USBD_NORMAL_COMPLETION) { +DPRINTF(("uhidev_open: xb1 init failed, " +"error=%d\n", err)); +error = EIO; +goto out4; + } + } } return (0); +out4: + /* Free output xfer */ + if (sc->sc_oxfer != NULL) + usbd_free_xfer(sc->sc_oxfer); out3: /* Abort output pipe */ usbd_close_pipe(sc->sc_opipe); Index: src/sys/dev/usb/uhidev.h diff -u src/sys/dev/usb/uhidev.h:1.15 src/sys/dev/usb/uhidev.h:1.15.2.1 --- src/sys/dev/usb/uhidev.h:1.15 Tue Jun 17 09:35:46 2014 +++ src/sys/dev/usb/uhidev.h Wed Feb 11 08:25:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uhidev.h,v 1.15 2014/06/17 09:35:46 skrll Exp $ */ +/* $NetBSD: uhidev.h,v 1.15.2.1 2015/02/11 08:25:40 snj Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -57,6 +57,9 @@ struct uhidev_softc { u_char sc_dying; kmutex_t sc_lock; /* protects writes to sc_state */ + + u_int sc_flags; +#define UHIDEV_F_XB1 0x0001 /* Xbox 1 controller */ }; struct uhidev { Added files: Index: src/sys/dev/usb/x1input_rdesc.h diff -u /dev/null src/sys/dev/usb/x1input_rdesc.h:1.1.2.2 --- /dev/null Wed Feb 11 08:25:40 2015 +++ src/sys/dev/usb/x1input_rdesc.h Wed Feb 11 08:25:40 2015 @@ -0,0 +1,105 @@ +/* $NetBSD: x1input_rdesc.h,v 1.1.2.2 2015/02/11 08:25:40 snj Exp $ */ + +/*- + * Copyright (C) 2014 Loic Nageleisen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the copyright holders nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. +