CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 05:51:06 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c main.c Log Message: Check mode argument earlier. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.12 -r1.13 src/usr.bin/audiocfg/main.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/audiocfg/audiodev.c diff -u src/usr.bin/audiocfg/audiodev.c:1.10 src/usr.bin/audiocfg/audiodev.c:1.11 --- src/usr.bin/audiocfg/audiodev.c:1.10 Sat Aug 24 05:45:24 2019 +++ src/usr.bin/audiocfg/audiodev.c Sat Aug 24 05:51:06 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.c,v 1.10 2019/08/24 05:45:24 isaki Exp $ */ +/* $NetBSD: audiodev.c,v 1.11 2019/08/24 05:51:06 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -282,11 +282,6 @@ audiodev_set_param(struct audiodev *adev ai.record.sample_rate = freq; } - if (setmode == 0) { - errno = EINVAL; - return -1; - } - ai.mode = setmode; printf("setting %s to %s:%u, %uch, %uHz\n", adev->xname, encname, prec, ch, freq); Index: src/usr.bin/audiocfg/main.c diff -u src/usr.bin/audiocfg/main.c:1.12 src/usr.bin/audiocfg/main.c:1.13 --- src/usr.bin/audiocfg/main.c:1.12 Sat Aug 24 05:45:25 2019 +++ src/usr.bin/audiocfg/main.c Sat Aug 24 05:51:06 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.12 2019/08/24 05:45:25 isaki Exp $ */ +/* $NetBSD: main.c,v 1.13 2019/08/24 05:51:06 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -222,6 +222,9 @@ main(int argc, char *argv[]) else usage(argv[0]); } + if (mode == 0) + usage(argv[0]); + /* NOTREACHED */ enc = argv[4]; prec = strtoul(argv[5], NULL, 10); if (errno)
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 05:51:06 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c main.c Log Message: Check mode argument earlier. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.12 -r1.13 src/usr.bin/audiocfg/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 05:45:25 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c audiodev.h main.c Log Message: Use device unit number for index. The index number was too confusing such as 0: [ ] audio1 @ wss0 1: [*] audio0 @ yds0 in my PC for example. Here is new format: [*] audio0 @ yds0 [ ] audio1 @ wss0 In this style, devices are always listed in order of unit number and 0 always means audio0, 1 always means audio1. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.7 -r1.8 src/usr.bin/audiocfg/audiodev.h cvs rdiff -u -r1.11 -r1.12 src/usr.bin/audiocfg/main.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/audiocfg/audiodev.c diff -u src/usr.bin/audiocfg/audiodev.c:1.9 src/usr.bin/audiocfg/audiodev.c:1.10 --- src/usr.bin/audiocfg/audiodev.c:1.9 Sat Aug 24 04:04:10 2019 +++ src/usr.bin/audiocfg/audiodev.c Sat Aug 24 05:45:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.c,v 1.9 2019/08/24 04:04:10 isaki Exp $ */ +/* $NetBSD: audiodev.c,v 1.10 2019/08/24 05:45:24 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -48,6 +48,7 @@ static int audiodev_test_chmask(struct a static TAILQ_HEAD(audiodevhead, audiodev) audiodevlist = TAILQ_HEAD_INITIALIZER(audiodevlist); +static unsigned int maxunit; #define AUDIODEV_SAMPLE_RATE 44100 @@ -138,6 +139,9 @@ audiodev_add(const char *pdev, const cha TAILQ_INSERT_TAIL(, adev, next); + if (unit > maxunit) + maxunit = unit; + return 0; } @@ -179,29 +183,22 @@ audiodev_refresh(void) } unsigned int -audiodev_count(void) +audiodev_maxunit(void) { - struct audiodev *adev; - unsigned int n; - - n = 0; - TAILQ_FOREACH(adev, , next) - ++n; - - return n; + return maxunit; } +/* + * Get audiodev corresponding to audio device. + */ struct audiodev * audiodev_get(unsigned int i) { struct audiodev *adev; - unsigned int n; - n = 0; TAILQ_FOREACH(adev, , next) { - if (n == i) + if (i == adev->unit) return adev; - ++n; } return NULL; Index: src/usr.bin/audiocfg/audiodev.h diff -u src/usr.bin/audiocfg/audiodev.h:1.7 src/usr.bin/audiocfg/audiodev.h:1.8 --- src/usr.bin/audiocfg/audiodev.h:1.7 Sat Aug 24 04:04:10 2019 +++ src/usr.bin/audiocfg/audiodev.h Sat Aug 24 05:45:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.h,v 1.7 2019/08/24 04:04:10 isaki Exp $ */ +/* $NetBSD: audiodev.h,v 1.8 2019/08/24 05:45:25 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -60,7 +60,7 @@ struct audiodev { }; int audiodev_refresh(void); -unsigned int audiodev_count(void); +unsigned int audiodev_maxunit(void); struct audiodev * audiodev_get(unsigned int); int audiodev_set_default(struct audiodev *); int audiodev_set_param(struct audiodev *, int, Index: src/usr.bin/audiocfg/main.c diff -u src/usr.bin/audiocfg/main.c:1.11 src/usr.bin/audiocfg/main.c:1.12 --- src/usr.bin/audiocfg/main.c:1.11 Sat Aug 24 04:04:10 2019 +++ src/usr.bin/audiocfg/main.c Sat Aug 24 05:45:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.11 2019/08/24 04:04:10 isaki Exp $ */ +/* $NetBSD: main.c,v 1.12 2019/08/24 05:45:25 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -72,15 +72,15 @@ const char *encoding_names[] = { u_int encoding_max = __arraycount(encoding_names); static void -print_audiodev(struct audiodev *adev, int i) +print_audiodev(struct audiodev *adev) { struct audiofmt *f; int j; assert(adev != NULL); - printf("%u: [%c] %s @ %s: ", - i, adev->defaultdev ? '*' : ' ', + printf("[%c] %s @ %s: ", + adev->defaultdev ? '*' : ' ', adev->xname, adev->pxname); printf("%s", adev->audio_device.name); if (strlen(adev->audio_device.version) > 0) @@ -159,9 +159,12 @@ main(int argc, char *argv[]) /* NOTREACHED */ if (strcmp(argv[1], "list") == 0 && argc == 2) { - n = audiodev_count(); - for (i = 0; i < n; i++) - print_audiodev(audiodev_get(i), i); + n = audiodev_maxunit(); + for (i = 0; i <= n; i++) { + adev = audiodev_get(i); + if (adev) +print_audiodev(adev); + } } else if (strcmp(argv[1], "list") == 0 && argc == 3) { errno = 0; i = strtoul(argv[2], NULL, 10); @@ -173,7 +176,7 @@ main(int argc, char *argv[]) fprintf(stderr, "no such device\n"); return EXIT_FAILURE; } - print_audiodev(adev, i); + print_audiodev(adev); } else if (strcmp(argv[1], "default") == 0 && argc == 3) { if (*argv[2] < '0' || *argv[2] > '9') usage(argv[0]); @@ -252,7 +255,7 @@ main(int argc, char *argv[]) fprintf(stderr, "no such device\n"); return EXIT_FAILURE; } - print_audiodev(adev, i); + print_audiodev(adev); if (audiodev_test(adev) == -1) return EXIT_FAILURE; } else
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 05:45:25 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c audiodev.h main.c Log Message: Use device unit number for index. The index number was too confusing such as 0: [ ] audio1 @ wss0 1: [*] audio0 @ yds0 in my PC for example. Here is new format: [*] audio0 @ yds0 [ ] audio1 @ wss0 In this style, devices are always listed in order of unit number and 0 always means audio0, 1 always means audio1. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.7 -r1.8 src/usr.bin/audiocfg/audiodev.h cvs rdiff -u -r1.11 -r1.12 src/usr.bin/audiocfg/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 04:04:10 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c audiodev.h main.c Log Message: Revert to use single descriptor for "audiocfg test" as before. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiodev.h cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 04:04:10 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c audiodev.h main.c Log Message: Revert to use single descriptor for "audiocfg test" as before. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiodev.h cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/main.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/audiocfg/audiodev.c diff -u src/usr.bin/audiocfg/audiodev.c:1.8 src/usr.bin/audiocfg/audiodev.c:1.9 --- src/usr.bin/audiocfg/audiodev.c:1.8 Sat Aug 24 03:28:37 2019 +++ src/usr.bin/audiocfg/audiodev.c Sat Aug 24 04:04:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.c,v 1.8 2019/08/24 03:28:37 isaki Exp $ */ +/* $NetBSD: audiodev.c,v 1.9 2019/08/24 04:04:10 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -43,6 +43,9 @@ #include "drvctl.h" #include "dtmf.h" +static int audiodev_test_chmask(struct audiodev *, unsigned int, + audio_info_t *); + static TAILQ_HEAD(audiodevhead, audiodev) audiodevlist = TAILQ_HEAD_INITIALIZER(audiodevlist); @@ -298,17 +301,16 @@ audiodev_set_param(struct audiodev *adev } int -audiodev_test(struct audiodev *adev, unsigned int chanmask) +audiodev_test(struct audiodev *adev) { audio_info_t info; - int16_t *buf; - size_t buflen; - off_t off; - int fd; - int rv = -1; + unsigned int i; + int rv; - fd = open(adev->path, O_WRONLY); - if (fd == -1) { + rv = -1; + + adev->fd = open(adev->path, O_WRONLY); + if (adev->fd == -1) { perror("open"); return -1; } @@ -319,19 +321,44 @@ audiodev_test(struct audiodev *adev, uns info.play.precision = 16; info.play.encoding = AUDIO_ENCODING_SLINEAR_LE; info.mode = AUMODE_PLAY; - if (ioctl(fd, AUDIO_SETINFO, ) == -1) { + if (ioctl(adev->fd, AUDIO_SETINFO, ) == -1) { perror("ioctl AUDIO_SETINFO"); - goto abort; + goto done; } - if (ioctl(fd, AUDIO_GETINFO, ) == -1) { + if (ioctl(adev->fd, AUDIO_GETINFO, ) == -1) { perror("ioctl AUDIO_GETINFO"); - goto abort; + goto done; + } + + for (i = 0; i < adev->hwinfo.play.channels; i++) { + printf(" testing channel %u...", i); + fflush(stdout); + if (audiodev_test_chmask(adev, 1 << i, ) == -1) + goto done; + printf(" done\n"); } - dtmf_new(, , info.play.sample_rate, 2, + rv = 0; +done: + close(adev->fd); + return rv; +} + +static int +audiodev_test_chmask(struct audiodev *adev, unsigned int chanmask, + audio_info_t *info) +{ + int16_t *buf; + size_t buflen; + off_t off; + int rv; + + rv = -1; + + dtmf_new(, , info->play.sample_rate, 2, adev->hwinfo.play.channels, chanmask, 350.0, 440.0); if (buf == NULL) { - goto abort; + return -1; } off = 0; @@ -339,10 +366,10 @@ audiodev_test(struct audiodev *adev, uns size_t wlen; ssize_t ret; - wlen = info.play.buffer_size; + wlen = info->play.buffer_size; if (wlen > buflen) wlen = buflen; - ret = write(fd, (char *)buf + off, wlen); + ret = write(adev->fd, (char *)buf + off, wlen); if (ret == -1) { perror("write"); goto done; @@ -352,7 +379,7 @@ audiodev_test(struct audiodev *adev, uns buflen -= wlen; } - if (ioctl(fd, AUDIO_DRAIN) == -1) { + if (ioctl(adev->fd, AUDIO_DRAIN) == -1) { perror("ioctl AUDIO_DRAIN"); goto done; } @@ -360,8 +387,5 @@ audiodev_test(struct audiodev *adev, uns rv = 0; done: free(buf); -abort: - close(fd); - return rv; } Index: src/usr.bin/audiocfg/audiodev.h diff -u src/usr.bin/audiocfg/audiodev.h:1.6 src/usr.bin/audiocfg/audiodev.h:1.7 --- src/usr.bin/audiocfg/audiodev.h:1.6 Sat Aug 24 03:28:37 2019 +++ src/usr.bin/audiocfg/audiodev.h Sat Aug 24 04:04:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.h,v 1.6 2019/08/24 03:28:37 isaki Exp $ */ +/* $NetBSD: audiodev.h,v 1.7 2019/08/24 04:04:10 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -46,6 +46,7 @@ struct audiodev { uint16_t unit; char path[PATH_MAX+1]; char ctlpath[PATH_MAX+1]; + int fd; int ctlfd; dev_t dev; @@ -65,7 +66,7 @@ int audiodev_set_default(struct audiod int audiodev_set_param(struct audiodev *, int, const char *, unsigned int, unsigned int, unsigned int); -int audiodev_test(struct audiodev *, unsigned int); +int audiodev_test(struct audiodev *); extern const char * encoding_names[]; extern u_int encoding_max; Index: src/usr.bin/audiocfg/main.c diff -u src/usr.bin/audiocfg/main.c:1.10 src/usr.bin/audiocfg/main.c:1.11 --- src/usr.bin/audiocfg/main.c:1.10 Sat Aug 24 03:28:37 2019 +++ src/usr.bin/audiocfg/main.c Sat Aug 24 04:04:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.10 2019/08/24 03:28:37 isaki Exp $ */ +/* $NetBSD: main.c,v 1.11 2019/08/24 04:04:10 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -253,13 +253,8 @@ main(int argc, char *argv[]) return EXIT_FAILURE; }
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 03:28:38 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c audiodev.h main.c Log Message: Rename some members in adev for clarity. No functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.5 -r1.6 src/usr.bin/audiocfg/audiodev.h cvs rdiff -u -r1.9 -r1.10 src/usr.bin/audiocfg/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/audiocfg
Module Name:src Committed By: isaki Date: Sat Aug 24 03:28:38 UTC 2019 Modified Files: src/usr.bin/audiocfg: audiodev.c audiodev.h main.c Log Message: Rename some members in adev for clarity. No functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.bin/audiocfg/audiodev.c cvs rdiff -u -r1.5 -r1.6 src/usr.bin/audiocfg/audiodev.h cvs rdiff -u -r1.9 -r1.10 src/usr.bin/audiocfg/main.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/audiocfg/audiodev.c diff -u src/usr.bin/audiocfg/audiodev.c:1.7 src/usr.bin/audiocfg/audiodev.c:1.8 --- src/usr.bin/audiocfg/audiodev.c:1.7 Wed May 8 14:36:12 2019 +++ src/usr.bin/audiocfg/audiodev.c Sat Aug 24 03:28:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.c,v 1.7 2019/05/08 14:36:12 isaki Exp $ */ +/* $NetBSD: audiodev.c,v 1.8 2019/08/24 03:28:37 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -63,26 +63,26 @@ audiodev_getinfo(struct audiodev *adev) if (stat(_PATH_AUDIOCTL, ) != -1 && st.st_rdev == adev->dev) adev->defaultdev = true; - adev->fd = open(adev->ctlpath, O_RDONLY); - if (adev->fd == -1) { + adev->ctlfd = open(adev->ctlpath, O_RDONLY); + if (adev->ctlfd == -1) { return -1; } - if (ioctl(adev->fd, AUDIO_GETDEV, >audio_device) == -1) { - close(adev->fd); + if (ioctl(adev->ctlfd, AUDIO_GETDEV, >audio_device) == -1) { + close(adev->ctlfd); return -1; } for (i = 0; ;i++) { memset(, 0, sizeof(query)); query.index = i; - if (ioctl(adev->fd, AUDIO_QUERYFORMAT, ) == -1) { + if (ioctl(adev->ctlfd, AUDIO_QUERYFORMAT, ) == -1) { if (errno == ENODEV) { /* QUERYFORMAT not supported. */ break; } if (errno == EINVAL) break; - close(adev->fd); + close(adev->ctlfd); return -1; } @@ -91,8 +91,8 @@ audiodev_getinfo(struct audiodev *adev) TAILQ_INSERT_TAIL(>formats, f, next); } - if (ioctl(adev->fd, AUDIO_GETFORMAT, >info) == -1) { - close(adev->fd); + if (ioctl(adev->ctlfd, AUDIO_GETFORMAT, >hwinfo) == -1) { + close(adev->ctlfd); return -1; } @@ -158,8 +158,8 @@ audiodev_refresh(void) while (!TAILQ_EMPTY()) { adev = TAILQ_FIRST(); - if (adev->fd != -1) - close(adev->fd); + if (adev->ctlfd != -1) + close(adev->ctlfd); TAILQ_REMOVE(, adev, next); free(adev); } @@ -250,12 +250,12 @@ int audiodev_set_param(struct audiodev *adev, int mode, const char *encname, unsigned int prec, unsigned int ch, unsigned int freq) { - struct audio_info ai; + audio_info_t ai; int setmode; u_int enc; setmode = 0; - ai = adev->info; + ai = adev->hwinfo; for (enc = 0; enc < encoding_max; enc++) { if (strcmp(encname, encoding_names[enc]) == 0) @@ -290,7 +290,7 @@ audiodev_set_param(struct audiodev *adev ai.mode = setmode; printf("setting %s to %s:%u, %uch, %uHz\n", adev->xname, encname, prec, ch, freq); - if (ioctl(adev->fd, AUDIO_SETFORMAT, ) == -1) { + if (ioctl(adev->ctlfd, AUDIO_SETFORMAT, ) == -1) { perror("ioctl AUDIO_SETFORMAT"); return -1; } @@ -315,7 +315,7 @@ audiodev_test(struct audiodev *adev, uns AUDIO_INITINFO(); info.play.sample_rate = AUDIODEV_SAMPLE_RATE; - info.play.channels = adev->info.play.channels; + info.play.channels = adev->hwinfo.play.channels; info.play.precision = 16; info.play.encoding = AUDIO_ENCODING_SLINEAR_LE; info.mode = AUMODE_PLAY; @@ -329,7 +329,7 @@ audiodev_test(struct audiodev *adev, uns } dtmf_new(, , info.play.sample_rate, 2, - adev->info.play.channels, chanmask, 350.0, 440.0); + adev->hwinfo.play.channels, chanmask, 350.0, 440.0); if (buf == NULL) { goto abort; } Index: src/usr.bin/audiocfg/audiodev.h diff -u src/usr.bin/audiocfg/audiodev.h:1.5 src/usr.bin/audiocfg/audiodev.h:1.6 --- src/usr.bin/audiocfg/audiodev.h:1.5 Wed May 8 14:36:12 2019 +++ src/usr.bin/audiocfg/audiodev.h Sat Aug 24 03:28:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audiodev.h,v 1.5 2019/05/08 14:36:12 isaki Exp $ */ +/* $NetBSD: audiodev.h,v 1.6 2019/08/24 03:28:37 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -46,14 +46,14 @@ struct audiodev { uint16_t unit; char path[PATH_MAX+1]; char ctlpath[PATH_MAX+1]; + int ctlfd; - int fd; dev_t dev; bool defaultdev; audio_device_t audio_device; TAILQ_HEAD(, audiofmt) formats; - struct audio_info info; + audio_info_t hwinfo; TAILQ_ENTRY(audiodev) next; }; Index: src/usr.bin/audiocfg/main.c diff -u src/usr.bin/audiocfg/main.c:1.9 src/usr.bin/audiocfg/main.c:1.10 --- src/usr.bin/audiocfg/main.c:1.9 Thu Aug 22 14:40:14 2019 +++ src/usr.bin/audiocfg/main.c Sat Aug 24 03:28:37 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.9 2019/08/22 14:40:14 isaki Exp $ */ +/* $NetBSD: main.c,v 1.10 2019/08/24 03:28:37 isaki Exp $ */ /* * Copyright (c) 2010 Jared D. McNeill @@ -87,17 +87,21 @@ print_audiodev(struct audiodev *adev, in printf(" %s",
CVS commit: src/external/bsd/compiler_rt/lib/clang/lib/netbsd
Module Name:src Committed By: kamil Date: Fri Aug 23 19:26:03 UTC 2019 Modified Files: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32: Makefile src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64: Makefile src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64: Makefile Log Message: Fix LLVM sanitizer build by GCC (HAVE_LLVM=no) Do not error if a priority from 0 to 100 is used for constructor or destructor. Use -Wno-error to silence all errors from this warning type. There should be used -Wno-prio-ctor-dtor, but it's not supported by GCC7. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/compiler_rt/lib/clang/lib/netbsd
Module Name:src Committed By: kamil Date: Fri Aug 23 19:26:03 UTC 2019 Modified Files: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32: Makefile src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64: Makefile src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64: Makefile Log Message: Fix LLVM sanitizer build by GCC (HAVE_LLVM=no) Do not error if a priority from 0 to 100 is used for constructor or destructor. Use -Wno-error to silence all errors from this warning type. There should be used -Wno-prio-ctor-dtor, but it's not supported by GCC7. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile:1.1 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile:1.2 --- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile:1.1 Thu Aug 8 14:00:30 2019 +++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32/Makefile Fri Aug 23 19:26:02 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2019/08/08 14:00:30 kamil Exp $ +# $NetBSD: Makefile,v 1.2 2019/08/23 19:26:02 kamil Exp $ NOSANITIZER=# defined @@ -26,6 +26,8 @@ SRCS+= ${SANITIZER_NOLIBC_SOURCES} CXXFLAGS+= -fno-rtti -fno-exceptions -fno-builtin -fno-stack-protector +COPTS.safestack.cc+= ${${ACTIVE_CXX} == "gcc" :? -Wno-error :} + LIBDIR= /usr/lib/clang/${CLANG_VER}/lib/netbsd LIBISCXX= yes Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile:1.1 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile:1.2 --- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile:1.1 Thu Aug 8 14:00:30 2019 +++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64/Makefile Fri Aug 23 19:26:02 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2019/08/08 14:00:30 kamil Exp $ +# $NetBSD: Makefile,v 1.2 2019/08/23 19:26:02 kamil Exp $ NOSANITIZER=# defined @@ -26,6 +26,8 @@ SRCS+= ${SANITIZER_NOLIBC_SOURCES} CXXFLAGS+= -fno-rtti -fno-exceptions -fno-builtin -fno-stack-protector +COPTS.safestack.cc+= ${${ACTIVE_CXX} == "gcc" :? -Wno-error :} + LIBDIR= /usr/lib/clang/${CLANG_VER}/lib/netbsd LIBISCXX= yes Index: src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile diff -u src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile:1.1 src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile:1.2 --- src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile:1.1 Thu Aug 8 14:00:32 2019 +++ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64/Makefile Fri Aug 23 19:26:02 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2019/08/08 14:00:32 kamil Exp $ +# $NetBSD: Makefile,v 1.2 2019/08/23 19:26:02 kamil Exp $ NOSANITIZER=# defined @@ -23,6 +23,8 @@ SRCS+= ${SANITIZER_LIBCDEP_SOURCES} CXXFLAGS+= -fno-rtti -fno-exceptions -fno-builtin -fno-stack-protector +COPTS.xray_init.cc+= ${${ACTIVE_CXX} == "gcc" :? -Wno-error :} + # Macro defined in newer builtin subdirectory, it has to be empty on NetBSD CPPFLAGS+= -DNO_EXEC_STACK_DIRECTIVE=""
CVS commit: src/sys/ddb
Module Name:src Committed By: kamil Date: Fri Aug 23 14:48:51 UTC 2019 Modified Files: src/sys/ddb: db_access.c Log Message: Avoids signedness bit shift in db_get_value() Appease UBSan. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/ddb/db_access.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/ddb/db_access.c diff -u src/sys/ddb/db_access.c:1.23 src/sys/ddb/db_access.c:1.24 --- src/sys/ddb/db_access.c:1.23 Sun Feb 4 09:17:54 2018 +++ src/sys/ddb/db_access.c Fri Aug 23 14:48:50 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: db_access.c,v 1.23 2018/02/04 09:17:54 mrg Exp $ */ +/* $NetBSD: db_access.c,v 1.24 2019/08/23 14:48:50 kamil Exp $ */ /* * Mach Operating System @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_access.c,v 1.23 2018/02/04 09:17:54 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_access.c,v 1.24 2019/08/23 14:48:50 kamil Exp $"); #if defined(_KERNEL_OPT) #include "opt_kgdb.h" @@ -59,18 +59,21 @@ db_expr_t db_get_value(db_addr_t addr, size_t size, bool is_signed) { char data[sizeof(db_expr_t)] __aligned(sizeof(db_expr_t)); + uintmax_t uvalue; db_expr_t value; size_t i; db_read_bytes(addr, size, data); - value = 0; + uvalue = 0; #if BYTE_ORDER == LITTLE_ENDIAN for (i = size; i-- > 0;) #else /* BYTE_ORDER == BIG_ENDIAN */ for (i = 0; i < size; i++) #endif /* BYTE_ORDER */ - value = (value << 8) + (data[i] & 0xFF); + uvalue = (uvalue << 8) + (data[i] & 0xFF); + + value = (db_expr_t)uvalue; if (size < sizeof(db_expr_t) && is_signed && (value & ((db_expr_t)1 << (8*size - 1 {
CVS commit: src/sys/ddb
Module Name:src Committed By: kamil Date: Fri Aug 23 14:48:51 UTC 2019 Modified Files: src/sys/ddb: db_access.c Log Message: Avoids signedness bit shift in db_get_value() Appease UBSan. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/ddb/db_access.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/miscfs/procfs
Module Name:src Committed By: maxv Date: Fri Aug 23 14:12:39 UTC 2019 Modified Files: src/sys/miscfs/procfs: procfs_linux.c Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/miscfs/procfs/procfs_linux.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/miscfs/procfs/procfs_linux.c diff -u src/sys/miscfs/procfs/procfs_linux.c:1.74 src/sys/miscfs/procfs/procfs_linux.c:1.75 --- src/sys/miscfs/procfs/procfs_linux.c:1.74 Wed Dec 5 18:16:51 2018 +++ src/sys/miscfs/procfs/procfs_linux.c Fri Aug 23 14:12:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_linux.c,v 1.74 2018/12/05 18:16:51 christos Exp $ */ +/* $NetBSD: procfs_linux.c,v 1.75 2019/08/23 14:12:39 maxv Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.74 2018/12/05 18:16:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.75 2019/08/23 14:12:39 maxv Exp $"); #include #include @@ -383,6 +383,7 @@ procfs_do_pid_statm(struct lwp *curl, st mutex_enter(p->p_lock); /* retrieve RSS size */ + memset(, 0, sizeof(ki)); fill_kproc2(p, , false, false); mutex_exit(p->p_lock); @@ -440,6 +441,7 @@ procfs_do_pid_stat(struct lwp *curl, str mutex_enter(proc_lock); mutex_enter(p->p_lock); + memset(, 0, sizeof(ki)); fill_kproc2(p, , false, false); calcru(p, NULL, NULL, NULL, );
CVS commit: src/sys/miscfs/procfs
Module Name:src Committed By: maxv Date: Fri Aug 23 14:12:39 UTC 2019 Modified Files: src/sys/miscfs/procfs: procfs_linux.c Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/miscfs/procfs/procfs_linux.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: maxv Date: Fri Aug 23 13:59:45 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_43.c Log Message: Fix info leak. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_compat_43.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/compat/netbsd32/netbsd32_compat_43.c diff -u src/sys/compat/netbsd32/netbsd32_compat_43.c:1.57 src/sys/compat/netbsd32/netbsd32_compat_43.c:1.58 --- src/sys/compat/netbsd32/netbsd32_compat_43.c:1.57 Sun Jan 27 02:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_43.c Fri Aug 23 13:59:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_43.c,v 1.57 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_compat_43.c,v 1.58 2019/08/23 13:59:45 maxv Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.57 2019/01/27 02:08:40 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.58 2019/08/23 13:59:45 maxv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -77,6 +77,7 @@ static void netbsd32_from_stat(const struct stat *sb, struct netbsd32_stat43 *sp32) { + memset(sp32, 0, sizeof(*sp32)); sp32->st_dev = sb->st_dev; sp32->st_ino = sb->st_ino; sp32->st_mode = sb->st_mode;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: maxv Date: Fri Aug 23 13:59:45 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_43.c Log Message: Fix info leak. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_compat_43.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux32/common
Module Name:src Committed By: maxv Date: Fri Aug 23 13:49:12 UTC 2019 Modified Files: src/sys/compat/linux32/common: linux32_misc.c Log Message: Hum, don't forget the 'pid' argument, otherwise we're not gonna go very far. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/compat/linux32/common/linux32_misc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux32/common
Module Name:src Committed By: maxv Date: Fri Aug 23 13:49:12 UTC 2019 Modified Files: src/sys/compat/linux32/common: linux32_misc.c Log Message: Hum, don't forget the 'pid' argument, otherwise we're not gonna go very far. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/compat/linux32/common/linux32_misc.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/compat/linux32/common/linux32_misc.c diff -u src/sys/compat/linux32/common/linux32_misc.c:1.26 src/sys/compat/linux32/common/linux32_misc.c:1.27 --- src/sys/compat/linux32/common/linux32_misc.c:1.26 Mon Apr 10 15:04:32 2017 +++ src/sys/compat/linux32/common/linux32_misc.c Fri Aug 23 13:49:12 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_misc.c,v 1.26 2017/04/10 15:04:32 dholland Exp $ */ +/* $NetBSD: linux32_misc.c,v 1.27 2019/08/23 13:49:12 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.26 2017/04/10 15:04:32 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.27 2019/08/23 13:49:12 maxv Exp $"); #include #include @@ -293,11 +293,13 @@ linux32_sys_get_robust_list(struct lwp * const struct linux32_sys_get_robust_list_args *uap, register_t *retval) { /* { + syscallarg(linux32_pid_t) pid; syscallarg(linux32_robust_list_headpp_t) head; syscallarg(linux32_sizep_t) len; } */ struct linux_sys_get_robust_list_args ua; + NETBSD32TOX_UAP(pid, int); NETBSD32TOP_UAP(head, struct robust_list_head *); NETBSD32TOP_UAP(len, size_t *); return linux_sys_get_robust_list(l, , retval);
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 13:36:45 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_statfs.h Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/common/linux_statfs.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/compat/linux/common/linux_statfs.h diff -u src/sys/compat/linux/common/linux_statfs.h:1.6 src/sys/compat/linux/common/linux_statfs.h:1.7 --- src/sys/compat/linux/common/linux_statfs.h:1.6 Thu Sep 13 13:59:33 2012 +++ src/sys/compat/linux/common/linux_statfs.h Fri Aug 23 13:36:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_statfs.h,v 1.6 2012/09/13 13:59:33 pooka Exp $ */ +/* $NetBSD: linux_statfs.h,v 1.7 2019/08/23 13:36:45 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -48,6 +48,8 @@ bsd_to_linux_statfs(const struct statvfs { int i; + memset(lsp, 0, sizeof(*lsp)); + for (i = 0; i < linux_fstypes_cnt; i++) { if (strcmp(bsp->f_fstypename, linux_fstypes[i].mty_bsd) == 0) { lsp->l_ftype = linux_fstypes[i].mty_linux; @@ -82,7 +84,6 @@ bsd_to_linux_statfs(const struct statvfs lsp->l_ffsid.val[0] = bsp->f_fsidx.__fsid_val[0]; lsp->l_ffsid.val[1] = bsp->f_fsidx.__fsid_val[1]; lsp->l_fnamelen = bsp->f_namemax; - (void)memset(lsp->l_fspare, 0, sizeof(lsp->l_fspare)); } /* @@ -96,6 +97,8 @@ bsd_to_linux_statfs64(const struct statv { int i, div; + memset(lsp, 0, sizeof(*lsp)); + for (i = 0; i < linux_fstypes_cnt; i++) { if (strcmp(bsp->f_fstypename, linux_fstypes[i].mty_bsd) == 0) { lsp->l_ftype = linux_fstypes[i].mty_linux; @@ -121,7 +124,6 @@ bsd_to_linux_statfs64(const struct statv lsp->l_ffsid.val[0] = bsp->f_fsidx.__fsid_val[0]; lsp->l_ffsid.val[1] = bsp->f_fsidx.__fsid_val[1]; lsp->l_fnamelen = bsp->f_namemax; - (void)memset(lsp->l_fspare, 0, sizeof(lsp->l_fspare)); } #endif /* !_LINUX_STATFS_H */
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 13:36:45 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_statfs.h Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/common/linux_statfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux32/common
Module Name:src Committed By: maxv Date: Fri Aug 23 12:49:59 UTC 2019 Modified Files: src/sys/compat/linux32/common: linux32_ioctl.c Log Message: Put the printf under DEBUG_LINUX. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux32/common
Module Name:src Committed By: maxv Date: Fri Aug 23 12:49:59 UTC 2019 Modified Files: src/sys/compat/linux32/common: linux32_ioctl.c Log Message: Put the printf under DEBUG_LINUX. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux32/common/linux32_ioctl.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/compat/linux32/common/linux32_ioctl.c diff -u src/sys/compat/linux32/common/linux32_ioctl.c:1.13 src/sys/compat/linux32/common/linux32_ioctl.c:1.14 --- src/sys/compat/linux32/common/linux32_ioctl.c:1.13 Tue Aug 18 02:02:58 2009 +++ src/sys/compat/linux32/common/linux32_ioctl.c Fri Aug 23 12:49:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_ioctl.c,v 1.13 2009/08/18 02:02:58 christos Exp $ */ +/* $NetBSD: linux32_ioctl.c,v 1.14 2019/08/23 12:49:59 maxv Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_ioctl.c,v 1.13 2009/08/18 02:02:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_ioctl.c,v 1.14 2019/08/23 12:49:59 maxv Exp $"); #include #include @@ -124,7 +124,9 @@ linux32_sys_ioctl(struct lwp *l, const s error = linux32_ioctl_socket(l, uap, retval); break; default: +#ifdef DEBUG_LINUX printf("Not yet implemented ioctl group \'%c\'\n", group); +#endif error = EINVAL; break; }
CVS commit: src/sys/compat/ossaudio
Module Name:src Committed By: maxv Date: Fri Aug 23 12:42:14 UTC 2019 Modified Files: src/sys/compat/ossaudio: ossaudio.c Log Message: Fix error handling, returns an errno, not -1. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/compat/ossaudio/ossaudio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/ossaudio
Module Name:src Committed By: maxv Date: Fri Aug 23 12:42:14 UTC 2019 Modified Files: src/sys/compat/ossaudio: ossaudio.c Log Message: Fix error handling, returns an errno, not -1. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/compat/ossaudio/ossaudio.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/compat/ossaudio/ossaudio.c diff -u src/sys/compat/ossaudio/ossaudio.c:1.74 src/sys/compat/ossaudio/ossaudio.c:1.75 --- src/sys/compat/ossaudio/ossaudio.c:1.74 Sun Feb 3 03:19:26 2019 +++ src/sys/compat/ossaudio/ossaudio.c Fri Aug 23 12:42:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.74 2019/02/03 03:19:26 mrg Exp $ */ +/* $NetBSD: ossaudio.c,v 1.75 2019/08/23 12:42:14 maxv Exp $ */ /*- * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.74 2019/02/03 03:19:26 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.75 2019/08/23 12:42:14 maxv Exp $"); #include #include @@ -966,7 +966,7 @@ getdevinfo(file_t *fp) } for(i = 0; i < NETBSD_MAXDEVS; i++) { mi.index = i; - if (ioctlf(fp, AUDIO_MIXER_DEVINFO, ) < 0) + if (ioctlf(fp, AUDIO_MIXER_DEVINFO, ) != 0) break; switch(mi.type) { case AUDIO_MIXER_VALUE: @@ -994,7 +994,7 @@ getdevinfo(file_t *fp) } for(i = 0; i < NETBSD_MAXDEVS; i++) { mi.index = i; - if (ioctlf(fp, AUDIO_MIXER_DEVINFO, ) < 0) + if (ioctlf(fp, AUDIO_MIXER_DEVINFO, ) != 0) break; if (strcmp(mi.label.name, AudioNsource) != 0) continue;
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 12:09:18 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_termios.c src/sys/compat/linux32/common: linux32_termios.c Log Message: Add a default case, don't call sys_ioctl() with an uninitialized 'com' argument. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/compat/linux/common/linux_termios.c cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux32/common/linux32_termios.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/compat/linux/common/linux_termios.c diff -u src/sys/compat/linux/common/linux_termios.c:1.37 src/sys/compat/linux/common/linux_termios.c:1.38 --- src/sys/compat/linux/common/linux_termios.c:1.37 Fri Dec 27 16:58:50 2013 +++ src/sys/compat/linux/common/linux_termios.c Fri Aug 23 12:09:17 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_termios.c,v 1.37 2013/12/27 16:58:50 njoly Exp $ */ +/* $NetBSD: linux_termios.c,v 1.38 2019/08/23 12:09:17 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.37 2013/12/27 16:58:50 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.38 2019/08/23 12:09:17 maxv Exp $"); #if defined(_KERNEL_OPT) #include "opt_ptm.h" @@ -259,6 +259,7 @@ linux_ioctl_termios(struct lwp *l, const case LINUX_TIOCLINUX_READMOUSE: case LINUX_TIOCLINUX_VESABLANK: case LINUX_TIOCLINUX_CURCONS: /* could use VT_GETACTIVE */ + default: error = EINVAL; goto out; } Index: src/sys/compat/linux32/common/linux32_termios.c diff -u src/sys/compat/linux32/common/linux32_termios.c:1.14 src/sys/compat/linux32/common/linux32_termios.c:1.15 --- src/sys/compat/linux32/common/linux32_termios.c:1.14 Wed Nov 19 18:36:04 2008 +++ src/sys/compat/linux32/common/linux32_termios.c Fri Aug 23 12:09:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_termios.c,v 1.14 2008/11/19 18:36:04 ad Exp $ */ +/* $NetBSD: linux32_termios.c,v 1.15 2019/08/23 12:09:18 maxv Exp $ */ /*- * Copyright (c) 1995-2006, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_termios.c,v 1.14 2008/11/19 18:36:04 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_termios.c,v 1.15 2019/08/23 12:09:18 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_linux32.h" @@ -262,6 +262,7 @@ linux32_ioctl_termios(struct lwp *l, con case LINUX_TIOCLINUX_READMOUSE: case LINUX_TIOCLINUX_VESABLANK: case LINUX_TIOCLINUX_CURCONS: /* could use VT_GETACTIVE */ + default: error = EINVAL; goto out; }
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 12:09:18 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_termios.c src/sys/compat/linux32/common: linux32_termios.c Log Message: Add a default case, don't call sys_ioctl() with an uninitialized 'com' argument. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/compat/linux/common/linux_termios.c cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux32/common/linux32_termios.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 11:19:39 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_fcntl.h Log Message: When dealing with an unknown value, set -1, to prevent (harmless) uninitialized accesses later. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux/common/linux_fcntl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 11:19:39 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_fcntl.h Log Message: When dealing with an unknown value, set -1, to prevent (harmless) uninitialized accesses later. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux/common/linux_fcntl.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/compat/linux/common/linux_fcntl.h diff -u src/sys/compat/linux/common/linux_fcntl.h:1.17 src/sys/compat/linux/common/linux_fcntl.h:1.18 --- src/sys/compat/linux/common/linux_fcntl.h:1.17 Sun Mar 1 13:19:39 2015 +++ src/sys/compat/linux/common/linux_fcntl.h Fri Aug 23 11:19:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_fcntl.h,v 1.17 2015/03/01 13:19:39 njoly Exp $ */ +/* $NetBSD: linux_fcntl.h,v 1.18 2019/08/23 11:19:39 maxv Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -132,6 +132,9 @@ LINUX##_to_bsd_##FLOCK(struct flock *bfp case src_f##_WRLCK: \ dst->l_type = dst_f##_WRLCK; \ break; \ + default: \ + dst->l_type = -1; \ + break; \ } \ }
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Fri Aug 23 11:09:14 UTC 2019 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Danny Cohen https://www.nytimes.com/2019/08/16/obituaries/danny-cohen-who-helped-set-the-stage-for-a-digital-era-dies-at-81.html To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/usr.bin/calendar/calendars/calendar.birthday 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/calendar/calendars/calendar.birthday diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.29 src/usr.bin/calendar/calendars/calendar.birthday:1.30 --- src/usr.bin/calendar/calendars/calendar.birthday:1.29 Sun Jul 14 10:43:01 2019 +++ src/usr.bin/calendar/calendars/calendar.birthday Fri Aug 23 11:09:14 2019 @@ -175,6 +175,7 @@ 08/01 Herman Melville born, 1819 08/03 Lenny Bruce dies of a morphine overdose, 1966 08/08 Dustin Hoffman born in Los Angeles, 1937 +08/12 Danny Cohen died in Palo Alto, California, 2019 08/12 Thomas Mann's Death, 1955 08/13 Annie Oakley born, 1860 08/13 Fidel Castro born, 1927 @@ -256,6 +257,7 @@ 12/05 Walt (Walter Elias) Disney born in Chicago, 1901 12/08 Horace (Quintus Horatius Flaccus) born in Venosa (Italy), 65 BC 12/08 James (Grover) Thurber born in Columbus, Ohio, 1894 +12/09 Danny Cohen born in Haifa, Israel, 1937 12/10 Emily Dickinson born, 1830 12/12 E.G. Robinson born, 1893 12/14 George Washington dies, 1799
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Fri Aug 23 11:09:14 UTC 2019 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Danny Cohen https://www.nytimes.com/2019/08/16/obituaries/danny-cohen-who-helped-set-the-stage-for-a-digital-era-dies-at-81.html To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/usr.bin/calendar/calendars/calendar.birthday Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux/arch/amd64
Module Name:src Committed By: maxv Date: Fri Aug 23 10:31:14 UTC 2019 Modified Files: src/sys/compat/linux/arch/amd64: linux_machdep.c Log Message: Remove printf. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/compat/linux/arch/amd64/linux_machdep.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/compat/linux/arch/amd64/linux_machdep.c diff -u src/sys/compat/linux/arch/amd64/linux_machdep.c:1.58 src/sys/compat/linux/arch/amd64/linux_machdep.c:1.59 --- src/sys/compat/linux/arch/amd64/linux_machdep.c:1.58 Sun May 19 08:46:15 2019 +++ src/sys/compat/linux/arch/amd64/linux_machdep.c Fri Aug 23 10:31:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.58 2019/05/19 08:46:15 maxv Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.59 2019/08/23 10:31:14 maxv Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.58 2019/05/19 08:46:15 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.59 2019/08/23 10:31:14 maxv Exp $"); #include #include @@ -263,7 +263,6 @@ linux_sendsig(const ksiginfo_t *ksi, con int linux_sys_modify_ldt(struct lwp *l, const struct linux_sys_modify_ldt_args *v, register_t *retval) { - printf("linux_sys_modify_ldt\n"); return 0; }
CVS commit: src/sys/compat/linux/arch/amd64
Module Name:src Committed By: maxv Date: Fri Aug 23 10:31:14 UTC 2019 Modified Files: src/sys/compat/linux/arch/amd64: linux_machdep.c Log Message: Remove printf. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/compat/linux/arch/amd64/linux_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: maxv Date: Fri Aug 23 10:22:15 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_ipc.c src/sys/kern: sysv_shm.c src/sys/sys: shm.h Log Message: Fix stupid bugs in linux_sys_shmctl(): the index could be out of bound (page fault) and there was no proper locking. Maybe we should just remove LINUX_SHM_STAT, like compat_linux32. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/compat/linux/common/linux_ipc.c cvs rdiff -u -r1.137 -r1.138 src/sys/kern/sysv_shm.c cvs rdiff -u -r1.53 -r1.54 src/sys/sys/shm.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/compat/linux/common/linux_ipc.c diff -u src/sys/compat/linux/common/linux_ipc.c:1.56 src/sys/compat/linux/common/linux_ipc.c:1.57 --- src/sys/compat/linux/common/linux_ipc.c:1.56 Thu Feb 21 03:37:18 2019 +++ src/sys/compat/linux/common/linux_ipc.c Fri Aug 23 10:22:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ipc.c,v 1.56 2019/02/21 03:37:18 mrg Exp $ */ +/* $NetBSD: linux_ipc.c,v 1.57 2019/08/23 10:22:15 maxv Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.56 2019/02/21 03:37:18 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.57 2019/08/23 10:22:15 maxv Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -568,6 +568,7 @@ linux_sys_shmctl(struct lwp *l, const st syscallarg(struct linux_shmid_ds *) buf; } */ struct shmid_ds bs; + struct ipc_perm perm; struct linux_shmid_ds ls; struct linux_shmid64_ds ls64; struct linux_shminfo64 lsi64; @@ -582,7 +583,10 @@ linux_sys_shmctl(struct lwp *l, const st switch (cmd & ~LINUX_IPC_64) { case LINUX_SHM_STAT: - shmid = IXSEQ_TO_IPCID(shmid, shmsegs[shmid].shm_perm); + error = shm_find_segment_perm_by_index(shmid, ); + if (error) + return error; + shmid = IXSEQ_TO_IPCID(shmid, perm); retval[0] = shmid; /*FALLTHROUGH*/ Index: src/sys/kern/sysv_shm.c diff -u src/sys/kern/sysv_shm.c:1.137 src/sys/kern/sysv_shm.c:1.138 --- src/sys/kern/sysv_shm.c:1.137 Wed Aug 7 00:38:02 2019 +++ src/sys/kern/sysv_shm.c Fri Aug 23 10:22:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sysv_shm.c,v 1.137 2019/08/07 00:38:02 pgoyette Exp $ */ +/* $NetBSD: sysv_shm.c,v 1.138 2019/08/23 10:22:14 maxv Exp $ */ /*- * Copyright (c) 1999, 2007 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysv_shm.c,v 1.137 2019/08/07 00:38:02 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysv_shm.c,v 1.138 2019/08/23 10:22:14 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_sysv.h" @@ -121,6 +121,26 @@ SYSCTL_SETUP_PROTO(sysctl_ipc_shm_setup) static int shmrealloc(int); /* + * Find the shared memory segment permission by the index. Only used by + * compat_linux to implement SHM_STAT. + */ +int +shm_find_segment_perm_by_index(int index, struct ipc_perm *perm) +{ + struct shmid_ds *shmseg; + + mutex_enter(_lock); + if (index < 0 || index >= shminfo.shmmni) { + mutex_exit(_lock); + return EINVAL; + } + shmseg = [index]; + memcpy(perm, >shm_perm, sizeof(*perm)); + mutex_exit(_lock); + return 0; +} + +/* * Find the shared memory segment by the identifier. * => must be called with shm_lock held; */ Index: src/sys/sys/shm.h diff -u src/sys/sys/shm.h:1.53 src/sys/sys/shm.h:1.54 --- src/sys/sys/shm.h:1.53 Wed Aug 7 00:38:02 2019 +++ src/sys/sys/shm.h Fri Aug 23 10:22:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: shm.h,v 1.53 2019/08/07 00:38:02 pgoyette Exp $ */ +/* $NetBSD: shm.h,v 1.54 2019/08/23 10:22:14 maxv Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -178,6 +178,8 @@ void shmfork(struct vmspace *, struct vm void shmexit(struct vmspace *); int shmctl1(struct lwp *, int, int, struct shmid_ds *); +int shm_find_segment_perm_by_index(int, struct ipc_perm *); + extern void (*uvm_shmexit)(struct vmspace *); extern void (*uvm_shmfork)(struct vmspace *, struct vmspace *);
CVS commit: src/sys
Module Name:src Committed By: maxv Date: Fri Aug 23 10:22:15 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_ipc.c src/sys/kern: sysv_shm.c src/sys/sys: shm.h Log Message: Fix stupid bugs in linux_sys_shmctl(): the index could be out of bound (page fault) and there was no proper locking. Maybe we should just remove LINUX_SHM_STAT, like compat_linux32. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/compat/linux/common/linux_ipc.c cvs rdiff -u -r1.137 -r1.138 src/sys/kern/sysv_shm.c cvs rdiff -u -r1.53 -r1.54 src/sys/sys/shm.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/audio
Module Name:src Committed By: maxv Date: Fri Aug 23 09:41:26 UTC 2019 Modified Files: src/sys/dev/audio: audio.c Log Message: Add missing mutex, we were hitting a KASSERT. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/audio/audio.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/audio
Module Name:src Committed By: maxv Date: Fri Aug 23 09:41:26 UTC 2019 Modified Files: src/sys/dev/audio: audio.c Log Message: Add missing mutex, we were hitting a KASSERT. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.28 src/sys/dev/audio/audio.c:1.29 --- src/sys/dev/audio/audio.c:1.28 Wed Jul 10 13:26:47 2019 +++ src/sys/dev/audio/audio.c Fri Aug 23 09:41:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.28 2019/07/10 13:26:47 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.29 2019/08/23 09:41:26 maxv Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28 2019/07/10 13:26:47 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.29 2019/08/23 09:41:26 maxv Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -7726,7 +7726,9 @@ mixer_ioctl(struct audio_softc *sc, u_lo } else { ma = NULL; } + mutex_enter(sc->sc_lock); mixer_remove(sc); /* remove old entry */ + mutex_exit(sc->sc_lock); if (ma != NULL) { ma->next = sc->sc_async_mixer; ma->pid = curproc->p_pid;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 08:45:25 UTC 2019 Modified Files: src/sys/dev/usb: files.usb Log Message: aue depends upon usbnet To generate a diff of this commit: cvs rdiff -u -r1.166 -r1.167 src/sys/dev/usb/files.usb 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/files.usb diff -u src/sys/dev/usb/files.usb:1.166 src/sys/dev/usb/files.usb:1.167 --- src/sys/dev/usb/files.usb:1.166 Sun Aug 18 09:29:38 2019 +++ src/sys/dev/usb/files.usb Fri Aug 23 08:45:25 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.usb,v 1.166 2019/08/18 09:29:38 mrg Exp $ +# $NetBSD: files.usb,v 1.167 2019/08/23 08:45:25 mrg Exp $ # # Config file and device description for machine-independent USB code. # Included by ports that need it. Ports that use it must provide @@ -334,7 +334,7 @@ file dev/usb/uthum.c uthum # Ethernet adapters # ADMtek AN986 Pegasus -device aue: arp, ether, ifnet, mii, mii_phy +device aue: arp, ether, ifnet, mii, mii_phy, usbnet attach aue at usbdevif file dev/usb/if_aue.c aue
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 08:45:25 UTC 2019 Modified Files: src/sys/dev/usb: files.usb Log Message: aue depends upon usbnet To generate a diff of this commit: cvs rdiff -u -r1.166 -r1.167 src/sys/dev/usb/files.usb Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 08:31:12 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_signal.c src/sys/compat/linux32/common: linux32_signal.c Log Message: Fix info leaks in sigaltstack. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/common/linux_signal.c cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_signal.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/compat/linux/common/linux_signal.c diff -u src/sys/compat/linux/common/linux_signal.c:1.80 src/sys/compat/linux/common/linux_signal.c:1.81 --- src/sys/compat/linux/common/linux_signal.c:1.80 Sun Jan 7 21:14:38 2018 +++ src/sys/compat/linux/common/linux_signal.c Fri Aug 23 08:31:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_signal.c,v 1.80 2018/01/07 21:14:38 christos Exp $ */ +/* $NetBSD: linux_signal.c,v 1.81 2019/08/23 08:31:11 maxv Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.80 2018/01/07 21:14:38 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.81 2019/08/23 08:31:11 maxv Exp $"); #define COMPAT_LINUX 1 @@ -683,6 +683,7 @@ linux_to_native_sigaltstack(struct sigal void native_to_linux_sigaltstack(struct linux_sigaltstack *lss, const struct sigaltstack *bss) { + memset(lss, 0, sizeof(*lss)); lss->ss_sp = bss->ss_sp; lss->ss_size = bss->ss_size; if (bss->ss_flags & SS_ONSTACK) Index: src/sys/compat/linux32/common/linux32_signal.c diff -u src/sys/compat/linux32/common/linux32_signal.c:1.19 src/sys/compat/linux32/common/linux32_signal.c:1.20 --- src/sys/compat/linux32/common/linux32_signal.c:1.19 Sun Jan 7 21:16:00 2018 +++ src/sys/compat/linux32/common/linux32_signal.c Fri Aug 23 08:31:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_signal.c,v 1.19 2018/01/07 21:16:00 christos Exp $ */ +/* $NetBSD: linux32_signal.c,v 1.20 2019/08/23 08:31:11 maxv Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.19 2018/01/07 21:16:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.20 2019/08/23 08:31:11 maxv Exp $"); #include #include @@ -232,6 +232,7 @@ native_to_linux32_sigaction(struct linux void native_to_linux32_sigaltstack(struct linux32_sigaltstack *lss, const struct sigaltstack *bss) { + memset(lss, 0, sizeof(*lss)); NETBSD32PTR32(lss->ss_sp, bss->ss_sp); lss->ss_size = bss->ss_size; if (bss->ss_flags & SS_ONSTACK)
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 08:31:12 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_signal.c src/sys/compat/linux32/common: linux32_signal.c Log Message: Fix info leaks in sigaltstack. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/common/linux_signal.c cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_signal.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: mrg Date: Fri Aug 23 08:17:28 UTC 2019 Modified Files: src/distrib/sets/lists/base: shl.mi src/distrib/sets/lists/comp: mi shl.mi src/distrib/sets/lists/debug: mi shl.mi src/distrib/sets/lists/man: mi src/external/gpl3/gcc/lib: Makefile src/lib: Makefile src/share/mk: bsd.own.mk Log Message: fix MKCXX=no: - don't build GDB - don't build sanitizers - don't build GCC commands - fix some set lists To generate a diff of this commit: cvs rdiff -u -r1.867 -r1.868 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.2282 -r1.2283 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.325 -r1.326 src/distrib/sets/lists/comp/shl.mi cvs rdiff -u -r1.285 -r1.286 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.225 -r1.226 src/distrib/sets/lists/debug/shl.mi cvs rdiff -u -r1.1649 -r1.1650 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/lib/Makefile cvs rdiff -u -r1.271 -r1.272 src/lib/Makefile cvs rdiff -u -r1.1150 -r1.1151 src/share/mk/bsd.own.mk 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: mrg Date: Fri Aug 23 08:17:28 UTC 2019 Modified Files: src/distrib/sets/lists/base: shl.mi src/distrib/sets/lists/comp: mi shl.mi src/distrib/sets/lists/debug: mi shl.mi src/distrib/sets/lists/man: mi src/external/gpl3/gcc/lib: Makefile src/lib: Makefile src/share/mk: bsd.own.mk Log Message: fix MKCXX=no: - don't build GDB - don't build sanitizers - don't build GCC commands - fix some set lists To generate a diff of this commit: cvs rdiff -u -r1.867 -r1.868 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.2282 -r1.2283 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.325 -r1.326 src/distrib/sets/lists/comp/shl.mi cvs rdiff -u -r1.285 -r1.286 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.225 -r1.226 src/distrib/sets/lists/debug/shl.mi cvs rdiff -u -r1.1649 -r1.1650 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/lib/Makefile cvs rdiff -u -r1.271 -r1.272 src/lib/Makefile cvs rdiff -u -r1.1150 -r1.1151 src/share/mk/bsd.own.mk 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/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.867 src/distrib/sets/lists/base/shl.mi:1.868 --- src/distrib/sets/lists/base/shl.mi:1.867 Wed Aug 21 13:48:37 2019 +++ src/distrib/sets/lists/base/shl.mi Fri Aug 23 08:17:27 2019 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.867 2019/08/21 13:48:37 nakayama Exp $ +# $NetBSD: shl.mi,v 1.868 2019/08/23 08:17:27 mrg Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -177,13 +177,13 @@ ./usr/lib/libarchive.sobase-sys-shlib compatfile ./usr/lib/libarchive.so.4 base-sys-shlib compatfile ./usr/lib/libarchive.so.4.0 base-sys-shlib compatfile -./usr/lib/libasan.sobase-sys-shlib compatfile,gcc +./usr/lib/libasan.sobase-sys-shlib compatfile,cxx,gcc ./usr/lib/libasan.so.2base-obsolete obsolete ./usr/lib/libasan.so.2.0 base-obsolete obsolete -./usr/lib/libasan.so.3base-sys-shlib compatfile,gcc=6 -./usr/lib/libasan.so.3.0 base-sys-shlib compatfile,gcc=6 -./usr/lib/libasan.so.4base-sys-shlib compatfile,gcc=7 -./usr/lib/libasan.so.4.0 base-sys-shlib compatfile,gcc=7 +./usr/lib/libasan.so.3base-sys-shlib compatfile,cxx,gcc=6 +./usr/lib/libasan.so.3.0 base-sys-shlib compatfile,cxx,gcc=6 +./usr/lib/libasan.so.4base-sys-shlib compatfile,cxx,gcc=7 +./usr/lib/libasan.so.4.0 base-sys-shlib compatfile,cxx,gcc=7 ./usr/lib/libasn1.sobase-krb5-shlib compatfile,kerberos ./usr/lib/libasn1.so.10base-krb5-shlib compatfile,kerberos ./usr/lib/libasn1.so.10.0 base-krb5-shlib compatfile,kerberos @@ -385,11 +385,11 @@ ./usr/lib/libldap_r.sobase-ldap-shlib ldap,compatfile ./usr/lib/libldap_r.so.4 base-ldap-shlib ldap,compatfile ./usr/lib/libldap_r.so.4.3 base-ldap-shlib ldap,compatfile -./usr/lib/liblsan.sobase-sys-shlib compatfile,gcc -./usr/lib/liblsan.so.1base-sys-shlib compatfile,gcc=6 -./usr/lib/liblsan.so.1.0 base-sys-shlib compatfile,gcc=6 -./usr/lib/liblsan.so.2base-sys-shlib compatfile,gcc=7 -./usr/lib/liblsan.so.2.0 base-sys-shlib compatfile,gcc=7 +./usr/lib/liblsan.sobase-sys-shlib compatfile,cxx,gcc +./usr/lib/liblsan.so.1base-sys-shlib compatfile,cxx,gcc=6 +./usr/lib/liblsan.so.1.0 base-sys-shlib compatfile,cxx,gcc=6 +./usr/lib/liblsan.so.2base-sys-shlib compatfile,cxx,gcc=7 +./usr/lib/liblsan.so.2.0 base-sys-shlib compatfile,cxx,gcc=7 ./usr/lib/liblua.sobase-sys-shlib compatfile ./usr/lib/liblua.so.5base-sys-shlib compatfile ./usr/lib/liblua.so.5.3base-sys-shlib compatfile @@ -852,13 +852,13 @@ ./usr/lib/libtspi.sobase-sys-shlib compatfile,tpm ./usr/lib/libtspi.so.3base-sys-shlib compatfile,tpm ./usr/lib/libtspi.so.3.0 base-sys-shlib compatfile,tpm -./usr/lib/libubsan.sobase-sys-shlib compatfile,gcc +./usr/lib/libubsan.sobase-sys-shlib compatfile,cxx,gcc ./usr/lib/libubsan.so.1base-sys-shlib obsolete,gcc=5 ./usr/lib/libubsan.so.1.0 base-sys-shlib obsolete,gcc=5 -./usr/lib/libubsan.so.2base-sys-shlib compatfile,gcc=6 -./usr/lib/libubsan.so.2.0 base-sys-shlib compatfile,gcc=6 -./usr/lib/libubsan.so.3base-sys-shlib compatfile,gcc=7 -./usr/lib/libubsan.so.3.0 base-sys-shlib compatfile,gcc=7 +./usr/lib/libubsan.so.2base-sys-shlib compatfile,cxx,gcc=6 +./usr/lib/libubsan.so.2.0 base-sys-shlib compatfile,cxx,gcc=6 +./usr/lib/libubsan.so.3base-sys-shlib compatfile,cxx,cxx,gcc=7 +./usr/lib/libubsan.so.3.0 base-sys-shlib compatfile,cxx,gcc=7 ./usr/lib/libukfs.sobase-sys-shlib compatfile,rump ./usr/lib/libukfs.so.1base-sys-shlib compatfile,rump ./usr/lib/libukfs.so.1.0 base-sys-shlib compatfile,rump Index: src/distrib/sets/lists/comp/mi diff -u
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 08:01:43 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_misc.c src/sys/compat/linux32/common: linux32_sysinfo.c Log Message: Fix info leaks in sysinfo(). To generate a diff of this commit: cvs rdiff -u -r1.242 -r1.243 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux32/common/linux32_sysinfo.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/compat/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.242 src/sys/compat/linux/common/linux_misc.c:1.243 --- src/sys/compat/linux/common/linux_misc.c:1.242 Fri Aug 23 07:53:36 2019 +++ src/sys/compat/linux/common/linux_misc.c Fri Aug 23 08:01:42 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.242 2019/08/23 07:53:36 maxv Exp $ */ +/* $NetBSD: linux_misc.c,v 1.243 2019/08/23 08:01:42 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.242 2019/08/23 07:53:36 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.243 2019/08/23 08:01:42 maxv Exp $"); #include #include @@ -1347,6 +1347,7 @@ linux_sys_sysinfo(struct lwp *l, const s struct linux_sysinfo si; struct loadavg *la; + memset(, 0, sizeof(si)); si.uptime = time_uptime; la = si.loads[0] = la->ldavg[0] * LINUX_SYSINFO_LOADS_SCALE / la->fscale; Index: src/sys/compat/linux32/common/linux32_sysinfo.c diff -u src/sys/compat/linux32/common/linux32_sysinfo.c:1.7 src/sys/compat/linux32/common/linux32_sysinfo.c:1.8 --- src/sys/compat/linux32/common/linux32_sysinfo.c:1.7 Wed Nov 19 18:36:04 2008 +++ src/sys/compat/linux32/common/linux32_sysinfo.c Fri Aug 23 08:01:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_sysinfo.c,v 1.7 2008/11/19 18:36:04 ad Exp $ */ +/* $NetBSD: linux32_sysinfo.c,v 1.8 2019/08/23 08:01:43 maxv Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_sysinfo.c,v 1.7 2008/11/19 18:36:04 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_sysinfo.c,v 1.8 2019/08/23 08:01:43 maxv Exp $"); #include #include @@ -70,6 +70,7 @@ linux32_sys_sysinfo(struct lwp *l, const struct linux32_sysinfo si; struct loadavg *la; + memset(, 0, sizeof(si)); si.uptime = time_uptime; la = si.loads[0] = la->ldavg[0] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 08:01:43 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_misc.c src/sys/compat/linux32/common: linux32_sysinfo.c Log Message: Fix info leaks in sysinfo(). To generate a diff of this commit: cvs rdiff -u -r1.242 -r1.243 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux32/common/linux32_sysinfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 07:53:37 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_file64.c linux_misc.c src/sys/compat/linux32/common: linux32_dirent.c Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/compat/linux/common/linux_file64.c cvs rdiff -u -r1.241 -r1.242 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_dirent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 07:53:37 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_file64.c linux_misc.c src/sys/compat/linux32/common: linux32_dirent.c Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/compat/linux/common/linux_file64.c cvs rdiff -u -r1.241 -r1.242 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_dirent.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/compat/linux/common/linux_file64.c diff -u src/sys/compat/linux/common/linux_file64.c:1.61 src/sys/compat/linux/common/linux_file64.c:1.62 --- src/sys/compat/linux/common/linux_file64.c:1.61 Fri Aug 23 06:54:54 2019 +++ src/sys/compat/linux/common/linux_file64.c Fri Aug 23 07:53:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file64.c,v 1.61 2019/08/23 06:54:54 maxv Exp $ */ +/* $NetBSD: linux_file64.c,v 1.62 2019/08/23 07:53:36 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.61 2019/08/23 06:54:54 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.62 2019/08/23 07:53:36 maxv Exp $"); #include #include @@ -353,6 +353,7 @@ again: * we have to worry about touching user memory outside of * the copyout() call). */ + memset(, 0, sizeof(idb)); idb.d_ino = bdp->d_fileno; idb.d_type = bdp->d_type; idb.d_off = off; Index: src/sys/compat/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.241 src/sys/compat/linux/common/linux_misc.c:1.242 --- src/sys/compat/linux/common/linux_misc.c:1.241 Fri Aug 23 06:47:58 2019 +++ src/sys/compat/linux/common/linux_misc.c Fri Aug 23 07:53:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.241 2019/08/23 06:47:58 maxv Exp $ */ +/* $NetBSD: linux_misc.c,v 1.242 2019/08/23 07:53:36 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.241 2019/08/23 06:47:58 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.242 2019/08/23 07:53:36 maxv Exp $"); #include #include @@ -772,6 +772,7 @@ again: * we have to worry about touching user memory outside of * the copyout() call). */ + memset(, 0, sizeof(idb)); idb.d_ino = bdp->d_fileno; /* * The old readdir() call misuses the offset and reclen fields. Index: src/sys/compat/linux32/common/linux32_dirent.c diff -u src/sys/compat/linux32/common/linux32_dirent.c:1.19 src/sys/compat/linux32/common/linux32_dirent.c:1.20 --- src/sys/compat/linux32/common/linux32_dirent.c:1.19 Mon Sep 3 16:29:29 2018 +++ src/sys/compat/linux32/common/linux32_dirent.c Fri Aug 23 07:53:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_dirent.c,v 1.19 2018/09/03 16:29:29 riastradh Exp $ */ +/* $NetBSD: linux32_dirent.c,v 1.20 2019/08/23 07:53:36 maxv Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.19 2018/09/03 16:29:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.20 2019/08/23 07:53:36 maxv Exp $"); #include #include @@ -201,6 +201,7 @@ again: * we have to worry about touching user memory outside of * the copyout() call). */ + memset(, 0, sizeof(idb)); idb.d_ino = bdp->d_fileno; /* * The old readdir() call misuses the offset and reclen fields.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 07:29:29 UTC 2019 Modified Files: src/sys/dev/usb: TODO.usbmp Log Message: update the list of splusb drivers (it's grown unfortunately) and explicitly state that they should be converted. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/TODO.usbmp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 07:29:29 UTC 2019 Modified Files: src/sys/dev/usb: TODO.usbmp Log Message: update the list of splusb drivers (it's grown unfortunately) and explicitly state that they should be converted. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/TODO.usbmp 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/TODO.usbmp diff -u src/sys/dev/usb/TODO.usbmp:1.15 src/sys/dev/usb/TODO.usbmp:1.16 --- src/sys/dev/usb/TODO.usbmp:1.15 Mon Aug 19 08:07:55 2019 +++ src/sys/dev/usb/TODO.usbmp Fri Aug 23 07:29:29 2019 @@ -1,4 +1,4 @@ -$NetBSD: TODO.usbmp,v 1.15 2019/08/19 08:07:55 mrg Exp $ +$NetBSD: TODO.usbmp,v 1.16 2019/08/23 07:29:29 mrg Exp $ the majority of the USB MP device interface is documented in usbdivar.h. @@ -57,15 +57,15 @@ convert uhidev users to MPSAFE: uyurex(4) - sysmon -- hm? -splusb drivers: +splusb drivers to convert: - auvitek_dtv.c - auvitek_video.c - emdtv_dtv.c - if_athn_usb.c - - if_aue.c - if_otus.c - if_rum.c - if_run.c + - if_umb.c - if_ural.c - if_urtw.c - if_urtwn.c @@ -73,6 +73,17 @@ splusb drivers: - ubt.c - ucycom.c - udsir.c + - uhso.c + - uirda.c + - ukbd.c + - ulpt.c + - urio.c + - usbdi.h + - uscanner.c + - usscanner.c + - ustir.c + - utoppy.c + - uvideo.c wakeup/tsleep drivers: - if_otus.c
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 07:17:31 UTC 2019 Modified Files: src/sys/dev/usb: usb.h Log Message: avoid using old bsd types (u_int etc) so that this compiles with _POSIX_C_SOURCE as noted in PR#48339. To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/dev/usb/usb.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/usb.h diff -u src/sys/dev/usb/usb.h:1.117 src/sys/dev/usb/usb.h:1.118 --- src/sys/dev/usb/usb.h:1.117 Wed Aug 7 08:47:09 2019 +++ src/sys/dev/usb/usb.h Fri Aug 23 07:17:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: usb.h,v 1.117 2019/08/07 08:47:09 maxv Exp $ */ +/* $NetBSD: usb.h,v 1.118 2019/08/23 07:17:31 mrg Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -853,9 +853,9 @@ struct usb_endpoint_desc { }; struct usb_full_desc { - int ufd_config_index; - u_int ufd_size; - u_char *ufd_data; + int ufd_config_index; + unsigned ufd_size; + unsigned char *ufd_data; }; struct usb_string_desc { @@ -865,8 +865,8 @@ struct usb_string_desc { }; struct usb_ctl_report_desc { - int ucrd_size; - u_char ucrd_data[1024]; /* filled data size will vary */ + int ucrd_size; + unsigned char ucrd_data[1024]; /* filled data size will vary */ }; typedef struct { uint32_t cookie; } usb_event_cookie_t; @@ -928,17 +928,17 @@ struct usb_device_info_old { }; struct usb_ctl_report { - int ucr_report; - u_char ucr_data[1024]; /* filled data size will vary */ + int ucr_report; + unsigned char ucr_data[1024]; /* filled data size will vary */ }; struct usb_device_stats { - u_long uds_requests[4]; /* indexed by transfer type UE_* */ + unsigned long uds_requests[4]; /* indexed by transfer type UE_* */ }; struct usb_bulk_ra_wb_opt { - u_int ra_wb_buffer_size; - u_int ra_wb_request_size; + unsigned ra_wb_buffer_size; + unsigned ra_wb_request_size; }; /* Events that can be read from /dev/usb */
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 07:17:31 UTC 2019 Modified Files: src/sys/dev/usb: usb.h Log Message: avoid using old bsd types (u_int etc) so that this compiles with _POSIX_C_SOURCE as noted in PR#48339. To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/dev/usb/usb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Aug 23 07:14:35 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: Mark up NULL. Capitalize NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/usbnet.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Aug 23 07:14:35 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: Mark up NULL. Capitalize NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/usbnet.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/usbnet.9 diff -u src/share/man/man9/usbnet.9:1.8 src/share/man/man9/usbnet.9:1.9 --- src/share/man/man9/usbnet.9:1.8 Fri Aug 23 05:37:05 2019 +++ src/share/man/man9/usbnet.9 Fri Aug 23 07:14:35 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.8 2019/08/23 05:37:05 mrg Exp $ +.\" $NetBSD: usbnet.9,v 1.9 2019/08/23 07:14:35 wiz Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -399,7 +399,9 @@ will be used while waiting for final ref Final stage attach of usb network device. If the passed in .Fa unm -is non-NULL then an MII interface will be created using the values +is +.Pf non- Dv NULL +then an MII interface will be created using the values provided in the .Fa struct usbnet_mii structure, which has these members passed to @@ -887,6 +889,6 @@ This interface first appeared in .Nx 9.0 . Portions of the original design are based upon ideas from -.An Nick Hudson Aq Mt sk...@netbsd.org . +.An Nick Hudson Aq Mt sk...@netbsd.org . .Sh AUTHORS .An Matthew R. Green Aq Mt m...@eterna.com.au
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 07:13:03 UTC 2019 Modified Files: src/sys/dev/usb: TODO Log Message: - remove items that are fixed (usually in the distant past) - usbnet is (almost) done for non wifi - non trivial usbdi documentation exists now To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/TODO 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/TODO diff -u src/sys/dev/usb/TODO:1.51 src/sys/dev/usb/TODO:1.52 --- src/sys/dev/usb/TODO:1.51 Sun Aug 11 07:12:08 2019 +++ src/sys/dev/usb/TODO Fri Aug 23 07:13:03 2019 @@ -11,20 +11,6 @@ Use some encapsulation in the upl driver Get the uezcom driver (with Doug Ambrisko's firmware) running. -Bug reports: - - -Bernd Ernesti's problem: host controller halted with umodem - -umass problem with Ricoh flash reader - -wskbd for X - -mel kravitz's problem, lockups with disk and printer - -Aaron's problem: Test aue with ohci. - - General: @@ -47,33 +33,16 @@ Rotate the QHs for bulk transport to get Change HC drivers to queue multiple request for an endpoint to get better performance. -Do memory deallocation when HC driver is detached. - uaudio problems: mixer names are awful, use some heuristics. implement selector units debug input - test with more devices Stylistic changes: use usb_ and usbd_ consistently rearrange the contents and names of some files (Nick) -Factor out the common code from the Ethernet drivers and reuse that. - if_aue - patch available - if_axe - done - if_axen - done - if_cdce - done - if_cue - patch available - if_kue - patch available - if_mue - patch available - if_smsc - done - if_udav - done - if_umb - maybe too special? - if_upl - patch available - if_ure - done - if_url - patch available - if_urndis - done +Use usbnet in if_umb(4). Figure out how to use it for wifi. Keyspan serial driver @@ -83,8 +52,8 @@ Clean up umass driver Documentation: -- -Document device driver API. +Complete documentation of device driver API. -Document HC driver API. +Complete documentation of HC driver API. Update ugen(4)
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Aug 23 07:13:03 UTC 2019 Modified Files: src/sys/dev/usb: TODO Log Message: - remove items that are fixed (usually in the distant past) - usbnet is (almost) done for non wifi - non trivial usbdi documentation exists now To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/TODO Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/tests/net
On Fri, Aug 23, 2019 at 3:51 PM Martin Husemann wrote: > > On Fri, Aug 23, 2019 at 01:41:58PM +0900, Ryota Ozaki wrote: > > A workaround for the issue is: > > cp /usr/bin/vmstat ./vmstat > > $HIJACKING ./vmstat > > rm -f ./vmstat > > > > It's awkward but it's reasonable for now. A proper fix would > > be to stop using kvm(3) for vmstat and drop the sgid bit from > > the binary. > > Wow, good catch! > > > I guess on most anita environments leak checks pass just in luck > > because the environment normally doesn't communicate with outside > > and there are no L2 caches. OTOH on baremetal environments there > > can be active L2 caches, which makes the leak checks fail. > > Sounds like a good explanation. https://gist.github.com/ozaki-r/37bec56f93f5a57dc98ed618e8db42a3 Could you try the patch? Running just one failed ATF test is enough to confirm. Thanks, ozaki-r
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 06:59:52 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_termios.h Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/compat/linux/common/linux_termios.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/compat/linux/common/linux_termios.h diff -u src/sys/compat/linux/common/linux_termios.h:1.21 src/sys/compat/linux/common/linux_termios.h:1.22 --- src/sys/compat/linux/common/linux_termios.h:1.21 Sun Sep 25 13:40:07 2011 +++ src/sys/compat/linux/common/linux_termios.h Fri Aug 23 06:59:52 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_termios.h,v 1.21 2011/09/25 13:40:07 chs Exp $ */ +/* $NetBSD: linux_termios.h,v 1.22 2019/08/23 06:59:52 maxv Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -279,6 +279,7 @@ bsd_termios_to_linux_termio(struct termi { int i, mask; + memset(lt, 0, sizeof(*lt)); lt->c_iflag = 0; lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNBRK, LINUX_IGNBRK); lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, BRKINT, LINUX_BRKINT); @@ -466,6 +467,7 @@ bsd_termios_to_linux_termios(struct term { int i, mask; + memset(lts, 0, sizeof(*lts)); lts->c_iflag = 0; lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNBRK, LINUX_IGNBRK); lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, BRKINT, LINUX_BRKINT);
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 06:59:52 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_termios.h Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/compat/linux/common/linux_termios.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/tests/net
On Fri, Aug 23, 2019 at 1:53 PM matthew green wrote: > > > It's awkward but it's reasonable for now. A proper fix would > > be to stop using kvm(3) for vmstat and drop the sgid bit from > > the binary. > > please finish this work :-) it's been ongoing for a very > long time now... That task exists in our ToDo list for a long time too but there is no spare time to tackle it yet... ozaki-r
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 06:54:54 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_file64.c Log Message: Fix info leak. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/compat/linux/common/linux_file64.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/compat/linux/common/linux_file64.c diff -u src/sys/compat/linux/common/linux_file64.c:1.60 src/sys/compat/linux/common/linux_file64.c:1.61 --- src/sys/compat/linux/common/linux_file64.c:1.60 Mon Sep 3 16:29:29 2018 +++ src/sys/compat/linux/common/linux_file64.c Fri Aug 23 06:54:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file64.c,v 1.60 2018/09/03 16:29:29 riastradh Exp $ */ +/* $NetBSD: linux_file64.c,v 1.61 2019/08/23 06:54:54 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.60 2018/09/03 16:29:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.61 2019/08/23 06:54:54 maxv Exp $"); #include #include @@ -80,6 +80,7 @@ static void bsd_to_linux_stat(struct sta static void bsd_to_linux_stat(struct stat *bsp, struct linux_stat64 *lsp) { + memset(lsp, 0, sizeof(*lsp)); lsp->lst_dev = linux_fakedev(bsp->st_dev, 0); lsp->lst_ino = bsp->st_ino; lsp->lst_mode= (linux_mode_t)bsp->st_mode;
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: maxv Date: Fri Aug 23 06:54:54 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_file64.c Log Message: Fix info leak. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/compat/linux/common/linux_file64.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/tests/net
On Fri, Aug 23, 2019 at 01:41:58PM +0900, Ryota Ozaki wrote: > A workaround for the issue is: > cp /usr/bin/vmstat ./vmstat > $HIJACKING ./vmstat > rm -f ./vmstat > > It's awkward but it's reasonable for now. A proper fix would > be to stop using kvm(3) for vmstat and drop the sgid bit from > the binary. Wow, good catch! > I guess on most anita environments leak checks pass just in luck > because the environment normally doesn't communicate with outside > and there are no L2 caches. OTOH on baremetal environments there > can be active L2 caches, which makes the leak checks fail. Sounds like a good explanation. Martin
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 06:47:58 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_misc.c src/sys/compat/linux32/common: linux32_utsname.c Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.240 -r1.241 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_utsname.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/compat/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.240 src/sys/compat/linux/common/linux_misc.c:1.241 --- src/sys/compat/linux/common/linux_misc.c:1.240 Mon Sep 3 16:29:29 2018 +++ src/sys/compat/linux/common/linux_misc.c Fri Aug 23 06:47:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.240 2018/09/03 16:29:29 riastradh Exp $ */ +/* $NetBSD: linux_misc.c,v 1.241 2019/08/23 06:47:58 maxv Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.240 2018/09/03 16:29:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.241 2019/08/23 06:47:58 maxv Exp $"); #include #include @@ -351,6 +351,7 @@ linux_sys_uname(struct lwp *l, const str } */ struct linux_utsname luts; + memset(, 0, sizeof(luts)); strlcpy(luts.l_sysname, linux_sysname, sizeof(luts.l_sysname)); strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename)); strlcpy(luts.l_release, linux_release, sizeof(luts.l_release)); Index: src/sys/compat/linux32/common/linux32_utsname.c diff -u src/sys/compat/linux32/common/linux32_utsname.c:1.9 src/sys/compat/linux32/common/linux32_utsname.c:1.10 --- src/sys/compat/linux32/common/linux32_utsname.c:1.9 Wed Nov 19 18:36:04 2008 +++ src/sys/compat/linux32/common/linux32_utsname.c Fri Aug 23 06:47:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_utsname.c,v 1.9 2008/11/19 18:36:04 ad Exp $ */ +/* $NetBSD: linux32_utsname.c,v 1.10 2019/08/23 06:47:58 maxv Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_utsname.c,v 1.9 2008/11/19 18:36:04 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_utsname.c,v 1.10 2019/08/23 06:47:58 maxv Exp $"); #include #include @@ -81,6 +81,7 @@ linux32_sys_uname(struct lwp *l, const s struct linux_utsname luts; struct linux_utsname *lp; + memset(, 0, sizeof(luts)); strlcpy(luts.l_sysname, linux32_sysname, sizeof(luts.l_sysname)); strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename)); strlcpy(luts.l_release, linux32_release, sizeof(luts.l_release)); @@ -101,6 +102,7 @@ linux32_sys_olduname(struct lwp *l, cons } */ struct linux_oldutsname luts; + memset(, 0, sizeof(luts)); strlcpy(luts.l_sysname, linux32_sysname, sizeof(luts.l_sysname)); strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename)); strlcpy(luts.l_release, linux32_release, sizeof(luts.l_release)); @@ -118,6 +120,7 @@ linux32_sys_oldolduname(struct lwp *l, c } */ struct linux_oldoldutsname luts; + memset(, 0, sizeof(luts)); strlcpy(luts.l_sysname, linux32_sysname, sizeof(luts.l_sysname)); strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename)); strlcpy(luts.l_release, linux32_release, sizeof(luts.l_release));
CVS commit: src/sys/compat
Module Name:src Committed By: maxv Date: Fri Aug 23 06:47:58 UTC 2019 Modified Files: src/sys/compat/linux/common: linux_misc.c src/sys/compat/linux32/common: linux32_utsname.c Log Message: Fix info leaks. To generate a diff of this commit: cvs rdiff -u -r1.240 -r1.241 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_utsname.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin
Module Name:src Committed By: kamil Date: Fri Aug 23 06:39:54 UTC 2019 Modified Files: src/tests/usr.bin/c++: t_fuzzer_oom.sh t_fuzzer_simple.sh t_fuzzer_timeout.sh t_msan_allocated_memory.sh t_msan_check_mem.sh t_msan_free.sh t_msan_heap.sh t_msan_partial_poison.sh t_msan_poison.sh t_msan_realloc.sh t_msan_shadow.sh t_msan_stack.sh t_msan_unpoison.sh t_tsan_data_race.sh t_tsan_heap_use_after_free.sh t_tsan_lock_order_inversion.sh t_tsan_locked_mutex_destroy.sh t_tsan_signal_errno.sh t_tsan_thread_leak.sh t_tsan_vptr_race.sh src/tests/usr.bin/cc: t_fuzzer_oom.sh t_fuzzer_simple.sh t_fuzzer_timeout.sh t_msan_allocated_memory.sh t_msan_check_mem.sh t_msan_free.sh t_msan_heap.sh t_msan_partial_poison.sh t_msan_poison.sh t_msan_realloc.sh t_msan_shadow.sh t_msan_stack.sh t_msan_unpoison.sh t_tsan_data_race.sh t_tsan_heap_use_after_free.sh t_tsan_lock_order_inversion.sh t_tsan_locked_mutex_destroy.sh t_tsan_signal_errno.sh t_tsan_thread_leak.sh Log Message: Define target_not_supported_body() in TSan, MSan and libFuzzer tests To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/t_fuzzer_oom.sh \ src/tests/usr.bin/c++/t_fuzzer_simple.sh \ src/tests/usr.bin/c++/t_fuzzer_timeout.sh \ src/tests/usr.bin/c++/t_msan_allocated_memory.sh \ src/tests/usr.bin/c++/t_msan_check_mem.sh \ src/tests/usr.bin/c++/t_msan_free.sh src/tests/usr.bin/c++/t_msan_heap.sh \ src/tests/usr.bin/c++/t_msan_partial_poison.sh \ src/tests/usr.bin/c++/t_msan_poison.sh \ src/tests/usr.bin/c++/t_msan_realloc.sh \ src/tests/usr.bin/c++/t_msan_shadow.sh \ src/tests/usr.bin/c++/t_msan_stack.sh \ src/tests/usr.bin/c++/t_msan_unpoison.sh \ src/tests/usr.bin/c++/t_tsan_data_race.sh \ src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh \ src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh \ src/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh \ src/tests/usr.bin/c++/t_tsan_signal_errno.sh \ src/tests/usr.bin/c++/t_tsan_thread_leak.sh \ src/tests/usr.bin/c++/t_tsan_vptr_race.sh cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/cc/t_fuzzer_oom.sh \ src/tests/usr.bin/cc/t_fuzzer_simple.sh \ src/tests/usr.bin/cc/t_fuzzer_timeout.sh \ src/tests/usr.bin/cc/t_msan_allocated_memory.sh \ src/tests/usr.bin/cc/t_msan_check_mem.sh \ src/tests/usr.bin/cc/t_msan_free.sh src/tests/usr.bin/cc/t_msan_heap.sh \ src/tests/usr.bin/cc/t_msan_partial_poison.sh \ src/tests/usr.bin/cc/t_msan_poison.sh \ src/tests/usr.bin/cc/t_msan_realloc.sh \ src/tests/usr.bin/cc/t_msan_shadow.sh \ src/tests/usr.bin/cc/t_msan_stack.sh \ src/tests/usr.bin/cc/t_msan_unpoison.sh \ src/tests/usr.bin/cc/t_tsan_data_race.sh \ src/tests/usr.bin/cc/t_tsan_heap_use_after_free.sh \ src/tests/usr.bin/cc/t_tsan_lock_order_inversion.sh \ src/tests/usr.bin/cc/t_tsan_locked_mutex_destroy.sh \ src/tests/usr.bin/cc/t_tsan_signal_errno.sh \ src/tests/usr.bin/cc/t_tsan_thread_leak.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/usr.bin/c++/t_fuzzer_oom.sh diff -u src/tests/usr.bin/c++/t_fuzzer_oom.sh:1.1 src/tests/usr.bin/c++/t_fuzzer_oom.sh:1.2 --- src/tests/usr.bin/c++/t_fuzzer_oom.sh:1.1 Sun Aug 18 20:15:58 2019 +++ src/tests/usr.bin/c++/t_fuzzer_oom.sh Fri Aug 23 06:39:54 2019 @@ -152,6 +152,11 @@ target_not_supported_head() atf_set "descr" "Test forced skip" } +target_not_supported_body() +{ + atf_skip "Target is not supported" +} + atf_init_test_cases() { test_target Index: src/tests/usr.bin/c++/t_fuzzer_simple.sh diff -u src/tests/usr.bin/c++/t_fuzzer_simple.sh:1.1 src/tests/usr.bin/c++/t_fuzzer_simple.sh:1.2 --- src/tests/usr.bin/c++/t_fuzzer_simple.sh:1.1 Sun Aug 18 20:15:58 2019 +++ src/tests/usr.bin/c++/t_fuzzer_simple.sh Fri Aug 23 06:39:54 2019 @@ -168,6 +168,11 @@ target_not_supported_head() atf_set "descr" "Test forced skip" } +target_not_supported_body() +{ + atf_skip "Target is not supported" +} + atf_init_test_cases() { test_target Index: src/tests/usr.bin/c++/t_fuzzer_timeout.sh diff -u src/tests/usr.bin/c++/t_fuzzer_timeout.sh:1.1 src/tests/usr.bin/c++/t_fuzzer_timeout.sh:1.2 --- src/tests/usr.bin/c++/t_fuzzer_timeout.sh:1.1 Sun Aug 18 20:15:58 2019 +++ src/tests/usr.bin/c++/t_fuzzer_timeout.sh Fri Aug 23 06:39:54 2019 @@ -148,6 +148,11 @@ target_not_supported_head() atf_set "descr" "Test forced skip" } +target_not_supported_body() +{ + atf_skip "Target is not supported" +} + atf_init_test_cases() { test_target Index: src/tests/usr.bin/c++/t_msan_allocated_memory.sh diff -u src/tests/usr.bin/c++/t_msan_allocated_memory.sh:1.1 src/tests/usr.bin/c++/t_msan_allocated_memory.sh:1.2 ---
CVS commit: src/tests/usr.bin
Module Name:src Committed By: kamil Date: Fri Aug 23 06:39:54 UTC 2019 Modified Files: src/tests/usr.bin/c++: t_fuzzer_oom.sh t_fuzzer_simple.sh t_fuzzer_timeout.sh t_msan_allocated_memory.sh t_msan_check_mem.sh t_msan_free.sh t_msan_heap.sh t_msan_partial_poison.sh t_msan_poison.sh t_msan_realloc.sh t_msan_shadow.sh t_msan_stack.sh t_msan_unpoison.sh t_tsan_data_race.sh t_tsan_heap_use_after_free.sh t_tsan_lock_order_inversion.sh t_tsan_locked_mutex_destroy.sh t_tsan_signal_errno.sh t_tsan_thread_leak.sh t_tsan_vptr_race.sh src/tests/usr.bin/cc: t_fuzzer_oom.sh t_fuzzer_simple.sh t_fuzzer_timeout.sh t_msan_allocated_memory.sh t_msan_check_mem.sh t_msan_free.sh t_msan_heap.sh t_msan_partial_poison.sh t_msan_poison.sh t_msan_realloc.sh t_msan_shadow.sh t_msan_stack.sh t_msan_unpoison.sh t_tsan_data_race.sh t_tsan_heap_use_after_free.sh t_tsan_lock_order_inversion.sh t_tsan_locked_mutex_destroy.sh t_tsan_signal_errno.sh t_tsan_thread_leak.sh Log Message: Define target_not_supported_body() in TSan, MSan and libFuzzer tests To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/t_fuzzer_oom.sh \ src/tests/usr.bin/c++/t_fuzzer_simple.sh \ src/tests/usr.bin/c++/t_fuzzer_timeout.sh \ src/tests/usr.bin/c++/t_msan_allocated_memory.sh \ src/tests/usr.bin/c++/t_msan_check_mem.sh \ src/tests/usr.bin/c++/t_msan_free.sh src/tests/usr.bin/c++/t_msan_heap.sh \ src/tests/usr.bin/c++/t_msan_partial_poison.sh \ src/tests/usr.bin/c++/t_msan_poison.sh \ src/tests/usr.bin/c++/t_msan_realloc.sh \ src/tests/usr.bin/c++/t_msan_shadow.sh \ src/tests/usr.bin/c++/t_msan_stack.sh \ src/tests/usr.bin/c++/t_msan_unpoison.sh \ src/tests/usr.bin/c++/t_tsan_data_race.sh \ src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh \ src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh \ src/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh \ src/tests/usr.bin/c++/t_tsan_signal_errno.sh \ src/tests/usr.bin/c++/t_tsan_thread_leak.sh \ src/tests/usr.bin/c++/t_tsan_vptr_race.sh cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/cc/t_fuzzer_oom.sh \ src/tests/usr.bin/cc/t_fuzzer_simple.sh \ src/tests/usr.bin/cc/t_fuzzer_timeout.sh \ src/tests/usr.bin/cc/t_msan_allocated_memory.sh \ src/tests/usr.bin/cc/t_msan_check_mem.sh \ src/tests/usr.bin/cc/t_msan_free.sh src/tests/usr.bin/cc/t_msan_heap.sh \ src/tests/usr.bin/cc/t_msan_partial_poison.sh \ src/tests/usr.bin/cc/t_msan_poison.sh \ src/tests/usr.bin/cc/t_msan_realloc.sh \ src/tests/usr.bin/cc/t_msan_shadow.sh \ src/tests/usr.bin/cc/t_msan_stack.sh \ src/tests/usr.bin/cc/t_msan_unpoison.sh \ src/tests/usr.bin/cc/t_tsan_data_race.sh \ src/tests/usr.bin/cc/t_tsan_heap_use_after_free.sh \ src/tests/usr.bin/cc/t_tsan_lock_order_inversion.sh \ src/tests/usr.bin/cc/t_tsan_locked_mutex_destroy.sh \ src/tests/usr.bin/cc/t_tsan_signal_errno.sh \ src/tests/usr.bin/cc/t_tsan_thread_leak.sh 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: kamil Date: Fri Aug 23 06:38:27 UTC 2019 Modified Files: src: Makefile src/distrib/sets/lists/base: md.i386 src/external/bsd: Makefile src/external/bsd/compiler_rt/lib/clang/lib: Makefile src/external/bsd/compiler_rt/lib/clang/lib/netbsd: Makefile Log Message: Enhance MKSANITIZER support Add i386 support for LLVM sanitizers. Add new build phases do-sanitizer-* for building LLVM sanitizers after libs and before other programs. This phase is important as sanitizers need to link with libs and sanitized programs must link with sanitizer runtimes. To generate a diff of this commit: cvs rdiff -u -r1.327 -r1.328 src/Makefile cvs rdiff -u -r1.152 -r1.153 src/distrib/sets/lists/base/md.i386 cvs rdiff -u -r1.64 -r1.65 src/external/bsd/Makefile cvs rdiff -u -r1.1 -r1.2 src/external/bsd/compiler_rt/lib/clang/lib/Makefile cvs rdiff -u -r1.2 -r1.3 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/Makefile 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: kamil Date: Fri Aug 23 06:38:27 UTC 2019 Modified Files: src: Makefile src/distrib/sets/lists/base: md.i386 src/external/bsd: Makefile src/external/bsd/compiler_rt/lib/clang/lib: Makefile src/external/bsd/compiler_rt/lib/clang/lib/netbsd: Makefile Log Message: Enhance MKSANITIZER support Add i386 support for LLVM sanitizers. Add new build phases do-sanitizer-* for building LLVM sanitizers after libs and before other programs. This phase is important as sanitizers need to link with libs and sanitized programs must link with sanitizer runtimes. To generate a diff of this commit: cvs rdiff -u -r1.327 -r1.328 src/Makefile cvs rdiff -u -r1.152 -r1.153 src/distrib/sets/lists/base/md.i386 cvs rdiff -u -r1.64 -r1.65 src/external/bsd/Makefile cvs rdiff -u -r1.1 -r1.2 src/external/bsd/compiler_rt/lib/clang/lib/Makefile cvs rdiff -u -r1.2 -r1.3 \ src/external/bsd/compiler_rt/lib/clang/lib/netbsd/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/Makefile diff -u src/Makefile:1.327 src/Makefile:1.328 --- src/Makefile:1.327 Fri Jun 14 09:12:42 2019 +++ src/Makefile Fri Aug 23 06:38:27 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.327 2019/06/14 09:12:42 martin Exp $ +# $NetBSD: Makefile,v 1.328 2019/08/23 06:38:27 kamil Exp $ # # This is the top-level makefile for building NetBSD. For an outline of @@ -235,6 +235,13 @@ BUILDTARGETS+= includes .endif BUILDTARGETS+= do-lib BUILDTARGETS+= do-compat-lib +.if ${MKLLVM} != "no" +BUILDTARGETS+= do-sanitizer-includes +BUILDTARGETS+= do-sanitizer-lib +.if ${MKSANITIZER:Uno} == "yes" +BUILDTARGETS+= do-sanitizer-tools +.endif +.endif .if ${MKX11} != "no" BUILDTARGETS+= do-x11 .endif @@ -470,6 +477,20 @@ do-lib: .PHONY .MAKE do-compat-lib: .PHONY .MAKE ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib" +do-sanitizer-includes: .PHONY .MAKE + ${MAKEDIRTARGET} external/bsd/compiler_rt/lib/clang/include includes + ${MAKEDIRTARGET} external/bsd/compiler_rt/lib/clang/share includes + +do-sanitizer-lib: .PHONY .MAKE + ${MAKEDIRTARGET} external/bsd/compiler_rt/lib/clang/lib build_install + +do-sanitizer-tools: .PHONY .MAKE +.if !exists(${TOOLDIR}/lib/clang) + mkdir -p ${TOOLDIR}/lib/clang + cd ${DESTDIR}/usr/lib/clang && \ + ${TOOL_PAX} -rw . ${TOOLDIR}/lib/clang +.endif + do-top-obj: .PHONY .MAKE ${MAKEDIRTARGET} . obj NOSUBDIR= Index: src/distrib/sets/lists/base/md.i386 diff -u src/distrib/sets/lists/base/md.i386:1.152 src/distrib/sets/lists/base/md.i386:1.153 --- src/distrib/sets/lists/base/md.i386:1.152 Sun Sep 30 15:56:47 2018 +++ src/distrib/sets/lists/base/md.i386 Fri Aug 23 06:38:27 2019 @@ -1,4 +1,4 @@ -# $NetBSD: md.i386,v 1.152 2018/09/30 15:56:47 jmcneill Exp $ +# $NetBSD: md.i386,v 1.153 2019/08/23 06:38:27 kamil Exp $ ./dev/lms0 base-obsolete obsolete ./dev/mms0 base-obsolete obsolete ./dev/pms0 base-obsolete obsolete @@ -19,6 +19,22 @@ ./usr/bin/iasl base-util-bin ./usr/bin/pmc base-obsolete obsolete ./usr/bin/vttestbase-obsolete obsolete +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.a comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0 comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0.0 comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-preinit-i386.a comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan_cxx-i386.a comp-cxx-libllvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.safestack-i386.a comp-cxx-libllvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.a comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0 comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0.0 comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.a comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.so comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.so.0 comp-cxx-lib llvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.so.0.0 comp-cxx-libllvm +./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone_cxx-i386.a comp-cxx-lib llvm ./usr/lib/libi386.sobase-sys-shlib pic ./usr/lib/libi386.so.2base-sys-shlib pic ./usr/lib/libi386.so.2.0 base-sys-shlib pic Index: src/external/bsd/Makefile diff -u src/external/bsd/Makefile:1.64 src/external/bsd/Makefile:1.65 --- src/external/bsd/Makefile:1.64 Wed Aug 14 01:42:08 2019 +++ src/external/bsd/Makefile Fri Aug 23 06:38:27 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.64 2019/08/14 01:42:08