CVS commit: src/sys/lib/libsa

2016-09-05 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Sep  5 21:11:11 UTC 2016

Modified Files:
src/sys/lib/libsa: checkpasswd.c

Log Message:
Check bounds on input. From Michael Plass.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/lib/libsa/checkpasswd.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/lib/libsa/checkpasswd.c
diff -u src/sys/lib/libsa/checkpasswd.c:1.9 src/sys/lib/libsa/checkpasswd.c:1.10
--- src/sys/lib/libsa/checkpasswd.c:1.9	Thu Jan  6 02:45:13 2011
+++ src/sys/lib/libsa/checkpasswd.c	Mon Sep  5 21:11:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: checkpasswd.c,v 1.9 2011/01/06 02:45:13 jakllsch Exp $	*/
+/*	$NetBSD: checkpasswd.c,v 1.10 2016/09/05 21:11:11 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -84,8 +84,10 @@ getpass(const char *prompt)
 			putchar('\n');
 			break;
 		default:
-			*lp++ = c;
-			putchar('*');
+			if ((size_t)(lp - buf) < sizeof(buf) - 1) {
+*lp++ = c;
+putchar('*');
+			}
 			break;
 		}
 	}



CVS commit: src/sys/dev/usb

2016-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep  5 20:58:51 UTC 2016

Modified Files:
src/sys/dev/usb: if_athn_usb.c

Log Message:
kern/51458 (usb athn panic)

initialise buf in usc_tx_cmd


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/if_athn_usb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.12 src/sys/dev/usb/if_athn_usb.c:1.13
--- src/sys/dev/usb/if_athn_usb.c:1.12	Fri Jun 10 13:27:15 2016
+++ src/sys/dev/usb/if_athn_usb.c	Mon Sep  5 20:58:51 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.12 2016/06/10 13:27:15 ozaki-r Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.13 2016/09/05 20:58:51 skrll Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.12 2016/06/10 13:27:15 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.13 2016/09/05 20:58:51 skrll Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -716,6 +716,7 @@ athn_usb_alloc_tx_cmd(struct athn_usb_so
 		"could not allocate command xfer\n");
 		return err;
 	}
+	data->buf = usbd_get_buffer(data->xfer);
 
 	return 0;
 }



CVS commit: src/lib/librumpuser

2016-09-05 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Sep  5 20:41:59 UTC 2016

Modified Files:
src/lib/librumpuser: sp_common.c

Log Message:
printf functions should be tagged as printf functions. Noticed by
martin, whose build broke for some reason yet to be determined.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/librumpuser/sp_common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.38 src/lib/librumpuser/sp_common.c:1.39
--- src/lib/librumpuser/sp_common.c:1.38	Wed Jan  8 01:45:29 2014
+++ src/lib/librumpuser/sp_common.c	Mon Sep  5 20:41:59 2016
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.38 2014/01/08 01:45:29 pooka Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.39 2016/09/05 20:41:59 dholland Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -60,14 +60,17 @@
  * XXX: NetBSD's __unused collides with Linux headers, so we cannot
  * define it before we've included everything.
  */
-#if !defined(__unused) && defined(__GNUC__)
+#if !defined(__unused) && (defined(__clang__) || defined(__GNUC__))
 #define __unused __attribute__((__unused__))
 #endif
+#if !defined(__printflike) && (defined(__clang__) || defined(__GNUC__))
+#define __printflike(a,b) __attribute__((__format__(__printf__, a, b
+#endif
 
 //#define DEBUG
 #ifdef DEBUG
 #define DPRINTF(x) mydprintf x
