CVS commit: src/sys/dev
Module Name:src Committed By: riastradh Date: Thu Sep 9 23:26:37 UTC 2021 Modified Files: src/sys/dev/isa: mcd.c src/sys/dev/pci: if_iwi.c src/sys/dev/raidframe: rf_netbsdkintf.c src/sys/dev/scsipi: ses.c Log Message: sys/dev: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry. I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks; the raidframe(4) change probably doesn't (but doesn't hurt). To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.121 src/sys/dev/isa/mcd.c cvs rdiff -u -r1.116 -r1.117 src/sys/dev/pci/if_iwi.c cvs rdiff -u -r1.400 -r1.401 src/sys/dev/raidframe/rf_netbsdkintf.c cvs rdiff -u -r1.51 -r1.52 src/sys/dev/scsipi/ses.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev
Module Name:src Committed By: riastradh Date: Thu Sep 9 23:26:37 UTC 2021 Modified Files: src/sys/dev/isa: mcd.c src/sys/dev/pci: if_iwi.c src/sys/dev/raidframe: rf_netbsdkintf.c src/sys/dev/scsipi: ses.c Log Message: sys/dev: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry. I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks; the raidframe(4) change probably doesn't (but doesn't hurt). To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.121 src/sys/dev/isa/mcd.c cvs rdiff -u -r1.116 -r1.117 src/sys/dev/pci/if_iwi.c cvs rdiff -u -r1.400 -r1.401 src/sys/dev/raidframe/rf_netbsdkintf.c cvs rdiff -u -r1.51 -r1.52 src/sys/dev/scsipi/ses.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/isa/mcd.c diff -u src/sys/dev/isa/mcd.c:1.120 src/sys/dev/isa/mcd.c:1.121 --- src/sys/dev/isa/mcd.c:1.120 Mon Feb 24 12:20:29 2020 +++ src/sys/dev/isa/mcd.c Thu Sep 9 23:26:36 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mcd.c,v 1.120 2020/02/24 12:20:29 rin Exp $ */ +/* $NetBSD: mcd.c,v 1.121 2021/09/09 23:26:36 riastradh Exp $ */ /* * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. @@ -56,7 +56,7 @@ /*static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";*/ #include -__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.120 2020/02/24 12:20:29 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.121 2021/09/09 23:26:36 riastradh Exp $"); #include #include @@ -1601,6 +1601,7 @@ mcd_read_subchannel(struct mcd_softc *sc if ((error = mcd_getqchan(sc, &q, ch->data_format)) != 0) return error; + memset(info, 0, sizeof(*info)); info->header.audio_status = sc->audio_status; info->what.media_catalog.data_format = ch->data_format; Index: src/sys/dev/pci/if_iwi.c diff -u src/sys/dev/pci/if_iwi.c:1.116 src/sys/dev/pci/if_iwi.c:1.117 --- src/sys/dev/pci/if_iwi.c:1.116 Wed Jun 16 00:21:18 2021 +++ src/sys/dev/pci/if_iwi.c Thu Sep 9 23:26:36 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: if_iwi.c,v 1.116 2021/06/16 00:21:18 riastradh Exp $ */ +/* $NetBSD: if_iwi.c,v 1.117 2021/09/09 23:26:36 riastradh Exp $ */ /* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */ /*- @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.116 2021/06/16 00:21:18 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.117 2021/09/09 23:26:36 riastradh Exp $"); /*- * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver @@ -1870,8 +1870,9 @@ iwi_get_table0(struct iwi_softc *sc, uin { uint32_t size, buf[128]; + memset(buf, 0, sizeof buf); + if (!(sc->flags & IWI_FLAG_FW_INITED)) { - memset(buf, 0, sizeof buf); return copyout(buf, tbl, sizeof buf); } Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.400 src/sys/dev/raidframe/rf_netbsdkintf.c:1.401 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.400 Sat Aug 28 16:00:52 2021 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Thu Sep 9 23:26:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.400 2021/08/28 16:00:52 oster Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.401 2021/09/09 23:26:37 riastradh Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.400 2021/08/28 16:00:52 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.401 2021/09/09 23:26:37 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -3859,6 +3859,8 @@ void rf_check_recon_status_ext(RF_Raid_t *raidPtr, RF_ProgressInfo_t *info) { + memset(info, 0, sizeof(*info)); + if (raidPtr->status != rf_rs_reconstructing) { info->total = 100; info->completed = 100; @@ -3874,6 +3876,8 @@ void rf_check_parityrewrite_status_ext(RF_Raid_t *raidPtr, RF_ProgressInfo_t *info) { + memset(info, 0, sizeof(*info)); + if (raidPtr->parity_rewrite_in_progress == 1) { info->total = raidPtr->Layout.numStripe; info->completed = raidPtr->parity_rewrite_stripes_done; @@ -3889,6 +3893,8 @@ void rf_check_copyback_status_ext(RF_Raid_t *raidPtr, RF_ProgressInfo_t *info) { + memset(info, 0, sizeof(*info)); + if (raidPtr->copyback_in_progress == 1) { info->total = raidPtr->Layout.numStripe; info->completed = raidPtr->copyback_stripes_done; Index: src/sys/dev/scsipi/ses.c diff -u src/sys/dev/scsipi/ses.c:1.51 src/sys/dev/scsipi/ses.c:1.52 --- src/sys/dev/scsipi/ses.c:1.51 Fri Mar 8 08:35:58 2019 +++ src/sys/dev/scsipi/ses.c Thu Sep 9 23:26:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ses.c,v 1.51 2019/03/08 08:35:58 msaitoh Exp $ */ +/* $NetBSD: ses.c,v 1.52 2021/09/
CVS commit: src/tests/lib/libc/stdio
Module Name:src Committed By: rillig Date: Thu Sep 9 21:47:47 UTC 2021 Modified Files: src/tests/lib/libc/stdio: t_intr.sh Log Message: tests/stdio: disable flappy test for EINTR with _IOFBF for now This case is currently not handled correctly by fwrite/fflush, which makes the test fail sometimes. The tests for _IONBF and _IOLBF are pretty stable though. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdio/t_intr.sh 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/libc/stdio/t_intr.sh diff -u src/tests/lib/libc/stdio/t_intr.sh:1.4 src/tests/lib/libc/stdio/t_intr.sh:1.5 --- src/tests/lib/libc/stdio/t_intr.sh:1.4 Sun Sep 5 22:34:07 2021 +++ src/tests/lib/libc/stdio/t_intr.sh Thu Sep 9 21:47:47 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_intr.sh,v 1.4 2021/09/05 22:34:07 rillig Exp $ +# $NetBSD: t_intr.sh,v 1.5 2021/09/09 21:47:47 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -77,5 +77,6 @@ atf_init_test_cases() { atf_add_test_case stdio_intr_ionbf atf_add_test_case stdio_intr_iolbf - atf_add_test_case stdio_intr_iofbf + # flappy test; see fflush.c 1.19 to 1.24 + #atf_add_test_case stdio_intr_iofbf }
CVS commit: src/tests/lib/libc/stdio
Module Name:src Committed By: rillig Date: Thu Sep 9 21:47:47 UTC 2021 Modified Files: src/tests/lib/libc/stdio: t_intr.sh Log Message: tests/stdio: disable flappy test for EINTR with _IOFBF for now This case is currently not handled correctly by fwrite/fflush, which makes the test fail sometimes. The tests for _IONBF and _IOLBF are pretty stable though. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdio/t_intr.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/cortex
Module Name:src Committed By: jmcneill Date: Thu Sep 9 21:39:03 UTC 2021 Modified Files: src/sys/arch/arm/cortex: gtmr.c Log Message: If we get a spurious interrupt, log a debug message and ignore it. Otherwise we risk tripping an assertion later on due to an interrupt firing before it is scheduled. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/cortex/gtmr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/cortex/gtmr.c diff -u src/sys/arch/arm/cortex/gtmr.c:1.44 src/sys/arch/arm/cortex/gtmr.c:1.45 --- src/sys/arch/arm/cortex/gtmr.c:1.44 Mon Aug 30 22:53:37 2021 +++ src/sys/arch/arm/cortex/gtmr.c Thu Sep 9 21:39:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gtmr.c,v 1.44 2021/08/30 22:53:37 jmcneill Exp $ */ +/* $NetBSD: gtmr.c,v 1.45 2021/09/09 21:39:02 jmcneill Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.44 2021/08/30 22:53:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.45 2021/09/09 21:39:02 jmcneill Exp $"); #include #include @@ -334,6 +334,12 @@ gtmr_intr(void *arg) struct clockframe * const cf = arg; struct gtmr_softc * const sc = >mr_sc; + const uint32_t ctl = gtmr_read_ctl(sc); + if ((ctl & (CNTCTL_ENABLE|CNTCTL_ISTATUS)) != (CNTCTL_ENABLE|CNTCTL_ISTATUS)) { + aprint_debug_dev(ci->ci_dev, "spurious timer interrupt (ctl=%#x)\n", ctl); + return 0; + } + const uint64_t now = gtmr_read_cntct(sc); uint64_t delta = now - ci->ci_lastintr;
CVS commit: src/sys/arch/arm/cortex
Module Name:src Committed By: jmcneill Date: Thu Sep 9 21:39:03 UTC 2021 Modified Files: src/sys/arch/arm/cortex: gtmr.c Log Message: If we get a spurious interrupt, log a debug message and ignore it. Otherwise we risk tripping an assertion later on due to an interrupt firing before it is scheduled. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/cortex/gtmr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Thu Sep 9 20:25:30 UTC 2021 Modified Files: src/lib/libedit: readline.c Log Message: fix memory issues found by fuzzing (double frees and buffer overflows) To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/lib/libedit/readline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/readline.c diff -u src/lib/libedit/readline.c:1.165 src/lib/libedit/readline.c:1.166 --- src/lib/libedit/readline.c:1.165 Fri Sep 3 08:20:38 2021 +++ src/lib/libedit/readline.c Thu Sep 9 16:25:30 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $ */ +/* $NetBSD: readline.c,v 1.166 2021/09/09 20:25:30 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.166 2021/09/09 20:25:30 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -624,8 +624,7 @@ get_history_event(const char *cmd, int * if (sub) { if (pat != last_search_pat) { - if (last_search_pat) -el_free(last_search_pat); + el_free(last_search_pat); last_search_pat = pat; } ret = history_search(pat, -1); @@ -642,9 +641,8 @@ get_history_event(const char *cmd, int * } if (sub && len) { - if (last_search_match && last_search_match != pat) - el_free(last_search_match); - last_search_match = pat; + el_free(last_search_match); + last_search_match = strdup(pat); } if (pat != last_search_pat) @@ -676,7 +674,7 @@ getfrom(const char **cmdp, char **fromp, for (; *cmd && *cmd != delim; cmd++) { if (*cmd == '\\' && cmd[1] == delim) cmd++; - if (len >= size) { + if (len - 1 >= size) { char *nwhat; nwhat = el_realloc(what, (size <<= 1) * sizeof(*nwhat)); if (nwhat == NULL) { @@ -707,6 +705,7 @@ getfrom(const char **cmdp, char **fromp, } if (!*cmd) { el_free(what); + *fromp = NULL; return -1; } @@ -715,6 +714,7 @@ getfrom(const char **cmdp, char **fromp, if (!*cmd) { el_free(what); + *fromp = NULL; return -1; } return 1; @@ -728,6 +728,7 @@ getto(const char **cmdp, char **top, con size_t from_len = strlen(from); const char *cmd = *cmdp; char *with = el_realloc(*top, size * sizeof(*with)); + *top = NULL; if (with == NULL) goto out; @@ -848,7 +849,7 @@ _history_expand_command(const char *comm /* Now parse any word designators */ if (*cmd == '%') /* last word matched by ?pat? */ - tmp = strdup(last_search_match? last_search_match:""); + tmp = strdup(last_search_match ? last_search_match : ""); else if (strchr("^*$-0123456789", *cmd)) { start = end = -1; if (*cmd == '^') @@ -928,26 +929,30 @@ _history_expand_command(const char *comm continue; /*FALLTHROUGH*/ case 's': - delim = *(++cmd), cmd++; /* XXX: check */ - if ((ev = getfrom(&cmd, &from, search, delim)) != 1) { -el_free(tmp); -return ev; - } - if ((ev = getto(&cmd, &to, from, delim)) != 1) { -el_free(tmp); -return ev; - } + ev = -1; + delim = *++cmd; + if (delim == '\0' || *++cmd == '\0') +goto out; + if ((ev = getfrom(&cmd, &from, search, delim)) != 1) +goto out; + if ((ev = getto(&cmd, &to, from, delim)) != 1) +goto out; aptr = _rl_compat_sub(tmp, from, to, g_on); if (aptr) { el_free(tmp); tmp = aptr; } g_on = 0; + cmd--; continue; } } *result = tmp; return p_on ? 2 : 1; +out: + el_free(tmp); + return ev; + }
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Thu Sep 9 20:25:30 UTC 2021 Modified Files: src/lib/libedit: readline.c Log Message: fix memory issues found by fuzzing (double frees and buffer overflows) To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/lib/libedit/readline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Thu Sep 9 20:24:08 UTC 2021 Modified Files: src/lib/libedit: refresh.c terminal.c Log Message: Add casts to appease conversions between wchar_t and wint_t To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/refresh.c cvs rdiff -u -r1.43 -r1.44 src/lib/libedit/terminal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/refresh.c diff -u src/lib/libedit/refresh.c:1.57 src/lib/libedit/refresh.c:1.58 --- src/lib/libedit/refresh.c:1.57 Mon Mar 30 02:54:37 2020 +++ src/lib/libedit/refresh.c Thu Sep 9 16:24:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $ */ +/* $NetBSD: refresh.c,v 1.58 2021/09/09 20:24:07 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $"); +__RCSID("$NetBSD: refresh.c,v 1.58 2021/09/09 20:24:07 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -105,7 +105,7 @@ re_nextline(EditLine *el) */ if (el->el_refresh.r_cursor.v + 1 >= el->el_terminal.t_size.v) { int i, lins = el->el_terminal.t_size.v; - wchar_t *firstline = el->el_vdisplay[0]; + wint_t *firstline = el->el_vdisplay[0]; for(i = 1; i < lins; i++) el->el_vdisplay[i - 1] = el->el_vdisplay[i]; @@ -334,7 +334,8 @@ re_refresh(EditLine *el) ELRE_DEBUG(1, (__F, "updating %d lines.\r\n", el->el_refresh.r_newcv)); for (i = 0; i <= el->el_refresh.r_newcv; i++) { /* NOTE THAT re_update_line MAY CHANGE el_display[i] */ - re_update_line(el, el->el_display[i], el->el_vdisplay[i], i); + re_update_line(el, (wchar_t *)el->el_display[i], + (wchar_t *)el->el_vdisplay[i], i); /* * Copy the new line to be the current one, and pad out with @@ -343,7 +344,8 @@ re_refresh(EditLine *el) * end of the screen line, it won't be a NUL or some old * leftover stuff. */ - re__copy_and_pad(el->el_display[i], el->el_vdisplay[i], + re__copy_and_pad((wchar_t *)el->el_display[i], + (wchar_t *)el->el_vdisplay[i], (size_t) el->el_terminal.t_size.h); } ELRE_DEBUG(1, (__F, @@ -355,7 +357,8 @@ re_refresh(EditLine *el) terminal_move_to_line(el, i); terminal_move_to_char(el, 0); /* This wcslen should be safe even with MB_FILL_CHARs */ - terminal_clear_EOL(el, (int) wcslen(el->el_display[i])); + terminal_clear_EOL(el, + (int) wcslen((const wchar_t *)el->el_display[i])); #ifdef DEBUG_REFRESH terminal_overwrite(el, L"C\b", 2); #endif /* DEBUG_REFRESH */ @@ -1091,7 +1094,7 @@ re_refresh_cursor(EditLine *el) static void re_fastputc(EditLine *el, wint_t c) { - wchar_t *lastline; + wint_t *lastline; int w; w = wcwidth(c); @@ -1126,7 +1129,8 @@ re_fastputc(EditLine *el, wint_t c) el->el_cursor.v++; lastline = el->el_display[++el->el_refresh.r_oldcv]; } - re__copy_and_pad(lastline, L"", (size_t)el->el_terminal.t_size.h); + re__copy_and_pad((wchar_t *)lastline, L"", + (size_t)el->el_terminal.t_size.h); if (EL_HAS_AUTO_MARGINS) { if (EL_HAS_MAGIC_MARGINS) { Index: src/lib/libedit/terminal.c diff -u src/lib/libedit/terminal.c:1.43 src/lib/libedit/terminal.c:1.44 --- src/lib/libedit/terminal.c:1.43 Fri Jul 10 16:34:24 2020 +++ src/lib/libedit/terminal.c Thu Sep 9 16:24:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: terminal.c,v 1.43 2020/07/10 20:34:24 christos Exp $ */ +/* $NetBSD: terminal.c,v 1.44 2021/09/09 20:24:07 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95"; #else -__RCSID("$NetBSD: terminal.c,v 1.43 2020/07/10 20:34:24 christos Exp $"); +__RCSID("$NetBSD: terminal.c,v 1.44 2021/09/09 20:24:07 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -588,7 +588,8 @@ mc_again: * NOTE THAT terminal_overwrite() WILL CHANGE * el->el_cursor.h!!! */ -terminal_overwrite(el, &el->el_display[ +terminal_overwrite(el, +(wchar_t *)&el->el_display[ el->el_cursor.v][el->el_cursor.h], (size_t)(where - el->el_cursor.h));
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Thu Sep 9 20:24:08 UTC 2021 Modified Files: src/lib/libedit: refresh.c terminal.c Log Message: Add casts to appease conversions between wchar_t and wint_t To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/refresh.c cvs rdiff -u -r1.43 -r1.44 src/lib/libedit/terminal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: martin Date: Thu Sep 9 15:00:01 UTC 2021 Modified Files: src: build.sh Log Message: Add a new operation "mkrepro-timestamp" to extract the timestamp a build with -P would use. Example usage: ./build.sh -T /usr/tools -P mkrepro-timestamp This allows us to extract this information once, make other use of it, and replicate it on other machines with -V MKREPRO=yes -V MKREPRO_TIMESTAMP=.. To generate a diff of this commit: cvs rdiff -u -r1.355 -r1.356 src/build.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/build.sh diff -u src/build.sh:1.355 src/build.sh:1.356 --- src/build.sh:1.355 Sun Aug 29 09:02:01 2021 +++ src/build.sh Thu Sep 9 15:00:01 2021 @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.355 2021/08/29 09:02:01 christos Exp $ +# $NetBSD: build.sh,v 1.356 2021/09/09 15:00:01 martin Exp $ # # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -1071,6 +1071,8 @@ Usage: ${progname} [-EhnoPRrUuxy] [-a ar list-arch Display a list of valid MACHINE/MACHINE_ARCH values, and exit. The list may be narrowed by passing glob patterns or exact values in MACHINE or MACHINE_ARCH. +mkrepro-timestamp Show the latest source timestamp used for reproducable +builds and exit. Requires -P or -V MKREPRO=yes. Options: -a archSet MACHINE_ARCH to arch. [Default: deduced from MACHINE] @@ -1366,7 +1368,12 @@ parseoptions() list-arch) listarch "${MACHINE}" "${MACHINE_ARCH}" - exit $? + exit + ;; + mkrepro-timestamp) + setup_mkrepro quiet + echo ${MKREPRO_TIMESTAMP:-0} + [ ${MKREPRO_TIMESTAMP:-0} -ne 0 ]; exit ;; kernel=*|releasekernel=*|kernel.gdb=*) @@ -1965,7 +1972,7 @@ createmakewrapper() eval cat <
CVS commit: src
Module Name:src Committed By: martin Date: Thu Sep 9 15:00:01 UTC 2021 Modified Files: src: build.sh Log Message: Add a new operation "mkrepro-timestamp" to extract the timestamp a build with -P would use. Example usage: ./build.sh -T /usr/tools -P mkrepro-timestamp This allows us to extract this information once, make other use of it, and replicate it on other machines with -V MKREPRO=yes -V MKREPRO_TIMESTAMP=.. To generate a diff of this commit: cvs rdiff -u -r1.355 -r1.356 src/build.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: jakllsch Date: Thu Sep 9 13:22:50 UTC 2021 Modified Files: src/sys/arch/amd64/conf: GENERIC Log Message: Enable WSDISPLAY_CUSTOM_OUTPUT and WSDISPLAY_CUSTOM_BORDER on amd64 GENERIC as i386 GENERIC already does. To generate a diff of this commit: cvs rdiff -u -r1.589 -r1.590 src/sys/arch/amd64/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.589 src/sys/arch/amd64/conf/GENERIC:1.590 --- src/sys/arch/amd64/conf/GENERIC:1.589 Mon May 17 04:07:42 2021 +++ src/sys/arch/amd64/conf/GENERIC Thu Sep 9 13:22:50 2021 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.589 2021/05/17 04:07:42 yamaguchi Exp $ +# $NetBSD: GENERIC,v 1.590 2021/09/09 13:22:50 jakllsch Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.589 $" +#ident "GENERIC-$Revision: 1.590 $" maxusers 64 # estimated number of users @@ -262,8 +262,11 @@ options WSEMUL_VT100 # VT100 / VT220 e #options WSEMUL_SUN # sun terminal emulation #options WSEMUL_DEFAULT="\"vt100\"" # NB: default is "sun" if enabled # different kernel output - see dev/wscons/wsdisplayvar.h +options WSDISPLAY_CUSTOM_OUTPUT # color customization from wsconsctl(8) options WS_KERNEL_FG=WSCOL_GREEN #options WS_KERNEL_BG=WSCOL_BLACK +# customization of console border color +options WSDISPLAY_CUSTOM_BORDER # custom border colors via wsconsctl(8) # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: jakllsch Date: Thu Sep 9 13:22:50 UTC 2021 Modified Files: src/sys/arch/amd64/conf: GENERIC Log Message: Enable WSDISPLAY_CUSTOM_OUTPUT and WSDISPLAY_CUSTOM_BORDER on amd64 GENERIC as i386 GENERIC already does. To generate a diff of this commit: cvs rdiff -u -r1.589 -r1.590 src/sys/arch/amd64/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/alpha/conf
Module Name:src Committed By: jakllsch Date: Thu Sep 9 13:08:07 UTC 2021 Modified Files: src/sys/arch/alpha/conf: GENERIC Log Message: Add optional GENERIC.local include in alpha's GENERIC. To generate a diff of this commit: cvs rdiff -u -r1.413 -r1.414 src/sys/arch/alpha/conf/GENERIC 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/alpha/conf/GENERIC diff -u src/sys/arch/alpha/conf/GENERIC:1.413 src/sys/arch/alpha/conf/GENERIC:1.414 --- src/sys/arch/alpha/conf/GENERIC:1.413 Fri Jul 23 14:38:58 2021 +++ src/sys/arch/alpha/conf/GENERIC Thu Sep 9 13:08:07 2021 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.413 2021/07/23 14:38:58 thorpej Exp $ +# $NetBSD: GENERIC,v 1.414 2021/09/09 13:08:07 jakllsch Exp $ # # This machine description file is used to generate the default NetBSD # kernel. @@ -19,7 +19,7 @@ include "arch/alpha/conf/std.alpha" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -ident "GENERIC-$Revision: 1.413 $" +ident "GENERIC-$Revision: 1.414 $" maxusers 32 @@ -737,3 +737,6 @@ include "dev/veriexec.config" options PAX_MPROTECT=0 # PaX mprotect(2) restrictions options PAX_ASLR=0 # PaX Address Space Layout Randomization + +# Pull in optional local configuration +cinclude "arch/alpha/conf/GENERIC.local"
CVS commit: src/sys/arch/alpha/conf
Module Name:src Committed By: jakllsch Date: Thu Sep 9 13:08:07 UTC 2021 Modified Files: src/sys/arch/alpha/conf: GENERIC Log Message: Add optional GENERIC.local include in alpha's GENERIC. To generate a diff of this commit: cvs rdiff -u -r1.413 -r1.414 src/sys/arch/alpha/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/ti
Module Name:src Committed By: jakllsch Date: Thu Sep 9 12:14:37 UTC 2021 Modified Files: src/sys/arch/arm/ti: ti_omaptimer.c Log Message: Add license text I forgot to include in 1.1 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/ti/ti_omaptimer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/ti/ti_omaptimer.c diff -u src/sys/arch/arm/ti/ti_omaptimer.c:1.9 src/sys/arch/arm/ti/ti_omaptimer.c:1.10 --- src/sys/arch/arm/ti/ti_omaptimer.c:1.9 Wed Jan 27 03:10:20 2021 +++ src/sys/arch/arm/ti/ti_omaptimer.c Thu Sep 9 12:14:37 2021 @@ -1,7 +1,33 @@ -/* $NetBSD: ti_omaptimer.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */ +/* $NetBSD: ti_omaptimer.c,v 1.10 2021/09/09 12:14:37 jakllsch Exp $ */ + +/* + * Copyright (c) 2017 Jonathan A. Kollasch + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_omaptimer.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_omaptimer.c,v 1.10 2021/09/09 12:14:37 jakllsch Exp $"); #include #include
CVS commit: src/sys/arch/arm/ti
Module Name:src Committed By: jakllsch Date: Thu Sep 9 12:14:37 UTC 2021 Modified Files: src/sys/arch/arm/ti: ti_omaptimer.c Log Message: Add license text I forgot to include in 1.1 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/ti/ti_omaptimer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Thu Sep 9 08:12:27 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: pmap.c Log Message: In pmap_icache_sync_range change for (...) { ... if (condition) { // do stuff } } to for (...) { ... if (!conditional) continue; // do stuff } to save on indentation. Same code (modulo register usage) before and after. To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/sys/arch/aarch64/aarch64/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/pmap.c diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.109 src/sys/arch/aarch64/aarch64/pmap.c:1.110 --- src/sys/arch/aarch64/aarch64/pmap.c:1.109 Thu Sep 9 08:09:44 2021 +++ src/sys/arch/aarch64/aarch64/pmap.c Thu Sep 9 08:12:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.109 2021/09/09 08:09:44 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.110 2021/09/09 08:12:27 skrll Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2021/09/09 08:09:44 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 2021/09/09 08:12:27 skrll Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -967,23 +967,24 @@ pmap_icache_sync_range(pmap_t pm, vaddr_ } pte = *ptep; - if (lxpde_valid(pte)) { - vaddr_t eob = (va + blocksize) & ~(blocksize - 1); - vsize_t len = ulmin(eva, eob) - va; + if (!lxpde_valid(pte)) + continue; - if (l3pte_readable(pte)) { -cpu_icache_sync_range(va, len); - } else { -/* - * change to accessible temporally - * to do cpu_icache_sync_range() - */ -atomic_swap_64(ptep, pte | LX_BLKPAG_AF); -AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true); -cpu_icache_sync_range(va, len); -atomic_swap_64(ptep, pte); -AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true); - } + vaddr_t eob = (va + blocksize) & ~(blocksize - 1); + vsize_t len = ulmin(eva, eob) - va; + + if (l3pte_readable(pte)) { + cpu_icache_sync_range(va, len); + } else { + /* + * change to accessible temporally + * to do cpu_icache_sync_range() + */ + atomic_swap_64(ptep, pte | LX_BLKPAG_AF); + AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true); + cpu_icache_sync_range(va, len); + atomic_swap_64(ptep, pte); + AARCH64_TLBI_BY_ASID_VA(pm->pm_asid, va, true); } }
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Thu Sep 9 08:12:27 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: pmap.c Log Message: In pmap_icache_sync_range change for (...) { ... if (condition) { // do stuff } } to for (...) { ... if (!conditional) continue; // do stuff } to save on indentation. Same code (modulo register usage) before and after. To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/sys/arch/aarch64/aarch64/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: mrg Date: Thu Sep 9 08:11:43 UTC 2021 Modified Files: src/sys/dev/pci: pcireg.h Log Message: fix part of the previous: Link Capability Max Speed is a value not a bitmask. pointed out by msaitoh@. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/dev/pci/pcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: mrg Date: Thu Sep 9 08:11:43 UTC 2021 Modified Files: src/sys/dev/pci: pcireg.h Log Message: fix part of the previous: Link Capability Max Speed is a value not a bitmask. pointed out by msaitoh@. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/dev/pci/pcireg.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/pci/pcireg.h diff -u src/sys/dev/pci/pcireg.h:1.157 src/sys/dev/pci/pcireg.h:1.158 --- src/sys/dev/pci/pcireg.h:1.157 Thu Sep 9 02:12:48 2021 +++ src/sys/dev/pci/pcireg.h Thu Sep 9 08:11:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pcireg.h,v 1.157 2021/09/09 02:12:48 mrg Exp $ */ +/* $NetBSD: pcireg.h,v 1.158 2021/09/09 08:11:42 mrg Exp $ */ /* * Copyright (c) 1995, 1996, 1999, 2000 @@ -1017,12 +1017,12 @@ typedef u_int8_t pci_revision_t; #define PCIE_DCSR_EMGPWRREDD __BIT(6 + 16) /* Emg. Pwr. Reduct. Detected */ #define PCIE_LCAP 0x0c /* Link Capabilities Register */ #define PCIE_LCAP_MAX_SPEED __BITS(3, 0) /* Max Link Speed */ -#define PCIE_LCAP_MAX_SPEED_2 __BIT(0) /* 2.5GT/s */ -#define PCIE_LCAP_MAX_SPEED_5 __BIT(1) /* 5GT/s */ -#define PCIE_LCAP_MAX_SPEED_8 __BIT(3) /* 8GT/s */ -#define PCIE_LCAP_MAX_SPEED_16 __BIT(4) /* 16GT/s */ -#define PCIE_LCAP_MAX_SPEED_32 __BIT(5) /* 32GT/s */ -#define PCIE_LCAP_MAX_SPEED_64 __BIT(6) /* 64GT/s */ +#define PCIE_LCAP_MAX_SPEED_2 1 /* 2.5GT/s */ +#define PCIE_LCAP_MAX_SPEED_5 2 /* 5GT/s */ +#define PCIE_LCAP_MAX_SPEED_8 3 /* 8GT/s */ +#define PCIE_LCAP_MAX_SPEED_16 4 /* 16GT/s */ +#define PCIE_LCAP_MAX_SPEED_32 5 /* 32GT/s */ +#define PCIE_LCAP_MAX_SPEED_64 6 /* 64GT/s */ #define PCIE_LCAP_MAX_WIDTH __BITS(9, 4) /* Maximum Link Width */ #define PCIE_LCAP_ASPM __BITS(11, 10) /* Active State Link PM Supp. */ #define PCIE_LCAP_L0S_EXIT __BITS(14, 12) /* L0s Exit Latency */
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Thu Sep 9 08:09:44 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: pmap.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/arch/aarch64/aarch64/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/pmap.c diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.108 src/sys/arch/aarch64/aarch64/pmap.c:1.109 --- src/sys/arch/aarch64/aarch64/pmap.c:1.108 Sat May 29 06:54:20 2021 +++ src/sys/arch/aarch64/aarch64/pmap.c Thu Sep 9 08:09:44 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.108 2021/05/29 06:54:20 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.109 2021/09/09 08:09:44 skrll Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.108 2021/05/29 06:54:20 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2021/09/09 08:09:44 skrll Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -38,10 +38,11 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 #include #include + +#include +#include #include #include -#include -#include #include #include
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Thu Sep 9 08:09:44 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: pmap.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/arch/aarch64/aarch64/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.