-static void
+static __printflike(1, 2) void
 mydprintf(const char *fmt, ...)
 {
 	va_list ap;



CVS commit: src/sys/kern

2016-09-05 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Sep  5 17:42:57 UTC 2016

Modified Files:
src/sys/kern: core_elf32.c

Log Message:
Build fix for when COREDUMP is turned off, from Ray Phillips in PR 51460.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/kern/core_elf32.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/core_elf32.c
diff -u src/sys/kern/core_elf32.c:1.47 src/sys/kern/core_elf32.c:1.48
--- src/sys/kern/core_elf32.c:1.47	Mon Jun 27 01:46:04 2016
+++ src/sys/kern/core_elf32.c	Mon Sep  5 17:42:57 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_elf32.c,v 1.47 2016/06/27 01:46:04 christos Exp $	*/
+/*	$NetBSD: core_elf32.c,v 1.48 2016/09/05 17:42:57 dholland Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.47 2016/06/27 01:46:04 christos Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.48 2016/09/05 17:42:57 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_coredump.h"
@@ -562,7 +562,7 @@ ELFNAMEEND(coredump_savenote)(struct not
 #else	/* COREDUMP */
 
 int
-ELFNAMEEND(coredump)(struct lwp *l, void *cookie)
+ELFNAMEEND(coredump)(struct lwp *l, struct coredump_iostate *cookie)
 {
 
 	return ENOSYS;



CVS commit: src

2016-09-05 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Sep  5 14:47:31 UTC 2016

Modified Files:
src/distrib/cats/ramdisk: Makefile
src/sys/arch/cats/conf: INSTALL

Log Message:
Increase size of cats installation memory disk by 100Ki.

Or: We shouldn't let the cats out of the bag.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/distrib/cats/ramdisk/Makefile
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/cats/conf/INSTALL

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/cats/ramdisk/Makefile
diff -u src/distrib/cats/ramdisk/Makefile:1.22 src/distrib/cats/ramdisk/Makefile:1.23
--- src/distrib/cats/ramdisk/Makefile:1.22	Sun Mar  2 13:24:38 2014
+++ src/distrib/cats/ramdisk/Makefile	Mon Sep  5 14:47:30 2016
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.22 2014/03/02 13:24:38 joerg Exp $
+#	$NetBSD: Makefile,v 1.23 2016/09/05 14:47:30 jakllsch Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2300k
+IMAGESIZE=	2400k
 MAKEFS_FLAGS=	-f 14
 
 WARNS=		1

Index: src/sys/arch/cats/conf/INSTALL
diff -u src/sys/arch/cats/conf/INSTALL:1.96 src/sys/arch/cats/conf/INSTALL:1.97
--- src/sys/arch/cats/conf/INSTALL:1.96	Fri Aug 21 01:52:07 2015
+++ src/sys/arch/cats/conf/INSTALL	Mon Sep  5 14:47:31 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.96 2015/08/21 01:52:07 uebayasi Exp $
+#	$NetBSD: INSTALL,v 1.97 2016/09/05 14:47:31 jakllsch Exp $
 #
 #	CATSINST -- CHALTECH CATS Install kernel
 #
@@ -97,7 +97,7 @@ options		COMPAT_BSDPTY	# /dev/[pt]ty?? p
 # Device options
 
 options 	MEMORY_DISK_HOOKS	# boottime setup of ramdisk
-options 	MEMORY_DISK_ROOT_SIZE=4600	# Size in blocks
+options 	MEMORY_DISK_ROOT_SIZE=4800	# Size in blocks
 options 	MEMORY_DISK_IS_ROOT	# use memory disk as root
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode



CVS commit: src/external/gpl3/binutils/dist/bfd

2016-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  5 14:25:33 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c

Log Message:
more errors for text relocations


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.9 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.10
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.9	Mon Sep  5 05:17:35 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Mon Sep  5 10:25:33 2016
@@ -2616,7 +2616,13 @@ _bfd_sparc_elf_size_dynamic_sections (bf
 		srel = htab->elf.irelplt;
 		  srel->size += p->count * SPARC_ELF_RELA_BYTES (htab);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
-		info->flags |= DF_TEXTREL;
+		{
+		  info->flags |= DF_TEXTREL;
+		  if ((info->warn_shared_textrel && bfd_link_pic (info))
+			|| info->error_textrel)
+			info->callbacks->einfo (_("%P: %B: warning: relocation "
+			  "in readonly section `%A'\n"), p->sec->owner, p->sec);
+		}
 		}
 	}
 	}



CVS commit: src/sys/kern

2016-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  5 14:13:50 UTC 2016

Modified Files:
src/sys/kern: sysv_msg.c

Log Message:
don't forget to destroy a cv


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/sysv_msg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sysv_msg.c
diff -u src/sys/kern/sysv_msg.c:1.70 src/sys/kern/sysv_msg.c:1.71
--- src/sys/kern/sysv_msg.c:1.70	Thu Nov  5 21:26:42 2015
+++ src/sys/kern/sysv_msg.c	Mon Sep  5 10:13:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysv_msg.c,v 1.70 2015/11/06 02:26:42 pgoyette Exp $	*/
+/*	$NetBSD: sysv_msg.c,v 1.71 2016/09/05 14:13:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysv_msg.c,v 1.70 2015/11/06 02:26:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_msg.c,v 1.71 2016/09/05 14:13:50 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sysv.h"
@@ -195,6 +195,7 @@ msgfini(void)
 	sz = round_page(sz);
 	uvm_km_free(kernel_map, v, sz, UVM_KMF_WIRED);
 
+	cv_destroy(_realloc_cv);
 	mutex_exit();
 	mutex_destroy();
 



CVS commit: src/sbin/newfs_ext2fs

2016-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep  5 10:44:36 UTC 2016

Modified Files:
src/sbin/newfs_ext2fs: mke2fs.c

Log Message:
Add a bit of swapping for values in CG descriptors (used to be done
wholesale in e2fs_cgsave, but now common code keeps them in FS byte
order). Seems to fix newfs_ext2fs on big endian hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/newfs_ext2fs/mke2fs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_ext2fs/mke2fs.c
diff -u src/sbin/newfs_ext2fs/mke2fs.c:1.24 src/sbin/newfs_ext2fs/mke2fs.c:1.25
--- src/sbin/newfs_ext2fs/mke2fs.c:1.24	Thu Aug  4 17:43:47 2016
+++ src/sbin/newfs_ext2fs/mke2fs.c	Mon Sep  5 10:44:36 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mke2fs.c,v 1.24 2016/08/04 17:43:47 jdolecek Exp $	*/
+/*	$NetBSD: mke2fs.c,v 1.25 2016/09/05 10:44:36 martin Exp $	*/
 
 /*-
  * Copyright (c) 2007 Izumi Tsutsui.  All rights reserved.
@@ -100,7 +100,7 @@
 #if 0
 static char sccsid[] = "@(#)mkfs.c	8.11 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: mke2fs.c,v 1.24 2016/08/04 17:43:47 jdolecek Exp $");
+__RCSID("$NetBSD: mke2fs.c,v 1.25 2016/09/05 10:44:36 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -495,24 +495,27 @@ mke2fs(const char *fsys, int fi, int fo)
 			 EXT2F_COMPAT_RESIZE) != 0)
 boffset += sblock.e2fs.e2fs_reserved_ngdb;
 		}
-		gd[cylno].ext2bgd_b_bitmap = boffset;
+		gd[cylno].ext2bgd_b_bitmap = h2fs32(boffset);
 		boffset += NBLOCK_BLOCK_BITMAP;
-		gd[cylno].ext2bgd_i_bitmap = boffset;
+		gd[cylno].ext2bgd_i_bitmap = h2fs32(boffset);
 		boffset += NBLOCK_INODE_BITMAP;
-		gd[cylno].ext2bgd_i_tables = boffset;
+		gd[cylno].ext2bgd_i_tables = h2fs32(boffset);
 		if (cylno == (ncg - 1))
-			gd[cylno].ext2bgd_nbfree =
-			blocks_lastcg - cgoverhead(cylno);
+			gd[cylno].ext2bgd_nbfree = h2fs16(
+			blocks_lastcg - cgoverhead(cylno));
 		else
-			gd[cylno].ext2bgd_nbfree =
-			sblock.e2fs.e2fs_bpg - cgoverhead(cylno);
-		fbcount += gd[cylno].ext2bgd_nbfree;
-		gd[cylno].ext2bgd_nifree = sblock.e2fs.e2fs_ipg;
+			gd[cylno].ext2bgd_nbfree = h2fs16(
+			sblock.e2fs.e2fs_bpg - cgoverhead(cylno));
+		fbcount += fs2h16(gd[cylno].ext2bgd_nbfree);
 		if (cylno == 0) {
 			/* take reserved inodes off nifree */
-			gd[cylno].ext2bgd_nifree -= EXT2_RESERVED_INODES;
+			gd[cylno].ext2bgd_nifree = h2fs16(
+			sblock.e2fs.e2fs_ipg-EXT2_RESERVED_INODES);
+		} else {
+			gd[cylno].ext2bgd_nifree = 
+			h2fs16(sblock.e2fs.e2fs_ipg);
 		}
-		ficount += gd[cylno].ext2bgd_nifree;
+		ficount += fs2h16(gd[cylno].ext2bgd_nifree);
 		gd[cylno].ext2bgd_ndirs = 0;
 	}
 	sblock.e2fs.e2fs_fbcount = fbcount;
@@ -729,7 +732,7 @@ initcg(uint cylno)
 	i = i * NBBY;
 	for (; i < cgoverhead(cylno); i++)
 		setbit(buf, i);
-	wtfs(EXT2_FSBTODB(, gd[cylno].ext2bgd_b_bitmap),
+	wtfs(EXT2_FSBTODB(, fs2h32(gd[cylno].ext2bgd_b_bitmap)),
 	sblock.e2fs_bsize, buf);
 
 	/*
@@ -747,7 +750,7 @@ initcg(uint cylno)
 		for (i = 1; i < EXT2_FIRSTINO; i++)
 			setbit(buf, EXT2_INO_INDEX(i));
 	}
-	wtfs(EXT2_FSBTODB(, gd[cylno].ext2bgd_i_bitmap),
+	wtfs(EXT2_FSBTODB(, fs2h32(gd[cylno].ext2bgd_i_bitmap)),
 	sblock.e2fs_bsize, buf);
 
 	/*
@@ -764,7 +767,7 @@ initcg(uint cylno)
 			/* h2fs32() just for consistency */
 			dp->e2di_gen = h2fs32(arc4random());
 		}
-		wtfs(EXT2_FSBTODB(, gd[cylno].ext2bgd_i_tables + i),
+		wtfs(EXT2_FSBTODB(, fs2h32(gd[cylno].ext2bgd_i_tables) + i),
 		sblock.e2fs_bsize, buf);
 	}
 }
@@ -1264,7 +1267,7 @@ alloc(uint32_t size, uint16_t mode)
 	bbp = malloc(sblock.e2fs_bsize);
 	if (bbp == NULL)
 		return 0;
-	rdfs(EXT2_FSBTODB(, gd[0].ext2bgd_b_bitmap),
+	rdfs(EXT2_FSBTODB(, fs2h32(gd[0].ext2bgd_b_bitmap)),
 	sblock.e2fs_bsize, bbp);
 
 	/* XXX: kernel uses e2fs_fpg here */
@@ -1299,13 +1302,13 @@ alloc(uint32_t size, uint16_t mode)
 		errx(EXIT_FAILURE, "%s: inconsistent bitmap", __func__);
 
 	setbit(bbp, bno);
-	wtfs(EXT2_FSBTODB(, gd[0].ext2bgd_b_bitmap),
+	wtfs(EXT2_FSBTODB(, fs2h32(gd[0].ext2bgd_b_bitmap)),
 	sblock.e2fs_bsize, bbp);
 	free(bbp);
 	/* XXX: modified group descriptors won't be written into backups */
-	gd[0].ext2bgd_nbfree--;
+	gd[0].ext2bgd_nbfree = h2fs16(fs2h16(gd[0].ext2bgd_nbfree)-1);
 	if ((mode & EXT2_IFDIR) != 0)
-		gd[0].ext2bgd_ndirs++;
+		gd[0].ext2bgd_ndirs = h2fs16(fs2h16(gd[0].ext2bgd_ndirs)+1);
 	sblock.e2fs.e2fs_fbcount--;
 
 	return sblock.e2fs.e2fs_first_dblock + bno;
@@ -1343,7 +1346,7 @@ iput(struct ext2fs_dinode *ip, ino_t ino
 			__func__, (uint64_t)ino, c);
 
 		/* update inode bitmap */
-		rdfs(EXT2_FSBTODB(, gd[0].ext2bgd_i_bitmap),
+		rdfs(EXT2_FSBTODB(, fs2h32(gd[0].ext2bgd_i_bitmap)),
 		sblock.e2fs_bsize, bp);
 
 		/* more sanity */
@@ -1351,9 +1354,9 @@ iput(struct ext2fs_dinode *ip, ino_t ino
 			errx(EXIT_FAILURE, "%s: inode %" PRIu64
 			" already in use", __func__, (uint64_t)ino);
 		setbit(bp, EXT2_INO_INDEX(ino));

CVS commit: src/external/gpl3/binutils/dist/bfd

2016-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  5 09:17:35 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c

Log Message:
sync error with x86_64.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.8 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.9
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.8	Wed Jun 15 10:47:23 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c	Mon Sep  5 05:17:35 2016
@@ -2514,12 +2514,14 @@ readonly_dynrelocs (struct elf_link_hash
 	{
 	  struct bfd_link_info *info = (struct bfd_link_info *) inf;
 
-  if (info->warn_shared_textrel)
-(*_bfd_error_handler)
-  (_("warning: dynamic relocation to `%s' in readonly section `%s'"),
-  h->root.root.string, s->name);
 	  info->flags |= DF_TEXTREL;
 
+	  if ((info->warn_shared_textrel && bfd_link_pic (info))
+	  || info->error_textrel)
+	info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' in readonly section `%A'\n"),
+p->sec->owner, h->root.root.string,
+p->sec);
+
 	  /* Not an error, just cut short the traversal.  */
 	  return FALSE;
 	}



CVS commit: src/tests/fs/psshfs

2016-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  5 08:53:57 UTC 2016

Modified Files:
src/tests/fs/psshfs: t_psshfs.sh

Log Message:
PR/51461: Mateusz Poszwa: Processes hang when attempting to read from an empty 
file on psshfs mount, add unit test:

When a process attempts to read from an empty file originating from
psshfs mount, it waits indefinitely. Until the hanged process is
interrupted, the mounted filesystem appears to work as expected,
except for the directory containing the empty file. Processes trying
to list that directory also hang, and cause misbehaviour of the
containing directory.  It is possible to create a chain of hanged
processes trying to read directories up to the mount point. At the
same time, psshfs generates some network traffic (around 5KB/s, in
my case). Interrupting the first hanged process causes emission of
an error message by all other hanged processes, and psshfs ceases
to generate network traffic. Subsequent trials to list any affected
directory or if one of the affected directories is the mount point
to unmount the filesystem, fail with the same error.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/psshfs/t_psshfs.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/fs/psshfs/t_psshfs.sh
diff -u src/tests/fs/psshfs/t_psshfs.sh:1.7 src/tests/fs/psshfs/t_psshfs.sh:1.8
--- src/tests/fs/psshfs/t_psshfs.sh:1.7	Sat Mar 16 03:54:04 2013
+++ src/tests/fs/psshfs/t_psshfs.sh	Mon Sep  5 04:53:57 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_psshfs.sh,v 1.7 2013/03/16 07:54:04 jmmv Exp $
+# $NetBSD: t_psshfs.sh,v 1.8 2016/09/05 08:53:57 christos Exp $
 #
 # Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -262,6 +262,26 @@ setattr_cache_cleanup() {
 	stop_ssh
 }
 
+atf_test_case read_empty_file cleanup
+read_empty_file_head() {
+	atf_set "descr" "Checks whether an empty file can be read"
+	# This test is supposed to make sure psshfs does not hang
+	# when reading from an empty file, hence the timeout.
+	atf_set "timeout" 8
+}
+read_empty_file_body() {
+	require_puffs
+	start_ssh
+	atf_check mkdir root mnt
+	atf_check -x ': > root/empty'
+	mount_psshfs root mnt
+	atf_check cat mnt/empty
+}
+read_empty_file_cleanup() {
+	umount mnt
+	stop_ssh
+}
+
 # -
 # Initialization.
 # -
@@ -271,4 +291,5 @@ atf_init_test_cases() {
 	atf_add_test_case pwd
 	atf_add_test_case ls
 	#atf_add_test_case setattr_cache
+	atf_add_test_case read_empty_file
 }



CVS commit: src/etc/etc.evbmips

2016-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep  5 07:23:43 UTC 2016

Modified Files:
src/etc/etc.evbmips: Makefile.inc

Log Message:
Add ub and elf32 to KERNEL_SUFFIXES


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/etc/etc.evbmips/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/etc.evbmips/Makefile.inc
diff -u src/etc/etc.evbmips/Makefile.inc:1.20 src/etc/etc.evbmips/Makefile.inc:1.21
--- src/etc/etc.evbmips/Makefile.inc:1.20	Fri May  1 23:55:14 2015
+++ src/etc/etc.evbmips/Makefile.inc	Mon Sep  5 07:23:43 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.20 2015/05/01 23:55:14 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.21 2016/09/05 07:23:43 skrll Exp $
 #
 #	etc.evbmips/Makefile.inc -- evbmips-specific etc Makefile targets
 #
@@ -6,7 +6,7 @@
 # If you change the list of distributed kernels, don't forget
 # to update the release documentation in distrib/notes/common/contents
 
-KERNEL_SUFFIXES=	srec
+KERNEL_SUFFIXES=	srec ub elf32
 
 .if ${MACHINE_ARCH} == "mipsel"
 KERNEL_SETS=		ALCHEMY CI20 CPMBR1400 DBAU1500 DBAU1550 GDIUM



CVS commit: src/sys/arch/mips/mips

2016-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep  5 06:59:25 UTC 2016

Modified Files:
src/sys/arch/mips/mips: pmap_machdep.c

Log Message:
Flush the dcache before syncing the icache as previous mappings (UBC)
might have used the same colo(u)r and the dcache won't have been flush up
to now.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/mips/pmap_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/arch/mips/mips/pmap_machdep.c
diff -u src/sys/arch/mips/mips/pmap_machdep.c:1.10 src/sys/arch/mips/mips/pmap_machdep.c:1.11
--- src/sys/arch/mips/mips/pmap_machdep.c:1.10	Sun Sep  4 15:25:11 2016
+++ src/sys/arch/mips/mips/pmap_machdep.c	Mon Sep  5 06:59:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_machdep.c,v 1.10 2016/09/04 15:25:11 skrll Exp $	*/
+/*	$NetBSD: pmap_machdep.c,v 1.11 2016/09/05 06:59:25 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.10 2016/09/04 15:25:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.11 2016/09/05 06:59:25 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -656,6 +656,8 @@ pmap_md_page_syncicache(struct vm_page *
 	 */
 	if (MIPS_HAS_R4K_MMU) {
 		if (VM_PAGEMD_CACHED_P(mdpg)) {
+			/* This was probably mapped cached by UBC so flush it */
+			mips_dcache_wbinv_range_index(va, PAGE_SIZE);
 			mips_icache_sync_range_index(va, PAGE_SIZE);
 		}
 	} else {



CVS commit: src/external/mit/xorg/server/drivers

2016-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep  5 06:30:40 UTC 2016

Modified Files:
src/external/mit/xorg/server/drivers/xf86-video-suncg6: Makefile
src/external/mit/xorg/server/drivers/xf86-video-sunffb: Makefile

Log Message:
HAVE_GCC may not be set at all


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile
cvs rdiff -u -r1.10 -r1.11 \
src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile:1.7 src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile:1.8
--- src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile:1.7	Sat Aug 20 20:22:54 2016
+++ src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile	Mon Sep  5 06:30:40 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2016/08/20 20:22:54 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2016/09/05 06:30:40 martin Exp $
 
 DRIVER=		xf86-video-suncg6
 DRIVER_NAME=	suncg6_drv
@@ -12,6 +12,6 @@ MAN=		suncg6.4
 .include "../Makefile.xf86-driver"
 
 # XXX
-.if ${HAVE_GCC} > 48
+.if ${HAVE_GCC:U0} > 48
 COPTS.cg6_accel.c+=	${${ACTIVE_CC} == "gcc":? -Wno-error=discarded-qualifiers :}
 .endif

Index: src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile:1.10 src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile:1.11
--- src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile:1.10	Mon Aug 22 08:39:20 2016
+++ src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile	Mon Sep  5 06:30:40 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2016/08/22 08:39:20 mrg Exp $
+#	$NetBSD: Makefile,v 1.11 2016/09/05 06:30:40 martin Exp $
 
 DRIVER=		xf86-video-sunffb
 DRIVER_NAME=	sunffb_drv
@@ -24,7 +24,7 @@ MAN=		sunffb.4
 .include "../Makefile.xf86-driver"
 
 # XXX
-.if ${HAVE_GCC} > 48
+.if ${HAVE_GCC:U0} > 48
 COPTS.ffb_dac.c+=	${${ACTIVE_CC} == "gcc":? -Wno-error=discarded-qualifiers :}
 COPTS.ffb_dga.c+=	${${ACTIVE_CC} == "gcc":? -Wno-error=discarded-qualifiers :}
 .endif