From owner-svn-src-stable-10@freebsd.org Sun Jun 5 05:49:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E35B692AB; Sun, 5 Jun 2016 05:49:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC39D105E; Sun, 5 Jun 2016 05:49:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u555nZae033604; Sun, 5 Jun 2016 05:49:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u555nYW8033594; Sun, 5 Jun 2016 05:49:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050549.u555nYW8033594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 05:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301422 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 05:49:36 -0000 Author: dchagin Date: Sun Jun 5 05:49:33 2016 New Revision: 301422 URL: https://svnweb.freebsd.org/changeset/base/301422 Log: MFC r300359, r300360: Correct an argument param of linux_sched_* system calls as a struct l_sched_param does not defined due to it's nature. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_systrace_args.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux/linux_proto.h Sun Jun 5 05:49:33 2016 (r301422) @@ -524,16 +524,16 @@ struct linux_getpriority_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sun Jun 5 05:49:33 2016 (r301422) @@ -1178,7 +1178,7 @@ systrace_args(int sysnum, void *params, case 142: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1186,7 +1186,7 @@ systrace_args(int sysnum, void *params, case 143: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1195,7 +1195,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -4209,7 +4209,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4222,7 +4222,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4238,7 +4238,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux/syscalls.master Sun Jun 5 05:49:33 2016 (r301422) @@ -283,12 +283,12 @@ 141 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ int prio); } 142 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 143 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 144 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 145 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 146 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max( \ Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sun Jun 5 05:49:33 2016 (r301422) @@ -480,16 +480,16 @@ struct linux_sysctl_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sun Jun 5 05:49:33 2016 (r301422) @@ -1047,7 +1047,7 @@ systrace_args(int sysnum, void *params, case 154: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1055,7 +1055,7 @@ systrace_args(int sysnum, void *params, case 155: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1064,7 +1064,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -3938,7 +3938,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -3951,7 +3951,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -3967,7 +3967,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux32/syscalls.master Sun Jun 5 05:49:33 2016 (r301422) @@ -268,12 +268,12 @@ 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 158 AUE_NULL NOPROTO { int sched_yield(void); } Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/i386/linux/linux_proto.h Sun Jun 5 05:49:33 2016 (r301422) @@ -478,16 +478,16 @@ struct linux_sysctl_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sun Jun 5 05:49:33 2016 (r301422) @@ -1085,7 +1085,7 @@ systrace_args(int sysnum, void *params, case 154: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1093,7 +1093,7 @@ systrace_args(int sysnum, void *params, case 155: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1102,7 +1102,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -4072,7 +4072,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4085,7 +4085,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4101,7 +4101,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/i386/linux/syscalls.master Sun Jun 5 05:49:33 2016 (r301422) @@ -270,12 +270,12 @@ 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 158 AUE_NULL NOPROTO { int sched_yield(void); } From owner-svn-src-stable-10@freebsd.org Sun Jun 5 06:02:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C97F1B695DC; Sun, 5 Jun 2016 06:02:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A90D19B9; Sun, 5 Jun 2016 06:02:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5562bpc040823; Sun, 5 Jun 2016 06:02:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5562bhg040822; Sun, 5 Jun 2016 06:02:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050602.u5562bhg040822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 06:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301424 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:02:38 -0000 Author: dchagin Date: Sun Jun 5 06:02:37 2016 New Revision: 301424 URL: https://svnweb.freebsd.org/changeset/base/301424 Log: MFC r300411: Minor style(9) cleanup, no functional changes. Modified: stable/10/sys/compat/linux/linux_file.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sun Jun 5 05:55:27 2016 (r301423) +++ stable/10/sys/compat/linux/linux_file.c Sun Jun 5 06:02:37 2016 (r301424) @@ -69,108 +69,106 @@ __FBSDID("$FreeBSD$"); int linux_creat(struct thread *td, struct linux_creat_args *args) { - char *path; - int error; - - LCONVPATHEXIST(td, args->path, &path); + char *path; + int error; + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(creat)) printf(ARGS(creat, "%s, %d"), path, args->mode); #endif - error = kern_open(td, path, UIO_SYSSPACE, O_WRONLY | O_CREAT | O_TRUNC, - args->mode); - LFREEPATH(path); - return (error); + error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, + O_WRONLY | O_CREAT | O_TRUNC, args->mode); + LFREEPATH(path); + return (error); } static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) { - cap_rights_t rights; - struct proc *p = td->td_proc; - struct file *fp; - int fd; - int bsd_flags, error; - - bsd_flags = 0; - switch (l_flags & LINUX_O_ACCMODE) { - case LINUX_O_WRONLY: - bsd_flags |= O_WRONLY; - break; - case LINUX_O_RDWR: - bsd_flags |= O_RDWR; - break; - default: - bsd_flags |= O_RDONLY; - } - if (l_flags & LINUX_O_NDELAY) - bsd_flags |= O_NONBLOCK; - if (l_flags & LINUX_O_APPEND) - bsd_flags |= O_APPEND; - if (l_flags & LINUX_O_SYNC) - bsd_flags |= O_FSYNC; - if (l_flags & LINUX_O_NONBLOCK) - bsd_flags |= O_NONBLOCK; - if (l_flags & LINUX_FASYNC) - bsd_flags |= O_ASYNC; - if (l_flags & LINUX_O_CREAT) - bsd_flags |= O_CREAT; - if (l_flags & LINUX_O_TRUNC) - bsd_flags |= O_TRUNC; - if (l_flags & LINUX_O_EXCL) - bsd_flags |= O_EXCL; - if (l_flags & LINUX_O_NOCTTY) - bsd_flags |= O_NOCTTY; - if (l_flags & LINUX_O_DIRECT) - bsd_flags |= O_DIRECT; - if (l_flags & LINUX_O_NOFOLLOW) - bsd_flags |= O_NOFOLLOW; - if (l_flags & LINUX_O_DIRECTORY) - bsd_flags |= O_DIRECTORY; - /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ - - error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); - if (error != 0) - goto done; - - if (bsd_flags & O_NOCTTY) - goto done; - - /* - * XXX In between kern_open() and fget(), another process - * having the same filedesc could use that fd without - * checking below. - */ - fd = td->td_retval[0]; - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { - if (fp->f_type != DTYPE_VNODE) { - fdrop(fp, td); - goto done; - } - sx_slock(&proctree_lock); - PROC_LOCK(p); - if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { - PROC_UNLOCK(p); - sx_sunlock(&proctree_lock); - /* XXXPJD: Verify if TIOCSCTTY is allowed. */ - (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, - td->td_ucred, td); - } else { - PROC_UNLOCK(p); - sx_sunlock(&proctree_lock); - } - fdrop(fp, td); - } + cap_rights_t rights; + struct proc *p = td->td_proc; + struct file *fp; + int fd; + int bsd_flags, error; + + bsd_flags = 0; + switch (l_flags & LINUX_O_ACCMODE) { + case LINUX_O_WRONLY: + bsd_flags |= O_WRONLY; + break; + case LINUX_O_RDWR: + bsd_flags |= O_RDWR; + break; + default: + bsd_flags |= O_RDONLY; + } + if (l_flags & LINUX_O_NDELAY) + bsd_flags |= O_NONBLOCK; + if (l_flags & LINUX_O_APPEND) + bsd_flags |= O_APPEND; + if (l_flags & LINUX_O_SYNC) + bsd_flags |= O_FSYNC; + if (l_flags & LINUX_O_NONBLOCK) + bsd_flags |= O_NONBLOCK; + if (l_flags & LINUX_FASYNC) + bsd_flags |= O_ASYNC; + if (l_flags & LINUX_O_CREAT) + bsd_flags |= O_CREAT; + if (l_flags & LINUX_O_TRUNC) + bsd_flags |= O_TRUNC; + if (l_flags & LINUX_O_EXCL) + bsd_flags |= O_EXCL; + if (l_flags & LINUX_O_NOCTTY) + bsd_flags |= O_NOCTTY; + if (l_flags & LINUX_O_DIRECT) + bsd_flags |= O_DIRECT; + if (l_flags & LINUX_O_NOFOLLOW) + bsd_flags |= O_NOFOLLOW; + if (l_flags & LINUX_O_DIRECTORY) + bsd_flags |= O_DIRECTORY; + /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ + + error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); + if (error != 0) + goto done; + if (bsd_flags & O_NOCTTY) + goto done; + + /* + * XXX In between kern_open() and fget(), another process + * having the same filedesc could use that fd without + * checking below. + */ + fd = td->td_retval[0]; + if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { + if (fp->f_type != DTYPE_VNODE) { + fdrop(fp, td); + goto done; + } + sx_slock(&proctree_lock); + PROC_LOCK(p); + if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + PROC_UNLOCK(p); + sx_sunlock(&proctree_lock); + /* XXXPJD: Verify if TIOCSCTTY is allowed. */ + (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, + td->td_ucred, td); + } else { + PROC_UNLOCK(p); + sx_sunlock(&proctree_lock); + } + fdrop(fp, td); + } done: #ifdef DEBUG - if (ldebug(open)) - printf(LMSG("open returns error %d"), error); + if (ldebug(open)) + printf(LMSG("open returns error %d"), error); #endif - LFREEPATH(path); - return (error); + LFREEPATH(path); + return (error); } int @@ -195,44 +193,41 @@ linux_openat(struct thread *td, struct l int linux_open(struct thread *td, struct linux_open_args *args) { - char *path; - - if (args->flags & LINUX_O_CREAT) - LCONVPATHCREAT(td, args->path, &path); - else - LCONVPATHEXIST(td, args->path, &path); + char *path; + if (args->flags & LINUX_O_CREAT) + LCONVPATHCREAT(td, args->path, &path); + else + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(open)) printf(ARGS(open, "%s, 0x%x, 0x%x"), path, args->flags, args->mode); #endif - return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } int linux_lseek(struct thread *td, struct linux_lseek_args *args) { - - struct lseek_args /* { - int fd; - int pad; - off_t offset; - int whence; - } */ tmp_args; - int error; + struct lseek_args /* { + int fd; + int pad; + off_t offset; + int whence; + } */ tmp_args; + int error; #ifdef DEBUG if (ldebug(lseek)) printf(ARGS(lseek, "%d, %ld, %d"), args->fdes, (long)args->off, args->whence); #endif - tmp_args.fd = args->fdes; - tmp_args.offset = (off_t)args->off; - tmp_args.whence = args->whence; - error = sys_lseek(td, &tmp_args); - return error; + tmp_args.fd = args->fdes; + tmp_args.offset = (off_t)args->off; + tmp_args.whence = args->whence; + error = sys_lseek(td, &tmp_args); + return (error); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) @@ -255,13 +250,13 @@ linux_llseek(struct thread *td, struct l bsd_args.whence = args->whence; if ((error = sys_lseek(td, &bsd_args))) - return error; + return (error); if ((error = copyout(td->td_retval, args->res, sizeof (off_t)))) - return error; + return (error); td->td_retval[0] = 0; - return 0; + return (0); } int @@ -272,7 +267,7 @@ linux_readdir(struct thread *td, struct lda.fd = args->fd; lda.dent = args->dent; lda.count = 1; - return linux_getdents(td, &lda); + return (linux_getdents(td, &lda)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -945,7 +940,7 @@ linux_ftruncate(struct thread *td, struc int pad; off_t length; } */ nuap; - + nuap.fd = args->fd; nuap.length = args->length; return (sys_ftruncate(td, &nuap)); @@ -1016,7 +1011,7 @@ linux_fdatasync(td, uap) struct fsync_args bsd; bsd.fd = uap->fd; - return sys_fsync(td, &bsd); + return (sys_fsync(td, &bsd)); } int @@ -1033,9 +1028,7 @@ linux_pread(td, uap) bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - error = sys_pread(td, &bsd); - if (error == 0) { /* This seems to violate POSIX but linux does it */ error = fgetvp(td, uap->fd, @@ -1048,7 +1041,6 @@ linux_pread(td, uap) } vrele(vp); } - return (error); } @@ -1063,7 +1055,7 @@ linux_pwrite(td, uap) bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - return sys_pwrite(td, &bsd); + return (sys_pwrite(td, &bsd)); } int From owner-svn-src-stable-10@freebsd.org Sun Jun 5 06:04:26 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A2FB69695; Sun, 5 Jun 2016 06:04:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6868E1B34; Sun, 5 Jun 2016 06:04:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5564P5E040971; Sun, 5 Jun 2016 06:04:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5564P7B040970; Sun, 5 Jun 2016 06:04:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050604.u5564P7B040970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 06:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301425 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:04:26 -0000 Author: dchagin Date: Sun Jun 5 06:04:25 2016 New Revision: 301425 URL: https://svnweb.freebsd.org/changeset/base/301425 Log: MFC r300412: Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup while here. Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:02:37 2016 (r301424) +++ stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:04:25 2016 (r301425) @@ -1,7 +1,9 @@ /* $NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $ */ /*- - * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. + * Copyright (c) 2009-2016 Dmitry Chagin + * Copyright (c) 2005 Emmanuel Dreyfus + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -605,7 +607,7 @@ futex_atomic_op(struct thread *td, int e LIN_SDT_PROBE4(futex, futex_atomic_op, decoded_op, op, cmp, oparg, cmparg); - + /* XXX: Linux verifies access here and returns EFAULT */ LIN_SDT_PROBE0(futex, futex_atomic_op, missing_access_check); @@ -997,7 +999,6 @@ linux_sys_futex(struct thread *td, struc return (ENOSYS); case LINUX_FUTEX_REQUEUE: - /* * Glibc does not use this operation since version 2.3.3, * as it is racy and replaced by FUTEX_CMP_REQUEUE operation. From owner-svn-src-stable-10@freebsd.org Sun Jun 5 06:06:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB238B6972C; Sun, 5 Jun 2016 06:06:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 942D81CC4; Sun, 5 Jun 2016 06:06:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5566tM7041142; Sun, 5 Jun 2016 06:06:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5566tYK041141; Sun, 5 Jun 2016 06:06:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050606.u5566tYK041141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 06:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301426 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:06:56 -0000 Author: dchagin Date: Sun Jun 5 06:06:55 2016 New Revision: 301426 URL: https://svnweb.freebsd.org/changeset/base/301426 Log: MFC r300413: Due to lack the priority propagation feature replace sx by mutex. WIth this commit NPTL tests are ends in 1 minute faster. MFC r300414: For future use move futex timeout code to the separate function and switch to the high resolution sbintime_t. Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:04:25 2016 (r301425) +++ stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:06:55 2016 (r301426) @@ -55,9 +55,10 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include -#include #include +#include + #ifdef COMPAT_LINUX32 #include #include @@ -109,7 +110,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_get, LIN_SDT_PROBE_DEFINE0(futex, futex_get, error); LIN_SDT_PROBE_DEFINE1(futex, futex_get, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, entry, "struct futex *", - "struct waiting_proc **", "int"); + "struct waiting_proc **", "struct timespec *"); LIN_SDT_PROBE_DEFINE5(futex, futex_sleep, requeue_error, "int", "uint32_t *", "struct waiting_proc *", "uint32_t *", "uint32_t"); LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, sleep_error, "int", "uint32_t *", @@ -128,7 +129,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_reque "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", - "struct waiting_proc **", "int", "uint32_t"); + "struct waiting_proc **", "struct timespec *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", @@ -142,7 +143,6 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_atomi LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", "struct linux_sys_futex_args *"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); -LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, itimerfix_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", @@ -197,7 +197,7 @@ struct waiting_proc { }; struct futex { - struct sx f_lck; + struct mtx f_lck; uint32_t *f_uaddr; /* user-supplied value, for debug */ struct umtx_key f_key; uint32_t f_refcount; @@ -208,20 +208,22 @@ struct futex { struct futex_list futex_list; -#define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) -#define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) +#define FUTEX_LOCK(f) mtx_lock(&(f)->f_lck) +#define FUTEX_LOCKED(f) mtx_owned(&(f)->f_lck) +#define FUTEX_UNLOCK(f) mtx_unlock(&(f)->f_lck) #define FUTEX_INIT(f) do { \ - sx_init_flags(&(f)->f_lck, "ftlk", \ - SX_DUPOK); \ + mtx_init(&(f)->f_lck, "ftlk", NULL, \ + MTX_DUPOK); \ LIN_SDT_PROBE1(futex, futex, create, \ &(f)->f_lck); \ } while (0) #define FUTEX_DESTROY(f) do { \ LIN_SDT_PROBE1(futex, futex, destroy, \ &(f)->f_lck); \ - sx_destroy(&(f)->f_lck); \ + mtx_destroy(&(f)->f_lck); \ } while (0) -#define FUTEX_ASSERT_LOCKED(f) sx_assert(&(f)->f_lck, SA_XLOCKED) +#define FUTEX_ASSERT_LOCKED(f) mtx_assert(&(f)->f_lck, MA_OWNED) +#define FUTEX_ASSERT_UNLOCKED(f) mtx_assert(&(f)->f_lck, MA_NOTOWNED) struct mtx futex_mtx; /* protects the futex list */ #define FUTEXES_LOCK do { \ @@ -240,6 +242,7 @@ struct mtx futex_mtx; /* protects the #define FUTEX_DONTCREATE 0x2 /* don't create futex if not exists */ #define FUTEX_DONTEXISTS 0x4 /* return EINVAL if futex exists */ #define FUTEX_SHARED 0x8 /* shared futex */ +#define FUTEX_DONTLOCK 0x10 /* don't lock futex */ /* wp_flags */ #define FUTEX_WP_REQUEUED 0x1 /* wp requeued - wp moved from wp_list @@ -254,11 +257,15 @@ static void futex_put(struct futex *, st static int futex_get0(uint32_t *, struct futex **f, uint32_t); static int futex_get(uint32_t *, struct waiting_proc **, struct futex **, uint32_t); -static int futex_sleep(struct futex *, struct waiting_proc *, int); +static int futex_sleep(struct futex *, struct waiting_proc *, struct timespec *); static int futex_wake(struct futex *, int, uint32_t); static int futex_requeue(struct futex *, int, struct futex *, int); -static int futex_wait(struct futex *, struct waiting_proc *, int, +static int futex_copyin_timeout(int, struct l_timespec *, int, + struct timespec *); +static int futex_wait(struct futex *, struct waiting_proc *, struct timespec *, uint32_t); +static void futex_lock(struct futex *); +static void futex_unlock(struct futex *); static int futex_atomic_op(struct thread *, int, uint32_t *); static int handle_futex_death(struct linux_emuldata *, uint32_t *, unsigned int); @@ -273,12 +280,39 @@ int futex_andl(int oparg, uint32_t *uadd int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); +static int +futex_copyin_timeout(int op, struct l_timespec *luts, int clockrt, + struct timespec *ts) +{ + struct l_timespec lts; + struct timespec kts; + int error; + + error = copyin(luts, <s, sizeof(lts)); + if (error) + return (error); + + error = linux_to_native_timespec(ts, <s); + if (error) + return (error); + if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000) + return (EINVAL); + + if (clockrt) { + nanotime(&kts); + timespecsub(ts, &kts); + } else if (op == LINUX_FUTEX_WAIT_BITSET) { + nanouptime(&kts); + timespecsub(ts, &kts); + } + return (error); +} + static void futex_put(struct futex *f, struct waiting_proc *wp) { LIN_SDT_PROBE2(futex, futex_put, entry, f, wp); - FUTEX_ASSERT_LOCKED(f); if (wp != NULL) { if ((wp->wp_flags & FUTEX_WP_REMOVED) == 0) TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list); @@ -289,7 +323,8 @@ futex_put(struct futex *f, struct waitin if (--f->f_refcount == 0) { LIST_REMOVE(f, f_list); FUTEXES_UNLOCK; - FUTEX_UNLOCK(f); + if (FUTEX_LOCKED(f)) + futex_unlock(f); LIN_SDT_PROBE3(futex, futex_put, destroy, f->f_uaddr, f->f_refcount, f->f_key.shared); @@ -308,7 +343,8 @@ futex_put(struct futex *f, struct waitin LINUX_CTR3(sys_futex, "futex_put uaddr %p ref %d shared %d", f->f_uaddr, f->f_refcount, f->f_key.shared); FUTEXES_UNLOCK; - FUTEX_UNLOCK(f); + if (FUTEX_LOCKED(f)) + futex_unlock(f); LIN_SDT_PROBE0(futex, futex_put, return); } @@ -336,7 +372,8 @@ retry: LIST_FOREACH(f, &futex_list, f_list) { if (umtx_key_match(&f->f_key, &key)) { if (tmpf != NULL) { - FUTEX_UNLOCK(tmpf); + if (FUTEX_LOCKED(tmpf)) + futex_unlock(tmpf); FUTEX_DESTROY(tmpf); free(tmpf, M_FUTEX); } @@ -357,7 +394,8 @@ retry: FUTEXES_UNLOCK; umtx_key_release(&key); - FUTEX_LOCK(f); + if ((flags & FUTEX_DONTLOCK) == 0) + futex_lock(f); *newf = f; LIN_SDT_PROBE3(futex, futex_get0, shared, uaddr, f->f_refcount, f->f_key.shared); @@ -393,7 +431,8 @@ retry: * Lock the new futex before an insert into the futex_list * to prevent futex usage by other. */ - FUTEX_LOCK(tmpf); + if ((flags & FUTEX_DONTLOCK) == 0) + futex_lock(tmpf); goto retry; } @@ -441,16 +480,56 @@ futex_get(uint32_t *uaddr, struct waitin return (error); } +static inline void +futex_lock(struct futex *f) +{ + + LINUX_CTR3(sys_futex, "futex_lock uaddr %p ref %d shared %d", + f->f_uaddr, f->f_refcount, f->f_key.shared); + FUTEX_ASSERT_UNLOCKED(f); + FUTEX_LOCK(f); +} + +static inline void +futex_unlock(struct futex *f) +{ + + LINUX_CTR3(sys_futex, "futex_unlock uaddr %p ref %d shared %d", + f->f_uaddr, f->f_refcount, f->f_key.shared); + FUTEX_ASSERT_LOCKED(f); + FUTEX_UNLOCK(f); +} + static int -futex_sleep(struct futex *f, struct waiting_proc *wp, int timeout) +futex_sleep(struct futex *f, struct waiting_proc *wp, struct timespec *ts) { + struct timespec uts; + sbintime_t sbt, prec, tmp; + time_t over; int error; FUTEX_ASSERT_LOCKED(f); - LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, timeout); - LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %d ref %d", - f->f_uaddr, wp, timeout, f->f_refcount); - error = sx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout); + if (ts != NULL) { + uts = *ts; + if (uts.tv_sec > INT32_MAX / 2) { + over = uts.tv_sec - INT32_MAX / 2; + uts.tv_sec -= over; + } + tmp = tstosbt(uts); + if (TIMESEL(&sbt, tmp)) + sbt += tc_tick_sbt; + sbt += tmp; + prec = tmp; + prec >>= tc_precexp; + } else { + sbt = 0; + prec = 0; + } + LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, sbt); + LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %ld ref %d", + f->f_uaddr, wp, sbt, f->f_refcount); + + error = msleep_sbt(wp, &f->f_lck, PCATCH, "futex", sbt, prec, C_ABSOLUTE); if (wp->wp_flags & FUTEX_WP_REQUEUED) { KASSERT(f != wp->wp_futex, ("futex != wp_futex")); @@ -466,7 +545,7 @@ futex_sleep(struct futex *f, struct wait wp->wp_futex->f_refcount); futex_put(f, NULL); f = wp->wp_futex; - FUTEX_LOCK(f); + futex_lock(f); } else { if (error) { LIN_SDT_PROBE3(futex, futex_sleep, sleep_error, error, @@ -568,12 +647,12 @@ futex_requeue(struct futex *f, int n, st } static int -futex_wait(struct futex *f, struct waiting_proc *wp, int timeout_hz, +futex_wait(struct futex *f, struct waiting_proc *wp, struct timespec *ts, uint32_t bitset) { int error; - LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, timeout_hz, bitset); + LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, ts, bitset); if (bitset == 0) { LIN_SDT_PROBE1(futex, futex_wait, return, EINVAL); @@ -581,7 +660,7 @@ futex_wait(struct futex *f, struct waiti } f->f_bitset = bitset; - error = futex_sleep(f, wp, timeout_hz); + error = futex_sleep(f, wp, ts); if (error) LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); if (error == EWOULDBLOCK) @@ -673,11 +752,8 @@ linux_sys_futex(struct thread *td, struc struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; - struct l_timespec ltimeout; - struct timespec timeout; - struct timeval utv, ctv; - int timeout_hz; - int error; + struct timespec uts, *ts; + int error, save; uint32_t flags, val; LIN_SDT_PROBE2(futex, linux_sys_futex, entry, td, args); @@ -719,37 +795,19 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->val3); if (args->timeout != NULL) { - error = copyin(args->timeout, <imeout, sizeof(ltimeout)); + error = futex_copyin_timeout(args->op, args->timeout, + clockrt, &uts); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } - error = linux_to_native_timespec(&timeout, <imeout); - if (error) - return (error); - TIMESPEC_TO_TIMEVAL(&utv, &timeout); - error = itimerfix(&utv); - if (error) { - LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, - error); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); - return (error); - } - if (clockrt) { - microtime(&ctv); - timevalsub(&utv, &ctv); - } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { - microuptime(&ctv); - timevalsub(&utv, &ctv); - } - if (utv.tv_sec < 0) - timevalclear(&utv); - timeout_hz = tvtohz(&utv); + ts = &uts; } else - timeout_hz = 0; + ts = NULL; +retry0: error = futex_get(args->uaddr, &wp, &f, flags | FUTEX_CREATE_WP); if (error) { @@ -757,14 +815,16 @@ linux_sys_futex(struct thread *td, struc return (error); } - error = copyin(args->uaddr, &val, sizeof(val)); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); if (error) { + futex_put(f, wp); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry0; LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LINUX_CTR1(sys_futex, "WAIT copyin failed %d", error); - futex_put(f, wp); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } @@ -782,7 +842,7 @@ linux_sys_futex(struct thread *td, struc return (EWOULDBLOCK); } - error = futex_wait(f, wp, timeout_hz, args->val3); + error = futex_wait(f, wp, ts, args->val3); break; case LINUX_FUTEX_WAKE: @@ -832,7 +892,8 @@ linux_sys_futex(struct thread *td, struc return (EINVAL); } - error = futex_get(args->uaddr, NULL, &f, flags); +retry1: + error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); @@ -846,22 +907,26 @@ linux_sys_futex(struct thread *td, struc * returned by FUTEX_CMP_REQUEUE. */ error = futex_get(args->uaddr2, NULL, &f2, - flags | FUTEX_DONTEXISTS); + flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } - error = copyin(args->uaddr, &val, sizeof(val)); + futex_lock(f); + futex_lock(f2); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); if (error) { + futex_put(f2, NULL); + futex_put(f, NULL); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry1; LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d", error); - futex_put(f2, NULL); - futex_put(f, NULL); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } @@ -891,50 +956,45 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->uaddr2, args->val3, args->timeout); - error = futex_get(args->uaddr, NULL, &f, flags); +retry2: + error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } if (args->uaddr != args->uaddr2) - error = futex_get(args->uaddr2, NULL, &f2, flags); + error = futex_get(args->uaddr2, NULL, &f2, + flags | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } + futex_lock(f); + futex_lock(f2); /* * This function returns positive number as results and * negative as errors */ + save = vm_fault_disable_pagefaults(); op_ret = futex_atomic_op(td, args->val3, args->uaddr2); + vm_fault_enable_pagefaults(save); LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", args->uaddr, op_ret); if (op_ret < 0) { - /* XXX: We don't handle the EFAULT yet. */ - if (op_ret != -EFAULT) { - if (f2 != NULL) - futex_put(f2, NULL); - futex_put(f, NULL); - - LIN_SDT_PROBE1(futex, linux_sys_futex, return, - -op_ret); - return (-op_ret); - } else { - LIN_SDT_PROBE0(futex, linux_sys_futex, - unhandled_efault); - } if (f2 != NULL) futex_put(f2, NULL); futex_put(f, NULL); - - LIN_SDT_PROBE1(futex, linux_sys_futex, return, EFAULT); - return (EFAULT); + error = copyin(args->uaddr2, &val, sizeof(val)); + if (error == 0) + goto retry2; + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + return (error); } ret = futex_wake(f, args->val, args->val3); From owner-svn-src-stable-10@freebsd.org Sun Jun 5 07:34:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67814B687C4; Sun, 5 Jun 2016 07:34:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 351801DBC; Sun, 5 Jun 2016 07:34:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557YB51074039; Sun, 5 Jun 2016 07:34:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557YAXl074033; Sun, 5 Jun 2016 07:34:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050734.u557YAXl074033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301428 - in stable/10/sys: amd64/amd64 i386/i386 powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:34:12 -0000 Author: dchagin Date: Sun Jun 5 07:34:10 2016 New Revision: 301428 URL: https://svnweb.freebsd.org/changeset/base/301428 Log: MFC r300415: Add macro to convert errno and use it when appropriate. Modified: stable/10/sys/amd64/amd64/vm_machdep.c stable/10/sys/i386/i386/vm_machdep.c stable/10/sys/powerpc/powerpc/exec_machdep.c stable/10/sys/sparc64/sparc64/vm_machdep.c stable/10/sys/sys/sysent.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/vm_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/amd64/amd64/vm_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -414,13 +414,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_rax = error; + td->td_frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_rflags |= PSL_C; break; } Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/i386/i386/vm_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -486,13 +486,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_eax = error; + td->td_frame->tf_eax = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_eflags |= PSL_C; break; } Modified: stable/10/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/exec_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/powerpc/powerpc/exec_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -901,11 +901,7 @@ cpu_set_syscall_retval(struct thread *td tf->srr0 -= 4; break; default: - if (p->p_sysent->sv_errsize) { - error = (error < p->p_sysent->sv_errsize) ? - p->p_sysent->sv_errtbl[error] : -1; - } - tf->fixreg[FIRSTARG] = error; + tf->fixreg[FIRSTARG] = SV_ABI_ERRNO(p, error); tf->cr |= 0x10000000; /* Set summary overflow */ break; } Modified: stable/10/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/vm_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/sparc64/sparc64/vm_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -196,13 +196,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_out[0] = error; + td->td_frame->tf_out[0] = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_tstate |= TSTATE_XCC_C; break; } Modified: stable/10/sys/sys/sysent.h ============================================================================== --- stable/10/sys/sys/sysent.h Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/sys/sysent.h Sun Jun 5 07:34:10 2016 (r301428) @@ -141,6 +141,8 @@ struct sysentvec { #define SV_SHP 0x010000 #define SV_ABI_MASK 0xff +#define SV_ABI_ERRNO(p, e) ((p)->p_sysent->sv_errsize <= 0 ? e : \ + ((e) >= (p)->p_sysent->sv_errsize ? -1 : (p)->p_sysent->sv_errtbl[e])) #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) #define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) #define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) From owner-svn-src-stable-10@freebsd.org Sun Jun 5 07:38:58 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CCEBB68865; Sun, 5 Jun 2016 07:38:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08F161F35; Sun, 5 Jun 2016 07:38:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557cvwg074252; Sun, 5 Jun 2016 07:38:57 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557cvQQ074251; Sun, 5 Jun 2016 07:38:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050738.u557cvQQ074251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301429 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:38:58 -0000 Author: dchagin Date: Sun Jun 5 07:38:56 2016 New Revision: 301429 URL: https://svnweb.freebsd.org/changeset/base/301429 Log: MFC r300416: Add a missing errno translation for SO_ERROR optname. PR: 135458 Reported by: Stefan Schmidt Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:34:10 2016 (r301428) +++ stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:38:56 2016 (r301429) @@ -1594,10 +1594,10 @@ linux_getsockopt(struct thread *td, stru } */ bsd_args; l_timeval linux_tv; struct timeval tv; - socklen_t tv_len, xulen; + socklen_t tv_len, xulen, len; struct xucred xu; struct l_ucred lxu; - int error, name; + int error, name, newval; bsd_args.s = args->s; bsd_args.level = linux_to_bsd_sockopt_level(args->level); @@ -1636,6 +1636,15 @@ linux_getsockopt(struct thread *td, stru return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu))); /* NOTREACHED */ break; + case SO_ERROR: + len = sizeof(newval); + error = kern_getsockopt(td, args->s, bsd_args.level, + name, &newval, UIO_SYSSPACE, &len); + if (error) + return (error); + newval = -SV_ABI_ERRNO(td->td_proc, newval); + return (copyout(&newval, PTRIN(args->optval), len)); + /* NOTREACHED */ default: break; } From owner-svn-src-stable-10@freebsd.org Sun Jun 5 07:40:14 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10E7AB68943; Sun, 5 Jun 2016 07:40:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D647710C8; Sun, 5 Jun 2016 07:40:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557eDoQ074400; Sun, 5 Jun 2016 07:40:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557eDmP074399; Sun, 5 Jun 2016 07:40:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050740.u557eDmP074399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301430 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:40:14 -0000 Author: dchagin Date: Sun Jun 5 07:40:12 2016 New Revision: 301430 URL: https://svnweb.freebsd.org/changeset/base/301430 Log: MFC r300569: Don't leak fp in case where fo_ioctl() returns an error. Reported by: C Turt Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sun Jun 5 07:38:56 2016 (r301429) +++ stable/10/sys/compat/linux/linux_ioctl.c Sun Jun 5 07:40:12 2016 (r301430) @@ -978,7 +978,7 @@ linux_ioctl_termio(struct thread *td, st error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td->td_ucred, td); if (error) - return (error); + break; switch (bsd_line) { case TTYDISC: linux_line = LINUX_N_TTY; From owner-svn-src-stable-10@freebsd.org Sun Jun 5 07:43:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4E2B68C6D; Sun, 5 Jun 2016 07:43:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3963B167D; Sun, 5 Jun 2016 07:43:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557hKrF077732; Sun, 5 Jun 2016 07:43:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557hKXU077731; Sun, 5 Jun 2016 07:43:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050743.u557hKXU077731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301431 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:43:21 -0000 Author: dchagin Date: Sun Jun 5 07:43:20 2016 New Revision: 301431 URL: https://svnweb.freebsd.org/changeset/base/301431 Log: MFC r300431: Convert proto family in both directions. The linux and native values for local and inet are identical, but for inet6 values differ. PR: 155040 Reported by: Simon Walton Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:40:12 2016 (r301430) +++ stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:43:20 2016 (r301431) @@ -462,12 +462,16 @@ bsd_to_linux_sockaddr(struct sockaddr *a { struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); - int error; + int error, bdom; if ((error = copyin(arg, &sa, sa_len))) return (error); - *(u_short *)&sa = sa.sa_family; + bdom = bsd_to_linux_domain(sa.sa_family); + if (bdom == -1) + return (EAFNOSUPPORT); + + *(u_short *)&sa = bdom; return (copyout(&sa, arg, sa_len)); } @@ -476,12 +480,16 @@ linux_to_bsd_sockaddr(struct sockaddr *a { struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); - int error; + int error, bdom; if ((error = copyin(arg, &sa, sa_len))) return (error); - sa.sa_family = *(sa_family_t *)&sa; + bdom = linux_to_bsd_domain(*(sa_family_t *)&sa); + if (bdom == -1) + return (EAFNOSUPPORT); + + sa.sa_family = bdom; sa.sa_len = len; return (copyout(&sa, arg, sa_len)); } From owner-svn-src-stable-10@freebsd.org Sun Jun 5 08:42:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF07BB6AAC8; Sun, 5 Jun 2016 08:42:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 917D31659; Sun, 5 Jun 2016 08:42:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u558gXAP099487; Sun, 5 Jun 2016 08:42:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u558gXu2099486; Sun, 5 Jun 2016 08:42:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606050842.u558gXu2099486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Jun 2016 08:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301436 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 08:42:34 -0000 Author: kib Date: Sun Jun 5 08:42:33 2016 New Revision: 301436 URL: https://svnweb.freebsd.org/changeset/base/301436 Log: MFC r300959: Do not leak the vm object lock when swap reservation failed, in vm_object_coalesce(). Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Sun Jun 5 07:56:28 2016 (r301435) +++ stable/10/sys/vm/vm_object.c Sun Jun 5 08:42:33 2016 (r301436) @@ -2132,6 +2132,7 @@ vm_object_coalesce(vm_object_t prev_obje */ if (!reserved && !swap_reserve_by_cred(ptoa(next_size), prev_object->cred)) { + VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } prev_object->charge += ptoa(next_size); From owner-svn-src-stable-10@freebsd.org Sun Jun 5 10:48:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A52DBB6993F; Sun, 5 Jun 2016 10:48:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 759181070; Sun, 5 Jun 2016 10:48:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55AmR4u044258; Sun, 5 Jun 2016 10:48:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55AmRxx044257; Sun, 5 Jun 2016 10:48:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606051048.u55AmRxx044257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 10:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301441 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 10:48:28 -0000 Author: dchagin Date: Sun Jun 5 10:48:27 2016 New Revision: 301441 URL: https://svnweb.freebsd.org/changeset/base/301441 Log: MFC r300429: Remove a now unused global declaration of some sysentvec struct. Modified: stable/10/sys/sys/sysent.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/sysent.h ============================================================================== --- stable/10/sys/sys/sysent.h Sun Jun 5 10:33:53 2016 (r301440) +++ stable/10/sys/sys/sysent.h Sun Jun 5 10:48:27 2016 (r301441) @@ -154,8 +154,6 @@ struct sysentvec { #ifdef _KERNEL extern struct sysentvec aout_sysvec; -extern struct sysentvec elf_freebsd_sysvec; -extern struct sysentvec null_sysvec; extern struct sysent sysent[]; extern const char *syscallnames[]; From owner-svn-src-stable-10@freebsd.org Sun Jun 5 13:39:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65FF4B6A9BD; Sun, 5 Jun 2016 13:39:32 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 285821197; Sun, 5 Jun 2016 13:39:32 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55DdVM4006042; Sun, 5 Jun 2016 13:39:31 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55DdVA6006041; Sun, 5 Jun 2016 13:39:31 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051339.u55DdVA6006041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 13:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301443 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 13:39:32 -0000 Author: ache Date: Sun Jun 5 13:39:31 2016 New Revision: 301443 URL: https://svnweb.freebsd.org/changeset/base/301443 Log: MFC: r300953 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading harder. 2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case (non default) from negative seeds. 3) Don't check for valid "type" range in setstate(), it is always valid as calculated. Instead add a check that rear pointer not exceeed end pointer. MFC: r300965 Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no reason to add "& 0x7fffffff" here. Modified: stable/10/lib/libc/stdlib/random.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/random.c ============================================================================== --- stable/10/lib/libc/stdlib/random.c Sun Jun 5 11:56:03 2016 (r301442) +++ stable/10/lib/libc/stdlib/random.c Sun Jun 5 13:39:31 2016 (r301443) @@ -137,11 +137,7 @@ __FBSDID("$FreeBSD$"); */ #define MAX_TYPES 5 /* max number of types above */ -#ifdef USE_WEAK_SEEDING -#define NSHUFF 0 -#else /* !USE_WEAK_SEEDING */ #define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ -#endif /* !USE_WEAK_SEEDING */ static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; @@ -162,23 +158,12 @@ static const int seps [MAX_TYPES] = { SE static uint32_t randtbl[DEG_3 + 1] = { TYPE_3, -#ifdef USE_WEAK_SEEDING -/* Historic implementation compatibility */ -/* The random sequences do not vary much with the seed */ - 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, - 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, - 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, - 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, - 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, - 0x27fb47b9, -#else /* !USE_WEAK_SEEDING */ - 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05, - 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454, - 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471, - 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1, - 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41, - 0xf3bec5da -#endif /* !USE_WEAK_SEEDING */ + 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, + 0x696f5c16, 0x878f1ff5, 0x52d9c07f, 0x916a06cd, 0xb50b3a20, 0x2776970a, + 0xee4eb2a6, 0xe94640ec, 0xb1d65612, 0x9d1ed968, 0x1043f6b7, 0xa3432a76, + 0x17eacbb9, 0x3c09e2eb, 0x4f8c2b3, 0x708a1f57, 0xee341814, 0x95d0e4d2, + 0xb06f216c, 0x8bd2e72e, 0x8f7c38d7, 0xcfc6a8fc, 0x2a59495, 0xa20d2a69, + 0xe29d12d1 }; /* @@ -215,16 +200,8 @@ static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; static inline uint32_t -good_rand(int32_t x) +good_rand(uint32_t ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return (1103515245 * x + 12345); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * wihout overflowing 31 bits: @@ -233,18 +210,17 @@ good_rand(int32_t x) * Park and Miller, Communications of the ACM, vol. 31, no. 10, * October 1988, p. 1195. */ - int32_t hi, lo; + int32_t hi, lo, x; - /* Can't be initialized with 0, so use another value. */ - if (x == 0) - x = 123459876; + /* Transform to [1, 0x7ffffffe] range. */ + x = (ctx % 0x7ffffffe) + 1; hi = x / 127773; lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - return (x); -#endif /* !USE_WEAK_SEEDING */ + /* Transform to [0, 0x7ffffffd] range. */ + return (x - 1); } /* @@ -404,16 +380,8 @@ setstate(char *arg_state) uint32_t rear = new_state[0] / MAX_TYPES; char *ostate = (char *)(&state[-1]); - switch(type) { - case TYPE_0: - case TYPE_1: - case TYPE_2: - case TYPE_3: - case TYPE_4: - break; - default: + if (type != TYPE_0 && rear >= degrees[type]) return (NULL); - } if (rand_type == TYPE_0) state[-1] = rand_type; else @@ -455,14 +423,14 @@ random(void) if (rand_type == TYPE_0) { i = state[0]; - state[0] = i = (good_rand(i)) & 0x7fffffff; + state[0] = i = good_rand(i); } else { /* * Use local variables rather than static variables for speed. */ f = fptr; r = rptr; *f += *r; - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ + i = *f >> 1; /* chucking least random bit */ if (++f >= end_ptr) { f = state; ++r; From owner-svn-src-stable-10@freebsd.org Sun Jun 5 14:04:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D0FB6A019; Sun, 5 Jun 2016 14:04:56 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015771E63; Sun, 5 Jun 2016 14:04:55 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55E4t3V017518; Sun, 5 Jun 2016 14:04:55 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55E4t74017517; Sun, 5 Jun 2016 14:04:55 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051404.u55E4t74017517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 14:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301444 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 14:04:56 -0000 Author: ache Date: Sun Jun 5 14:04:54 2016 New Revision: 301444 URL: https://svnweb.freebsd.org/changeset/base/301444 Log: Prepare for merge of r300956. One year old r288030 which fix prototypes can't be merged without conflicts and require merging of other versions too and I don't want to go deep in that unmerged commits chain. Modified: stable/10/lib/libc/stdlib/rand.c Modified: stable/10/lib/libc/stdlib/rand.c ============================================================================== --- stable/10/lib/libc/stdlib/rand.c Sun Jun 5 13:39:31 2016 (r301443) +++ stable/10/lib/libc/stdlib/rand.c Sun Jun 5 14:04:54 2016 (r301444) @@ -111,14 +111,13 @@ static u_long next = #endif int -rand() +rand(void) { return (do_rand(&next)); } void -srand(seed) -u_int seed; +srand(u_int seed) { next = seed; #ifndef USE_WEAK_SEEDING @@ -136,7 +135,7 @@ u_int seed; * data from the kernel. */ void -sranddev() +sranddev(void) { int mib[2]; size_t len; From owner-svn-src-stable-10@freebsd.org Sun Jun 5 14:31:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED1E0B6A576; Sun, 5 Jun 2016 14:31:37 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFAE0197F; Sun, 5 Jun 2016 14:31:37 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55EVaor026448; Sun, 5 Jun 2016 14:31:36 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55EVavr026447; Sun, 5 Jun 2016 14:31:36 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051431.u55EVavr026447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 14:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301445 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 14:31:38 -0000 Author: ache Date: Sun Jun 5 14:31:36 2016 New Revision: 301445 URL: https://svnweb.freebsd.org/changeset/base/301445 Log: MFC: r300956 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. 2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones. 3) Use POSIX argument types for visible functions (cosmetic). Modified: stable/10/lib/libc/stdlib/rand.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/rand.c ============================================================================== --- stable/10/lib/libc/stdlib/rand.c Sun Jun 5 14:04:54 2016 (r301444) +++ stable/10/lib/libc/stdlib/rand.c Sun Jun 5 14:31:36 2016 (r301445) @@ -49,14 +49,6 @@ __FBSDID("$FreeBSD$"); static int do_rand(unsigned long *ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * without overflowing 31 bits: @@ -67,48 +59,34 @@ do_rand(unsigned long *ctx) */ long hi, lo, x; - /* Must be in [1, 0x7ffffffe] range at this point. */ - hi = *ctx / 127773; - lo = *ctx % 127773; + /* Transform to [1, 0x7ffffffe] range. */ + x = (*ctx % 0x7ffffffe) + 1; + hi = x / 127773; + lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - *ctx = x; /* Transform to [0, 0x7ffffffd] range. */ - return (x - 1); -#endif /* !USE_WEAK_SEEDING */ + x--; + *ctx = x; + return (x); } int -rand_r(unsigned int *ctx) +rand_r(unsigned *ctx) { u_long val; int r; -#ifdef USE_WEAK_SEEDING val = *ctx; -#else - /* Transform to [1, 0x7ffffffe] range. */ - val = (*ctx % 0x7ffffffe) + 1; -#endif r = do_rand(&val); - -#ifdef USE_WEAK_SEEDING - *ctx = (unsigned int)val; -#else - *ctx = (unsigned int)(val - 1); -#endif + *ctx = (unsigned)val; return (r); } -static u_long next = -#ifdef USE_WEAK_SEEDING - 1; -#else - 2; -#endif +static u_long next = 1; int rand(void) @@ -117,13 +95,9 @@ rand(void) } void -srand(u_int seed) +srand(unsigned seed) { next = seed; -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffffffe] range. */ - next = (next % 0x7ffffffe) + 1; -#endif } @@ -145,10 +119,6 @@ sranddev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; sysctl(mib, 2, (void *)&next, &len, NULL, 0); -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffffffe] range. */ - next = (next % 0x7ffffffe) + 1; -#endif } From owner-svn-src-stable-10@freebsd.org Sun Jun 5 15:03:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1381B6AD87; Sun, 5 Jun 2016 15:03:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6407D1AA0; Sun, 5 Jun 2016 15:03:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55F3tao039780; Sun, 5 Jun 2016 15:03:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55F3tP8039779; Sun, 5 Jun 2016 15:03:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606051503.u55F3tP8039779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 5 Jun 2016 15:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301446 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 15:03:56 -0000 Author: pfg Date: Sun Jun 5 15:03:55 2016 New Revision: 301446 URL: https://svnweb.freebsd.org/changeset/base/301446 Log: MFC r301206: usb/uhso: Don't bail out on first USB error. CID: 1305680 Submitted by: hselasky MFC after: 3 days Modified: stable/10/sys/dev/usb/net/uhso.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/uhso.c ============================================================================== --- stable/10/sys/dev/usb/net/uhso.c Sun Jun 5 14:31:36 2016 (r301445) +++ stable/10/sys/dev/usb/net/uhso.c Sun Jun 5 15:03:55 2016 (r301446) @@ -1223,6 +1223,7 @@ uhso_mux_write_callback(struct usb_xfer ht->ht_muxport); /* FALLTHROUGH */ case USB_ST_SETUP: +tr_setup: pc = usbd_xfer_get_frame(xfer, 1); if (ucom_get_data(&sc->sc_ucom[ht->ht_muxport], pc, 0, 32, &actlen)) { @@ -1253,7 +1254,8 @@ uhso_mux_write_callback(struct usb_xfer UHSO_DPRINTF(0, "error: %s\n", usbd_errstr(error)); if (error == USB_ERR_CANCELLED) break; - break; + usbd_xfer_set_stall(xfer); + goto tr_setup; } } From owner-svn-src-stable-10@freebsd.org Sun Jun 5 16:21:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD28FB6A493; Sun, 5 Jun 2016 16:21:54 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5EB198E; Sun, 5 Jun 2016 16:21:54 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55GLrog069697; Sun, 5 Jun 2016 16:21:53 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55GLrXl069696; Sun, 5 Jun 2016 16:21:53 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051621.u55GLrXl069696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 16:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301454 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 16:21:54 -0000 Author: ache Date: Sun Jun 5 16:21:53 2016 New Revision: 301454 URL: https://svnweb.freebsd.org/changeset/base/301454 Log: MFC: r301448 Reflect error indication according to POSIX and what those functions currently do. Modified: stable/10/lib/libc/stdlib/random.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/random.3 ============================================================================== --- stable/10/lib/libc/stdlib/random.3 Sun Jun 5 16:20:12 2016 (r301453) +++ stable/10/lib/libc/stdlib/random.3 Sun Jun 5 16:21:53 2016 (r301454) @@ -175,8 +175,8 @@ If .Fn initstate is called with less than 8 bytes of state information, or if .Fn setstate -detects that the state information has been garbled, error -messages are printed on the standard error output. +detects that the state information has been garbled, +NULL is returned. .Sh SEE ALSO .Xr arc4random 3 , .Xr lrand48 3 , From owner-svn-src-stable-10@freebsd.org Sun Jun 5 18:11:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF37FB6AE7F; Sun, 5 Jun 2016 18:11:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77CDE1AA5; Sun, 5 Jun 2016 18:11:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55IBqxg010821; Sun, 5 Jun 2016 18:11:52 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55IBqv2010817; Sun, 5 Jun 2016 18:11:52 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051811.u55IBqv2010817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 18:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301459 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 18:11:53 -0000 Author: ache Date: Sun Jun 5 18:11:52 2016 New Revision: 301459 URL: https://svnweb.freebsd.org/changeset/base/301459 Log: MFC: r301115 Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde Modified: stable/10/lib/libc/stdlib/div.c stable/10/lib/libc/stdlib/imaxdiv.c stable/10/lib/libc/stdlib/ldiv.c stable/10/lib/libc/stdlib/lldiv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/div.c ============================================================================== --- stable/10/lib/libc/stdlib/div.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/div.c Sun Jun 5 18:11:52 2016 (r301459) @@ -46,6 +46,7 @@ div(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) /* * The ANSI standard says that |r.quot| <= |n/d|, where * n/d is to be computed in infinite precision. In other @@ -73,5 +74,6 @@ div(num, denom) r.quot++; r.rem -= denom; } +#endif return (r); } Modified: stable/10/lib/libc/stdlib/imaxdiv.c ============================================================================== --- stable/10/lib/libc/stdlib/imaxdiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/imaxdiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -37,9 +37,11 @@ imaxdiv(intmax_t numer, intmax_t denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } Modified: stable/10/lib/libc/stdlib/ldiv.c ============================================================================== --- stable/10/lib/libc/stdlib/ldiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/ldiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -48,9 +48,11 @@ ldiv(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (num >= 0 && r.rem < 0) { r.quot++; r.rem -= denom; } +#endif return (r); } Modified: stable/10/lib/libc/stdlib/lldiv.c ============================================================================== --- stable/10/lib/libc/stdlib/lldiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/lldiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -37,9 +37,11 @@ lldiv(long long numer, long long denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } From owner-svn-src-stable-10@freebsd.org Mon Jun 6 07:10:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3734B6DA21; Mon, 6 Jun 2016 07:10:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE27B1024; Mon, 6 Jun 2016 07:10:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u567Acbq002801; Mon, 6 Jun 2016 07:10:38 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u567Ackh002797; Mon, 6 Jun 2016 07:10:38 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201606060710.u567Ackh002797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Mon, 6 Jun 2016 07:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301486 - stable/10/sys/dev/mrsas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 07:10:40 -0000 Author: kadesai Date: Mon Jun 6 07:10:38 2016 New Revision: 301486 URL: https://svnweb.freebsd.org/changeset/base/301486 Log: MFC r301203 r301203: Added support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers. Sponsored by: AVAGO Technologies/Broadcom Limited Modified: stable/10/sys/dev/mrsas/mrsas.c stable/10/sys/dev/mrsas/mrsas.h stable/10/sys/dev/mrsas/mrsas_cam.c stable/10/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.c Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas.c Mon Jun 6 07:10:38 2016 (r301486) @@ -188,6 +188,8 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, {0x1000, MRSAS_INTRUDER, 0xffff, 0xffff, "AVAGO Intruder SAS Controller"}, {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, + {0x1000, MRSAS_CUTLASS_52, 0xffff, 0xffff, "AVAGO Cutlass_52 SAS Controller"}, + {0x1000, MRSAS_CUTLASS_53, 0xffff, 0xffff, "AVAGO Cutlass_53 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -1629,7 +1631,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1653,7 +1657,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2454,7 +2460,9 @@ mrsas_ioc_init(struct mrsas_softc *sc) if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3490,7 +3498,9 @@ mrsas_build_mptmfi_passthru(struct mrsas if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: stable/10/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.h Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas.h Mon Jun 6 07:10:38 2016 (r301486) @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); #define MRSAS_FURY 0x005f #define MRSAS_INTRUDER 0x00ce #define MRSAS_INTRUDER_24 0x00cf +#define MRSAS_CUTLASS_52 0x0052 +#define MRSAS_CUTLASS_53 0x0053 #define MRSAS_PCI_BAR0 0x10 #define MRSAS_PCI_BAR1 0x14 #define MRSAS_PCI_BAR2 0x1C Modified: stable/10/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas_cam.c Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas_cam.c Mon Jun 6 07:10:38 2016 (r301486) @@ -880,7 +880,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -912,7 +914,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -1191,7 +1195,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1205,7 +1211,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1218,7 +1226,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1230,7 +1240,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: stable/10/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas_fp.c Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas_fp.c Mon Jun 6 07:10:38 2016 (r301486) @@ -752,7 +752,9 @@ mr_spanset_get_phy_params(struct mrsas_s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) do_invader = 1; /* Get row and span from io_info for Uneven Span IO. */ @@ -966,7 +968,9 @@ MR_BuildRaidContext(struct mrsas_softc * if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; else pRAID_Context->regLockFlags = (isRead) ? REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite; @@ -1454,7 +1458,9 @@ MR_GetPhyParams(struct mrsas_softc *sc, if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) do_invader = 1; row = mega_div64_32(stripRow, raid->rowDataSize); From owner-svn-src-stable-10@freebsd.org Mon Jun 6 11:08:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E0AB6D23B; Mon, 6 Jun 2016 11:08:06 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C1319AC; Mon, 6 Jun 2016 11:08:06 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56B85QS091223; Mon, 6 Jun 2016 11:08:05 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56B85VY091221; Mon, 6 Jun 2016 11:08:05 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201606061108.u56B85VY091221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Mon, 6 Jun 2016 11:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301500 - in stable/10: lib/libfetch usr.bin/fetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 11:08:06 -0000 Author: grembo (ports committer) Date: Mon Jun 6 11:08:05 2016 New Revision: 301500 URL: https://svnweb.freebsd.org/changeset/base/301500 Log: MFC r297052: Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles Modified: stable/10/lib/libfetch/fetch.3 stable/10/usr.bin/fetch/fetch.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/fetch.3 ============================================================================== --- stable/10/lib/libfetch/fetch.3 Mon Jun 6 10:21:53 2016 (r301499) +++ stable/10/lib/libfetch/fetch.3 Mon Jun 6 11:08:05 2016 (r301500) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 1998-2013 Dag-Erling Smørgrav -.\" Copyright (c) 2013 Michael Gmelin +.\" Copyright (c) 2013-2016 Michael Gmelin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2015 +.Dd March 18, 2016 .Dt FETCH 3 .Os .Sh NAME @@ -396,8 +396,15 @@ is currently unimplemented. .Sh HTTPS SCHEME Based on HTTP SCHEME. By default the peer is verified using the CA bundle located in -.Pa /etc/ssl/cert.pem . -The file may contain multiple CA certificates. +.Pa /usr/local/etc/ssl/cert.pem . +If this file does not exist, +.Pa /etc/ssl/cert.pem +is used instead. +If neither file exists, and +.Ev SSL_CA_CERT_PATH +has not been set, +OpenSSL's default CA cert and path settings apply. +The certificate bundle can contain multiple CA certificates. A common source of a current CA bundle is .Pa \%security/ca_root_nss . .Pp @@ -428,10 +435,11 @@ Client certificate based authentication The environment variable .Ev SSL_CLIENT_CERT_FILE should be set to point to a file containing key and client certificate -to be used in PEM format. In case the key is stored in a separate -file, the environment variable +to be used in PEM format. +When a PEM-format key is in a separate file from the client certificate, +the environment variable .Ev SSL_CLIENT_KEY_FILE -can be set to point to the key in PEM format. +can be set to point to the key file. In case the key uses a password, the user will be prompted on standard input (see .Xr PEM 3 ) . @@ -531,7 +539,7 @@ Invalid URL .El .Pp The accompanying error message includes a protocol-specific error code -and message, e.g.\& "File is not available (404 Not Found)" +and message, like "File is not available (404 Not Found)" .Sh ENVIRONMENT .Bl -tag -width ".Ev FETCH_BIND_ADDRESS" .It Ev FETCH_BIND_ADDRESS @@ -648,8 +656,7 @@ for compatibility. Allow SSL version 3 when negotiating the connection (not recommended). .It Ev SSL_CA_CERT_FILE CA certificate bundle containing trusted CA certificates. -Default value: -.Pa /etc/ssl/cert.pem . +Default value: See HTTPS SCHEME above. .It Ev SSL_CA_CERT_PATH Path containing trusted CA hashes. .It Ev SSL_CLIENT_CERT_FILE Modified: stable/10/usr.bin/fetch/fetch.1 ============================================================================== --- stable/10/usr.bin/fetch/fetch.1 Mon Jun 6 10:21:53 2016 (r301499) +++ stable/10/usr.bin/fetch/fetch.1 Mon Jun 6 11:08:05 2016 (r301500) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2000-2014 Dag-Erling Smørgrav -.\" Copyright (c) 2013 Michael Gmelin +.\" Copyright (c) 2013-2016 Michael Gmelin .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2015 +.Dd March 18, 2016 .Dt FETCH 1 .Os .Sh NAME @@ -134,11 +134,17 @@ only. [SSL] Path to certificate bundle containing trusted CA certificates. If not specified, -.Pa /etc/ssl/cert.pem +.Pa /usr/local/etc/ssl/cert.pem is used. -The file may contain multiple CA certificates. The port +If this file does not exist, +.Pa /etc/ssl/cert.pem +is used instead. +If neither file exists and no CA path has been configured, +OpenSSL's default CA cert and path settings apply. +The certificate bundle can contain multiple CA certificates. +The .Pa security/ca_root_nss -is a common source of a current CA bundle. +port is a common source of a current CA bundle. .It Fl -ca-path= Ns Ar dir [SSL] The directory @@ -218,10 +224,16 @@ altogether, or a comma- or whitespace-se which proxies should not be used. .It Fl -no-sslv3 [SSL] -Don't allow SSL version 3 when negotiating the connection. +Do not allow SSL version 3 when negotiating the connection. +This option is deprecated and is provided for backward compatibility +only. +SSLv3 is disabled by default. +Set +.Ev SSL_ALLOW_SSL3 +to change this behavior. .It Fl -no-tlsv1 [SSL] -Don't allow TLS version 1 when negotiating the connection. +Do not allow TLS version 1 when negotiating the connection. .It Fl -no-verify-hostname [SSL] Do not verify that the hostname matches the subject of the @@ -351,8 +363,10 @@ for a description of additional environm .Ev SSL_CLIENT_CERT_FILE , .Ev SSL_CLIENT_KEY_FILE , .Ev SSL_CRL_FILE , -.Ev SSL_NO_SSL3 , +.Ev SSL_ALLOW_SSL3 , .Ev SSL_NO_TLS1 , +.Ev SSL_NO_TLS1_1 , +.Ev SSL_NO_TLS1_2 , .Ev SSL_NO_VERIFY_HOSTNAME and .Ev SSL_NO_VERIFY_PEER . From owner-svn-src-stable-10@freebsd.org Mon Jun 6 11:10:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207F6B6D2AF; Mon, 6 Jun 2016 11:10:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC8ED1B6F; Mon, 6 Jun 2016 11:10:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56BAcGt092482; Mon, 6 Jun 2016 11:10:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56BAcMq092460; Mon, 6 Jun 2016 11:10:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606061110.u56BAcMq092460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 6 Jun 2016 11:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301501 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 11:10:39 -0000 Author: gjb Date: Mon Jun 6 11:10:37 2016 New Revision: 301501 URL: https://svnweb.freebsd.org/changeset/base/301501 Log: Fix missing svn:mergeinfo from r301101. Sponsored by: The FreeBSD Foundation Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Mon Jun 6 13:31:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFA2B6B1DF; Mon, 6 Jun 2016 13:31:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA45319FB; Mon, 6 Jun 2016 13:31:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56DVTIb045196; Mon, 6 Jun 2016 13:31:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56DVTj2045195; Mon, 6 Jun 2016 13:31:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606061331.u56DVTj2045195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 6 Jun 2016 13:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301506 - stable/10/sbin/dhclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:31:30 -0000 Author: pfg Date: Mon Jun 6 13:31:28 2016 New Revision: 301506 URL: https://svnweb.freebsd.org/changeset/base/301506 Log: MFC r301235: dhclient(1): correct obvious mismatch in get_char(). Correct switch between current and previous line buffers when encountering a carriage return in the input. CID: 1305719 Obtained from: OpenBSD (CVS rev. 1.30) Modified: stable/10/sbin/dhclient/conflex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/conflex.c ============================================================================== --- stable/10/sbin/dhclient/conflex.c Mon Jun 6 13:17:25 2016 (r301505) +++ stable/10/sbin/dhclient/conflex.c Mon Jun 6 13:31:28 2016 (r301506) @@ -97,8 +97,8 @@ get_char(FILE *cfile) cur_line = line2; prev_line = line1; } else { - cur_line = line2; - prev_line = line1; + cur_line = line1; + prev_line = line2; } line++; lpos = 1; From owner-svn-src-stable-10@freebsd.org Tue Jun 7 05:52:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9763EB6EA9A; Tue, 7 Jun 2016 05:52:53 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3811F38; Tue, 7 Jun 2016 05:52:52 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (localhost [127.0.0.1]) by salmon.maths.tcd.ie (Postfix) with ESMTP id D1BEC159165; Tue, 7 Jun 2016 06:52:49 +0100 (IST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=maths.tcd.ie; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received:received; s=20150418; t= 1465278762; x=1467093163; bh=KRvV2BlAds2lm+DgYWx9AkudgeMihpHHsO0 LOVMaVRE=; b=IjL8Wwp5WhHLg1v7DmDU/FZYZGd/5i27nZ0k4Yl1HkJuY2CMuP4 Njf6JY9XC260xFrbeRTQvAmfNyTh+/aSTM0CIiPvHCI8dEXavbhOo4sLgTnGVfD0 8xbnvC/BJsEa8VH09iir+AW3mb58wSVfEjgcM6VKGy/PiV+JmTmyBQtw= X-Virus-Scanned: amavisd-new at maths.tcd.ie Received: from salmon.maths.tcd.ie ([127.0.0.1]) by salmon.maths.tcd.ie (salmon.maths.tcd.ie [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XCfxYcAJl_q0; Tue, 7 Jun 2016 06:52:42 +0100 (IST) Received: from smtp.maths.tcd.ie (walton.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510a]) by salmon.maths.tcd.ie (Postfix) with ESMTP id 0F730159127; Tue, 7 Jun 2016 06:52:42 +0100 (IST) Received: by smtp.maths.tcd.ie (Postfix, from userid 238) id 785AC730B4; Tue, 7 Jun 2016 06:52:41 +0100 (IST) Date: Tue, 7 Jun 2016 06:52:40 +0100 From: David Malone To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r299954 - stable/10/sbin/restore Message-ID: <20160607055240.GA53732@walton.maths.tcd.ie> References: <201605161629.u4GGTumH048298@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605161629.u4GGTumH048298@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 05:52:53 -0000 Hi Pedro, The OpenBSD commit message said off_t, but you commit and commit message says size_t, which won't be bigger than a long on some of our platforms. Should it have been off_t, or did I misunderstand something? David. > Author: pfg > Date: Mon May 16 16:29:56 2016 > New Revision: 299954 > URL: https://svnweb.freebsd.org/changeset/base/299954 > > Log: > MFC r298901: > restore: promote some getfiles() parameters to size_t. > > This is based on a change from OpenBSD: > > "Fix restore so that it can actually restore files larger than 4GB by > changing the type of "size" to off_t in getfiles() plus little dependent > type cleanup, from Daniel Lucq." > > It is an important for machines with 32 bit longs. > While here unsign the flags, also from OpenBSD. > > Obtained from: OpenBSD (with changes) > > Modified: > stable/10/sbin/restore/dirs.c > stable/10/sbin/restore/extern.h > stable/10/sbin/restore/tape.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/restore/dirs.c > ============================================================================== > --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) > +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) > @@ -85,7 +85,7 @@ struct modeinfo { > mode_t mode; > uid_t uid; > gid_t gid; > - int flags; > + u_int flags; > int extsize; > }; > > @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct > static void flushent(void); > static struct inotab *inotablookup(ino_t); > static RST_DIR *opendirfile(const char *); > -static void putdir(char *, long); > -static void putdirattrs(char *, long); > +static void putdir(char *, size_t); > +static void putdirattrs(char *, size_t); > static void putent(struct direct *); > static void rst_seekdir(RST_DIR *, long, long); > static long rst_telldir(RST_DIR *); > @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) > * Put the directory entries in the directory file > */ > static void > -putdir(char *buf, long size) > +putdir(char *buf, size_t size) > { > struct direct *dp; > - long loc, i; > + size_t loc, i; > > for (loc = 0; loc < size; ) { > dp = (struct direct *)(buf + loc); > @@ -356,12 +356,12 @@ putdir(char *buf, long size) > "reclen not multiple of 4 "); > if (dp->d_reclen < DIRSIZ(0, dp)) > vprintf(stdout, > - "reclen less than DIRSIZ (%d < %zu) ", > + "reclen less than DIRSIZ (%u < %zu) ", > dp->d_reclen, DIRSIZ(0, dp)); > #if NAME_MAX < 255 > if (dp->d_namlen > NAME_MAX) > vprintf(stdout, > - "reclen name too big (%d > %d) ", > + "reclen name too big (%u > %u) ", > dp->d_namlen, NAME_MAX); > #endif > vprintf(stdout, "\n"); > @@ -418,7 +418,7 @@ flushent(void) > * Save extended attributes for a directory entry to a file. > */ > static void > -putdirattrs(char *buf, long size) > +putdirattrs(char *buf, size_t size) > { > > if (mf != NULL && fwrite(buf, size, 1, mf) != 1) > > Modified: stable/10/sbin/restore/extern.h > ============================================================================== > --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) > +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) > @@ -54,8 +54,8 @@ void freeentry(struct entry *); > void freename(char *); > int genliteraldir(char *, ino_t); > char *gentempname(struct entry *); > -void getfile(void (*)(char *, long), void (*)(char *, long), > - void (*)(char *, long)); > +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), > + void (*)(char *, size_t)); > void getvol(long); > void initsymtable(char *); > int inodetype(ino_t); > @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); > void treescan(char *, ino_t, long (*)(char *, ino_t, int)); > ino_t upperbnd(ino_t); > long verifyfile(char *, ino_t, int); > -void xtrnull(char *, long); > +void xtrnull(char *, size_t); > > /* From ../dump/dumprmt.c */ > void rmtclose(void); > > Modified: stable/10/sbin/restore/tape.c > ============================================================================== > --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) > +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) > @@ -104,7 +104,7 @@ static int checksum(int *); > static void findinode(struct s_spcl *); > static void findtapeblksize(void); > static char *setupextattr(int); > -static void xtrattr(char *, long); > +static void xtrattr(char *, size_t); > static void set_extattr_link(char *, void *, int); > static void set_extattr_fd(int, char *, void *, int); > static int gethead(struct s_spcl *); > @@ -114,12 +114,12 @@ static u_long swabl(u_long); > static u_char *swablong(u_char *, int); > static u_char *swabshort(u_char *, int); > static void terminateinput(void); > -static void xtrfile(char *, long); > -static void xtrlnkfile(char *, long); > -static void xtrlnkskip(char *, long); > -static void xtrmap(char *, long); > -static void xtrmapskip(char *, long); > -static void xtrskip(char *, long); > +static void xtrfile(char *, size_t); > +static void xtrlnkfile(char *, size_t); > +static void xtrlnkskip(char *, size_t); > +static void xtrmap(char *, size_t); > +static void xtrmapskip(char *, size_t); > +static void xtrskip(char *, size_t); > > /* > * Set up an input source > @@ -564,7 +564,7 @@ printdumpinfo(void) > int > extractfile(char *name) > { > - int flags; > + u_int flags; > uid_t uid; > gid_t gid; > mode_t mode; > @@ -931,13 +931,13 @@ skipfile(void) > * to the skip function. > */ > void > -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), > - void (*skip)(char *, long)) > +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), > + void (*skip)(char *, size_t)) > { > int i; > - off_t size; > + volatile off_t size; > int curblk, attrsize; > - void (*fillit)(char *, long); > + void (*fillit)(char *, size_t); > static char clearedbuf[MAXBSIZE]; > char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; > char junk[TP_BSIZE]; > @@ -1066,7 +1066,7 @@ setupextattr(int extsize) > * Extract the next block of extended attributes. > */ > static void > -xtrattr(char *buf, long size) > +xtrattr(char *buf, size_t size) > { > > if (extloc + size > extbufsize) > @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) > * Write out the next block of a file. > */ > static void > -xtrfile(char *buf, long size) > +xtrfile(char *buf, size_t size) > { > > if (Nflag) > @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) > */ > /* ARGSUSED */ > static void > -xtrskip(char *buf, long size) > +xtrskip(char *buf, size_t size) > { > > if (lseek(ofile, size, SEEK_CUR) == -1) { > @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) > * Collect the next block of a symbolic link. > */ > static void > -xtrlnkfile(char *buf, long size) > +xtrlnkfile(char *buf, size_t size) > { > > pathlen += size; > @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) > */ > /* ARGSUSED */ > static void > -xtrlnkskip(char *buf, long size) > +xtrlnkskip(char *buf, size_t size) > { > > fprintf(stderr, "unallocated block in symbolic link %s\n", > @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) > * Collect the next block of a bit map. > */ > static void > -xtrmap(char *buf, long size) > +xtrmap(char *buf, size_t size) > { > > memmove(map, buf, size); > @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) > */ > /* ARGSUSED */ > static void > -xtrmapskip(char *buf, long size) > +xtrmapskip(char *buf, size_t size) > { > > panic("hole in map\n"); > @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) > */ > /* ARGSUSED */ > void > -xtrnull(char *buf, long size) > +xtrnull(char *buf, size_t size) > { > > return; > From owner-svn-src-stable-10@freebsd.org Tue Jun 7 14:21:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA91B6D2B8 for ; Tue, 7 Jun 2016 14:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC071B81 for ; Tue, 7 Jun 2016 14:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465309316; bh=CgzcogzWNJzI7Gh46+6Ju5A4UlB9IUsB2KpK3GVlfac=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=b+L0Aep6MKz6QLHbszmiC6iqAp8T4ja0teQhVb9z91pqy33cUr/hkSQPttqZJ3SErBZk6bYNfBlMiIqfPbjfPRlG4Kj4amKVqSWjlzIiHZipFN5/vyNBLQi+hFcUGemzRfdD1v7ggabrWo0mQN/lAW8AEHLd9nGDRUTSLNfeqpgLs17+86817R9QFq/vCjdeIGL/YIQY2eUY/7iT1SbLfq13lFrSuqQftzZiiJmrITm8RARyNUJ/wCDrBC9LCy0JB0xFHoBTj6+cDhQf4/0tmtA9vJcubCsFQ/8jJPdXIyNXiBWXg5UZ5BRbghTa6j8Wa58doHw/VamZNiFgR8kF/g== Received: from [66.196.81.170] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 Received: from [98.139.211.205] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 X-Yahoo-Newman-Id: 163321.90188.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rQDRkKoVM1l_KvnSZYd3cswUwcLDq8x1_Z1zCWBEAdciUha OhxSX7aJf9J_ELQnbWQzFt_p7AqVxRG5wB_3DxFk3o5qcuuH5Sy3eiRF0KDD 9NheBkpVY3vNpcOKPVlzObeTQK64dF_l1etfFgHOZpXoHM2Q5xpyBAatvCPS QvFVG6Rd2OvG9uEmAsWqE7BcHwtmawdKOrWEKYBA_GlIOtw6JBlv2rcHhcVi Cqz4qYul3PgM_8002wKQErR80cETAVCuNgJXBhn_OTw__ZtYBpPWkyeiz3Kn nDaNKUTwx_nydjl.DJq34.TRYZ4yZeHRcR93T9GmqDni6vG3Lzdce4unu3Mj GBtGJ_Fm1GHbeFzsjen1u1OcgV_m0YkeFsBNdX5m7pIpX9eMHdVcpqZysEHP 4JvdQKBzLy2ouWSX2K4o.AkjVV4eKvukE3xCuWpCB4aX2eBUxBX1191A6GjD ZmHgkn48QKS7Tb7N0rvkShEYiYAxavGytRw.ufXwbF8KNWWMG_2R4nyyrcVC qDppsAHQ0VxTq.XnpuPYVE17uyxdbvnKI X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r299954 - stable/10/sbin/restore To: David Malone References: <201605161629.u4GGTumH048298@repo.freebsd.org> <20160607055240.GA53732@walton.maths.tcd.ie> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: Pedro Giffuni Message-ID: <1601b9c2-41a8-03e4-fa8f-3ccf4785ecd4@FreeBSD.org> Date: Tue, 7 Jun 2016 09:21:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160607055240.GA53732@walton.maths.tcd.ie> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 14:21:59 -0000 H David; On 06/07/16 00:52, David Malone wrote: > Hi Pedro, > > The OpenBSD commit message said off_t, but you commit and commit > message says size_t, which won't be bigger than a long on some of > our platforms. Should it have been off_t, or did I misunderstand > something? > You didn't misunderstand anything. The OpenBSD commit logs says off_t but their commit also has size_t's. I didn't feel like changing their commit log but still wanted to keep the "spirit" of the change and give them credit. size_t is bigger on the platforms that matter, plus it is unsigned. Pedro. > David. >> Author: pfg >> Date: Mon May 16 16:29:56 2016 >> New Revision: 299954 >> URL: https://svnweb.freebsd.org/changeset/base/299954 >> >> Log: >> MFC r298901: >> restore: promote some getfiles() parameters to size_t. >> >> This is based on a change from OpenBSD: >> >> "Fix restore so that it can actually restore files larger than 4GB by >> changing the type of "size" to off_t in getfiles() plus little dependent >> type cleanup, from Daniel Lucq." >> >> It is an important for machines with 32 bit longs. >> While here unsign the flags, also from OpenBSD. >> >> Obtained from: OpenBSD (with changes) >> >> Modified: >> stable/10/sbin/restore/dirs.c >> stable/10/sbin/restore/extern.h >> stable/10/sbin/restore/tape.c >> Directory Properties: >> stable/10/ (props changed) >> >> Modified: stable/10/sbin/restore/dirs.c >> ============================================================================== >> --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) >> @@ -85,7 +85,7 @@ struct modeinfo { >> mode_t mode; >> uid_t uid; >> gid_t gid; >> - int flags; >> + u_int flags; >> int extsize; >> }; >> >> @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct >> static void flushent(void); >> static struct inotab *inotablookup(ino_t); >> static RST_DIR *opendirfile(const char *); >> -static void putdir(char *, long); >> -static void putdirattrs(char *, long); >> +static void putdir(char *, size_t); >> +static void putdirattrs(char *, size_t); >> static void putent(struct direct *); >> static void rst_seekdir(RST_DIR *, long, long); >> static long rst_telldir(RST_DIR *); >> @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) >> * Put the directory entries in the directory file >> */ >> static void >> -putdir(char *buf, long size) >> +putdir(char *buf, size_t size) >> { >> struct direct *dp; >> - long loc, i; >> + size_t loc, i; >> >> for (loc = 0; loc < size; ) { >> dp = (struct direct *)(buf + loc); >> @@ -356,12 +356,12 @@ putdir(char *buf, long size) >> "reclen not multiple of 4 "); >> if (dp->d_reclen < DIRSIZ(0, dp)) >> vprintf(stdout, >> - "reclen less than DIRSIZ (%d < %zu) ", >> + "reclen less than DIRSIZ (%u < %zu) ", >> dp->d_reclen, DIRSIZ(0, dp)); >> #if NAME_MAX < 255 >> if (dp->d_namlen > NAME_MAX) >> vprintf(stdout, >> - "reclen name too big (%d > %d) ", >> + "reclen name too big (%u > %u) ", >> dp->d_namlen, NAME_MAX); >> #endif >> vprintf(stdout, "\n"); >> @@ -418,7 +418,7 @@ flushent(void) >> * Save extended attributes for a directory entry to a file. >> */ >> static void >> -putdirattrs(char *buf, long size) >> +putdirattrs(char *buf, size_t size) >> { >> >> if (mf != NULL && fwrite(buf, size, 1, mf) != 1) >> >> Modified: stable/10/sbin/restore/extern.h >> ============================================================================== >> --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) >> @@ -54,8 +54,8 @@ void freeentry(struct entry *); >> void freename(char *); >> int genliteraldir(char *, ino_t); >> char *gentempname(struct entry *); >> -void getfile(void (*)(char *, long), void (*)(char *, long), >> - void (*)(char *, long)); >> +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), >> + void (*)(char *, size_t)); >> void getvol(long); >> void initsymtable(char *); >> int inodetype(ino_t); >> @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); >> void treescan(char *, ino_t, long (*)(char *, ino_t, int)); >> ino_t upperbnd(ino_t); >> long verifyfile(char *, ino_t, int); >> -void xtrnull(char *, long); >> +void xtrnull(char *, size_t); >> >> /* From ../dump/dumprmt.c */ >> void rmtclose(void); >> >> Modified: stable/10/sbin/restore/tape.c >> ============================================================================== >> --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) >> @@ -104,7 +104,7 @@ static int checksum(int *); >> static void findinode(struct s_spcl *); >> static void findtapeblksize(void); >> static char *setupextattr(int); >> -static void xtrattr(char *, long); >> +static void xtrattr(char *, size_t); >> static void set_extattr_link(char *, void *, int); >> static void set_extattr_fd(int, char *, void *, int); >> static int gethead(struct s_spcl *); >> @@ -114,12 +114,12 @@ static u_long swabl(u_long); >> static u_char *swablong(u_char *, int); >> static u_char *swabshort(u_char *, int); >> static void terminateinput(void); >> -static void xtrfile(char *, long); >> -static void xtrlnkfile(char *, long); >> -static void xtrlnkskip(char *, long); >> -static void xtrmap(char *, long); >> -static void xtrmapskip(char *, long); >> -static void xtrskip(char *, long); >> +static void xtrfile(char *, size_t); >> +static void xtrlnkfile(char *, size_t); >> +static void xtrlnkskip(char *, size_t); >> +static void xtrmap(char *, size_t); >> +static void xtrmapskip(char *, size_t); >> +static void xtrskip(char *, size_t); >> >> /* >> * Set up an input source >> @@ -564,7 +564,7 @@ printdumpinfo(void) >> int >> extractfile(char *name) >> { >> - int flags; >> + u_int flags; >> uid_t uid; >> gid_t gid; >> mode_t mode; >> @@ -931,13 +931,13 @@ skipfile(void) >> * to the skip function. >> */ >> void >> -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), >> - void (*skip)(char *, long)) >> +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), >> + void (*skip)(char *, size_t)) >> { >> int i; >> - off_t size; >> + volatile off_t size; >> int curblk, attrsize; >> - void (*fillit)(char *, long); >> + void (*fillit)(char *, size_t); >> static char clearedbuf[MAXBSIZE]; >> char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; >> char junk[TP_BSIZE]; >> @@ -1066,7 +1066,7 @@ setupextattr(int extsize) >> * Extract the next block of extended attributes. >> */ >> static void >> -xtrattr(char *buf, long size) >> +xtrattr(char *buf, size_t size) >> { >> >> if (extloc + size > extbufsize) >> @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) >> * Write out the next block of a file. >> */ >> static void >> -xtrfile(char *buf, long size) >> +xtrfile(char *buf, size_t size) >> { >> >> if (Nflag) >> @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrskip(char *buf, long size) >> +xtrskip(char *buf, size_t size) >> { >> >> if (lseek(ofile, size, SEEK_CUR) == -1) { >> @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) >> * Collect the next block of a symbolic link. >> */ >> static void >> -xtrlnkfile(char *buf, long size) >> +xtrlnkfile(char *buf, size_t size) >> { >> >> pathlen += size; >> @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrlnkskip(char *buf, long size) >> +xtrlnkskip(char *buf, size_t size) >> { >> >> fprintf(stderr, "unallocated block in symbolic link %s\n", >> @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) >> * Collect the next block of a bit map. >> */ >> static void >> -xtrmap(char *buf, long size) >> +xtrmap(char *buf, size_t size) >> { >> >> memmove(map, buf, size); >> @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrmapskip(char *buf, long size) >> +xtrmapskip(char *buf, size_t size) >> { >> >> panic("hole in map\n"); >> @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) >> */ >> /* ARGSUSED */ >> void >> -xtrnull(char *buf, long size) >> +xtrnull(char *buf, size_t size) >> { >> >> return; >> From owner-svn-src-stable-10@freebsd.org Tue Jun 7 16:53:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EC56B6E999; Tue, 7 Jun 2016 16:53:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58370139E; Tue, 7 Jun 2016 16:53:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57Gr53x057163; Tue, 7 Jun 2016 16:53:05 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57Gr5A4057162; Tue, 7 Jun 2016 16:53:05 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606071653.u57Gr5A4057162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 7 Jun 2016 16:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301556 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:53:06 -0000 Author: truckman Date: Tue Jun 7 16:53:05 2016 New Revision: 301556 URL: https://svnweb.freebsd.org/changeset/base/301556 Log: MFC r299921 Add an assertion to catch a potential underflow in an array index calculation, though this should not happen in the current code. Reported by: Coverity CID: 1008486 Modified: stable/10/sbin/ifconfig/ifieee80211.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/10/sbin/ifconfig/ifieee80211.c Tue Jun 7 16:51:56 2016 (r301555) +++ stable/10/sbin/ifconfig/ifieee80211.c Tue Jun 7 16:53:05 2016 (r301556) @@ -3626,6 +3626,7 @@ list_txpow(int s) /* suppress duplicates as above */ if (isset(reported, c->ic_ieee) && !verbose) { /* XXX we assume duplicates are adjacent */ + assert(achans->ic_nchans > 0); prev = &achans->ic_chans[achans->ic_nchans-1]; /* display highest power on channel */ if (c->ic_maxpower > prev->ic_maxpower) From owner-svn-src-stable-10@freebsd.org Tue Jun 7 16:56:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F3AB6EA9D; Tue, 7 Jun 2016 16:56:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7246F1752; Tue, 7 Jun 2016 16:56:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GuFpT057463; Tue, 7 Jun 2016 16:56:15 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GuFr9057462; Tue, 7 Jun 2016 16:56:15 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606071656.u57GuFr9057462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 7 Jun 2016 16:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301557 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:56:16 -0000 Author: truckman Date: Tue Jun 7 16:56:15 2016 New Revision: 301557 URL: https://svnweb.freebsd.org/changeset/base/301557 Log: MFC r300564 Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes The length of the name returned from the $LOGNAME and $USER can be very long and it was being concatenated to a fixed length buffer with no bounds checking. Fix this problem by limiting the length of the name copied. Additionally, this name is actually used to create a format string to be used in adding log file entries so embedded % characters in the name could confuse *printf(), and embedded whitespace could confuse a log file parser. Handle the former by escaping each % with an additional %, and handle the latter by simply stripping it out. Clean up the code by moving the variable declarations to the top of the function, formatting them to conform with style, and moving intialization elsewhere. Reduce code indentation by returning early in a couple of places. Reported by: Coverity CID: 1006692 Reviewed by: markj (previous version) Differential Revision: https://reviews.freebsd.org/D6490 Modified: stable/10/usr.sbin/pw/pw_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_log.c ============================================================================== --- stable/10/usr.sbin/pw/pw_log.c Tue Jun 7 16:53:05 2016 (r301556) +++ stable/10/usr.sbin/pw/pw_log.c Tue Jun 7 16:56:15 2016 (r301557) @@ -29,40 +29,90 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include +#include #include #include #include #include "pw.h" -static FILE *logfile = NULL; +static FILE *logfile = NULL; void pw_log(struct userconf * cnf, int mode, int which, char const * fmt,...) { - if (cnf->logfile && *cnf->logfile) { - if (logfile == NULL) { /* With umask==0 we need to control file access modes on create */ - int fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600); + va_list argp; + time_t now; + const char *cp, *name; + struct tm *t; + int fd, i, rlen; + char nfmt[256], sname[32]; - if (fd != -1) - logfile = fdopen(fd, "a"); + if (cnf->logfile == NULL || cnf->logfile[0] == '\0') { + return; + } + + if (logfile == NULL) { + /* With umask==0 we need to control file access modes on create */ + fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600); + if (fd == -1) { + return; } - if (logfile != NULL) { - va_list argp; - time_t now = time(NULL); - struct tm *t = localtime(&now); - char nfmt[256]; - const char *name; - - if ((name = getenv("LOGNAME")) == NULL && (name = getenv("USER")) == NULL) - name = "unknown"; - /* ISO 8601 International Standard Date format */ - strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); - sprintf(nfmt + strlen(nfmt), "[%s:%s%s] %s\n", name, Which[which], Modes[mode], fmt); - va_start(argp, fmt); - vfprintf(logfile, nfmt, argp); - va_end(argp); - fflush(logfile); + logfile = fdopen(fd, "a"); + if (logfile == NULL) { + return; } } + + if ((name = getenv("LOGNAME")) == NULL && + (name = getenv("USER")) == NULL) { + strcpy(sname, "unknown"); + } else { + /* + * Since "name" will be embedded in a printf-like format, + * we must sanitize it: + * + * Limit its length so other information in the message + * is not truncated + * + * Squeeze out embedded whitespace for the benefit of + * log file parsers + * + * Escape embedded % characters with another % + */ + for (i = 0, cp = name; + *cp != '\0' && i < (int)sizeof(sname) - 1; cp++) { + if (*cp == '%') { + if (i < (int)sizeof(sname) - 2) { + sname[i++] = '%'; + sname[i++] = '%'; + } else { + break; + } + } else if (!isspace(*cp)) { + sname[i++] = *cp; + } /* else do nothing */ + } + if (i == 0) { + strcpy(sname, "unknown"); + } else { + sname[i] = '\0'; + } + } + now = time(NULL); + t = localtime(&now); + /* ISO 8601 International Standard Date format */ + strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); + rlen = sizeof(nfmt) - strlen(nfmt); + if (rlen <= 0 || snprintf(nfmt + strlen(nfmt), rlen, + "[%s:%s%s] %s\n", sname, Which[which], Modes[mode], + fmt) >= rlen) { + warnx("log format overflow, user name=%s", sname); + } else { + va_start(argp, fmt); + vfprintf(logfile, nfmt, argp); + va_end(argp); + fflush(logfile); + } } From owner-svn-src-stable-10@freebsd.org Wed Jun 8 01:17:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C0C5B6FB65; Wed, 8 Jun 2016 01:17:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6FB11D6; Wed, 8 Jun 2016 01:17:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u581HMtZ057854; Wed, 8 Jun 2016 01:17:22 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u581HMlX057853; Wed, 8 Jun 2016 01:17:22 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606080117.u581HMlX057853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 8 Jun 2016 01:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301571 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 01:17:23 -0000 Author: truckman Date: Wed Jun 8 01:17:22 2016 New Revision: 301571 URL: https://svnweb.freebsd.org/changeset/base/301571 Log: MFC r301139 The (i < PROMPTLEN - 1) test added by r300442 in the code for the default case of \c in the prompt format string is a no-op. We already passed this test at the top of the loop, and i has not yet been incremented in this path. Change this test to (i < PROMPTLEN - 2). Reported by: Coverity CID: 1008328 Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D6552 Modified: stable/10/bin/sh/parser.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/parser.c ============================================================================== --- stable/10/bin/sh/parser.c Wed Jun 8 00:29:48 2016 (r301570) +++ stable/10/bin/sh/parser.c Wed Jun 8 01:17:22 2016 (r301571) @@ -2039,7 +2039,7 @@ getprompt(void *unused __unused) */ default: ps[i] = '\\'; - if (i < PROMPTLEN - 1) + if (i < PROMPTLEN - 2) ps[++i] = *fmt; break; } From owner-svn-src-stable-10@freebsd.org Wed Jun 8 03:08:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE961B6E3E0; Wed, 8 Jun 2016 03:08:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE4481C2B; Wed, 8 Jun 2016 03:08:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5838bP4098577; Wed, 8 Jun 2016 03:08:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5838bcQ098576; Wed, 8 Jun 2016 03:08:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606080308.u5838bcQ098576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 8 Jun 2016 03:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301577 - stable/10/etc/periodic/daily X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 03:08:39 -0000 Author: cy Date: Wed Jun 8 03:08:37 2016 New Revision: 301577 URL: https://svnweb.freebsd.org/changeset/base/301577 Log: MFC r301102: Don't rely on $ntpd_enable to periodically fetch the latest leapfile. Suggested by: cperciva Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 02:39:10 2016 (r301576) +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 2016 (r301577) @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd fetch) & + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & ;; *) - service ntpd fetch + service ntpd onefetch ;; esac ;; From owner-svn-src-stable-10@freebsd.org Wed Jun 8 04:49:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49C19B6F6BE; Wed, 8 Jun 2016 04:49:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE4E618D5; Wed, 8 Jun 2016 04:49:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u584nL1e035413; Wed, 8 Jun 2016 04:49:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u584nLS7035412; Wed, 8 Jun 2016 04:49:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606080449.u584nLS7035412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Jun 2016 04:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301581 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 04:49:22 -0000 Author: kib Date: Wed Jun 8 04:49:20 2016 New Revision: 301581 URL: https://svnweb.freebsd.org/changeset/base/301581 Log: MFC r300691: Fix issues found by Coverity in the rtld-elf.c:gethints(). Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Wed Jun 8 04:37:03 2016 (r301580) +++ stable/10/libexec/rtld-elf/rtld.c Wed Jun 8 04:49:20 2016 (r301581) @@ -1623,14 +1623,16 @@ static const char * gethints(bool nostdlib) { static char *hints, *filtered_path; - struct elfhints_hdr hdr; + static struct elfhints_hdr hdr; struct fill_search_info_args sargs, hargs; struct dl_serinfo smeta, hmeta, *SLPinfo, *hintinfo; struct dl_serpath *SLPpath, *hintpath; char *p; + struct stat hint_stat; unsigned int SLPndx, hintndx, fndx, fcount; int fd; size_t flen; + uint32_t dl; bool skip; /* First call, read the hints file */ @@ -1640,19 +1642,38 @@ gethints(bool nostdlib) if ((fd = open(ld_elf_hints_path, O_RDONLY | O_CLOEXEC)) == -1) return (NULL); + + /* + * Check of hdr.dirlistlen value against type limit + * intends to pacify static analyzers. Further + * paranoia leads to checks that dirlist is fully + * contained in the file range. + */ if (read(fd, &hdr, sizeof hdr) != sizeof hdr || hdr.magic != ELFHINTS_MAGIC || - hdr.version != 1) { + hdr.version != 1 || hdr.dirlistlen > UINT_MAX / 2 || + fstat(fd, &hint_stat) == -1) { +cleanup1: close(fd); + hdr.dirlistlen = 0; return (NULL); } + dl = hdr.strtab; + if (dl + hdr.dirlist < dl) + goto cleanup1; + dl += hdr.dirlist; + if (dl + hdr.dirlistlen < dl) + goto cleanup1; + dl += hdr.dirlistlen; + if (dl > hint_stat.st_size) + goto cleanup1; p = xmalloc(hdr.dirlistlen + 1); + if (lseek(fd, hdr.strtab + hdr.dirlist, SEEK_SET) == -1 || read(fd, p, hdr.dirlistlen + 1) != - (ssize_t)hdr.dirlistlen + 1) { + (ssize_t)hdr.dirlistlen + 1 || p[hdr.dirlistlen] != '\0') { free(p); - close(fd); - return (NULL); + goto cleanup1; } hints = p; close(fd); @@ -1685,7 +1706,7 @@ gethints(bool nostdlib) hargs.serinfo = &hmeta; path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); - path_enumerate(p, fill_search_info, &hargs); + path_enumerate(hints, fill_search_info, &hargs); SLPinfo = xmalloc(smeta.dls_size); hintinfo = xmalloc(hmeta.dls_size); @@ -1704,7 +1725,7 @@ gethints(bool nostdlib) hargs.strspace = (char *)&hintinfo->dls_serpath[hmeta.dls_cnt]; path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); - path_enumerate(p, fill_search_info, &hargs); + path_enumerate(hints, fill_search_info, &hargs); /* * Now calculate the difference between two sets, by excluding From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:21:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5995B6F283; Wed, 8 Jun 2016 13:21:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B78451D7F; Wed, 8 Jun 2016 13:21:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DLHv6032726; Wed, 8 Jun 2016 13:21:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DLHA4032725; Wed, 8 Jun 2016 13:21:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081321.u58DLHA4032725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301608 - stable/10/sys/cddl/boot/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:21:19 -0000 Author: ngie Date: Wed Jun 8 13:21:17 2016 New Revision: 301608 URL: https://svnweb.freebsd.org/changeset/base/301608 Log: MFC r299657: Include arpa/inet.h to get the htonl(3) definition Modified: stable/10/sys/cddl/boot/zfs/lz4.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/boot/zfs/lz4.c ============================================================================== --- stable/10/sys/cddl/boot/zfs/lz4.c Wed Jun 8 13:14:52 2016 (r301607) +++ stable/10/sys/cddl/boot/zfs/lz4.c Wed Jun 8 13:21:17 2016 (r301608) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include + static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:24:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061C7B6F430; Wed, 8 Jun 2016 13:24:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB541125E; Wed, 8 Jun 2016 13:24:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DOhnE036300; Wed, 8 Jun 2016 13:24:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DOhHc036299; Wed, 8 Jun 2016 13:24:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081324.u58DOhHc036299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301610 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:24:44 -0000 Author: ngie Date: Wed Jun 8 13:24:42 2016 New Revision: 301610 URL: https://svnweb.freebsd.org/changeset/base/301610 Log: MFC r299833: Fix fully canonicalized example for `myvariable.27...` `6` doesn't occur in the OID; it was spurious Bump .Dd for the change Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 13:22:25 2016 (r301609) +++ stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 13:24:42 2016 (r301610) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd September 9, 2010 +.Dd May 10, 2016 .Dt BSNMPD 1 .Os .Sh NAME @@ -227,7 +227,7 @@ myvariable.27.foooll.[localhost]."&^!" .Pp results in the oid .Bd -unfilled -offset indent -myvariable.27.6.102.111.111.111.108.108.127.0.0.1.38.94.33 +myvariable.27.102.111.111.111.108.108.127.0.0.1.38.94.33 .Ed .Pp The value of the assignment may be either empty, a string or a number. From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:32:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E63B6F838; Wed, 8 Jun 2016 13:32:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4A31AC5; Wed, 8 Jun 2016 13:32:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DW1nR039937; Wed, 8 Jun 2016 13:32:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DW0C3039930; Wed, 8 Jun 2016 13:32:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081332.u58DW0C3039930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301612 - in stable/10: etc/rc.d tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:32:03 -0000 Author: ngie Date: Wed Jun 8 13:32:00 2016 New Revision: 301612 URL: https://svnweb.freebsd.org/changeset/base/301612 Log: MFC r299839,r299840,r299841: r299839: Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol Make zfs and zvol come before all of the items that depended on them previously r299840: Conditionalize etc/rc.d/{zfs,zvol} install on MK_ZFS != no r299841: Remove etc/rc.d/{zfs,zvol} if MK_ZFS != no Modified: stable/10/etc/rc.d/FILESYSTEMS stable/10/etc/rc.d/Makefile stable/10/etc/rc.d/dumpon stable/10/etc/rc.d/var stable/10/etc/rc.d/zfs stable/10/etc/rc.d/zvol stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/FILESYSTEMS ============================================================================== --- stable/10/etc/rc.d/FILESYSTEMS Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/FILESYSTEMS Wed Jun 8 13:32:00 2016 (r301612) @@ -4,7 +4,7 @@ # # PROVIDE: FILESYSTEMS -# REQUIRE: root mountcritlocal cleanvar zfs +# REQUIRE: root mountcritlocal cleanvar # This is a dummy dependency, for services which require file systems # to be mounted before starting. It also serves as the default early / Modified: stable/10/etc/rc.d/Makefile ============================================================================== --- stable/10/etc/rc.d/Makefile Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/Makefile Wed Jun 8 13:32:00 2016 (r301612) @@ -134,8 +134,6 @@ FILES= DAEMON \ ypset \ ypupdated \ ypxfrd \ - zfs \ - zvol .if ${MK_ACCT} != "no" FILES+= accounting @@ -283,6 +281,11 @@ FILES+= hostapd FILES+= wpa_supplicant .endif +.if ${MK_ZFS} != "no" +FILES+= zfs +FILES+= zvol +.endif + FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} Modified: stable/10/etc/rc.d/dumpon ============================================================================== --- stable/10/etc/rc.d/dumpon Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/dumpon Wed Jun 8 13:32:00 2016 (r301612) @@ -4,7 +4,6 @@ # # PROVIDE: dumpon -# REQUIRE: zvol # BEFORE: disks # KEYWORD: nojail Modified: stable/10/etc/rc.d/var ============================================================================== --- stable/10/etc/rc.d/var Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/var Wed Jun 8 13:32:00 2016 (r301612) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: mountcritlocal zfs +# REQUIRE: mountcritlocal # NFS /var is not supported, unless NFS /var is part of diskless NFS / Modified: stable/10/etc/rc.d/zfs ============================================================================== --- stable/10/etc/rc.d/zfs Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/zfs Wed Jun 8 13:32:00 2016 (r301612) @@ -5,6 +5,7 @@ # PROVIDE: zfs # REQUIRE: mountcritlocal +# BEFORE: FILESYSTEMS var . /etc/rc.subr Modified: stable/10/etc/rc.d/zvol ============================================================================== --- stable/10/etc/rc.d/zvol Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/zvol Wed Jun 8 13:32:00 2016 (r301612) @@ -5,6 +5,7 @@ # PROVIDE: zvol # REQUIRE: hostid +# BEFORE: dumpon # KEYWORD: nojail . /etc/rc.subr Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 13:32:00 2016 (r301612) @@ -650,6 +650,8 @@ OLD_DIRS+=usr/share/dtrace OLD_FILES+=boot/gptzfsboot OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader +OLD_FILES+=etc/rc.d/zfs +OLD_FILES+=etc/rc.d/zvol OLD_FILES+=etc/devd/zfs.conf OLD_FILES+=etc/periodic/daily/404.status-zfs OLD_FILES+=etc/periodic/daily/800.scrub-zfs From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:34:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9A5B6F947; Wed, 8 Jun 2016 13:34:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24B901DD1; Wed, 8 Jun 2016 13:34:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DYr5a040105; Wed, 8 Jun 2016 13:34:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DYr2q040103; Wed, 8 Jun 2016 13:34:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081334.u58DYr2q040103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301613 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:34:54 -0000 Author: ngie Date: Wed Jun 8 13:34:52 2016 New Revision: 301613 URL: https://svnweb.freebsd.org/changeset/base/301613 Log: MFC r299843: Fix broken dependency with routed when MK_ROUTED != no Remove routed as a requirement in NETWORKING, and put it in routed as a BEFORE requirement instead Modified: stable/10/etc/rc.d/NETWORKING stable/10/etc/rc.d/routed Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/NETWORKING ============================================================================== --- stable/10/etc/rc.d/NETWORKING Wed Jun 8 13:32:00 2016 (r301612) +++ stable/10/etc/rc.d/NETWORKING Wed Jun 8 13:34:52 2016 (r301613) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netwait netoptions routing ppp ipfw stf faith -# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge +# REQUIRE: defaultroute mrouted route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking Modified: stable/10/etc/rc.d/routed ============================================================================== --- stable/10/etc/rc.d/routed Wed Jun 8 13:32:00 2016 (r301612) +++ stable/10/etc/rc.d/routed Wed Jun 8 13:34:52 2016 (r301613) @@ -5,6 +5,7 @@ # PROVIDE: routed # REQUIRE: netif routing +# BEFORE: NETWORK # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:40:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB61B6FB02; Wed, 8 Jun 2016 13:40:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCF71362; Wed, 8 Jun 2016 13:40:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58De7PR040576; Wed, 8 Jun 2016 13:40:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58De74b040574; Wed, 8 Jun 2016 13:40:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081340.u58De74b040574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301615 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:40:08 -0000 Author: ngie Date: Wed Jun 8 13:40:07 2016 New Revision: 301615 URL: https://svnweb.freebsd.org/changeset/base/301615 Log: MFC r299844,r300931: r299844: Make hostid_save depend on hostid r300931: Make netif REQUIRE hostid As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before hostid, and the MAC address generated for any bridge devices will be non-deterministic. Make the MAC address generated be deterministic for bridge devices by explicitly REQUIRE'ing hostid. This fixes up the rest of the PR, inadvertently committed in r299844 PR: 195188 Modified: stable/10/etc/rc.d/hostid_save stable/10/etc/rc.d/netif Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/hostid_save ============================================================================== --- stable/10/etc/rc.d/hostid_save Wed Jun 8 13:37:18 2016 (r301614) +++ stable/10/etc/rc.d/hostid_save Wed Jun 8 13:40:07 2016 (r301615) @@ -4,7 +4,7 @@ # # PROVIDE: hostid_save -# REQUIRE: root +# REQUIRE: hostid root # KEYWORD: nojail . /etc/rc.subr Modified: stable/10/etc/rc.d/netif ============================================================================== --- stable/10/etc/rc.d/netif Wed Jun 8 13:37:18 2016 (r301614) +++ stable/10/etc/rc.d/netif Wed Jun 8 13:40:07 2016 (r301615) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: atm1 FILESYSTEMS serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: hostid ipfilter ipfs # KEYWORD: nojailvnet . /etc/rc.subr From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:44:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 698BBB6FD5A; Wed, 8 Jun 2016 13:44:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABDB1B3E; Wed, 8 Jun 2016 13:44:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Di1JX044050; Wed, 8 Jun 2016 13:44:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Di1DK044049; Wed, 8 Jun 2016 13:44:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081344.u58Di1DK044049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301617 - stable/10/usr.bin/kdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:44:02 -0000 Author: ngie Date: Wed Jun 8 13:44:01 2016 New Revision: 301617 URL: https://svnweb.freebsd.org/changeset/base/301617 Log: MFC r300428: Fix humanized decoding of struct stat with respect to .st_mtim st_mtim was being incorrectly described as "stime=", not "mtime=". This was introduced with the original feature commit (r176471). PR: 209699 Modified: stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Wed Jun 8 13:41:51 2016 (r301616) +++ stable/10/usr.bin/kdump/kdump.c Wed Jun 8 13:44:01 2016 (r301617) @@ -1750,7 +1750,7 @@ ktrstat(struct stat *statp) printf(".%09ld, ", statp->st_atim.tv_nsec); else printf(", "); - printf("stime="); + printf("mtime="); if (resolv == 0) printf("%jd", (intmax_t)statp->st_mtim.tv_sec); else { From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:50:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65C41B6E01D; Wed, 8 Jun 2016 13:50:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36BC71038; Wed, 8 Jun 2016 13:50:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Dnx7s044448; Wed, 8 Jun 2016 13:49:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Dnx8s044447; Wed, 8 Jun 2016 13:49:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081349.u58Dnx8s044447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301619 - stable/10/usr.sbin/rpc.yppasswdd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:50:00 -0000 Author: ngie Date: Wed Jun 8 13:49:59 2016 New Revision: 301619 URL: https://svnweb.freebsd.org/changeset/base/301619 Log: MFC r300430: Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line As a positive side-effect, this eliminates the double semicolons reported by Coverity: the macro contained a trailing semicolon, in addition to the semicolon placed on each line where EXPAND(..) was called. CID: 1194269 Modified: stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 8 13:45:02 2016 (r301618) +++ stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 8 13:49:59 2016 (r301619) @@ -103,7 +103,10 @@ copy_yp_pass(char *p, int x, int m) } t = buf; -#define EXPAND(e) e = t; while ((*t++ = *p++)); +#define EXPAND(e) do { \ + e = t; \ + while ((*t++ = *p++)); \ +} while (0) EXPAND(yp_password.pw_name); yp_password.pw_fields |= _PWF_NAME; EXPAND(yp_password.pw_passwd); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 13:58:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D28EB6E5DD; Wed, 8 Jun 2016 13:58:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A5C81DB1; Wed, 8 Jun 2016 13:58:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Dwl2p048160; Wed, 8 Jun 2016 13:58:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Dwlt1048159; Wed, 8 Jun 2016 13:58:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081358.u58Dwlt1048159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301622 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:58:48 -0000 Author: ngie Date: Wed Jun 8 13:58:47 2016 New Revision: 301622 URL: https://svnweb.freebsd.org/changeset/base/301622 Log: MFC r300620,r300621: r300620: Use reallocf instead of malloc to fix leak with outbuf_pmap The previous code overwrote outbuf_pmap's memory with malloc once per loop iteration, which leaked its memory; use reallocf instead to ensure that memory is properly free'd each loop iteration. Add a outbuf_pmap = NULL in the failure case to avoid a double-free at the bottom of the function. CID: 1038776 r300621: Remove redundant NULLing of outbuf_pmap If reallocf ever failed, outbuf_pmap would already be NULL Modified: stable/10/lib/libc/rpc/clnt_bcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/clnt_bcast.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_bcast.c Wed Jun 8 13:57:18 2016 (r301621) +++ stable/10/lib/libc/rpc/clnt_bcast.c Wed Jun 8 13:58:47 2016 (r301622) @@ -341,7 +341,8 @@ rpc_broadcast_exp(prog, vers, proc, xarg #ifdef PORTMAP if (si.si_af == AF_INET && si.si_proto == IPPROTO_UDP) { udpbufsz = fdlist[fdlistno].dsize; - if ((outbuf_pmap = malloc(udpbufsz)) == NULL) { + outbuf_pmap = reallocf(outbuf_pmap, udpbufsz); + if (outbuf_pmap == NULL) { _close(fd); stat = RPC_SYSTEMERROR; goto done_broad; From owner-svn-src-stable-10@freebsd.org Wed Jun 8 14:01:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CB66B6E7E2; Wed, 8 Jun 2016 14:01:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8DA710F6; Wed, 8 Jun 2016 14:01:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E1hHc048953; Wed, 8 Jun 2016 14:01:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E1h0d048952; Wed, 8 Jun 2016 14:01:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081401.u58E1h0d048952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301623 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:01:44 -0000 Author: ngie Date: Wed Jun 8 14:01:42 2016 New Revision: 301623 URL: https://svnweb.freebsd.org/changeset/base/301623 Log: MFC r300936: Remove the calendar tests if MK_CALENDAR == no when "make delete-old" is run Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 13:58:47 2016 (r301622) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:01:42 2016 (r301623) @@ -548,6 +548,39 @@ OLD_FILES+=usr/share/calendar/uk_UA.KOI8 OLD_DIRS+=usr/share/calendar/uk_UA.KOI8-U OLD_DIRS+=usr/share/calendar OLD_FILES+=usr/share/man/man1/calendar.1.gz +OLD_FILES+=usr/tests/usr.bin/calendar/Kyuafile +OLD_FILES+=usr/tests/usr.bin/calendar/calendar.calibrate +OLD_FILES+=usr/tests/usr.bin/calendar/legacy_test +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.sh +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-7.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-7.out +OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CCD} == no From owner-svn-src-stable-10@freebsd.org Wed Jun 8 14:05:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB9EDB6E9F3; Wed, 8 Jun 2016 14:05:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB95F1723; Wed, 8 Jun 2016 14:05:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E58fv052027; Wed, 8 Jun 2016 14:05:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E58U7052026; Wed, 8 Jun 2016 14:05:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081405.u58E58U7052026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301625 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:05:10 -0000 Author: ngie Date: Wed Jun 8 14:05:08 2016 New Revision: 301625 URL: https://svnweb.freebsd.org/changeset/base/301625 Log: MFC r300937: Remove the etcupdate tests if MK_RCS == no when "make delete-old" is run etcupdate is conditionally installed based on MK_RCS != no today Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:02:21 2016 (r301624) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:05:08 2016 (r301625) @@ -4166,6 +4166,15 @@ OLD_FILES+=usr/share/man/man1/rcsmerge.1 OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz OLD_FILES+=usr/share/man/man8/etcupdate.8.gz +OLD_FILES+=usr/tests/usr.sbin/etcupdate/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/etcupdate/always_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/conflicts_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/fbsdid_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/ignore_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/preworld_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tests_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tzsetup_test +OLD_DIRS+=usr/tests/usr.sbin/etcupdate .endif #.if ${MK_RESCUE} == no From owner-svn-src-stable-10@freebsd.org Wed Jun 8 14:06:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50B31B6EACC; Wed, 8 Jun 2016 14:06:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06F63196A; Wed, 8 Jun 2016 14:06:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E6Yn8052132; Wed, 8 Jun 2016 14:06:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E6YUT052131; Wed, 8 Jun 2016 14:06:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081406.u58E6YUT052131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301626 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:06:35 -0000 Author: ngie Date: Wed Jun 8 14:06:34 2016 New Revision: 301626 URL: https://svnweb.freebsd.org/changeset/base/301626 Log: MFC r300938: Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run sa(8) is conditionally installed based on MK_ACCT != no today Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:05:08 2016 (r301625) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:06:34 2016 (r301626) @@ -12,6 +12,33 @@ OLD_FILES+=usr/sbin/accton OLD_FILES+=usr/sbin/sa OLD_FILES+=usr/share/man/man8/accton.8.gz OLD_FILES+=usr/share/man/man8/sa.8.gz +OLD_FILES+=usr/tests/usr.sbin/sa/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/sa/legacy_test +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa .endif .if ${MK_ACPI} == no From owner-svn-src-stable-10@freebsd.org Wed Jun 8 14:07:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2428B6EBA2; Wed, 8 Jun 2016 14:07:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7266B1B46; Wed, 8 Jun 2016 14:07:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E7hGP052232; Wed, 8 Jun 2016 14:07:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E7hYU052231; Wed, 8 Jun 2016 14:07:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081407.u58E7hYU052231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301627 - stable/10/bin/ls/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:07:44 -0000 Author: ngie Date: Wed Jun 8 14:07:43 2016 New Revision: 301627 URL: https://svnweb.freebsd.org/changeset/base/301627 Log: MFC r300939: Use require.progs with bc instead of require.files with /usr/bin/bc This will make things more flexible if the program path changes in the future, and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc Modified: stable/10/bin/ls/tests/ls_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ls/tests/ls_tests.sh ============================================================================== --- stable/10/bin/ls/tests/ls_tests.sh Wed Jun 8 14:06:34 2016 (r301626) +++ stable/10/bin/ls/tests/ls_tests.sh Wed Jun 8 14:07:43 2016 (r301627) @@ -535,7 +535,7 @@ atf_test_case h_flag h_flag_head() { atf_set "descr" "Verify that -h prints out the humanized units for file sizes with ls -l" - atf_set "require.files" "/usr/bin/bc" + atf_set "require.progs" "bc" } h_flag_body() From owner-svn-src-stable-10@freebsd.org Wed Jun 8 14:18:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4B0B6EFEF; Wed, 8 Jun 2016 14:18:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 870C0172A; Wed, 8 Jun 2016 14:18:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58EIlpV056004; Wed, 8 Jun 2016 14:18:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58EIlKM056000; Wed, 8 Jun 2016 14:18:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081418.u58EIlKM056000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301629 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:18:48 -0000 Author: ngie Date: Wed Jun 8 14:18:47 2016 New Revision: 301629 URL: https://svnweb.freebsd.org/changeset/base/301629 Log: MFC r300387,r300388,r300389: r300387: getnetid(..): consistently fclose fd at the end of the function This mutes a false positive with cppcheck, but also helps eliminate future potential issues with this variable r300388: Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf was NULL This would theoretically happen if the netconfig protocol family and protocol semantics were never matched. CID: 978179 r300389: nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..) If the buffer couldn't be adequately resized to accomodate an additional "\n", it would leak resultbuf by breaking from the loop early CID: 1016702 Modified: stable/10/lib/libc/rpc/getrpcent.c stable/10/lib/libc/rpc/netnamer.c stable/10/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getrpcent.c ============================================================================== --- stable/10/lib/libc/rpc/getrpcent.c Wed Jun 8 14:15:29 2016 (r301628) +++ stable/10/lib/libc/rpc/getrpcent.c Wed Jun 8 14:18:47 2016 (r301629) @@ -512,6 +512,7 @@ nis_rpcent(void *retval, void *mdata, va sizeof(char *)) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } @@ -521,6 +522,7 @@ nis_rpcent(void *retval, void *mdata, va if (aliases_size < 1) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } Modified: stable/10/lib/libc/rpc/netnamer.c ============================================================================== --- stable/10/lib/libc/rpc/netnamer.c Wed Jun 8 14:15:29 2016 (r301628) +++ stable/10/lib/libc/rpc/netnamer.c Wed Jun 8 14:18:47 2016 (r301629) @@ -253,6 +253,9 @@ getnetid(key, ret) char *lookup; int len; #endif + int rv; + + rv = 0; fd = fopen(NETIDFILE, "r"); if (fd == NULL) { @@ -263,13 +266,11 @@ getnetid(key, ret) return (0); #endif } - for (;;) { - if (fd == NULL) - return (0); /* getnetidyp brings us here */ + while (fd != NULL) { res = fgets(buf, sizeof(buf), fd); if (res == NULL) { - fclose(fd); - return (0); + rv = 0; + goto done; } if (res[0] == '#') continue; @@ -292,9 +293,8 @@ getnetid(key, ret) lookup[len] = 0; strcpy(ret, lookup); free(lookup); - if (fd != NULL) - fclose(fd); - return (2); + rv = 2; + goto done; #else /* YP */ #ifdef DEBUG fprintf(stderr, @@ -320,10 +320,14 @@ getnetid(key, ret) } if (strcmp(mkey, key) == 0) { strcpy(ret, mval); - fclose(fd); - return (1); - + rv = 1; + goto done; } } } + +done: + if (fd != NULL) + fclose(fd); + return (rv); } Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Wed Jun 8 14:15:29 2016 (r301628) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Wed Jun 8 14:18:47 2016 (r301629) @@ -508,6 +508,7 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } + endnetconfig(nc_handle); if (tmpnconf == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); @@ -515,7 +516,6 @@ try_nconf: } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ - endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 15:41:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 882E3B6FC70; Wed, 8 Jun 2016 15:41:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B68D107D; Wed, 8 Jun 2016 15:41:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58FfdVb088402; Wed, 8 Jun 2016 15:41:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ffd3p088401; Wed, 8 Jun 2016 15:41:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081541.u58Ffd3p088401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 15:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301636 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 15:41:40 -0000 Author: ngie Date: Wed Jun 8 15:41:39 2016 New Revision: 301636 URL: https://svnweb.freebsd.org/changeset/base/301636 Log: MFC r300867,r300932,r300934,r300941,r300972,r300973: r300867: Only expose `hint_uaddr` in the ND_DEBUG case This fixes a -Wunused-but-set-variable warning with gcc r300932: Catch malloc(3) errors and socket(2) errors - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. CID: 976288, 976321, 976858 r300934: Plug leak with ifp by calling freeifaddrs after calling getifaddrs Obtained from: NetBSD v1.18 r300941: Don't leak res in network_init(..) Call freeaddrinfo on it after it's been used CID: 1225050 r300972 (by markj): Fix rpcbind init after r300941. - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 r300973: Follow up to r300932 In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately Modified: stable/10/usr.sbin/rpcbind/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/util.c ============================================================================== --- stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 15:38:19 2016 (r301635) +++ stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 15:41:39 2016 (r301636) @@ -119,7 +119,9 @@ addrmerge(struct netbuf *caller, const c struct sockaddr_storage ss; struct netconfig *nconf; char *caller_uaddr = NULL; +#ifdef ND_DEBUG const char *hint_uaddr = NULL; +#endif char *ret = NULL; int bestif_goodness; @@ -140,13 +142,17 @@ addrmerge(struct netbuf *caller, const c */ hint_sa = NULL; if (clnt_uaddr != NULL) { +#ifdef ND_DEBUG hint_uaddr = clnt_uaddr; +#endif if ((hint_nbp = uaddr2taddr(nconf, clnt_uaddr)) == NULL) goto freeit; hint_sa = hint_nbp->buf; } if (hint_sa == NULL || hint_sa->sa_family != caller_sa->sa_family) { +#ifdef ND_DEBUG hint_uaddr = caller_uaddr; +#endif hint_sa = caller->buf; } @@ -330,8 +336,10 @@ network_init(void) if (local_in4 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip4 addr\n"); + exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); + freeaddrinfo(res); } #ifdef INET6 @@ -345,8 +353,10 @@ network_init(void) if (local_in6 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip6 addr\n"); + exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); + freeaddrinfo(res); } /* @@ -359,6 +369,11 @@ network_init(void) inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (s == -1) { + if (debugging) + fprintf(stderr, "couldn't create ip6 socket"); + goto done_inet6; + } /* * Loop through all interfaces. For each IPv6 multicast-capable @@ -380,6 +395,8 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } +done_inet6: + freeifaddrs(ifp); #endif /* close(s); */ From owner-svn-src-stable-10@freebsd.org Wed Jun 8 16:02:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B66DB6F26A for ; Wed, 8 Jun 2016 16:02:23 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F901D8E for ; Wed, 8 Jun 2016 16:02:22 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f49.google.com with SMTP id u74so8905827lff.2 for ; Wed, 08 Jun 2016 09:02:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=QUqpsSH2y0pkpAucdMObt6+VMue0cZy4tsg4xmz8ZLk=; b=Dhczfimvegq61Y8OqbuHWM6lS/TtBwm+ePS7F/Zwv2tH9s2nOvJVIs8lSIKTQRVRqB TNH63EEQPM8ogtHWTGTQhOKCX2iRfCaGohFsGHfScPnTr/upqXXnE/BGDj+DpAQFh3bi lv9CrD2nxzJ+15H9zxgCo0lS9jf/V7LhnxTB7ph2UMyxqxtgE/xP9jvoWv4nTbnUKE8e pTgO9Z1RheD2P44c0E6P3xGqqAwa8Eoh9OYjXSQOFG8jO24MTuYPcjnJDqIGsdvnwLc9 kXt8tI9Vbf+JFeigmd9BMmr2AQWvAaYB//XUl/MwWl4yQcrk8b425dVm6Hh/WhF42Uum s5dg== X-Gm-Message-State: ALyK8tIcwVT7D2U/ZBQnQDAf0DN5vxHWxu9Lj8A5HauDikiAeeyQ6u6yoLmyzbgn50l16w== X-Received: by 10.25.43.135 with SMTP id r129mr4248830lfr.63.1465401735113; Wed, 08 Jun 2016 09:02:15 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id e16sm207889lfb.23.2016.06.08.09.02.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2016 09:02:14 -0700 (PDT) Subject: Re: svn commit: r301577 - stable/10/etc/periodic/daily To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201606080308.u5838bcQ098576@repo.freebsd.org> From: Andrey Chernov Message-ID: Date: Wed, 8 Jun 2016 19:02:12 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606080308.u5838bcQ098576@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:02:23 -0000 The code still is called only if $daily_ntpd_leapfile_enable is YES and it is NO by default. On 08.06.2016 6:08, Cy Schubert wrote: > Author: cy > Date: Wed Jun 8 03:08:37 2016 > New Revision: 301577 > URL: https://svnweb.freebsd.org/changeset/base/301577 > > Log: > MFC r301102: > > Don't rely on $ntpd_enable to periodically fetch the latest leapfile. > > Suggested by: cperciva > > Modified: > stable/10/etc/periodic/daily/480.leapfile-ntpd > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd > ============================================================================== > --- stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 02:39:10 2016 (r301576) > +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 2016 (r301577) > @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in > case "$daily_ntpd_avoid_congestion" in > [Yy][Ee][Ss]) > # Avoid dogpiling > - (sleep $(jot -r 1 0 86400); service ntpd fetch) & > + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & > ;; > *) > - service ntpd fetch > + service ntpd onefetch > ;; > esac > ;; > From owner-svn-src-stable-10@freebsd.org Wed Jun 8 16:56:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F568B6F229; Wed, 8 Jun 2016 16:56:07 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 213F51358; Wed, 8 Jun 2016 16:56:06 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id AglubHm7q7qnxAglvbqD25; Wed, 08 Jun 2016 10:56:05 -0600 X-Authority-Analysis: v=2.2 cv=SeW1TbZu c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=Kmfb5eCDVM_NwREuCT0A:9 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3319713751; Wed, 8 Jun 2016 09:56:02 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u58Gu19q088458; Wed, 8 Jun 2016 09:56:01 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606081656.u58Gu19q088458@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andrey Chernov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r301577 - stable/10/etc/periodic/daily In-Reply-To: Message from Andrey Chernov of "Wed, 08 Jun 2016 19:02:12 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Jun 2016 09:56:01 -0700 X-CMAE-Envelope: MS4wfKPLBKtkHrDNJE2mBiFVpdww08fpeUf7wXknfCS4fuVfug5AxeclKrPTUzwmaEl8+KrfbvL6VYg1FtOzJ0nk17xRNOoB59NZKrjo42XACGZuwtgRrc5y pt4PLgvHx9DDdMYZ5SQbq/oZMtcIzy6QoVjoe9Jcz3XOpYgDvp3cyOGv/BQUr8a4P9RH1Cv9haHpLwnBWlAVGhj46GKWyBuzn3V35txuk62nHx/yvIy8wjid ox9h3iOTjrVTxz141x2LpF3AEdlWcQtPqznK5+4cR3AaKdx4FZIyQJrxLIDhu2lIBlr8FrfcpBO5HHjYhQF0WmamHh+AJWFTmJ34G9xVdVn2fwG2c7Zvp1gK i54FRIgl X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:56:07 -0000 In message , Andrey Chernov w rites: > The code still is called only if $daily_ntpd_leapfile_enable is YES and > it is NO by default. Yes, that will be MFCd on Friday, June 10. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > > On 08.06.2016 6:08, Cy Schubert wrote: > > Author: cy > > Date: Wed Jun 8 03:08:37 2016 > > New Revision: 301577 > > URL: https://svnweb.freebsd.org/changeset/base/301577 > > > > Log: > > MFC r301102: > > > > Don't rely on $ntpd_enable to periodically fetch the latest leapfile. > > > > Suggested by: cperciva > > > > Modified: > > stable/10/etc/periodic/daily/480.leapfile-ntpd > > Directory Properties: > > stable/10/ (props changed) > > > > Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd > > =========================================================================== > === > > --- stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 02:39:10 201 > 6 (r301576) > > +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 201 > 6 (r301577) > > @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in > > case "$daily_ntpd_avoid_congestion" in > > [Yy][Ee][Ss]) > > # Avoid dogpiling > > - (sleep $(jot -r 1 0 86400); service ntpd fetch) & > > + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & > > ;; > > *) > > - service ntpd fetch > > + service ntpd onefetch > > ;; > > esac > > ;; > > > From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:09:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDFA0B6F859; Wed, 8 Jun 2016 17:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 943091F45; Wed, 8 Jun 2016 17:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58H9lBu019725; Wed, 8 Jun 2016 17:09:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58H9lox019724; Wed, 8 Jun 2016 17:09:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081709.u58H9lox019724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301644 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:09:48 -0000 Author: ngie Date: Wed Jun 8 17:09:47 2016 New Revision: 301644 URL: https://svnweb.freebsd.org/changeset/base/301644 Log: MFC r300942: Remove a useless if (x != NULL) check before calling free on allocated_uaddr Modified: stable/10/usr.sbin/rpcbind/check_bound.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/check_bound.c ============================================================================== --- stable/10/usr.sbin/rpcbind/check_bound.c Wed Jun 8 17:04:15 2016 (r301643) +++ stable/10/usr.sbin/rpcbind/check_bound.c Wed Jun 8 17:09:47 2016 (r301644) @@ -220,8 +220,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch fprintf(stderr, "mergeaddr: uaddr = %s, merged uaddr = %s\n", uaddr, m_uaddr); #endif - if (allocated_uaddr != NULL) - free(allocated_uaddr); + free(allocated_uaddr); return (m_uaddr); } From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:11:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889EBB6FA58; Wed, 8 Jun 2016 17:11:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58F0B1452; Wed, 8 Jun 2016 17:11:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HBgwK022677; Wed, 8 Jun 2016 17:11:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HBg1J022676; Wed, 8 Jun 2016 17:11:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081711.u58HBg1J022676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301646 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:11:43 -0000 Author: ngie Date: Wed Jun 8 17:11:42 2016 New Revision: 301646 URL: https://svnweb.freebsd.org/changeset/base/301646 Log: MFC r300945: Remove unnecessary caller_uaddr != NULL test before calling free on it Modified: stable/10/usr.sbin/rpcbind/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/util.c ============================================================================== --- stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 17:10:43 2016 (r301645) +++ stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 17:11:42 2016 (r301646) @@ -293,8 +293,7 @@ found: ret = taddr2uaddr(nconf, &tbuf); freeit: - if (caller_uaddr != NULL) - free(caller_uaddr); + free(caller_uaddr); if (hint_nbp != NULL) { free(hint_nbp->buf); free(hint_nbp); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:13:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C650BB6FB82; Wed, 8 Jun 2016 17:13:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9869C1B25; Wed, 8 Jun 2016 17:13:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HDSQp023625; Wed, 8 Jun 2016 17:13:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HDSbt023624; Wed, 8 Jun 2016 17:13:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081713.u58HDSbt023624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301648 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:13:29 -0000 Author: ngie Date: Wed Jun 8 17:13:28 2016 New Revision: 301648 URL: https://svnweb.freebsd.org/changeset/base/301648 Log: MFC r300947: Staticize variables only used in rpcbind.c This is some low hanging fruit necessary for making this WARNS?= 6 clean Modified: stable/10/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcbind.c Wed Jun 8 17:12:37 2016 (r301647) +++ stable/10/usr.sbin/rpcbind/rpcbind.c Wed Jun 8 17:13:28 2016 (r301648) @@ -86,17 +86,17 @@ rpcblist_ptr list_rbl; /* A list of vers #define RPCBINDDLOCK "/var/run/rpcbind.lock" -int runasdaemon = 0; +static int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; int verboselog = 0; -char **hosts = NULL; -struct sockaddr **bound_sa; -int ipv6_only = 0; -int nhosts = 0; -int on = 1; -int rpcbindlockfd; +static char **hosts = NULL; +static struct sockaddr **bound_sa; +static int ipv6_only = 0; +static int nhosts = 0; +static int on = 1; +static int rpcbindlockfd; #ifdef WARMSTART /* Local Variable */ From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:27:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE43CB6F18E; Wed, 8 Jun 2016 17:27:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 764611FE1; Wed, 8 Jun 2016 17:27:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HRcHD029121; Wed, 8 Jun 2016 17:27:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HRci1029119; Wed, 8 Jun 2016 17:27:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081727.u58HRci1029119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301653 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:27:39 -0000 Author: ngie Date: Wed Jun 8 17:27:38 2016 New Revision: 301653 URL: https://svnweb.freebsd.org/changeset/base/301653 Log: MFC r299810: Correct function names that failed in error messages It should be calloc/strdup, not malloc Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:24:57 2016 (r301652) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:27:38 2016 (r301653) @@ -269,12 +269,12 @@ enum_pair_insert(struct enum_pairs *head struct enum_pair *e_new; if ((e_new = calloc(1, sizeof(struct enum_pair))) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "calloc() failed: %s", strerror(errno)); return (-1); } if ((e_new->enum_str = strdup(enum_str)) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "strdup() failed: %s", strerror(errno)); free(e_new); return (-1); } Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:24:57 2016 (r301652) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:27:38 2016 (r301653) @@ -252,12 +252,12 @@ add_filename(struct snmp_toolinfo *snmpt } if ((fstring = strdup(filename)) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("strdup() failed - %s", strerror(errno)); return (-1); } if ((entry = calloc(1, sizeof(struct fname))) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("calloc() failed - %s", strerror(errno)); free(fstring); return (-1); } From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:30:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A29B6F2F9; Wed, 8 Jun 2016 17:30:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63BDF1440; Wed, 8 Jun 2016 17:30:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HUTQB029364; Wed, 8 Jun 2016 17:30:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HUTXc029363; Wed, 8 Jun 2016 17:30:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081730.u58HUTXc029363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301655 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:30:30 -0000 Author: ngie Date: Wed Jun 8 17:30:29 2016 New Revision: 301655 URL: https://svnweb.freebsd.org/changeset/base/301655 Log: MFC r299766: Fix logically dead code pointed out by clang/Coverity parse_context, parse_user_security: test for validity of results from parse_ascii(..) with by casting to int32_t and comparing to -1; comparing unsigned types to negative values will always be false. CID: 1011432, 1011433 Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:29:07 2016 (r301654) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:30:29 2016 (r301655) @@ -615,8 +615,8 @@ parse_context(struct snmp_toolinfo *snmp warnx("Suboption 'context-engine' - no argument"); return (-1); } - if ((snmp_client.clen = parse_ascii(val, - snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) < 0) { + if ((int32_t)(snmp_client.clen = parse_ascii(val, + snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) == -1) { warnx("Bad EngineID - %s", val); return (-1); } @@ -654,7 +654,7 @@ parse_user_security(struct snmp_toolinfo } snmp_client.engine.engine_len = parse_ascii(val, snmp_client.engine.engine_id, SNMP_ENGINE_ID_SIZ); - if (snmp_client.engine.engine_len < 0) { + if ((int32_t)snmp_client.engine.engine_len == -1) { warnx("Bad EngineID - %s", val); return (-1); } From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:32:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2BF3B6F482; Wed, 8 Jun 2016 17:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83AE519A5; Wed, 8 Jun 2016 17:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HWfUB032855; Wed, 8 Jun 2016 17:32:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HWfLi032854; Wed, 8 Jun 2016 17:32:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081732.u58HWfLi032854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301656 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:32:42 -0000 Author: ngie Date: Wed Jun 8 17:32:41 2016 New Revision: 301656 URL: https://svnweb.freebsd.org/changeset/base/301656 Log: MFC r299778: Use a consistent errno save/restore pattern before running strtoul - Save errno - Set errno to 0 - Call strtoul - Test errno (optional, but many calls to strtoul did this afterwards) Some of the code was setting errno = 0 after calling strtoul, not setting errno = 0, or setting errno to saved_errno after the call, but before the test. These all have unwanted behavioral side-effects, depending on the initial value of errno and whether or not the input to strtoul was correct or incorrect. Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed Jun 8 17:30:29 2016 (r301655) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed Jun 8 17:32:41 2016 (r301656) @@ -364,6 +364,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM-' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -377,6 +378,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'DD,' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -390,6 +392,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'HH:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -403,6 +406,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -416,6 +420,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'SS.' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -429,6 +434,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'M(mseconds),' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -454,6 +460,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'HH:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -467,6 +474,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM' - last one - ignore endptr here. */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -725,6 +733,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as ptr = str; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { warnx("Integer value %s not supported", str); @@ -749,6 +758,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { warnx("Integer value %s not supported", str); @@ -776,6 +786,7 @@ parse_ntp_ts(struct snmp_value *sv, char uint8_t ntp_ts[SNMP_NTP_TS_OCTETS]; saved_errno = errno; + errno = 0; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { errno = saved_errno; @@ -797,6 +808,7 @@ parse_ntp_ts(struct snmp_value *sv, char val = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { errno = saved_errno; @@ -879,8 +891,8 @@ snmp_bridgeid2oct(char *str, struct asn_ ptr = str; /* Read the priority. */ saved_errno = errno; - v = strtoul(ptr, &endptr, 10); errno = 0; + v = strtoul(ptr, &endptr, 10); if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -897,6 +909,7 @@ snmp_bridgeid2oct(char *str, struct asn_ ptr = endptr + 1; for (i = 0; i < 5; i++) { saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; if (v > 0xff) { @@ -914,6 +927,7 @@ snmp_bridgeid2oct(char *str, struct asn_ /* The last one - don't check the ending char here. */ saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; if (v > 0xff) { @@ -938,7 +952,6 @@ parse_bridge_id(struct snmp_value *sv, c saved_errno = errno; errno = 0; v = strtoul(string, &endptr, 10); - errno = saved_errno; if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -1026,8 +1039,8 @@ snmp_bport_id2oct(char *str, struct asn_ ptr = str; /* Read the priority. */ saved_errno = errno; - v = strtoul(ptr, &endptr, 10); errno = 0; + v = strtoul(ptr, &endptr, 10); if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -1039,6 +1052,7 @@ snmp_bport_id2oct(char *str, struct asn_ return (NULL); saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; @@ -1065,7 +1079,6 @@ parse_bport_id(struct snmp_value *value, saved_errno = errno; errno = 0; v = strtoul(string, &endptr, 10); - errno = saved_errno; if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:34:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047D2B6F4FB; Wed, 8 Jun 2016 17:34:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C594E1B20; Wed, 8 Jun 2016 17:34:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HYb5f033028; Wed, 8 Jun 2016 17:34:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HYbFN033025; Wed, 8 Jun 2016 17:34:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081734.u58HYbFN033025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301657 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:34:39 -0000 Author: ngie Date: Wed Jun 8 17:34:37 2016 New Revision: 301657 URL: https://svnweb.freebsd.org/changeset/base/301657 Log: MFC r299701: Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern to the header allows us to cover all of our bases for the variable, and allows _bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c. Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:32:41 2016 (r301656) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:34:37 2016 (r301657) @@ -47,7 +47,6 @@ #include "bsnmptc.h" #include "bsnmptools.h" -extern int _bsnmptools_debug; #define DEBUG if (_bsnmptools_debug) fprintf /* Allocate memory and initialize list. */ Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Wed Jun 8 17:32:41 2016 (r301656) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Wed Jun 8 17:34:37 2016 (r301657) @@ -231,7 +231,7 @@ extern struct snmp_toolinfo snmptool; #define SET_NONREP(ctx, i) (((ctx)->flags |= (((i) & 0xff) << 24))) #define GET_NONREP(ctx) (((ctx)->flags & NONREP_BITS) >> 24) - +extern int _bsnmptools_debug; extern const struct asn_oid IsoOrgDod_OID; int snmptool_init(struct snmp_toolinfo *); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:43:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24ADBB6F943; Wed, 8 Jun 2016 17:43:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9DB0144D; Wed, 8 Jun 2016 17:43:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Hh5Q5036852; Wed, 8 Jun 2016 17:43:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Hh4lC036846; Wed, 8 Jun 2016 17:43:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081743.u58Hh4lC036846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301661 - in stable/10/contrib/bsnmp: lib snmp_mibII snmp_target X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:43:06 -0000 Author: ngie Date: Wed Jun 8 17:43:04 2016 New Revision: 301661 URL: https://svnweb.freebsd.org/changeset/base/301661 Log: MFC r256678,r256680,r260986,r272878,r286402: r256678 (by syrinx): Fix SNMP Error response PDUs and properly encode them when using v3 auth/encryption. r256680 (by syrinx): Fix the -Wconversion warnings produced when compiling the SNMP agent. r260986 (by harti): Fix a problem with OBJECT IDENTIFIER encoding: need to check the second subid to be less than 40, not the first when the first subid is 0 or 1. r272878 (by syrinx): Fix a bug in decoding string indexes in snmp_target(3), thus causing bsnmpd(1) to not send v3 notifications properly; while here add two missing return statements which could lead to abort() in case of a rollback r286402 (by araujo): Fix variable 'old' is used uninitialized whenever '&&' condition is false. Spotted by clang. Modified: stable/10/contrib/bsnmp/lib/asn1.c stable/10/contrib/bsnmp/lib/snmp.c stable/10/contrib/bsnmp/lib/snmp.h stable/10/contrib/bsnmp/lib/snmpagent.c stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c stable/10/contrib/bsnmp/snmp_target/target_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/10/contrib/bsnmp/lib/asn1.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/asn1.c Wed Jun 8 17:43:04 2016 (r301661) @@ -652,7 +652,7 @@ asn_put_objid(struct asn_buf *b, const s err = ASN_ERR_RANGE; } if (oid->subs[0] > 2 || - (oid->subs[0] < 2 && oid->subs[0] >= 40)) { + (oid->subs[0] < 2 && oid->subs[1] >= 40)) { asn_error(NULL, "oid out of range (%u,%u)", oid->subs[0], oid->subs[1]); err = ASN_ERR_RANGE; Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/snmp.c Wed Jun 8 17:43:04 2016 (r301661) @@ -288,11 +288,13 @@ parse_secparams(struct asn_buf *b, struc memset(buf, 0, 256); tb.asn_ptr = buf; tb.asn_len = 256; + u_int len; - if (asn_get_octetstring(b, buf, &tb.asn_len) != ASN_ERR_OK) { + if (asn_get_octetstring(b, buf, &len) != ASN_ERR_OK) { snmp_error("cannot parse usm header"); return (ASN_ERR_FAILED); } + tb.asn_len = len; if (asn_get_sequence(&tb, &octs_len) != ASN_ERR_OK) { snmp_error("cannot decode usm header"); @@ -864,7 +866,7 @@ snmp_fix_encoding(struct asn_buf *b, str return (SNMP_CODE_FAILED); pdu->scoped_len = b->asn_ptr - pdu->scoped_ptr; - if ((code = snmp_pdu_fix_padd(b, pdu))!= ASN_ERR_OK) + if (snmp_pdu_fix_padd(b, pdu) != ASN_ERR_OK) return (SNMP_CODE_FAILED); if (pdu->security_model != SNMP_SECMODEL_USM) @@ -997,7 +999,7 @@ snmp_pdu_encode(struct snmp_pdu *pdu, st if ((err = snmp_pdu_encode_header(resp_b, pdu)) != SNMP_CODE_OK) return (err); for (idx = 0; idx < pdu->nbindings; idx++) - if ((err = snmp_binding_encode(resp_b, &pdu->bindings[idx])) + if (snmp_binding_encode(resp_b, &pdu->bindings[idx]) != ASN_ERR_OK) return (SNMP_CODE_FAILED); Modified: stable/10/contrib/bsnmp/lib/snmp.h ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.h Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/snmp.h Wed Jun 8 17:43:04 2016 (r301661) @@ -182,7 +182,7 @@ struct snmp_pdu { /* fixes for encoding */ size_t outer_len; - size_t scoped_len; + asn_len_t scoped_len; u_char *outer_ptr; u_char *digest_ptr; u_char *encrypted_ptr; Modified: stable/10/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpagent.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/snmpagent.c Wed Jun 8 17:43:04 2016 (r301661) @@ -166,7 +166,7 @@ find_subnode(const struct snmp_value *va } static void -snmp_pdu_create_response(struct snmp_pdu *pdu, struct snmp_pdu *resp) +snmp_pdu_create_response(const struct snmp_pdu *pdu, struct snmp_pdu *resp) { memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); @@ -276,7 +276,12 @@ snmp_get(struct snmp_pdu *pdu, struct as } } - return (snmp_fix_encoding(resp_b, resp)); + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("get: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } static struct snmp_node * @@ -438,7 +443,13 @@ snmp_getnext(struct snmp_pdu *pdu, struc return (SNMP_RET_ERR); } } - return (snmp_fix_encoding(resp_b, resp)); + + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("getnext: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } enum snmp_ret @@ -542,7 +553,12 @@ snmp_getbulk(struct snmp_pdu *pdu, struc } done: - return (snmp_fix_encoding(resp_b, resp)); + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("getnext: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } /* @@ -957,18 +973,57 @@ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *pdu, struct asn_buf *pdu_b, struct asn_buf *resp_b) { + u_char type; asn_len_t len; struct snmp_pdu resp; enum asn_err err; enum snmp_code code; - memset(&resp, 0, sizeof(resp)); + snmp_pdu_create_response(pdu, &resp); + if ((code = snmp_pdu_decode_header(pdu_b, &resp)) != SNMP_CODE_OK) return (SNMP_RET_IGN); - if (pdu_b->asn_len < len) + if (pdu->version == SNMP_V3) { + if (resp.user.priv_proto != SNMP_PRIV_NOPRIV && + (asn_get_header(pdu_b, &type, &resp.scoped_len) != ASN_ERR_OK + || type != ASN_TYPE_OCTETSTRING)) { + snmp_error("cannot decode encrypted pdu"); + return (SNMP_RET_IGN); + } + + if (asn_get_sequence(pdu_b, &len) != ASN_ERR_OK) { + snmp_error("cannot decode scoped pdu header"); + return (SNMP_RET_IGN); + } + + len = SNMP_ENGINE_ID_SIZ; + if (asn_get_octetstring(pdu_b, (u_char *)resp.context_engine, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context engine"); + return (SNMP_RET_IGN); + } + resp.context_engine_len = len; + len = SNMP_CONTEXT_NAME_SIZ; + if (asn_get_octetstring(pdu_b, (u_char *)resp.context_name, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context name"); + return (SNMP_RET_IGN); + } + resp.context_name[len] = '\0'; + } + + + if (asn_get_header(pdu_b, &type, &len) != ASN_ERR_OK) { + snmp_error("cannot get pdu header"); return (SNMP_RET_IGN); - pdu_b->asn_len = len; + } + + if ((type & ~ASN_TYPE_MASK) != + (ASN_TYPE_CONSTRUCTED | ASN_CLASS_CONTEXT)) { + snmp_error("bad pdu header tag"); + return (SNMP_RET_IGN); + } err = snmp_parse_pdus_hdr(pdu_b, &resp, &len); if (ASN_ERR_STOPPED(err)) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c Wed Jun 8 17:43:04 2016 (r301661) @@ -151,7 +151,7 @@ int op_ip(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { - int old; + int old = 0; switch (op) { Modified: stable/10/contrib/bsnmp/snmp_target/target_snmp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_target/target_snmp.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/snmp_target/target_snmp.c Wed Jun 8 17:43:04 2016 (r301661) @@ -301,6 +301,7 @@ op_snmp_target_addrs(struct snmp_context default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -625,6 +626,7 @@ op_snmp_notify(struct snmp_context *ctx default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -663,13 +665,14 @@ target_append_index(struct asn_oid *oid, static int target_decode_index(const struct asn_oid *oid, uint sub, char *name) { - uint32_t i, len; + uint32_t i; - if ((len = oid->len - sub) >= SNMP_ADM_STR32_SIZ) + if (oid->len - sub != oid->subs[sub] + 1 || oid->subs[sub] >= + SNMP_ADM_STR32_SIZ) return (-1); - for (i = 0; i < len; i++) - name[i] = oid->subs[sub + i]; + for (i = 0; i < oid->subs[sub]; i++) + name[i] = oid->subs[sub + i + 1]; name[i] = '\0'; return (0); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:49:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99171B6FAC1; Wed, 8 Jun 2016 17:49:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C63219F0; Wed, 8 Jun 2016 17:49:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Hn3fg037267; Wed, 8 Jun 2016 17:49:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Hn3gh037262; Wed, 8 Jun 2016 17:49:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081749.u58Hn3gh037262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301663 - in stable/10/contrib/bsnmp: snmp_mibII snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:49:04 -0000 Author: ngie Date: Wed Jun 8 17:49:03 2016 New Revision: 301663 URL: https://svnweb.freebsd.org/changeset/base/301663 Log: MFC r294507,r294567,r299466: r294507 (by harti): Fill the ifAlias leaf of the ifXTable with the interface description if there is one available and it fits into the maximum size (64 characters). r294567 (by bz): Change the variable to a #define in order to make gcc happy which otherwise will complain about "variably modified 'alias' at file scope". Unbreaks the build on gcc platforms. r299466 (by cem): bsnmpd: Fix size of trapsink::comm to match other community arrays This fixes a number of possible strcpy() buffer overruns between the various community strings in trap.c. CIDs: 1006820, 1006821, 1006822 Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c stable/10/contrib/bsnmp/snmp_mibII/mibII.h stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c stable/10/contrib/bsnmp/snmpd/snmpd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Wed Jun 8 17:49:03 2016 (r301663) @@ -443,6 +443,7 @@ mib_fetch_ifmib(struct mibif *ifp) size_t len; void *newmib; struct ifmibdata oldmib = ifp->mib; + struct ifreq irr; if (fetch_generic_mib(ifp, &oldmib) == -1) return (-1); @@ -514,6 +515,18 @@ mib_fetch_ifmib(struct mibif *ifp) } out: + strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; + irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); + if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { + MIBIF_PRIV(ifp)->alias[0] = 0; + if (errno != ENOMSG) + syslog(LOG_WARNING, "SIOCGIFDESCR (%s): %m", ifp->name); + } else if (irr.ifr_buffer.buffer == NULL) { + MIBIF_PRIV(ifp)->alias[0] = 0; + syslog(LOG_WARNING, "SIOCGIFDESCR (%s): too long (%zu)", + ifp->name, irr.ifr_buffer.length); + } ifp->mibtick = get_ticks(); return (0); } Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.h Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.h Wed Jun 8 17:49:03 2016 (r301663) @@ -57,6 +57,9 @@ #include "snmp_mibII.h" #include "mibII_tree.h" +/* maximum size of the interface alias */ +#define MIBIF_ALIAS_SIZE (64 + 1) + /* * Interface list and flags. */ @@ -77,6 +80,9 @@ struct mibif_private { uint64_t hc_opackets; uint64_t hc_imcasts; uint64_t hc_ipackets; + + /* this should be made public */ + char alias[MIBIF_ALIAS_SIZE]; }; #define MIBIF_PRIV(IFP) ((struct mibif_private *)((IFP)->private)) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Wed Jun 8 17:49:03 2016 (r301663) @@ -528,7 +528,7 @@ op_ifxtable(struct snmp_context *ctx, st break; case LEAF_ifAlias: - ret = string_get(value, "", -1); + ret = string_get(value, MIBIF_PRIV(ifp)->alias, -1); break; case LEAF_ifCounterDiscontinuityTime: Modified: stable/10/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/snmpd.h Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmpd/snmpd.h Wed Jun 8 17:49:03 2016 (r301663) @@ -307,7 +307,7 @@ struct trapsink { struct asn_oid index; u_int status; int socket; - u_char comm[SNMP_COMMUNITY_MAXLEN]; + u_char comm[SNMP_COMMUNITY_MAXLEN + 1]; int version; }; enum { From owner-svn-src-stable-10@freebsd.org Wed Jun 8 17:59:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A188CB6FE41; Wed, 8 Jun 2016 17:59:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73BD712BD; Wed, 8 Jun 2016 17:59:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HxLLc041263; Wed, 8 Jun 2016 17:59:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HxLgp041261; Wed, 8 Jun 2016 17:59:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081759.u58HxLgp041261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301667 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:59:22 -0000 Author: ngie Date: Wed Jun 8 17:59:21 2016 New Revision: 301667 URL: https://svnweb.freebsd.org/changeset/base/301667 Log: MFC r299834: Fix .Dd Today is the 14th, not the 10th of May Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 17:57:42 2016 (r301666) +++ stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 17:59:21 2016 (r301667) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd May 10, 2016 +.Dd May 14, 2016 .Dt BSNMPD 1 .Os .Sh NAME From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:05:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C43A9B6F094; Wed, 8 Jun 2016 18:05:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90E871A11; Wed, 8 Jun 2016 18:05:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I5q4r044986; Wed, 8 Jun 2016 18:05:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I5qRT044985; Wed, 8 Jun 2016 18:05:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081805.u58I5qRT044985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301669 - stable/10/usr.sbin/bsnmpd/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:05:53 -0000 Author: ngie Date: Wed Jun 8 18:05:52 2016 New Revision: 301669 URL: https://svnweb.freebsd.org/changeset/base/301669 Log: MFC r299806: Bump WARNS to 6 Modified: stable/10/usr.sbin/bsnmpd/tools/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/Makefile.inc ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/Makefile.inc Wed Jun 8 18:00:07 2016 (r301668) +++ stable/10/usr.sbin/bsnmpd/tools/Makefile.inc Wed Jun 8 18:05:52 2016 (r301669) @@ -11,3 +11,5 @@ LIBBSNMPTOOLSDIR= ${.OBJDIR}/../lib LIBBSNMPTOOLSDIR= ${.CURDIR}/../libbsnmptools .endif LIBBSNMPTOOLS= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a + +WARNS?= 6 From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:08:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF977B6F177; Wed, 8 Jun 2016 18:08:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0BC81D0E; Wed, 8 Jun 2016 18:08:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I86GB045194; Wed, 8 Jun 2016 18:08:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I86a9045193; Wed, 8 Jun 2016 18:08:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081808.u58I86a9045193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301671 - stable/10/usr.sbin/bsnmpd/modules/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:08:07 -0000 Author: ngie Date: Wed Jun 8 18:08:06 2016 New Revision: 301671 URL: https://svnweb.freebsd.org/changeset/base/301671 Log: MFC r299815: Remove NO_WERROR.clang from this Makefile This compiles with clang without warnings Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Wed Jun 8 18:07:51 2016 (r301670) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Wed Jun 8 18:08:06 2016 (r301671) @@ -15,8 +15,6 @@ MAN= snmp_mibII.3 CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H -# XXX Work around clang warning, until maintainer approves fix. -NO_WERROR.clang= DEFS= ${MOD}_tree.def INCS= snmp_${MOD}.h From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:14:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F3EAB6F64F; Wed, 8 Jun 2016 18:14:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC351391; Wed, 8 Jun 2016 18:14:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IE6Eo049124; Wed, 8 Jun 2016 18:14:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IE6Z5049123; Wed, 8 Jun 2016 18:14:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081814.u58IE6Z5049123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301673 - stable/10/lib/libbsnmp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:14:07 -0000 Author: ngie Date: Wed Jun 8 18:14:06 2016 New Revision: 301673 URL: https://svnweb.freebsd.org/changeset/base/301673 Log: MFC r299699: Remove NO_WERROR from libbsnmp/Makefile.inc This has been compiling without warnings with clang/gcc for a while now Tested with: clang 3.8.0, gcc 4.2.x, gcc 5.x Modified: stable/10/lib/libbsnmp/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libbsnmp/Makefile.inc ============================================================================== --- stable/10/lib/libbsnmp/Makefile.inc Wed Jun 8 18:09:40 2016 (r301672) +++ stable/10/lib/libbsnmp/Makefile.inc Wed Jun 8 18:14:06 2016 (r301673) @@ -1,6 +1,5 @@ # $FreeBSD$ -NO_WERROR= INCSDIR= ${INCLUDEDIR}/bsnmp .include "../Makefile.inc" From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:15:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0CDB6F76D; Wed, 8 Jun 2016 18:15:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6C417C9; Wed, 8 Jun 2016 18:15:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IFqsw049318; Wed, 8 Jun 2016 18:15:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IFqj7049317; Wed, 8 Jun 2016 18:15:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081815.u58IFqj7049317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301675 - stable/10/contrib/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:15:53 -0000 Author: ngie Date: Wed Jun 8 18:15:51 2016 New Revision: 301675 URL: https://svnweb.freebsd.org/changeset/base/301675 Log: MFC r300714: The readme provides a high-level overview of how to upgrade top(1). Reviewed By: ngie Added: stable/10/contrib/top/FREEBSD-upgrade - copied unchanged from r300714, head/contrib/top/FREEBSD-upgrade Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/top/FREEBSD-upgrade (from r300714, head/contrib/top/FREEBSD-upgrade) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/top/FREEBSD-upgrade Wed Jun 8 18:15:51 2016 (r301675, copy of r300714, head/contrib/top/FREEBSD-upgrade) @@ -0,0 +1,22 @@ +$FreeBSD$ + +This file contains notes regarding the upgrade of top(1). See the vendor +import instructions at: + + https://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html#svn-advanced-use-vendor-imports + +The upstream project pages for top(1) are: + + http://www.unixtop.org/ + + https://sourceforge.net/projects/unixtop/ + +contrib/top/machine.h specifies an interface that must be provided by the +target OS. That interface is implemented in usr.bin/top/machine.c + +To enable building on case-insensitive filesystems, the following files were +renamed: + + contrib/top/top.X -> contrib/top/top.xs + contrib/top/top.local.H -> contrib/top/top.local.hs + From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:19:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 656BAB6F8E2; Wed, 8 Jun 2016 18:19:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2E11BA2; Wed, 8 Jun 2016 18:19:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IJYwY049612; Wed, 8 Jun 2016 18:19:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IJYnU049610; Wed, 8 Jun 2016 18:19:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081819.u58IJYnU049610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301677 - stable/10/tools/tools/ioat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:19:35 -0000 Author: ngie Date: Wed Jun 8 18:19:34 2016 New Revision: 301677 URL: https://svnweb.freebsd.org/changeset/base/301677 Log: MFC r300856,r300857,r300858,r300874: r300856: Initialize `t` with memset(.., 0, ..) This will help ensure that we're not using random garbage on the stack by accident with respect to the variable r300857: Document the default behavior for -c (0) Bump .Dd for the change r300858: Fix description for -V in the -r case t.verify_test = true is always set when -V is specified, regardless of whether or not the tool is being run in raw mode r300874: Update usage(..) - Document missing options - Sync options with ioatcontrol(8). - Make it clear that the first 2 parameters are always required. Modified: stable/10/tools/tools/ioat/ioatcontrol.8 stable/10/tools/tools/ioat/ioatcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- stable/10/tools/tools/ioat/ioatcontrol.8 Wed Jun 8 18:16:34 2016 (r301676) +++ stable/10/tools/tools/ioat/ioatcontrol.8 Wed Jun 8 18:19:34 2016 (r301677) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd May 27, 2016 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -62,7 +62,8 @@ driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds .It Fl c Ar period -Configure the channel's interrupt coalescing period, in microseconds. +Configure the channel's interrupt coalescing period, in microseconds +(defaults to 0). .It Fl E Test non-contiguous 8k copy. .It Fl f @@ -92,7 +93,7 @@ is a kernel virtual address (by default, .Ar address is assumed to be a physical address) .It Fl V -Dump the resulting hex to syslog +Verify copies/fills for accuracy .It Fl w Write to the specified .Ar address Modified: stable/10/tools/tools/ioat/ioatcontrol.c ============================================================================== --- stable/10/tools/tools/ioat/ioatcontrol.c Wed Jun 8 18:16:34 2016 (r301676) +++ stable/10/tools/tools/ioat/ioatcontrol.c Wed Jun 8 18:19:34 2016 (r301677) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,14 +49,19 @@ static void usage(void) { - printf("Usage: %s [-E|-f|-m] OPTIONS [ " + printf("Usage: %s [-c period] [-EfmVz] channel-number num-txns [ " "[ [duration]]]\n", getprogname()); - printf(" %s -r [-v] OPTIONS []\n\n", + printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); - printf(" OPTIONS:\n"); - printf(" -c - Enable interrupt coalescing (us)\n"); - printf(" -V - Enable verification\n"); - printf(" -z - Zero device stats before test\n"); + printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); + printf(" -E - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -m - Test memcpy instead of DMA.\n"); + printf(" -r - Issue DMA to or from a specific address.\n"); + printf(" -V - Enable verification\n"); + printf(" -v -
is a kernel virtual address\n"); + printf(" -w - Write to the specified address\n"); + printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -104,6 +110,8 @@ main(int argc, char **argv) bool fflag, rflag, Eflag, mflag; unsigned modeflags; + memset(&t, 0, sizeof(t)); + fflag = rflag = Eflag = mflag = false; modeflags = 0; From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:21:26 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A08FB6F984; Wed, 8 Jun 2016 18:21:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4812D1DA8; Wed, 8 Jun 2016 18:21:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58ILP9D051741; Wed, 8 Jun 2016 18:21:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58ILPq0051720; Wed, 8 Jun 2016 18:21:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081821.u58ILPq0051720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301678 - stable/10/tools/tools/ioat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:21:26 -0000 Author: ngie Date: Wed Jun 8 18:21:25 2016 New Revision: 301678 URL: https://svnweb.freebsd.org/changeset/base/301678 Log: MFC r300861,r300862: r300861: - Sort make variables - Use SRCTOP instead of ad hoc definition for it r300862: Install ioatcontrol to /usr/bin by default instead of / Modified: stable/10/tools/tools/ioat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/ioat/Makefile ============================================================================== --- stable/10/tools/tools/ioat/Makefile Wed Jun 8 18:19:34 2016 (r301677) +++ stable/10/tools/tools/ioat/Makefile Wed Jun 8 18:21:25 2016 (r301678) @@ -2,9 +2,13 @@ PROG= ioatcontrol MAN= ioatcontrol.8 -CFLAGS+= -I${.CURDIR:H:H:H}/sys/dev/ioat -WARNS?= 6 +BINDIR?= /usr/bin + +CFLAGS+= -I${SRCTOP}/sys/dev/ioat + #LIBADD= util LDADD= -lutil +WARNS?= 6 + .include From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:22:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37873B6FB73; Wed, 8 Jun 2016 18:22:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0404012A5; Wed, 8 Jun 2016 18:22:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IMt6C053355; Wed, 8 Jun 2016 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IMtc6053354; Wed, 8 Jun 2016 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081822.u58IMtc6053354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301680 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:22:56 -0000 Author: ngie Date: Wed Jun 8 18:22:54 2016 New Revision: 301680 URL: https://svnweb.freebsd.org/changeset/base/301680 Log: MFC r300625: Remove unnecessary memset(.., 0, ..)'s The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO) under the covers, so zeroing out memory is already handled by the underlying calls Modified: stable/10/sys/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Wed Jun 8 18:21:27 2016 (r301679) +++ stable/10/sys/rpc/svc.c Wed Jun 8 18:22:54 2016 (r301680) @@ -847,9 +847,7 @@ svc_xprt_alloc() SVCXPRT_EXT *ext; xprt = mem_alloc(sizeof(SVCXPRT)); - memset(xprt, 0, sizeof(SVCXPRT)); ext = mem_alloc(sizeof(SVCXPRT_EXT)); - memset(ext, 0, sizeof(SVCXPRT_EXT)); xprt->xp_p3 = ext; refcount_init(&xprt->xp_refs, 1); From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:27:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E355B6FC74; Wed, 8 Jun 2016 18:27:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4EE175B; Wed, 8 Jun 2016 18:27:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IRjQw053640; Wed, 8 Jun 2016 18:27:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IRjlt053639; Wed, 8 Jun 2016 18:27:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081827.u58IRjlt053639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301682 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:27:46 -0000 Author: ngie Date: Wed Jun 8 18:27:44 2016 New Revision: 301682 URL: https://svnweb.freebsd.org/changeset/base/301682 Log: MFC r300386: Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new struct xlist object fails CID: 978277 Modified: stable/10/lib/libc/rpc/svc_generic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/svc_generic.c ============================================================================== --- stable/10/lib/libc/rpc/svc_generic.c Wed Jun 8 18:23:33 2016 (r301681) +++ stable/10/lib/libc/rpc/svc_generic.c Wed Jun 8 18:27:44 2016 (r301682) @@ -121,7 +121,8 @@ svc_create(dispatch, prognum, versnum, n if (l == NULL) { warnx("svc_create: no memory"); mutex_unlock(&xprtlist_lock); - return (0); + num = 0; + goto done; } l->xprt = xprt; l->next = xprtlist; @@ -131,6 +132,7 @@ svc_create(dispatch, prognum, versnum, n } mutex_unlock(&xprtlist_lock); } +done: __rpc_endconf(handle); /* * In case of num == 0; the error messages are generated by the From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:41:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C26A5B6F384; Wed, 8 Jun 2016 18:41:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FEF713BB; Wed, 8 Jun 2016 18:41:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IfnQH059640; Wed, 8 Jun 2016 18:41:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ifnu1059639; Wed, 8 Jun 2016 18:41:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081841.u58Ifnu1059639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301684 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:41:50 -0000 Author: ngie Date: Wed Jun 8 18:41:49 2016 New Revision: 301684 URL: https://svnweb.freebsd.org/changeset/base/301684 Log: MFC r300385: Don't leak `tmp` if `p->nc_lookups` can't be malloced Modified: stable/10/lib/libc/rpc/getnetconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:38:48 2016 (r301683) +++ stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:41:49 2016 (r301684) @@ -727,6 +727,7 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); + free(tmp); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-stable-10@freebsd.org Wed Jun 8 18:46:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 730A4B6F536; Wed, 8 Jun 2016 18:46:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 442041B43; Wed, 8 Jun 2016 18:46:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IkAju061232; Wed, 8 Jun 2016 18:46:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IkA3k061231; Wed, 8 Jun 2016 18:46:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081846.u58IkA3k061231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301687 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:46:11 -0000 Author: ngie Date: Wed Jun 8 18:46:10 2016 New Revision: 301687 URL: https://svnweb.freebsd.org/changeset/base/301687 Log: MFC r300624: Fix up r300385 I accidentally glossed over the fact that tmp is manipulated via strchr, so if we tried to free `tmp` after r300385, it would have crashed. Create a separate pointer (tmp2) to track the original allocation of `tmp`, and free `tmp2` if `p->nc_lookups` can't be malloced CID: 1356026 Modified: stable/10/lib/libc/rpc/getnetconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:43:56 2016 (r301686) +++ stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:46:10 2016 (r301687) @@ -697,7 +697,7 @@ dup_ncp(ncp) struct netconfig *ncp; { struct netconfig *p; - char *tmp; + char *tmp, *tmp2; u_int i; if ((tmp=malloc(MAXNETCONFIGLINE)) == NULL) @@ -706,6 +706,7 @@ struct netconfig *ncp; free(tmp); return(NULL); } + tmp2 = tmp; /* * First we dup all the data from matched netconfig buffer. Then we * adjust some of the member pointer to a pre-allocated buffer where @@ -727,7 +728,7 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); - free(tmp); + free(tmp2); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-stable-10@freebsd.org Wed Jun 8 20:47:26 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A68F4B6F9DB; Wed, 8 Jun 2016 20:47:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E4FE1F70; Wed, 8 Jun 2016 20:47:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58KlPgc005962; Wed, 8 Jun 2016 20:47:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58KlP3s005960; Wed, 8 Jun 2016 20:47:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606082047.u58KlP3s005960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 20:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301695 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 20:47:26 -0000 Author: ngie Date: Wed Jun 8 20:47:25 2016 New Revision: 301695 URL: https://svnweb.freebsd.org/changeset/base/301695 Log: MFC r300870,r300884: r300870: Unbreak the zfs(4) build vm/vm_pageout.h grew a dependency on the bool typedef in r300865 arc.c didn't include sys/types.h, which included the definition for the typedef Other items (ofed, drm2) might need to be chased for this commit. Pointyhat to: alc r300884: Fix up r300870 The sys/types.h fix I proposed was only tested with zfs(4), not with libzpool, which is where the build failure actually existed Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both unneeded In collaboration with: kib Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 8 20:42:35 2016 (r301694) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 8 20:47:25 2016 (r301695) @@ -139,7 +139,6 @@ #include #include -#include #include #ifdef illumos Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 8 20:42:35 2016 (r301694) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 8 20:47:25 2016 (r301695) @@ -75,7 +75,6 @@ #include #include #include -#include /* * Programming rules. From owner-svn-src-stable-10@freebsd.org Thu Jun 9 15:43:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D62DAEFD3A; Thu, 9 Jun 2016 15:43:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCF01C63; Thu, 9 Jun 2016 15:43:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59Fh0pf029619; Thu, 9 Jun 2016 15:43:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Fh0hn029618; Thu, 9 Jun 2016 15:43:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606091543.u59Fh0hn029618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 9 Jun 2016 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301738 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 15:43:02 -0000 Author: bdrewery Date: Thu Jun 9 15:43:00 2016 New Revision: 301738 URL: https://svnweb.freebsd.org/changeset/base/301738 Log: MFC r301465: Fix bmake version upgrade logic to use the new bmake. The '${WANT_MAKE} != "bmake"' logic seems wrong but is not being modified. Modified: stable/10/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Thu Jun 9 15:34:33 2016 (r301737) +++ stable/10/Makefile Thu Jun 9 15:43:00 2016 (r301738) @@ -155,9 +155,13 @@ HAVE_MAKE= bmake .else HAVE_MAKE= fmake .endif +.if ${HAVE_MAKE} != ${WANT_MAKE} || \ + (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) +NEED_MAKE_UPGRADE= t +.endif .if exists(${MYMAKE}) SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk -.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +.elif defined(NEED_MAKE_UPGRADE) || ${WANT_MAKE} != "bmake" # It may not exist yet but we may cause it to. # In the case of fmake, upgrade_checks may cause a newer version to be built. SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ @@ -334,8 +338,7 @@ kernel: buildkernel installkernel # for building the world. # upgrade_checks: -.if ${HAVE_MAKE} != ${WANT_MAKE} || \ - (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) +.if defined(NEED_MAKE_UPGRADE) @${_+_}(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ From owner-svn-src-stable-10@freebsd.org Thu Jun 9 16:29:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3C6B7005A; Thu, 9 Jun 2016 16:29:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7971C94; Thu, 9 Jun 2016 16:29:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59GTJAU045071; Thu, 9 Jun 2016 16:29:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59GTJXv045070; Thu, 9 Jun 2016 16:29:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606091629.u59GTJXv045070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 9 Jun 2016 16:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301743 - stable/10/usr.bin/indent X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:29:20 -0000 Author: pfg Date: Thu Jun 9 16:29:19 2016 New Revision: 301743 URL: https://svnweb.freebsd.org/changeset/base/301743 Log: MFC r301513: indent(1): Fix old typo. It's typedef, not typdef. Obtained from: NetBSD (CVS rev. 1.14) Modified: stable/10/usr.bin/indent/lexi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/indent/lexi.c ============================================================================== --- stable/10/usr.bin/indent/lexi.c Thu Jun 9 16:15:01 2016 (r301742) +++ stable/10/usr.bin/indent/lexi.c Thu Jun 9 16:29:19 2016 (r301743) @@ -79,7 +79,7 @@ struct templ specials[1000] = {"double", 4}, {"long", 4}, {"short", 4}, - {"typdef", 4}, + {"typedef", 4}, {"unsigned", 4}, {"register", 4}, {"static", 4}, From owner-svn-src-stable-10@freebsd.org Fri Jun 10 00:00:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA70B70943; Fri, 10 Jun 2016 00:00:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A79F11A0; Fri, 10 Jun 2016 00:00:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A00QZa015073; Fri, 10 Jun 2016 00:00:26 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A00QiO015063; Fri, 10 Jun 2016 00:00:26 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606100000.u5A00QiO015063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 10 Jun 2016 00:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301772 - in stable/10: sbin/ipfw sys/conf sys/modules/dummynet sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 00:00:27 -0000 Author: truckman Date: Fri Jun 10 00:00:25 2016 New Revision: 301772 URL: https://svnweb.freebsd.org/changeset/base/301772 Log: MFC r300779, r300781, r300783, r300784, r300949, r301162, r301180 r300779 | truckman | 2016-05-26 14:40:13 -0700 (Thu, 26 May 2016) | 64 lines Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). Centre for Advanced Internet Architectures Implementing AQM in FreeBSD * Overview * Articles, Papers and Presentations * Patches and Tools Overview Recent years have seen a resurgence of interest in better managing the depth of bottleneck queues in routers, switches and other places that get congested. Solutions include transport protocol enhancements at the end-hosts (such as delay-based or hybrid congestion control schemes) and active queue management (AQM) schemes applied within bottleneck queues. The notion of AQM has been around since at least the late 1990s (e.g. RFC 2309). In recent years the proliferation of oversized buffers in all sorts of network devices (aka bufferbloat) has stimulated keen community interest in four new AQM schemes -- CoDel, FQ-CoDel, PIE and FQ-PIE. The IETF AQM working group is looking to document these schemes, and independent implementations are a corner-stone of the IETF's process for confirming the clarity of publicly available protocol descriptions. While significant development work on all three schemes has occured in the Linux kernel, there is very little in FreeBSD. Project Goals This project began in late 2015, and aims to design and implement functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE in FreeBSD (with code BSD-licensed as much as practical). We have chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall and traffic shaper. Implementation of these AQM schemes in FreeBSD will: * Demonstrate whether the publicly available documentation is sufficient to enable independent, functionally equivalent implementations * Provide a broader suite of AQM options for sections the networking community that rely on FreeBSD platforms Program Members: * Rasool Al Saadi (developer) * Grenville Armitage (project lead) Acknowledgements: This project has been made possible in part by a gift from the Comcast Innovation Fund. Submitted by: Rasool Al-Saadi X-No objection: core MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6388 [Remove some code that was added to the mq_append() inline function in HEAD by r258457, which was not merged to stable/10. The AQM patch moved mq_append() from ip_dn_io.c to the new file ip_dn_private.h, so we need to remove that copy of the r258457 changes.] ------------------------------------------------------------------------ r300781 | truckman | 2016-05-26 14:44:52 -0700 (Thu, 26 May 2016) | 7 lines Modify BOUND_VAR() macro to wrap all of its arguments in () and tweak its expression to work on powerpc and sparc64 (gcc compatibility). Correct a typo in a nearby comment. MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r300783 | truckman | 2016-05-26 15:03:28 -0700 (Thu, 26 May 2016) | 4 lines Correct a typo in a comment. MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r300784 | truckman | 2016-05-26 15:07:09 -0700 (Thu, 26 May 2016) | 5 lines Include the new AQM files when compiling a kernel with options DUMMYNET. Reported by: Nikolay Denev MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r300949 | truckman | 2016-05-29 00:23:56 -0700 (Sun, 29 May 2016) | 10 lines Cast some expressions that multiply a long long constant by a floating point constant to int64_t. This avoids the runtime conversion of the the other operand in a set of comparisons from int64_t to floating point and doing the comparisions in floating point. Suggested by: lidl Submitted by: Rasool Al-Saadi MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r301162 | truckman | 2016-06-01 13:04:24 -0700 (Wed, 01 Jun 2016) | 9 lines Replace constant expressions that contain multiplications by fractional floating point values with integer divides. This will eliminate any chance that the compiler will generate code to evaluate the expression using floating point at runtime. Suggested by: bde Submitted by: Rasool Al-Saadi MFC after: 8 days (with r300779 and r300949) ------------------------------------------------------------------------ r301180 | truckman | 2016-06-01 17:42:15 -0700 (Wed, 01 Jun 2016) | 2 lines Belatedly bump .Dd date for Dummynet AQM import in r300779. Relnotes: yes Added: stable/10/sys/netpfil/ipfw/dn_aqm.h - copied, changed from r300779, head/sys/netpfil/ipfw/dn_aqm.h stable/10/sys/netpfil/ipfw/dn_aqm_codel.c - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_aqm_codel.c stable/10/sys/netpfil/ipfw/dn_aqm_codel.h - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_aqm_codel.h stable/10/sys/netpfil/ipfw/dn_aqm_pie.c - copied, changed from r300779, head/sys/netpfil/ipfw/dn_aqm_pie.c stable/10/sys/netpfil/ipfw/dn_aqm_pie.h - copied, changed from r300779, head/sys/netpfil/ipfw/dn_aqm_pie.h stable/10/sys/netpfil/ipfw/dn_sched_fq_codel.c - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_sched_fq_codel.c stable/10/sys/netpfil/ipfw/dn_sched_fq_codel.h - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_sched_fq_codel.h stable/10/sys/netpfil/ipfw/dn_sched_fq_codel_helper.h - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_sched_fq_codel_helper.h stable/10/sys/netpfil/ipfw/dn_sched_fq_pie.c - copied, changed from r300779, head/sys/netpfil/ipfw/dn_sched_fq_pie.c Modified: stable/10/sbin/ipfw/dummynet.c stable/10/sbin/ipfw/ipfw.8 stable/10/sbin/ipfw/ipfw2.h stable/10/sys/conf/files stable/10/sys/modules/dummynet/Makefile stable/10/sys/netinet/ip_dummynet.h stable/10/sys/netpfil/ipfw/dn_sched.h stable/10/sys/netpfil/ipfw/dn_sched_fifo.c stable/10/sys/netpfil/ipfw/dn_sched_prio.c stable/10/sys/netpfil/ipfw/dn_sched_qfq.c stable/10/sys/netpfil/ipfw/dn_sched_rr.c stable/10/sys/netpfil/ipfw/dn_sched_wf2q.c stable/10/sys/netpfil/ipfw/ip_dn_glue.c stable/10/sys/netpfil/ipfw/ip_dn_io.c stable/10/sys/netpfil/ipfw/ip_dn_private.h stable/10/sys/netpfil/ipfw/ip_dummynet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ipfw/dummynet.c ============================================================================== --- stable/10/sbin/ipfw/dummynet.c Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sbin/ipfw/dummynet.c Fri Jun 10 00:00:25 2016 (r301772) @@ -1,4 +1,11 @@ /* + * Codel/FQ_Codel and PIE/FQ_PIE Code: + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from + * The Comcast Innovation Fund. + * Implemented by Rasool Al-Saadi + * * Copyright (c) 2002-2003,2010 Luigi Rizzo * * Redistribution and use in source forms, with and without modification, @@ -15,6 +22,7 @@ * dummynet support */ +#define NEW_AQM #include #include /* XXX there are several sysctl leftover here */ @@ -22,6 +30,10 @@ #include "ipfw2.h" +#ifdef NEW_AQM +#include +#endif + #include #include #include @@ -59,6 +71,12 @@ static struct _s_x dummynet_params[] = { { "ecn", TOK_ECN }, { "red", TOK_RED }, { "gred", TOK_GRED }, +#ifdef NEW_AQM + { "codel", TOK_CODEL}, /* Codel AQM */ + { "fq_codel", TOK_FQ_CODEL}, /* FQ-Codel */ + { "pie", TOK_PIE}, /* PIE AQM */ + { "fq_pie", TOK_FQ_PIE}, /* FQ-PIE */ +#endif { "bw", TOK_BW }, { "bandwidth", TOK_BW }, { "delay", TOK_DELAY }, @@ -81,6 +99,32 @@ static struct _s_x dummynet_params[] = { { NULL, 0 } /* terminator */ }; +#ifdef NEW_AQM +/* AQM/extra sched parameters tokens*/ +static struct _s_x aqm_params[] = { + { "target", TOK_TARGET}, + { "interval", TOK_INTERVAL}, + { "limit", TOK_LIMIT}, + { "flows", TOK_FLOWS}, + { "quantum", TOK_QUANTUM}, + { "ecn", TOK_ECN}, + { "noecn", TOK_NO_ECN}, + { "tupdate", TOK_TUPDATE}, + { "max_burst", TOK_MAX_BURST}, + { "max_ecnth", TOK_MAX_ECNTH}, + { "alpha", TOK_ALPHA}, + { "beta", TOK_BETA}, + { "capdrop", TOK_CAPDROP}, + { "nocapdrop", TOK_NO_CAPDROP}, + { "onoff", TOK_ONOFF}, + { "dre", TOK_DRE}, + { "ts", TOK_TS}, + { "derand", TOK_DERAND}, + { "noderand", TOK_NO_DERAND}, + { NULL, 0 } /* terminator */ +}; +#endif + #define O_NEXT(p, len) ((void *)((char *)p + len)) static void @@ -102,6 +146,214 @@ o_next(struct dn_id **o, int len, int ty return ret; } +#ifdef NEW_AQM + +/* Codel flags */ +enum { + CODEL_ECN_ENABLED = 1 +}; + +/* PIE flags, from PIE kernel module */ +enum { + PIE_ECN_ENABLED = 1, + PIE_CAPDROP_ENABLED = 2, + PIE_ON_OFF_MODE_ENABLED = 4, + PIE_DEPRATEEST_ENABLED = 8, + PIE_DERAND_ENABLED = 16 +}; + +#define PIE_FIX_POINT_BITS 13 +#define PIE_SCALE (1L<15) + return -1; + for (i = 0; ioid, l, DN_CMD_GET, DN_API_VERSION); + ep->oid.len = l; + ep->oid.subtype = subtype; + ep->nr = nr; + + ret = do_cmd(-IP_DUMMYNET3, ep, (uintptr_t)&l); + if (ret) { + free(ep); + errx(EX_DATAERR, "Error getting extra parameters\n"); + } + + switch (subtype) { + case DN_AQM_PARAMS: + if( !strcasecmp(ep->name, "codel")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + l = sprintf(out, " AQM CoDel target %s interval %s", + strt1, strt2); + if (ep->par[2] & CODEL_ECN_ENABLED) + l = sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + } else if( !strcasecmp(ep->name, "pie")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + us_to_time(ep->par[2], strt3); + l = sprintf(out, " AQM type PIE target %s tupdate %s alpha " + "%g beta %g max_burst %s max_ecnth %.3g", + strt1, + strt2, + ep->par[4] / (float) PIE_SCALE, + ep->par[5] / (float) PIE_SCALE, + strt3, + ep->par[3] / (float) PIE_SCALE + ); + + if (ep->par[6] & PIE_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + if (ep->par[6] & PIE_CAPDROP_ENABLED) + l += sprintf(out + l, " CapDrop"); + else + l += sprintf(out + l, " NoCapDrop"); + if (ep->par[6] & PIE_ON_OFF_MODE_ENABLED) + l += sprintf(out + l, " OnOff"); + if (ep->par[6] & PIE_DEPRATEEST_ENABLED) + l += sprintf(out + l, " DRE"); + else + l += sprintf(out + l, " TS"); + if (ep->par[6] & PIE_DERAND_ENABLED) + l += sprintf(out + l, " Derand"); + else + l += sprintf(out + l, " NoDerand"); + } + break; + + case DN_SCH_PARAMS: + if (!strcasecmp(ep->name,"FQ_CODEL")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + l = sprintf(out," FQ_CODEL target %s interval %s" + " quantum %jd limit %jd flows %jd", + strt1, strt2, + (intmax_t) ep->par[3], + (intmax_t) ep->par[4], + (intmax_t) ep->par[5] + ); + if (ep->par[2] & CODEL_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + l += sprintf(out + l, "\n"); + } else if (!strcasecmp(ep->name,"FQ_PIE")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + us_to_time(ep->par[2], strt3); + l = sprintf(out, " FQ_PIE target %s tupdate %s alpha " + "%g beta %g max_burst %s max_ecnth %.3g" + " quantum %jd limit %jd flows %jd", + strt1, + strt2, + ep->par[4] / (float) PIE_SCALE, + ep->par[5] / (float) PIE_SCALE, + strt3, + ep->par[3] / (float) PIE_SCALE, + (intmax_t) ep->par[7], + (intmax_t) ep->par[8], + (intmax_t) ep->par[9] + ); + + if (ep->par[6] & PIE_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + if (ep->par[6] & PIE_CAPDROP_ENABLED) + l += sprintf(out + l, " CapDrop"); + else + l += sprintf(out + l, " NoCapDrop"); + if (ep->par[6] & PIE_ON_OFF_MODE_ENABLED) + l += sprintf(out + l, " OnOff"); + if (ep->par[6] & PIE_DEPRATEEST_ENABLED) + l += sprintf(out + l, " DRE"); + else + l += sprintf(out + l, " TS"); + if (ep->par[6] & PIE_DERAND_ENABLED) + l += sprintf(out + l, " Derand"); + else + l += sprintf(out + l, " NoDerand"); + l += sprintf(out + l, "\n"); + } + break; + } + + free(ep); +} +#endif + + #if 0 static int sort_q(void *arg, const void *pa, const void *pb) @@ -225,7 +477,7 @@ print_flowset_parms(struct dn_fs *fs, ch int l; char qs[30]; char plr[30]; - char red[90]; /* Display RED parameters */ + char red[200]; /* Display RED parameters */ l = fs->qsize; if (fs->flags & DN_QSIZE_BYTES) { @@ -250,6 +502,11 @@ print_flowset_parms(struct dn_fs *fs, ch 1.0 * fs->max_p / (double)(1 << SCALE_RED)); if (fs->flags & DN_IS_ECN) strncat(red, " (ecn)", 6); +#ifdef NEW_AQM + /* get AQM parameters */ + } else if (fs->flags & DN_IS_AQM) { + get_extra_parms(fs->fs_nr, red, DN_AQM_PARAMS); +#endif } else sprintf(red, "droptail"); @@ -340,6 +597,11 @@ list_pipes(struct dn_id *oid, struct dn_ printf(" sched %d type %s flags 0x%x %d buckets %d active\n", s->sched_nr, s->name, s->flags, s->buckets, s->oid.id); +#ifdef NEW_AQM + char parms[200]; + get_extra_parms(s->sched_nr, parms, DN_SCH_PARAMS); + printf("%s",parms); +#endif if (s->flags & DN_HAVE_MASK) print_mask(&s->sched_mask); } @@ -740,6 +1002,242 @@ load_extra_delays(const char *filename, strncpy(p->name, profile_name, sizeof(p->name)); } +#ifdef NEW_AQM + +/* Parse AQM/extra scheduler parameters */ +static int +process_extra_parms(int *ac, char **av, struct dn_extra_parms *ep, + uint16_t type) +{ + int i; + + /* use kernel defaults */ + for (i=0; ipar[i] = -1; + + switch(type) { + case TOK_CODEL: + case TOK_FQ_CODEL: + /* Codel + * 0- target, 1- interval, 2- flags, + * FQ_CODEL + * 3- quantum, 4- limit, 5- flows + */ + if (type==TOK_CODEL) + ep->par[2] = 0; + else + ep->par[2] = CODEL_ECN_ENABLED; + + while (*ac > 0) { + int tok = match_token(aqm_params, *av); + (*ac)--; av++; + switch(tok) { + case TOK_TARGET: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "target needs time\n"); + + ep->par[0] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_INTERVAL: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "interval needs time\n"); + + ep->par[1] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_ECN: + ep->par[2] = CODEL_ECN_ENABLED; + break; + case TOK_NO_ECN: + ep->par[2] &= ~CODEL_ECN_ENABLED; + break; + /* Config fq_codel parameters */ + case TOK_QUANTUM: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "quantum is not for codel\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "quantum needs number\n"); + + ep->par[3]= atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_LIMIT: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "limit is not for codel, use queue instead\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "limit needs number\n"); + + ep->par[4] = atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_FLOWS: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "flows is not for codel\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "flows needs number\n"); + + ep->par[5] = atoi(av[0]); + (*ac)--; av++; + break; + + default: + printf("%s is Invalid parameter\n", av[-1]); + } + } + break; + case TOK_PIE: + case TOK_FQ_PIE: + /* PIE + * 0- target , 1- tupdate, 2- max_burst, + * 3- max_ecnth, 4- alpha, + * 5- beta, 6- flags + * FQ_CODEL + * 7- quantum, 8- limit, 9- flows + */ + + if ( type == TOK_PIE) + ep->par[6] = PIE_CAPDROP_ENABLED | PIE_DEPRATEEST_ENABLED + | PIE_DERAND_ENABLED; + else + /* for FQ-PIE, use TS mode */ + ep->par[6] = PIE_CAPDROP_ENABLED | PIE_DERAND_ENABLED + | PIE_ECN_ENABLED; + + while (*ac > 0) { + int tok = match_token(aqm_params, *av); + (*ac)--; av++; + switch(tok) { + case TOK_TARGET: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "target needs time\n"); + + ep->par[0] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_TUPDATE: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "tupdate needs time\n"); + + ep->par[1] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_MAX_BURST: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "max_burst needs time\n"); + + ep->par[2] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_MAX_ECNTH: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "max_ecnth needs number\n"); + + ep->par[3] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_ALPHA: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "alpha needs number\n"); + + ep->par[4] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_BETA: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "beta needs number\n"); + + ep->par[5] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_ECN: + ep->par[6] |= PIE_ECN_ENABLED; + break; + case TOK_NO_ECN: + ep->par[6] &= ~PIE_ECN_ENABLED; + break; + + case TOK_CAPDROP: + ep->par[6] |= PIE_CAPDROP_ENABLED; + break; + case TOK_NO_CAPDROP: + ep->par[6] &= ~PIE_CAPDROP_ENABLED; + break; + + case TOK_ONOFF: + ep->par[6] |= PIE_ON_OFF_MODE_ENABLED; + break; + + case TOK_DRE: + ep->par[6] |= PIE_DEPRATEEST_ENABLED; + break; + + case TOK_TS: + ep->par[6] &= ~PIE_DEPRATEEST_ENABLED; + break; + + case TOK_DERAND: + ep->par[6] |= PIE_DERAND_ENABLED; + break; + case TOK_NO_DERAND: + ep->par[6] &= ~PIE_DERAND_ENABLED; + break; + + /* Config fq_pie parameters */ + case TOK_QUANTUM: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "quantum is not for pie\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "quantum needs number\n"); + + ep->par[7]= atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_LIMIT: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "limit is not for pie, use queue instead\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "limit needs number\n"); + + ep->par[8] = atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_FLOWS: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "flows is not for pie\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "flows needs number\n"); + + ep->par[9] = atoi(av[0]); + (*ac)--; av++; + break; + + + default: + printf("%s is invalid parameter\n", av[-1]); + } + } + break; + } + + return 0; +} + +#endif + + /* * configuration of pipes, schedulers, flowsets. * When we configure a new scheduler, an empty pipe is created, so: @@ -771,6 +1269,12 @@ ipfw_config_pipe(int ac, char **av) struct dn_fs *fs = NULL; struct dn_profile *pf = NULL; struct ipfw_flow_id *mask = NULL; +#ifdef NEW_AQM + struct dn_extra_parms *aqm_extra; + struct dn_extra_parms *sch_extra; + int lmax_extra; +#endif + int lmax; uint32_t _foo = 0, *flags = &_foo , *buckets = &_foo; @@ -782,6 +1286,15 @@ ipfw_config_pipe(int ac, char **av) lmax += sizeof(struct dn_sch) + sizeof(struct dn_link) + sizeof(struct dn_fs) + sizeof(struct dn_profile); +#ifdef NEW_AQM + /* Extra Params */ + lmax_extra = sizeof(struct dn_extra_parms); + /* two lmax_extra because one for AQM params and another + * sch params + */ + lmax += lmax_extra*2; +#endif + av++; ac--; /* Pipe number */ if (ac && isdigit(**av)) { @@ -807,8 +1320,16 @@ ipfw_config_pipe(int ac, char **av) * The FIFO scheduler and link are derived from the * WF2Q+ one in the kernel. */ +#ifdef NEW_AQM + sch_extra = o_next(&buf, lmax_extra, DN_TEXT); + sch_extra ->oid.subtype = 0; /* don't configure scheduler */ +#endif sch = o_next(&buf, sizeof(*sch), DN_SCH); p = o_next(&buf, sizeof(*p), DN_LINK); +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; /* don't configure AQM */ +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); sch->sched_nr = i; @@ -826,6 +1347,10 @@ ipfw_config_pipe(int ac, char **av) break; case 2: /* "queue N config ... " */ +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); fs->fs_nr = i; mask = &fs->flow_mask; @@ -834,7 +1359,15 @@ ipfw_config_pipe(int ac, char **av) break; case 3: /* "sched N config ..." */ +#ifdef NEW_AQM + sch_extra = o_next(&buf, lmax_extra, DN_TEXT); + sch_extra ->oid.subtype = 0; +#endif sch = o_next(&buf, sizeof(*sch), DN_SCH); +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); sch->sched_nr = i; mask = &sch->sched_mask; @@ -1021,7 +1554,31 @@ ipfw_config_pipe(int ac, char **av) } /* end while, config masks */ end_mask: break; +#ifdef NEW_AQM + case TOK_CODEL: + case TOK_PIE: + NEED(fs, "codel/pie is only for flowsets"); + + fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED); + fs->flags |= DN_IS_AQM; + + strcpy(aqm_extra->name,av[-1]); + aqm_extra->oid.subtype = DN_AQM_PARAMS; + + process_extra_parms(&ac, av, aqm_extra, tok); + break; + case TOK_FQ_CODEL: + case TOK_FQ_PIE: + if (!strcmp(av[-1],"type")) + errx(EX_DATAERR, "use type before fq_codel/fq_pie"); + + NEED(sch, "fq_codel/fq_pie is only for schd"); + strcpy(sch_extra->name,av[-1]); + sch_extra->oid.subtype = DN_SCH_PARAMS; + process_extra_parms(&ac, av, sch_extra, tok); + break; +#endif case TOK_RED: case TOK_GRED: NEED1("red/gred needs w_q/min_th/max_th/max_p\n"); @@ -1088,7 +1645,20 @@ end_mask: errx(1, "type %s too long\n", av[0]); strcpy(sch->name, av[0]); sch->oid.subtype = 0; /* use string */ - ac--; av++; +#ifdef NEW_AQM + /* if fq_codel is selected, consider all tokens after it + * as parameters + */ + if (!strcasecmp(av[0],"fq_codel") || !strcasecmp(av[0],"fq_pie")){ + strcpy(sch_extra->name,av[0]); + sch_extra->oid.subtype = DN_SCH_PARAMS; + process_extra_parms(&ac, av, sch_extra, tok); + } else { + ac--;av++; + } +#else + ac--;av++; +#endif break; } @@ -1182,9 +1752,17 @@ end_mask: errx(EX_DATAERR, "2 <= queue size <= %ld", limit); } +#ifdef NEW_AQM + if ((fs->flags & DN_IS_ECN) && !((fs->flags & DN_IS_RED)|| + (fs->flags & DN_IS_AQM))) + errx(EX_USAGE, "ECN can be used with red/gred/" + "codel/fq_codel only!"); +#else if ((fs->flags & DN_IS_ECN) && !(fs->flags & DN_IS_RED)) errx(EX_USAGE, "enable red/gred for ECN"); +#endif + if (fs->flags & DN_IS_RED) { size_t len; int lookup_depth, avg_pkt_size; Modified: stable/10/sbin/ipfw/ipfw.8 ============================================================================== --- stable/10/sbin/ipfw/ipfw.8 Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sbin/ipfw/ipfw.8 Fri Jun 10 00:00:25 2016 (r301772) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2014 +.Dd May 26, 2016 .Dt IPFW 8 .Os .Sh NAME Modified: stable/10/sbin/ipfw/ipfw2.h ============================================================================== --- stable/10/sbin/ipfw/ipfw2.h Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sbin/ipfw/ipfw2.h Fri Jun 10 00:00:25 2016 (r301772) @@ -168,6 +168,31 @@ enum tokens { TOK_ECN, TOK_DROPTAIL, TOK_PROTO, +#ifdef NEW_AQM + /* AQM tokens*/ + TOK_NO_ECN, + TOK_CODEL, + TOK_FQ_CODEL, + TOK_TARGET, + TOK_INTERVAL, + TOK_FLOWS, + TOK_QUANTUM, + + TOK_PIE, + TOK_FQ_PIE, + TOK_TUPDATE, + TOK_MAX_BURST, + TOK_MAX_ECNTH, + TOK_ALPHA, + TOK_BETA, + TOK_CAPDROP, + TOK_NO_CAPDROP, + TOK_ONOFF, + TOK_DRE, + TOK_TS, + TOK_DERAND, + TOK_NO_DERAND, +#endif /* dummynet tokens */ TOK_WEIGHT, TOK_LMAX, Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sys/conf/files Fri Jun 10 00:00:25 2016 (r301772) @@ -3592,8 +3592,12 @@ netipx/spx_usrreq.c optional ipx netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm +netpfil/ipfw/dn_aqm_codel.c optional inet dummynet +netpfil/ipfw/dn_aqm_pie.c optional inet dummynet netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_codel.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_pie.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet netpfil/ipfw/dn_sched_qfq.c optional inet dummynet netpfil/ipfw/dn_sched_rr.c optional inet dummynet Modified: stable/10/sys/modules/dummynet/Makefile ============================================================================== --- stable/10/sys/modules/dummynet/Makefile Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sys/modules/dummynet/Makefile Fri Jun 10 00:00:25 2016 (r301772) @@ -6,8 +6,9 @@ KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c +SRCS+= dn_aqm_codel.c dn_aqm_pie.c SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c -SRCS+= dn_sched_prio.c +SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c SRCS+= opt_inet6.h .if !defined(KERNBUILDDIR) Modified: stable/10/sys/netinet/ip_dummynet.h ============================================================================== --- stable/10/sys/netinet/ip_dummynet.h Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sys/netinet/ip_dummynet.h Fri Jun 10 00:00:25 2016 (r301772) @@ -29,7 +29,7 @@ #ifndef _IP_DUMMYNET_H #define _IP_DUMMYNET_H - +#define NEW_AQM /* * Definition of the kernel-userland API for dummynet. * @@ -85,7 +85,13 @@ enum { /* special commands for emulation of sysctl variables */ DN_SYSCTL_GET, DN_SYSCTL_SET, - +#ifdef NEW_AQM + /* subtypes used for setting/getting extra parameters. + * these subtypes used with IP_DUMMYNET3 command (get) + * and DN_TEXT (set). */ + DN_AQM_PARAMS, /* AQM extra params */ + DN_SCH_PARAMS, /* scheduler extra params */ +#endif DN_LAST, }; @@ -105,6 +111,9 @@ enum { /* user flags */ DN_IS_RED = 0x0020, DN_IS_GENTLE_RED= 0x0040, DN_IS_ECN = 0x0080, + #ifdef NEW_AQM + DN_IS_AQM = 0x0100, /* AQMs: e.g Codel & PIE */ + #endif DN_PIPE_CMD = 0x1000, /* pipe config... */ }; @@ -210,7 +219,19 @@ struct dn_profile { int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ }; - +#ifdef NEW_AQM +/* Extra parameters for AQM and scheduler. + * This struct is used to pass and retrieve parameters (configurations) + * to/from AQM and Scheduler. + */ +struct dn_extra_parms { + struct dn_id oid; + char name[16]; + uint32_t nr; +#define DN_MAX_EXTRA_PARM 10 + int64_t par[DN_MAX_EXTRA_PARM]; +}; +#endif /* * Overall structure of dummynet Copied and modified: stable/10/sys/netpfil/ipfw/dn_aqm.h (from r300779, head/sys/netpfil/ipfw/dn_aqm.h) ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 21:40:13 2016 (r300779, copy source) +++ stable/10/sys/netpfil/ipfw/dn_aqm.h Fri Jun 10 00:00:25 2016 (r301772) @@ -28,7 +28,7 @@ */ /* - * API for writting an Active Queue Management algorithm for Dummynet + * API for writing an Active Queue Management algorithm for Dummynet * * $FreeBSD$ */ @@ -52,9 +52,9 @@ typedef int32_t aqm_stime_t; #define DN_AQM_MTAG_TS 55345 /* Macro for variable bounding */ -#define BOUND_VAR(x,l,h) (x < l? l : x > h? h : x) +#define BOUND_VAR(x,l,h) ((x) > (h)? (h) : ((x) > (l)? (x) : (l))) -/* sysctl variable to count number of droped packets */ +/* sysctl variable to count number of dropped packets */ extern unsigned long io_pkt_drop; /* Copied: stable/10/sys/netpfil/ipfw/dn_aqm_codel.c (from r300779, head/sys/netpfil/ipfw/dn_aqm_codel.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netpfil/ipfw/dn_aqm_codel.c Fri Jun 10 00:00:25 2016 (r301772, copy of r300779, head/sys/netpfil/ipfw/dn_aqm_codel.c) @@ -0,0 +1,444 @@ +/* + * Codel - The Controlled-Delay Active Queue Management algorithm. + * + * $FreeBSD$ + * + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from + * The Comcast Innovation Fund. + * Implemented by Rasool Al-Saadi + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ +#include +#include + +#include +#include /* ip_len, ip_off */ +#include /* ip_output(), IP_FORWARDING */ +#include +#include +#include /* various ether_* routines */ +#include /* for ip6_input, ip6_output prototypes */ +#include +#include + +#ifdef NEW_AQM +#include +#include +#include +#include +#include + +#define DN_AQM_CODEL 1 + +static struct dn_aqm codel_desc; + +/* default codel parameters */ +struct dn_aqm_codel_parms codel_sysctl = {5000 * AQM_TIME_1US, + 100000 * AQM_TIME_1US, 0}; + +static int +codel_sysctl_interval_handler(SYSCTL_HANDLER_ARGS) +{ + int error; + long value; + + value = codel_sysctl.interval; + value /= AQM_TIME_1US; + error = sysctl_handle_long(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (value < 1 || value > 100 * AQM_TIME_1S) + return (EINVAL); + codel_sysctl.interval = value * AQM_TIME_1US ; + return (0); +} + +static int +codel_sysctl_target_handler(SYSCTL_HANDLER_ARGS) +{ + int error; + long value; + + value = codel_sysctl.target; + value /= AQM_TIME_1US; + error = sysctl_handle_long(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + D("%ld", value); + if (value < 1 || value > 5 * AQM_TIME_1S) + return (EINVAL); + codel_sysctl.target = value * AQM_TIME_1US ; + return (0); +} + +/* defining Codel sysctl variables */ +SYSBEGIN(f4) + +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); +SYSCTL_DECL(_net_inet_ip_dummynet); +static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, + codel, CTLFLAG_RW, 0, "CODEL"); + +#ifdef SYSCTL_NODE +SYSCTL_PROC(_net_inet_ip_dummynet_codel, OID_AUTO, target, + CTLTYPE_LONG | CTLFLAG_RW, NULL, 0,codel_sysctl_target_handler, "L", + "CoDel target in microsecond"); + +SYSCTL_PROC(_net_inet_ip_dummynet_codel, OID_AUTO, interval, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Fri Jun 10 04:04:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54CA5B71943; Fri, 10 Jun 2016 04:04:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261C717DE; Fri, 10 Jun 2016 04:04:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A44tmw007434; Fri, 10 Jun 2016 04:04:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A44tuv007433; Fri, 10 Jun 2016 04:04:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606100404.u5A44tuv007433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Jun 2016 04:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301776 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 04:04:56 -0000 Author: kib Date: Fri Jun 10 04:04:55 2016 New Revision: 301776 URL: https://svnweb.freebsd.org/changeset/base/301776 Log: MFC r301278 Reduce number of iterations used for calibrating ICR read loop. MFC r301279: Record correct commit message for r301278. Modified: stable/10/sys/x86/x86/local_apic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/local_apic.c ============================================================================== --- stable/10/sys/x86/x86/local_apic.c Fri Jun 10 01:10:48 2016 (r301775) +++ stable/10/sys/x86/x86/local_apic.c Fri Jun 10 04:04:55 2016 (r301776) @@ -284,7 +284,7 @@ lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 1000000 +#define LOOPS 100000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which @@ -440,7 +440,7 @@ lapic_setup(int boot) /* Program the CMCI LVT entry if present. */ if (maxlvt >= APIC_LVT_CMCI) lapic->lvt_cmci = lvt_mode(la, APIC_LVT_CMCI, lapic->lvt_cmci); - + intr_restore(saveintr); } @@ -1363,7 +1363,7 @@ static void apic_setup_local(void *dummy __unused) { int retval; - + if (best_enum == NULL) return; From owner-svn-src-stable-10@freebsd.org Fri Jun 10 13:57:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D52AB703DF; Fri, 10 Jun 2016 13:57:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A84A14E3; Fri, 10 Jun 2016 13:57:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ADvuht026471; Fri, 10 Jun 2016 13:57:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ADvuGX026470; Fri, 10 Jun 2016 13:57:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101357.u5ADvuGX026470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 13:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301780 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 13:57:57 -0000 Author: ngie Date: Fri Jun 10 13:57:56 2016 New Revision: 301780 URL: https://svnweb.freebsd.org/changeset/base/301780 Log: MFC r299387: r299387 (by cem): netipsec: Fix minor style nit Coverity points out that 'continue' is equivalent to 'break' in a do {} while(false) loop. CID: 1354983 Modified: stable/10/sys/netipsec/key.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/key.c ============================================================================== --- stable/10/sys/netipsec/key.c Fri Jun 10 08:33:15 2016 (r301779) +++ stable/10/sys/netipsec/key.c Fri Jun 10 13:57:56 2016 (r301780) @@ -346,7 +346,7 @@ do { \ if ((head) != (sav)) { \ ipseclog((LOG_DEBUG, "%s: state mismatched (TREE=%d SA=%d)\n", \ (name), (head), (sav))); \ - continue; \ + break; \ } \ } while (0) From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:08:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 829C7B70868; Fri, 10 Jun 2016 14:08:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 539041D93; Fri, 10 Jun 2016 14:08:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AE8fjE030400; Fri, 10 Jun 2016 14:08:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AE8fKA030399; Fri, 10 Jun 2016 14:08:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101408.u5AE8fKA030399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301782 - stable/10/sbin/fsck_ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:08:42 -0000 Author: ngie Date: Fri Jun 10 14:08:41 2016 New Revision: 301782 URL: https://svnweb.freebsd.org/changeset/base/301782 Log: MFC r299460: r299460 (by cem): fsck_ffs: Don't overrun mount device buffer Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a non-global device name, check that we do not overrun the f_mntfromname buffer. In this case, truncating (with strlcpy or similar) would not be useful, since the f_mntfromname result of getmntpt() is passed directly to open(2) later. CID: 1006789 Modified: stable/10/sbin/fsck_ffs/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_ffs/main.c ============================================================================== --- stable/10/sbin/fsck_ffs/main.c Fri Jun 10 14:06:16 2016 (r301781) +++ stable/10/sbin/fsck_ffs/main.c Fri Jun 10 14:08:41 2016 (r301782) @@ -644,6 +644,9 @@ getmntpt(const char *name) statfsp = &mntbuf[i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, ddevname); strcpy(statfsp->f_mntfromname, device); From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:13:26 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41818B70B17; Fri, 10 Jun 2016 14:13:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8CF1346; Fri, 10 Jun 2016 14:13:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEDPLq033907; Fri, 10 Jun 2016 14:13:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEDPTu033906; Fri, 10 Jun 2016 14:13:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101413.u5AEDPTu033906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301784 - stable/10/usr.sbin/makefs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:13:26 -0000 Author: ngie Date: Fri Jun 10 14:13:24 2016 New Revision: 301784 URL: https://svnweb.freebsd.org/changeset/base/301784 Log: MFC r299461: r299461 (by cem): ffs_bswap: Copy one UFS dinode member at a time No functional change. CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:10:51 2016 (r301783) +++ stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:13:24 2016 (r301784) @@ -135,7 +135,8 @@ ffs_dinode1_swap(struct ufs1_dinode *o, n->di_mtimensec = bswap32(o->di_mtimensec); n->di_ctime = bswap32(o->di_ctime); n->di_ctimensec = bswap32(o->di_ctimensec); - memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); n->di_flags = bswap32(o->di_flags); n->di_blocks = bswap32(o->di_blocks); n->di_gen = bswap32(o->di_gen); @@ -165,7 +166,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, n->di_kernflags = bswap32(o->di_kernflags); n->di_flags = bswap32(o->di_flags); n->di_extsize = bswap32(o->di_extsize); - memcpy(n->di_extb, o->di_extb, (NXADDR + NDADDR + NIADDR) * 8); + memcpy(n->di_extb, o->di_extb, sizeof(n->di_extb)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); } void From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:31:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 606F3B710FA; Fri, 10 Jun 2016 14:31:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D7ED11BE; Fri, 10 Jun 2016 14:31:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEV3RS038456; Fri, 10 Jun 2016 14:31:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEV3pH038455; Fri, 10 Jun 2016 14:31:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101431.u5AEV3pH038455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301786 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:31:04 -0000 Author: ngie Date: Fri Jun 10 14:31:03 2016 New Revision: 301786 URL: https://svnweb.freebsd.org/changeset/base/301786 Log: MFC r299489: r299489 (by cem): camcontrol(8): Fix trival double-free CID: 1331223 Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Fri Jun 10 14:27:56 2016 (r301785) +++ stable/10/sbin/camcontrol/camcontrol.c Fri Jun 10 14:31:03 2016 (r301786) @@ -4992,6 +4992,7 @@ dev_has_vpd_page(struct cam_device *dev, if (cam_send_ccb(dev, ccb) < 0) { cam_freeccb(ccb); + ccb = NULL; retval = -1; goto bailout; } From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:33:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C4F1B711C6; Fri, 10 Jun 2016 14:33:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39507174B; Fri, 10 Jun 2016 14:33:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEXLiS041840; Fri, 10 Jun 2016 14:33:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEXLmg041839; Fri, 10 Jun 2016 14:33:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101433.u5AEXLmg041839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301788 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:33:22 -0000 Author: ngie Date: Fri Jun 10 14:33:21 2016 New Revision: 301788 URL: https://svnweb.freebsd.org/changeset/base/301788 Log: MFC r299490: r299490 (by cem): camcontrol(8): Fix another trivial double-free CID: 1331222 Modified: stable/10/sbin/camcontrol/fwdownload.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/10/sbin/camcontrol/fwdownload.c Fri Jun 10 14:31:59 2016 (r301787) +++ stable/10/sbin/camcontrol/fwdownload.c Fri Jun 10 14:33:21 2016 (r301788) @@ -488,6 +488,7 @@ fw_validate_ibm(struct cam_device *dev, CAM_EPF_ALL, stderr); cam_freeccb(ccb); + ccb = NULL; goto bailout; } @@ -549,7 +550,8 @@ fw_validate_ibm(struct cam_device *dev, fprintf(stdout, "Firmware file is valid for this drive.\n"); retval = 0; bailout: - cam_freeccb(ccb); + if (ccb != NULL) + cam_freeccb(ccb); return (retval); } From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:40:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3CBB712D9; Fri, 10 Jun 2016 14:40:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE411A50; Fri, 10 Jun 2016 14:40:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEefm6042806; Fri, 10 Jun 2016 14:40:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEefB0042805; Fri, 10 Jun 2016 14:40:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101440.u5AEefB0042805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301789 - stable/10/usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:40:42 -0000 Author: ngie Date: Fri Jun 10 14:40:41 2016 New Revision: 301789 URL: https://svnweb.freebsd.org/changeset/base/301789 Log: MFC r299491: r299491 (by cem): route6d(8): Fix potential double-free In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. CID: 272537 Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Fri Jun 10 14:33:21 2016 (r301788) +++ stable/10/usr.sbin/route6d/route6d.c Fri Jun 10 14:40:41 2016 (r301789) @@ -2602,8 +2602,10 @@ krtread(int again) sleep(1); retry++; errmsg = NULL; - if (buf) + if (buf) { free(buf); + buf = NULL; + } if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:45:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE135B71575; Fri, 10 Jun 2016 14:45:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF5DD110E; Fri, 10 Jun 2016 14:45:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEjKfU048254; Fri, 10 Jun 2016 14:45:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEjKfm048253; Fri, 10 Jun 2016 14:45:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101445.u5AEjKfm048253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301791 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:45:22 -0000 Author: ngie Date: Fri Jun 10 14:45:20 2016 New Revision: 301791 URL: https://svnweb.freebsd.org/changeset/base/301791 Log: MFC r299494: r299494 (by cem): subr_vmem: Fix double-free in error case of vmem_create If vmem_init() fails, 'vm' is already destroyed and freed. Don't free it again. CID: 1042110 Modified: stable/10/sys/kern/subr_vmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:42:36 2016 (r301790) +++ stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:45:20 2016 (r301791) @@ -1046,10 +1046,8 @@ vmem_create(const char *name, vmem_addr_ if (vm == NULL) return (NULL); if (vmem_init(vm, name, base, size, quantum, qcache_max, - flags) == NULL) { - free(vm, M_VMEM); + flags) == NULL) return (NULL); - } return (vm); } From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:48:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29DC1B71637; Fri, 10 Jun 2016 14:48:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBAD01493; Fri, 10 Jun 2016 14:48:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEmBvd048416; Fri, 10 Jun 2016 14:48:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEmBWD048415; Fri, 10 Jun 2016 14:48:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101448.u5AEmBWD048415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301792 - stable/10/crypto/heimdal/lib/krb5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:48:12 -0000 Author: ngie Date: Fri Jun 10 14:48:10 2016 New Revision: 301792 URL: https://svnweb.freebsd.org/changeset/base/301792 Log: MFC r299495: r299495 (by cem): libkrb5: Fix potential double-free If krb5_make_principal fails, tmp_creds.server may remain a pointer to freed memory and then be double-freed. After freeing it the first time, initialize it to NULL, which causes subsequent krb5_free_principal calls to do the right thing. CID: 1273430 Modified: stable/10/crypto/heimdal/lib/krb5/get_cred.c Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/heimdal/lib/krb5/get_cred.c ============================================================================== --- stable/10/crypto/heimdal/lib/krb5/get_cred.c Fri Jun 10 14:45:20 2016 (r301791) +++ stable/10/crypto/heimdal/lib/krb5/get_cred.c Fri Jun 10 14:48:10 2016 (r301792) @@ -831,6 +831,7 @@ get_cred_kdc_capath_worker(krb5_context if(strcmp(tgt_inst, server_realm) == 0) break; krb5_free_principal(context, tmp_creds.server); + tmp_creds.server = NULL; ret = krb5_make_principal(context, &tmp_creds.server, tgt_inst, KRB5_TGS_NAME, server_realm, NULL); if(ret) { From owner-svn-src-stable-10@freebsd.org Fri Jun 10 14:51:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6886EB716C2; Fri, 10 Jun 2016 14:51:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A89E18D5; Fri, 10 Jun 2016 14:51:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEpBDF049179; Fri, 10 Jun 2016 14:51:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEpBC5049178; Fri, 10 Jun 2016 14:51:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101451.u5AEpBC5049178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301793 - stable/10/contrib/atf/atf-c/detail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:51:12 -0000 Author: ngie Date: Fri Jun 10 14:51:11 2016 New Revision: 301793 URL: https://svnweb.freebsd.org/changeset/base/301793 Log: MFC r299496: r299496 (by cem): atf map: Fix double-free in low memory error path If atf_list_append(, X, ) fails, X is freed. Don't free it again. CID: 979936 Modified: stable/10/contrib/atf/atf-c/detail/map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-c/detail/map.c ============================================================================== --- stable/10/contrib/atf/atf-c/detail/map.c Fri Jun 10 14:48:10 2016 (r301792) +++ stable/10/contrib/atf/atf-c/detail/map.c Fri Jun 10 14:51:11 2016 (r301793) @@ -360,7 +360,6 @@ atf_map_insert(atf_map_t *m, const char if (atf_is_error(err)) { if (managed) free(value); - free(me); } } } else { From owner-svn-src-stable-10@freebsd.org Fri Jun 10 15:03:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1DBFB71AAF; Fri, 10 Jun 2016 15:03:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3B93117C; Fri, 10 Jun 2016 15:03:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AF3JgC055614; Fri, 10 Jun 2016 15:03:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AF3JF1055613; Fri, 10 Jun 2016 15:03:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606101503.u5AF3JF1055613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Jun 2016 15:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301795 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:03:20 -0000 Author: cy Date: Fri Jun 10 15:03:18 2016 New Revision: 301795 URL: https://svnweb.freebsd.org/changeset/base/301795 Log: MFC r301295: Enable daily_ntpd_leapfile_enable by default. Otherwise an expired leapfile will be ignored and ntpd will behave as if it has no leapfile. While here, remove an extraneous blank line. Suggested by: ache Modified: stable/10/etc/defaults/periodic.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/periodic.conf ============================================================================== --- stable/10/etc/defaults/periodic.conf Fri Jun 10 14:59:11 2016 (r301794) +++ stable/10/etc/defaults/periodic.conf Fri Jun 10 15:03:18 2016 (r301795) @@ -139,9 +139,8 @@ daily_status_mail_rejects_logs=3 # How daily_status_mail_rejects_shorten="NO" # Shorten output # 480.leapfile-ntpd -daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting - # leapfile sources # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status From owner-svn-src-stable-10@freebsd.org Fri Jun 10 15:42:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEB4B715FF; Fri, 10 Jun 2016 15:42:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 313F51814; Fri, 10 Jun 2016 15:42:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AFgHP6070263; Fri, 10 Jun 2016 15:42:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AFgHks070262; Fri, 10 Jun 2016 15:42:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101542.u5AFgHks070262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 15:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301798 - stable/10/lib/libc/tests/nss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:42:18 -0000 Author: ngie Date: Fri Jun 10 15:42:17 2016 New Revision: 301798 URL: https://svnweb.freebsd.org/changeset/base/301798 Log: MFC r299502: r299502 (by cem): nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliases h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not a valid way to determine its end; instead, check for NULL. CID: 1346578 Modified: stable/10/lib/libc/tests/nss/gethostby_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- stable/10/lib/libc/tests/nss/gethostby_test.c Fri Jun 10 15:05:35 2016 (r301797) +++ stable/10/lib/libc/tests/nss/gethostby_test.c Fri Jun 10 15:42:17 2016 (r301798) @@ -893,7 +893,7 @@ hostent_test_getnameinfo_eq(struct hoste printf("matched official hostname\n"); #endif } else { - for (i = 0; i < nitems(result->h_aliases); i++) { + for (i = 0; result->h_aliases[i] != NULL; i++) { printf("[%d] resolved: %s\n", i, result->h_aliases[i]); if (strcmp(result->h_aliases[i], From owner-svn-src-stable-10@freebsd.org Fri Jun 10 15:47:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72918B71714; Fri, 10 Jun 2016 15:47:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 356491B0C; Fri, 10 Jun 2016 15:47:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AFlKOg070517; Fri, 10 Jun 2016 15:47:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AFlKdU070516; Fri, 10 Jun 2016 15:47:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101547.u5AFlKdU070516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 15:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301799 - stable/10/sys/dev/sound/pci/hda X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:47:21 -0000 Author: ngie Date: Fri Jun 10 15:47:20 2016 New Revision: 301799 URL: https://svnweb.freebsd.org/changeset/base/301799 Log: MFC r299503,r299504: r299503 (by cem): snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter None of the sysctl handlers in hdaa use the arg2 parameter, so just pass zero instead. Additionally, the sizes being passed in were suspect (size of the pointer rather than the value). CIDs: 1007694, 1009679 r299504 (by cem): snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter (again) More of the same sort of issue as r299503, just missed some sysctls added in a different place than the others. CIDs: 1007692, 1009677, 1009678 Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa.c Fri Jun 10 15:42:17 2016 (r301798) +++ stable/10/sys/dev/sound/pci/hda/hdaa.c Fri Jun 10 15:47:20 2016 (r301799) @@ -1553,20 +1553,20 @@ hdaa_widget_parse(struct hdaa_widget *w) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - w, sizeof(w), hdaa_sysctl_caps, "A", "Node capabilities"); + w, 0, hdaa_sysctl_caps, "A", "Node capabilities"); if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { snprintf(buf, sizeof(buf), "nid%d_config", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &w->wclass.pin.newconf, sizeof(&w->wclass.pin.newconf), - hdaa_sysctl_config, "A", "Current pin configuration"); + &w->wclass.pin.newconf, 0, hdaa_sysctl_config, "A", + "Current pin configuration"); snprintf(buf, sizeof(buf), "nid%d_original", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - &w->wclass.pin.original, sizeof(&w->wclass.pin.original), - hdaa_sysctl_config, "A", "Original pin configuration"); + &w->wclass.pin.original, 0, hdaa_sysctl_config, "A", + "Original pin configuration"); } hdaa_lock(w->devinfo); } @@ -6641,38 +6641,32 @@ hdaa_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &devinfo->newquirks, sizeof(&devinfo->newquirks), - hdaa_sysctl_quirks, "A", "Configuration options"); + &devinfo->newquirks, 0, hdaa_sysctl_quirks, "A", + "Configuration options"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpi_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpi_state, "A", "GPI state"); + devinfo, 0, hdaa_sysctl_gpi_state, "A", "GPI state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_state, "A", "GPIO state"); + devinfo, 0, hdaa_sysctl_gpio_state, "A", "GPIO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_config, "A", "GPIO configuration"); + devinfo, 0, hdaa_sysctl_gpio_config, "A", "GPIO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_state, "A", "GPO state"); + devinfo, 0, hdaa_sysctl_gpo_state, "A", "GPO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_config, "A", "GPO configuration"); + devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, - dev, sizeof(dev), - hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); bus_generic_attach(dev); return (0); } From owner-svn-src-stable-10@freebsd.org Fri Jun 10 17:57:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E016AD9BC6; Fri, 10 Jun 2016 17:57:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1262D290F; Fri, 10 Jun 2016 17:57:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AHvohi018521; Fri, 10 Jun 2016 17:57:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AHvoU8018520; Fri, 10 Jun 2016 17:57:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101757.u5AHvoU8018520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 17:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301801 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 17:57:51 -0000 Author: ngie Date: Fri Jun 10 17:57:50 2016 New Revision: 301801 URL: https://svnweb.freebsd.org/changeset/base/301801 Log: MFC r300836: Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. CID: 1007338, 1007339, 1007340 Modified: stable/10/sys/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc_vc.c ============================================================================== --- stable/10/sys/rpc/svc_vc.c Fri Jun 10 17:53:28 2016 (r301800) +++ stable/10/sys/rpc/svc_vc.c Fri Jun 10 17:57:50 2016 (r301801) @@ -189,11 +189,11 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCKBUF_UNLOCK(&so->so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + return (NULL); } @@ -203,8 +203,8 @@ cleanup_svc_vc_create: SVCXPRT * svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) { - SVCXPRT *xprt = NULL; - struct cf_conn *cd = NULL; + SVCXPRT *xprt; + struct cf_conn *cd; struct sockaddr* sa = NULL; struct sockopt opt; int one = 1; @@ -279,12 +279,10 @@ svc_vc_create_conn(SVCPOOL *pool, struct return (xprt); cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:02:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47B56AD9E18; Fri, 10 Jun 2016 18:02:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F30112E09; Fri, 10 Jun 2016 18:02:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AI2qUl022034; Fri, 10 Jun 2016 18:02:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AI2qYm022033; Fri, 10 Jun 2016 18:02:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101802.u5AI2qYm022033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301803 - stable/10/usr.sbin/rtadvd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:02:53 -0000 Author: ngie Date: Fri Jun 10 18:02:51 2016 New Revision: 301803 URL: https://svnweb.freebsd.org/changeset/base/301803 Log: MFC r299507: r299507 (by cem): rtadvd(8): Fix a typo in full msg receive logic Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Modified: stable/10/usr.sbin/rtadvd/control.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/control.c ============================================================================== --- stable/10/usr.sbin/rtadvd/control.c Fri Jun 10 17:59:30 2016 (r301802) +++ stable/10/usr.sbin/rtadvd/control.c Fri Jun 10 18:02:51 2016 (r301803) @@ -59,7 +59,7 @@ int cm_recv(int fd, char *buf) { - int n; + ssize_t n; struct ctrl_msg_hdr *cm; char *msg; struct pollfd pfds[1]; @@ -98,7 +98,7 @@ cm_recv(int fd, char *buf) } } - if (n != sizeof(*cm)) { + if (n != (ssize_t)sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); goto cm_recv_err; @@ -123,11 +123,11 @@ cm_recv(int fd, char *buf) "<%s> ctrl msg received: type=%d", __func__, cm->cm_type); - if (cm->cm_len > sizeof(cm)) { - int msglen = cm->cm_len - sizeof(*cm); + if (cm->cm_len > sizeof(*cm)) { + size_t msglen = cm->cm_len - sizeof(*cm); syslog(LOG_DEBUG, - "<%s> ctrl msg has payload (len=%d)", __func__, + "<%s> ctrl msg has payload (len=%zu)", __func__, msglen); for (;;) { @@ -153,7 +153,7 @@ cm_recv(int fd, char *buf) } break; } - if (n != msglen) { + if (n != (ssize_t)msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); goto cm_recv_err; From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:07:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB1EAD9F5A; Fri, 10 Jun 2016 18:07:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB4D20EB; Fri, 10 Jun 2016 18:07:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AI7Z2m022316; Fri, 10 Jun 2016 18:07:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AI7ZXu022315; Fri, 10 Jun 2016 18:07:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101807.u5AI7ZXu022315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301805 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:07:36 -0000 Author: ngie Date: Fri Jun 10 18:07:35 2016 New Revision: 301805 URL: https://svnweb.freebsd.org/changeset/base/301805 Log: MFC r299508: r299508 (by cem): kern_descrip_test: Fix trivial buffer overrun with readlink(2) CID: 1229965, 1229972 Modified: stable/10/tests/sys/kern/kern_descrip_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/kern_descrip_test.c ============================================================================== --- stable/10/tests/sys/kern/kern_descrip_test.c Fri Jun 10 18:04:54 2016 (r301804) +++ stable/10/tests/sys/kern/kern_descrip_test.c Fri Jun 10 18:07:35 2016 (r301805) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -170,7 +171,7 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, char buf[80]; if ((n = readlink(VALUE, buf, sizeof(buf))) > 0) { - buf[n] = '\0'; + buf[MIN((size_t)n, sizeof(buf) - 1)] = '\0'; if (sscanf(buf, "%d", &oldmaxfiles) == 1) { oldlen = sizeof(oldmaxfiles); (void) sysctlbyname("kern.maxfiles", NULL, 0, From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:10:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EF9CADA002; Fri, 10 Jun 2016 18:10:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3E3422BB; Fri, 10 Jun 2016 18:10:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIAXwq022495; Fri, 10 Jun 2016 18:10:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIAX86022494; Fri, 10 Jun 2016 18:10:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101810.u5AIAX86022494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301806 - stable/10/lib/libmp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:10:34 -0000 Author: ngie Date: Fri Jun 10 18:10:32 2016 New Revision: 301806 URL: https://svnweb.freebsd.org/changeset/base/301806 Log: MFC r299510: r299510 (by cem): libmp: Fix trivial buffer overrun fgetln yields a non-NUL-terminated buffer and its length. This routine attempted to NUL-terminate it, but did not allocate space for the NUL. So, allocate space for the NUL. CID: 1017457 Modified: stable/10/lib/libmp/mpasbn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmp/mpasbn.c ============================================================================== --- stable/10/lib/libmp/mpasbn.c Fri Jun 10 18:07:35 2016 (r301805) +++ stable/10/lib/libmp/mpasbn.c Fri Jun 10 18:10:32 2016 (r301806) @@ -286,10 +286,10 @@ mp_min(MINT *mp) line = fgetln(stdin, &linelen); if (line == NULL) MPERR(("min")); - nline = malloc(linelen); + nline = malloc(linelen + 1); if (nline == NULL) MPERR(("min")); - strncpy(nline, line, linelen); + memcpy(nline, line, linelen); nline[linelen] = '\0'; rmp = _dtom("min", nline); _movem("min", rmp, mp); From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:13:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16041ADA312; Fri, 10 Jun 2016 18:13:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA1C928EB; Fri, 10 Jun 2016 18:13:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIDgff025914; Fri, 10 Jun 2016 18:13:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIDgWw025913; Fri, 10 Jun 2016 18:13:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101813.u5AIDgWw025913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301808 - stable/10/lib/libc/tests/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:13:43 -0000 Author: ngie Date: Fri Jun 10 18:13:41 2016 New Revision: 301808 URL: https://svnweb.freebsd.org/changeset/base/301808 Log: MFC r299511: r299511 (by cem): print_positional_test: Fix misuse of wchar APIs These APIs take unit length, not byte length parameters. CIDs: 1338543, 1338544, 1338545 Modified: stable/10/lib/libc/tests/stdio/print_positional_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/print_positional_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/print_positional_test.c Fri Jun 10 18:12:11 2016 (r301807) +++ stable/10/lib/libc/tests/stdio/print_positional_test.c Fri Jun 10 18:13:41 2016 (r301808) @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -94,7 +95,7 @@ ATF_TC_WITHOUT_HEAD(positional_wide); ATF_TC_BODY(positional_wide, tc) { - swprintf(wbuf1, sizeof wbuf1, + swprintf(wbuf1, nitems(wbuf1), L"|xx %1$s %2$s %3$s %4$s\n" "|xx %5$s %6$s %7$s %8$s\n" "|xx %9$s %10$s %11$s %12$s\n" @@ -117,7 +118,7 @@ ATF_TC_BODY(positional_wide, tc) "43", "44", 45, -1L, 1LL, -1, 1LL ); temp = correct; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } @@ -139,7 +140,7 @@ ATF_TC_BODY(positional_precision_wide, t swprintf(wbuf1, sizeof buf, L"%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); temp = correct2; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:21:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CFDDADA434; Fri, 10 Jun 2016 18:21:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 169BC2B73; Fri, 10 Jun 2016 18:21:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIL6h1026272; Fri, 10 Jun 2016 18:21:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIL6bX026270; Fri, 10 Jun 2016 18:21:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101821.u5AIL6bX026270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301809 - stable/10/usr.sbin/rtadvd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:21:07 -0000 Author: ngie Date: Fri Jun 10 18:21:05 2016 New Revision: 301809 URL: https://svnweb.freebsd.org/changeset/base/301809 Log: MFC r299513,r299515: r299513 (by cem): rtadvd(8): Don't use-after-free This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. CID: 1006079 r299515 (by cem): rtadvd(8): Fix use-after-close in cm_handler_client cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. CID: 1006078 Modified: stable/10/usr.sbin/rtadvd/config.c stable/10/usr.sbin/rtadvd/control_client.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/config.c ============================================================================== --- stable/10/usr.sbin/rtadvd/config.c Fri Jun 10 18:13:41 2016 (r301808) +++ stable/10/usr.sbin/rtadvd/config.c Fri Jun 10 18:21:05 2016 (r301809) @@ -229,7 +229,6 @@ rm_ifinfo(struct ifinfo *ifi) TAILQ_REMOVE(&ifilist, ifi, ifi_next); syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", __func__, ifi->ifi_ifindex); - free(ifi); } else { /* recreate an empty entry */ update_persist_ifinfo(&ifilist, ifi->ifi_ifname); @@ -273,6 +272,8 @@ rm_ifinfo(struct ifinfo *ifi) } syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); + if (!ifi->ifi_persist) + free(ifi); return (0); } Modified: stable/10/usr.sbin/rtadvd/control_client.c ============================================================================== --- stable/10/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:13:41 2016 (r301808) +++ stable/10/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:21:05 2016 (r301809) @@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, cha case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; error = cm_send(fd, buf); - if (error) + if (error) { syslog(LOG_WARNING, "<%s> cm_send()", __func__); + return (-1); + } state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:34:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4969ADA943; Fri, 10 Jun 2016 18:34:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A89542586; Fri, 10 Jun 2016 18:34:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIYVJK033954; Fri, 10 Jun 2016 18:34:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIYVDm033950; Fri, 10 Jun 2016 18:34:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101834.u5AIYVDm033950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301811 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:34:33 -0000 Author: ngie Date: Fri Jun 10 18:34:31 2016 New Revision: 301811 URL: https://svnweb.freebsd.org/changeset/base/301811 Log: MFC r295618,r300100,r300531: r295618 (by cem): NTB: workaround for high traffic hardware hang This patch comes from Dave Jiang's Linux tree, davejiang/ntb. It hasn't been accepted into Linus' tree, so I do not have an authoritative SHA1 to point at. Original commit log: ===================================================================== A hardware errata causes the NTB to hang when heavy bi-directional traffic in addition to the usage of BAR0/1 (where the registers reside, including the doorbell registers to trigger interrupts). This workaround is only available on Haswell and Broadwell platform. The workaround is to enable split BAR in the BIOS to allow the 64bit BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed to LAPIC region of the remote host. We will bypass the db mechanism and directly trigger the MSIX interrupts. The offsets and vectors are exchanged during transport scratch pad negotiation. The scratch pads are now overloaded in order to allow the exchange of the information. This gets around using the doorbell and prevents the lockup with additional pcode changes in BIOS. Signed-off-by: Dave Jiang ===================================================================== Notable changes in the FreeBSD version of this patch: * The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx). The Linux version of the patch only uses BAR4. * MSIX negotiation aborts if the link goes down. Obtained from: Linux (Dual BSD/GPL driver) r300100 (by cem): ntb_hw(4): Add sysctls for administrative/test link config, state dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN. dev.ntb_hw.0.active=0/1: Like ifconfig 'status' r300531 (by cem): ntb_hw(4): Only record the first three MSIX vectors Don't overrun the msix_data array by reading the (unused) link state interrupt information. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 10 18:34:31 2016 (r301811) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -42,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +73,19 @@ __FBSDID("$FreeBSD$"); #define DEVICE2SOFTC(dev) ((struct ntb_softc *) device_get_softc(dev)) +#define NTB_MSIX_VER_GUARD 0xaabbccdd +#define NTB_MSIX_RECEIVED 0xe0f0e0f0 +#define ONE_MB (1024u * 1024) + +/* + * PCI constants could be somewhere more generic, but aren't defined/used in + * pci.c. + */ +#define PCI_MSIX_ENTRY_SIZE 16 +#define PCI_MSIX_ENTRY_LOWER_ADDR 0 +#define PCI_MSIX_ENTRY_UPPER_ADDR 4 +#define PCI_MSIX_ENTRY_DATA 8 + enum ntb_device_type { NTB_XEON, NTB_ATOM @@ -95,6 +111,18 @@ enum ntb_bar { NTB_MAX_BARS }; +enum { + NTB_MSIX_GUARD = 0, + NTB_MSIX_DATA0, + NTB_MSIX_DATA1, + NTB_MSIX_DATA2, + NTB_MSIX_OFS0, + NTB_MSIX_OFS1, + NTB_MSIX_OFS2, + NTB_MSIX_DONE, + NTB_MAX_MSIX_SPAD +}; + /* Device features and workarounds */ #define HAS_FEATURE(feature) \ ((ntb->features & (feature)) != 0) @@ -131,6 +159,7 @@ struct ntb_int_info { struct ntb_vec { struct ntb_softc *ntb; uint32_t num; + unsigned masked; }; struct ntb_reg { @@ -169,6 +198,11 @@ struct ntb_b2b_addr { uint64_t bar5_addr32; }; +struct ntb_msix_data { + uint32_t nmd_ofs; + uint32_t nmd_data; +}; + struct ntb_softc { device_t device; enum ntb_device_type type; @@ -178,6 +212,13 @@ struct ntb_softc { struct ntb_int_info int_info[MAX_MSIX_INTERRUPTS]; uint32_t allocated_interrupts; + struct ntb_msix_data peer_msix_data[XEON_NONLINK_DB_MSIX_BITS]; + struct ntb_msix_data msix_data[XEON_NONLINK_DB_MSIX_BITS]; + bool peer_msix_good; + bool peer_msix_done; + struct ntb_pci_bar_info *peer_lapic_bar; + struct callout peer_msix_work; + struct callout heartbeat_timer; struct callout lr_timer; @@ -198,6 +239,7 @@ struct ntb_softc { /* Memory window used to access peer bar0 */ #define B2B_MW_DISABLED UINT8_MAX uint8_t b2b_mw_idx; + uint8_t msix_mw_idx; uint8_t mw_count; uint8_t spad_count; @@ -292,6 +334,8 @@ static inline void db_iowrite(struct ntb static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); static void ntb_free_msix_vec(struct ntb_softc *ntb); +static void ntb_get_msix_info(struct ntb_softc *ntb); +static void ntb_exchange_msix(void *); static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); static void ntb_detect_max_mw(struct ntb_softc *ntb); static int ntb_detect_xeon(struct ntb_softc *ntb); @@ -308,7 +352,9 @@ static void xeon_set_pbar_xlat(struct nt enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); +static int xeon_setup_msix_bar(struct ntb_softc *); static inline bool link_is_up(struct ntb_softc *ntb); +static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); static inline enum ntb_speed ntb_link_sta_speed(struct ntb_softc *); static inline enum ntb_width ntb_link_sta_width(struct ntb_softc *); @@ -319,6 +365,8 @@ static bool ntb_poll_link(struct ntb_sof static void save_bar_parameters(struct ntb_pci_bar_info *bar); static void ntb_sysctl_init(struct ntb_softc *); static int sysctl_handle_features(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS); static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS); static int sysctl_handle_register(SYSCTL_HANDLER_ARGS); @@ -397,6 +445,13 @@ ntb_vm_memattr_to_str(vm_memattr_t pat) } } +static int g_ntb_msix_idx = 0; +SYSCTL_INT(_hw_ntb, OID_AUTO, msix_mw_idx, CTLFLAG_RDTUN, &g_ntb_msix_idx, + 0, "Use this memory window to access the peer MSIX message complex on " + "certain Xeon-based NTB systems, as a workaround for a hardware errata. " + "Like b2b_mw_idx, negative values index from the last available memory " + "window. (Applies on Xeon platforms with SB01BASE_LOCKUP errata.)"); + static int g_ntb_mw_idx = -1; TUNABLE_INT("hw.ntb.b2b_mw_idx", &g_ntb_mw_idx); SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTUN, &g_ntb_mw_idx, @@ -604,10 +659,12 @@ ntb_attach(device_t device) ntb->type = p->type; ntb->features = p->features; ntb->b2b_mw_idx = B2B_MW_DISABLED; + ntb->msix_mw_idx = B2B_MW_DISABLED; /* Heartbeat timer for NTB_ATOM since there is no link interrupt */ callout_init(&ntb->heartbeat_timer, CALLOUT_MPSAFE); callout_init(&ntb->lr_timer, CALLOUT_MPSAFE); + callout_init(&ntb->peer_msix_work, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_DEF); @@ -632,6 +689,8 @@ ntb_attach(device_t device) if (error != 0) goto out; + ntb_spad_clear(ntb); + ntb_poll_link(ntb); ntb_sysctl_init(ntb); @@ -649,10 +708,14 @@ ntb_detach(device_t device) ntb = DEVICE2SOFTC(device); - if (ntb->self_reg != NULL) - ntb_db_set_mask(ntb, ntb->db_valid_mask); + if (ntb->self_reg != NULL) { + DB_MASK_LOCK(ntb); + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_valid_mask); + DB_MASK_UNLOCK(ntb); + } callout_drain(&ntb->heartbeat_timer); callout_drain(&ntb->lr_timer); + callout_drain(&ntb->peer_msix_work); pci_disable_busmaster(ntb->device); if (ntb->type == NTB_XEON) ntb_teardown_xeon(ntb); @@ -978,9 +1041,12 @@ ntb_init_isr(struct ntb_softc *ntb) ntb->last_ts = ticks; /* - * Mask all doorbell interrupts. + * Mask all doorbell interrupts. (Except link events!) */ - ntb_db_set_mask(ntb, ntb->db_valid_mask); + DB_MASK_LOCK(ntb); + ntb->db_mask = ntb->db_valid_mask; + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + DB_MASK_UNLOCK(ntb); num_vectors = desired_vectors = MIN(pci_msix_count(ntb->device), ntb->db_count); @@ -1005,12 +1071,28 @@ ntb_init_isr(struct ntb_softc *ntb) num_vectors = 1; if (ntb->type == NTB_XEON && num_vectors < ntb->db_vec_count) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + device_printf(ntb->device, + "Errata workaround does not support MSI or INTX\n"); + return (EINVAL); + } + ntb->db_vec_count = 1; ntb->db_vec_shift = XEON_DB_TOTAL_SHIFT; rc = ntb_setup_legacy_interrupt(ntb); } else { + if (num_vectors - 1 != XEON_NONLINK_DB_MSIX_BITS && + HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + device_printf(ntb->device, + "Errata workaround expects %d doorbell bits\n", + XEON_NONLINK_DB_MSIX_BITS); + return (EINVAL); + } + ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); + if (rc == 0 && HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + ntb_get_msix_info(ntb); } if (rc != 0) { device_printf(ntb->device, @@ -1116,6 +1198,9 @@ void ntb_db_set_mask(struct ntb_softc *ntb, uint64_t bits) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return; + DB_MASK_LOCK(ntb); ntb->db_mask |= bits; db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); @@ -1131,6 +1216,9 @@ ntb_db_clear_mask(struct ntb_softc *ntb, (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return; + DB_MASK_LOCK(ntb); ntb->db_mask &= ~bits; db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); @@ -1141,6 +1229,18 @@ uint64_t ntb_db_read(struct ntb_softc *ntb) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + uint64_t res; + unsigned i; + + res = 0; + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if (ntb->msix_vec[i].masked != 0) + res |= ntb_db_vector_mask(ntb, i); + } + return (res); + } + return (db_ioread(ntb, ntb->self_reg->db_bell)); } @@ -1153,6 +1253,25 @@ ntb_db_clear(struct ntb_softc *ntb, uint (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + unsigned i; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((bits & ntb_db_vector_mask(ntb, i)) != 0) { + DB_MASK_LOCK(ntb); + if (ntb->msix_vec[i].masked != 0) { + /* XXX These need a public API. */ +#if 0 + pci_unmask_msix(ntb->device, i); +#endif + ntb->msix_vec[i].masked = 0; + } + DB_MASK_UNLOCK(ntb); + } + } + return; + } + db_iowrite(ntb, ntb->self_reg->db_bell, bits); } @@ -1179,6 +1298,19 @@ ntb_interrupt(struct ntb_softc *ntb, uin ntb_link_event(ntb); } + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + (vec_mask & ntb->db_link_mask) == 0) { + DB_MASK_LOCK(ntb); + if (ntb->msix_vec[vec].masked == 0) { + /* XXX These need a public API. */ +#if 0 + pci_mask_msix(ntb->device, vec); +#endif + ntb->msix_vec[vec].masked = 1; + } + DB_MASK_UNLOCK(ntb); + } + if ((vec_mask & ntb->db_valid_mask) != 0) ntb_db_event(ntb, vec); } @@ -1224,6 +1356,40 @@ ntb_free_msix_vec(struct ntb_softc *ntb) ntb->msix_vec = NULL; } +static void +ntb_get_msix_info(struct ntb_softc *ntb) +{ + struct pci_devinfo *dinfo; + struct pcicfg_msix *msix; + uint32_t laddr, data, i, offset; + + dinfo = device_get_ivars(ntb->device); + msix = &dinfo->cfg.msix; + + laddr = data = 0; + + CTASSERT(XEON_NONLINK_DB_MSIX_BITS == nitems(ntb->msix_data)); + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + offset = msix->msix_table_offset + i * PCI_MSIX_ENTRY_SIZE; + + laddr = bus_read_4(msix->msix_table_res, offset + + PCI_MSIX_ENTRY_LOWER_ADDR); + ntb_printf(2, "local lower MSIX addr(%u): 0x%x\n", i, laddr); + + KASSERT((laddr & MSI_INTEL_ADDR_BASE) == MSI_INTEL_ADDR_BASE, + ("local MSIX addr 0x%x not in MSI base 0x%x", laddr, + MSI_INTEL_ADDR_BASE)); + ntb->msix_data[i].nmd_ofs = laddr & ~MSI_INTEL_ADDR_BASE; + + data = bus_read_4(msix->msix_table_res, offset + + PCI_MSIX_ENTRY_DATA); + ntb_printf(2, "local MSIX data(%u): 0x%x\n", i, data); + + ntb->msix_data[i].nmd_data = data; + } +} + static struct ntb_hw_info * ntb_get_device_info(uint32_t device_id) { @@ -1276,9 +1442,12 @@ ntb_detect_xeon(struct ntb_softc *ntb) if ((ppd & XEON_PPD_SPLIT_BAR) != 0) ntb->features |= NTB_SPLIT_BAR; - /* SB01BASE_LOCKUP errata is a superset of SDOORBELL errata */ + /* + * SDOORBELL errata workaround gets in the way of SB01BASE_LOCKUP + * errata workaround; only do one at a time. + */ if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) - ntb->features |= NTB_SDOORBELL_LOCKUP; + ntb->features &= ~NTB_SDOORBELL_LOCKUP; conn_type = ppd & XEON_PPD_CONN_TYPE; switch (conn_type) { @@ -1342,19 +1511,28 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) ntb->peer_reg = &xeon_b2b_reg; ntb->xlat_reg = &xeon_sec_xlat; - /* - * There is a Xeon hardware errata related to writes to SDOORBELL or - * B2BDOORBELL in conjunction with inbound access to NTB MMIO space, - * which may hang the system. To workaround this, use a memory - * window to access the interrupt and scratch pad registers on the - * remote system. - */ - if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + ntb->msix_mw_idx = (ntb->mw_count + g_ntb_msix_idx) % + ntb->mw_count; + ntb_printf(2, "Setting up MSIX mw idx %d means %u\n", + g_ntb_msix_idx, ntb->msix_mw_idx); + rc = ntb_mw_set_wc_internal(ntb, ntb->msix_mw_idx, + VM_MEMATTR_UNCACHEABLE); + KASSERT(rc == 0, ("shouldn't fail")); + } else if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { + /* + * There is a Xeon hardware errata related to writes to SDOORBELL or + * B2BDOORBELL in conjunction with inbound access to NTB MMIO space, + * which may hang the system. To workaround this, use a memory + * window to access the interrupt and scratch pad registers on the + * remote system. + */ ntb->b2b_mw_idx = (ntb->mw_count + g_ntb_mw_idx) % ntb->mw_count; ntb_printf(2, "Setting up b2b mw idx %d means %u\n", g_ntb_mw_idx, ntb->b2b_mw_idx); - rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, VM_MEMATTR_UNCACHEABLE); + rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, + VM_MEMATTR_UNCACHEABLE); KASSERT(rc == 0, ("shouldn't fail")); } else if (HAS_FEATURE(NTB_B2BDOORBELL_BIT14)) /* @@ -1385,7 +1563,14 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) /* * Mask all doorbell interrupts. */ - ntb_db_set_mask(ntb, ntb->db_valid_mask); + DB_MASK_LOCK(ntb); + ntb->db_mask = ntb->db_valid_mask; + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + DB_MASK_UNLOCK(ntb); + + rc = xeon_setup_msix_bar(ntb); + if (rc != 0) + return (rc); rc = ntb_init_isr(ntb); return (rc); @@ -1489,6 +1674,15 @@ xeon_reset_sbar_size(struct ntb_softc *n bar_sz--; else bar_sz = 0; + } else if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) { + /* Restrict LAPIC BAR to 1MB */ + pci_write_config(ntb->device, bar->psz_off, 20, 1); + pci_write_config(ntb->device, bar->ssz_off, 20, 1); + bar_sz = pci_read_config(ntb->device, bar->psz_off, 1); + bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); + (void)bar_sz; + return; } pci_write_config(ntb->device, bar->ssz_off, bar_sz, 1); bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); @@ -1499,28 +1693,37 @@ static void xeon_set_sbar_base_and_limit(struct ntb_softc *ntb, uint64_t bar_addr, enum ntb_bar idx, enum ntb_bar regbar) { - uint64_t reg_val; + uint64_t reg_val, lmt_addr; uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); if (idx == regbar) bar_addr += ntb->b2b_off; + lmt_addr = bar_addr; + + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) + lmt_addr += ONE_MB; + /* + * Set limit registers first to avoid an errata where setting the base + * registers locks the limit registers. + */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, base_reg, bar_addr); - reg_val = ntb_reg_read(4, base_reg); + ntb_reg_write(4, lmt_reg, lmt_addr); + reg_val = ntb_reg_read(4, lmt_reg); (void)reg_val; - ntb_reg_write(4, lmt_reg, bar_addr); - reg_val = ntb_reg_read(4, lmt_reg); + ntb_reg_write(4, base_reg, bar_addr); + reg_val = ntb_reg_read(4, base_reg); (void)reg_val; } else { - ntb_reg_write(8, base_reg, bar_addr); - reg_val = ntb_reg_read(8, base_reg); + ntb_reg_write(8, lmt_reg, lmt_addr); + reg_val = ntb_reg_read(8, lmt_reg); (void)reg_val; - ntb_reg_write(8, lmt_reg, bar_addr); - reg_val = ntb_reg_read(8, lmt_reg); + ntb_reg_write(8, base_reg, bar_addr); + reg_val = ntb_reg_read(8, base_reg); (void)reg_val; } } @@ -1542,6 +1745,37 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb } static int +xeon_setup_msix_bar(struct ntb_softc *ntb) +{ + struct ntb_pci_bar_info *lapic_bar; + enum ntb_bar bar_num; + int rc; + + if (!HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return (0); + + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + lapic_bar = &ntb->bar_info[bar_num]; + + /* Restrict LAPIC BAR to 1MB */ + if (lapic_bar->size > ONE_MB) { + rc = bus_adjust_resource(ntb->device, SYS_RES_MEMORY, + lapic_bar->pci_resource, lapic_bar->pbase, + lapic_bar->pbase + ONE_MB - 1); + if (rc == 0) + lapic_bar->size = ONE_MB; + else { + ntb_printf(0, "Failed to shrink LAPIC BAR resource to " + "1 MB: %d\n", rc); + /* Ignore error */ + } + } + + ntb->peer_lapic_bar = lapic_bar; + return (0); +} + +static int xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr) { @@ -1619,6 +1853,43 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, XEON_SBAR2XLAT_OFFSET, 0); ntb_reg_write(8, XEON_SBAR4XLAT_OFFSET, 0); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + size_t size, xlatoffset; + + switch (ntb_mw_to_bar(ntb, ntb->msix_mw_idx)) { + case NTB_B2B_BAR_1: + size = 8; + xlatoffset = XEON_SBAR2XLAT_OFFSET; + break; + case NTB_B2B_BAR_2: + xlatoffset = XEON_SBAR4XLAT_OFFSET; + if (HAS_FEATURE(NTB_SPLIT_BAR)) + size = 4; + else + size = 8; + break; + case NTB_B2B_BAR_3: + xlatoffset = XEON_SBAR5XLAT_OFFSET; + size = 4; + break; + default: + KASSERT(false, ("Bogus msix mw idx: %u", + ntb->msix_mw_idx)); + return (EINVAL); + } + + /* + * We point the chosen MSIX MW BAR xlat to remote LAPIC for + * workaround + */ + if (size == 4) + ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); + else + ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); + } + (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); + (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); + /* Zero outgoing translation limits (whole bar size windows) */ ntb_reg_write(8, XEON_PBAR2LMT_OFFSET, 0); ntb_reg_write(8, XEON_PBAR4LMT_OFFSET, 0); @@ -1656,14 +1927,21 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, } static inline bool +_xeon_link_is_up(struct ntb_softc *ntb) +{ + + if (ntb->conn_type == NTB_CONN_TRANSPARENT) + return (true); + return ((ntb->lnk_sta & NTB_LINK_STATUS_ACTIVE) != 0); +} + +static inline bool link_is_up(struct ntb_softc *ntb) { - if (ntb->type == NTB_XEON) { - if (ntb->conn_type == NTB_CONN_TRANSPARENT) - return (true); - return ((ntb->lnk_sta & NTB_LINK_STATUS_ACTIVE) != 0); - } + if (ntb->type == NTB_XEON) + return (_xeon_link_is_up(ntb) && (ntb->peer_msix_good || + !HAS_FEATURE(NTB_SB01BASE_LOCKUP))); KASSERT(ntb->type == NTB_ATOM, ("ntb type")); return ((ntb->ntb_ctl & ATOM_CNTL_LINK_DOWN) == 0); @@ -1881,6 +2159,8 @@ ntb_link_enable(struct ntb_softc *ntb, e { uint32_t cntl; + ntb_printf(2, "%s\n", __func__); + if (ntb->type == NTB_ATOM) { pci_write_config(ntb->device, NTB_PPD_OFFSET, ntb->ppd | ATOM_PPD_INIT_LINK, 4); @@ -1919,6 +2199,8 @@ ntb_link_disable(struct ntb_softc *ntb) { uint32_t cntl; + ntb_printf(2, "%s\n", __func__); + if (ntb->conn_type == NTB_CONN_TRANSPARENT) { ntb_link_event(ntb); return (0); @@ -1934,6 +2216,23 @@ ntb_link_disable(struct ntb_softc *ntb) return (0); } +bool +ntb_link_enabled(struct ntb_softc *ntb) +{ + uint32_t cntl; + + if (ntb->type == NTB_ATOM) { + cntl = pci_read_config(ntb->device, NTB_PPD_OFFSET, 4); + return ((cntl & ATOM_PPD_INIT_LINK) != 0); + } + + if (ntb->conn_type == NTB_CONN_TRANSPARENT) + return (true); + + cntl = ntb_reg_read(4, ntb->reg->ntb_ctl); + return ((cntl & NTB_CNTL_LINK_DISABLE) == 0); +} + static void recover_atom_link(void *arg) { @@ -2002,6 +2301,19 @@ ntb_poll_link(struct ntb_softc *ntb) return (false); ntb->lnk_sta = reg_val; + + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + if (_xeon_link_is_up(ntb)) { + if (!ntb->peer_msix_good) { + callout_reset(&ntb->peer_msix_work, 0, + ntb_exchange_msix, ntb); + return (false); + } + } else { + ntb->peer_msix_good = false; + ntb->peer_msix_done = false; + } + } } return (true); } @@ -2040,16 +2352,26 @@ SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_inf static void ntb_sysctl_init(struct ntb_softc *ntb) { - struct sysctl_oid_list *tree_par, *regpar, *statpar, *errpar; + struct sysctl_oid_list *globals, *tree_par, *regpar, *statpar, *errpar; struct sysctl_ctx_list *ctx; struct sysctl_oid *tree, *tmptree; ctx = device_get_sysctl_ctx(ntb->device); + globals = SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)); + + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "link_status", + CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, + sysctl_handle_link_status_human, "A", + "Link status (human readable)"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "active", + CTLFLAG_RD | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_status, + "IU", "Link status (1=active, 0=inactive)"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "admin_up", + CTLFLAG_RW | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_admin, + "IU", "Set/get interface status (1=UP, 0=DOWN)"); - tree = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)), OID_AUTO, - "debug_info", CTLFLAG_RD, NULL, - "Driver state, statistics, and HW registers"); + tree = SYSCTL_ADD_NODE(ctx, globals, OID_AUTO, "debug_info", + CTLFLAG_RD, NULL, "Driver state, statistics, and HW registers"); tree_par = SYSCTL_CHILDREN(tree); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "conn_type", CTLFLAG_RD, @@ -2081,10 +2403,6 @@ ntb_sysctl_init(struct ntb_softc *ntb) __DEVOLATILE(uint32_t *, &ntb->lnk_sta), 0, "LNK STA register (cached)"); - SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status", - CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status, - "A", "Link status"); - #ifdef notyet SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "mw_count", CTLFLAG_RD, &ntb->mw_count, 0, "MW count"); @@ -2332,7 +2650,37 @@ sysctl_handle_features(SYSCTL_HANDLER_AR } static int -sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) +sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS) +{ + struct ntb_softc *ntb; + unsigned old, new; + int error; + + error = 0; + ntb = arg1; + + old = ntb_link_enabled(ntb); + + error = SYSCTL_OUT(req, &old, sizeof(old)); + if (error != 0 || req->newptr == NULL) + return (error); + + error = SYSCTL_IN(req, &new, sizeof(new)); + if (error != 0) + return (error); + + ntb_printf(0, "Admin set interface state to '%sabled'\n", + (new != 0)? "en" : "dis"); + + if (new != 0) + error = ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); + else + error = ntb_link_disable(ntb); + return (error); +} + +static int +sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS) { struct ntb_softc *ntb; struct sbuf sb; @@ -2360,6 +2708,24 @@ sysctl_handle_link_status(SYSCTL_HANDLER } static int +sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) +{ + struct ntb_softc *ntb; + unsigned res; + int error; + + error = 0; + ntb = arg1; + + res = ntb_link_is_up(ntb, NULL, NULL); + + error = SYSCTL_OUT(req, &res, sizeof(res)); + if (error || !req->newptr) + return (error); + return (EINVAL); +} + +static int sysctl_handle_register(SYSCTL_HANDLER_ARGS) { struct ntb_softc *ntb; @@ -2434,12 +2800,70 @@ static unsigned ntb_user_mw_to_idx(struct ntb_softc *ntb, unsigned uidx) { - if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && - uidx >= ntb->b2b_mw_idx) - return (uidx + 1); + if ((ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && + uidx >= ntb->b2b_mw_idx) || + (ntb->msix_mw_idx != B2B_MW_DISABLED && uidx >= ntb->msix_mw_idx)) + uidx++; + if ((ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && + uidx >= ntb->b2b_mw_idx) && + (ntb->msix_mw_idx != B2B_MW_DISABLED && uidx >= ntb->msix_mw_idx)) + uidx++; return (uidx); } +static void +ntb_exchange_msix(void *ctx) +{ + struct ntb_softc *ntb; + uint32_t val; + unsigned i; + + ntb = ctx; + + if (ntb->peer_msix_done) + goto msix_done; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + ntb_peer_spad_write(ntb, NTB_MSIX_DATA0 + i, + ntb->msix_data[i].nmd_data); + ntb_peer_spad_write(ntb, NTB_MSIX_OFS0 + i, + ntb->msix_data[i].nmd_ofs); + } + ntb_peer_spad_write(ntb, NTB_MSIX_GUARD, NTB_MSIX_VER_GUARD); + + ntb_spad_read(ntb, NTB_MSIX_GUARD, &val); + if (val != NTB_MSIX_VER_GUARD) + goto reschedule; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + ntb_spad_read(ntb, NTB_MSIX_DATA0 + i, &val); + ntb->peer_msix_data[i].nmd_data = val; + ntb_spad_read(ntb, NTB_MSIX_OFS0 + i, &val); + ntb->peer_msix_data[i].nmd_ofs = val; + } + + ntb->peer_msix_done = true; + +msix_done: + ntb_peer_spad_write(ntb, NTB_MSIX_DONE, NTB_MSIX_RECEIVED); + ntb_spad_read(ntb, NTB_MSIX_DONE, &val); + if (val != NTB_MSIX_RECEIVED) + goto reschedule; + + ntb->peer_msix_good = true; + + ntb_poll_link(ntb); + ntb_link_event(ntb); + return; + +reschedule: + ntb->lnk_sta = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); + if (_xeon_link_is_up(ntb)) + callout_reset(&ntb->peer_msix_work, hz / 100, ntb_exchange_msix, ntb); + else + ntb_spad_clear(ntb); +} + /* * Public API to the rest of the OS */ @@ -2469,10 +2893,14 @@ ntb_get_max_spads(struct ntb_softc *ntb) uint8_t ntb_mw_count(struct ntb_softc *ntb) { + uint8_t res; + res = ntb->mw_count; if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0) - return (ntb->mw_count - 1); - return (ntb->mw_count); + res--; + if (ntb->msix_mw_idx != B2B_MW_DISABLED) + res--; + return (res); } /** @@ -2498,6 +2926,18 @@ ntb_spad_write(struct ntb_softc *ntb, un return (0); } +/* + * Zeros the local scratchpad. + */ +void +ntb_spad_clear(struct ntb_softc *ntb) +{ + unsigned i; + + for (i = 0; i < ntb->spad_count; i++) + ntb_spad_write(ntb, i, 0); +} + /** * ntb_spad_read() - read from the primary scratchpad register * @ntb: pointer to ntb_softc instance @@ -2826,6 +3266,22 @@ void ntb_peer_db_set(struct ntb_softc *ntb, uint64_t bit) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + struct ntb_pci_bar_info *lapic; + unsigned i; + + lapic = ntb->peer_lapic_bar; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((bit & ntb_db_vector_mask(ntb, i)) != 0) + bus_space_write_4(lapic->pci_bus_tag, + lapic->pci_bus_handle, + ntb->peer_msix_data[i].nmd_ofs, + ntb->peer_msix_data[i].nmd_data); + } + return; + } + if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit); return; Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h Fri Jun 10 18:34:31 2016 (r301811) @@ -70,6 +70,7 @@ bool ntb_link_is_up(struct ntb_softc *, void ntb_link_event(struct ntb_softc *); int ntb_link_enable(struct ntb_softc *, enum ntb_speed, enum ntb_width); int ntb_link_disable(struct ntb_softc *); +bool ntb_link_enabled(struct ntb_softc *); int ntb_set_ctx(struct ntb_softc *, void *, const struct ntb_ctx_ops *); void *ntb_get_ctx(struct ntb_softc *, const struct ntb_ctx_ops **); @@ -86,6 +87,7 @@ int ntb_mw_get_wc(struct ntb_softc *, un int ntb_mw_set_wc(struct ntb_softc *, unsigned mw_idx, vm_memattr_t mode); uint8_t ntb_get_max_spads(struct ntb_softc *ntb); +void ntb_spad_clear(struct ntb_softc *ntb); int ntb_spad_write(struct ntb_softc *ntb, unsigned int idx, uint32_t val); int ntb_spad_read(struct ntb_softc *ntb, unsigned int idx, uint32_t *val); int ntb_peer_spad_write(struct ntb_softc *ntb, unsigned int idx, Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Fri Jun 10 18:34:31 2016 (r301811) @@ -44,6 +44,7 @@ #define XEON_DB_MSIX_VECTOR_COUNT 4 #define XEON_DB_MSIX_VECTOR_SHIFT 5 #define XEON_DB_LINK_BIT (1 << XEON_DB_LINK) +#define XEON_NONLINK_DB_MSIX_BITS 3 #define XEON_SPCICMD_OFFSET 0x0504 #define XEON_DEVCTRL_OFFSET 0x0598 From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:40:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2BC6ADAA65; Fri, 10 Jun 2016 18:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4AB52779; Fri, 10 Jun 2016 18:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIe3O2034273; Fri, 10 Jun 2016 18:40:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIe3ph034270; Fri, 10 Jun 2016 18:40:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101840.u5AIe3ph034270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301812 - stable/10/sys/dev/ioat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:40:05 -0000 Author: ngie Date: Fri Jun 10 18:40:03 2016 New Revision: 301812 URL: https://svnweb.freebsd.org/changeset/base/301812 Log: MFC r301296,r301297,r301300: r301296 (by cem): ioat(4): Make channel indices unsigned r301297 (by cem): ioat(4): Export the number of available channels r301300 (by cem): ioat(4): Always log capabilities on attach Different, relatively recent Intel Xeon hardware support radically different features. E.g., BDX support CRC32 while BDX-DE does not. Modified: stable/10/sys/dev/ioat/ioat.c stable/10/sys/dev/ioat/ioat.h stable/10/sys/dev/ioat/ioat_internal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ioat/ioat.c ============================================================================== --- stable/10/sys/dev/ioat/ioat.c Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat.c Fri Jun 10 18:40:03 2016 (r301812) @@ -152,8 +152,8 @@ MODULE_VERSION(ioat, 1); * Private data structures */ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNELS]; -static int ioat_channel_index = 0; -SYSCTL_INT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, +static unsigned ioat_channel_index = 0; +SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, "Number of IOAT channels attached"); static struct _pcsid @@ -407,7 +407,7 @@ ioat3_attach(device_t device) ioat = DEVICE2SOFTC(device); ioat->capabilities = ioat_read_dmacapability(ioat); - ioat_log_message(1, "Capabilities: %b\n", (int)ioat->capabilities, + ioat_log_message(0, "Capabilities: %b\n", (int)ioat->capabilities, IOAT_DMACAP_STR); xfercap = ioat_read_xfercap(ioat); @@ -742,6 +742,13 @@ ioat_reset_hw_task(void *ctx, int pendin /* * User API functions */ +unsigned +ioat_get_nchannels(void) +{ + + return (ioat_channel_index); +} + bus_dmaengine_t ioat_get_dmaengine(uint32_t index, int flags) { Modified: stable/10/sys/dev/ioat/ioat.h ============================================================================== --- stable/10/sys/dev/ioat/ioat.h Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat.h Fri Jun 10 18:40:03 2016 (r301812) @@ -85,6 +85,8 @@ typedef void *bus_dmaengine_t; struct bus_dmadesc; typedef void (*bus_dmaengine_callback_t)(void *arg, int error); +unsigned ioat_get_nchannels(void); + /* * Called first to acquire a reference to the DMA channel * Modified: stable/10/sys/dev/ioat/ioat_internal.h ============================================================================== --- stable/10/sys/dev/ioat/ioat_internal.h Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat_internal.h Fri Jun 10 18:40:03 2016 (r301812) @@ -455,7 +455,7 @@ struct ioat_softc { }) int version; - int chan_idx; + unsigned chan_idx; struct mtx submit_lock; device_t device; From owner-svn-src-stable-10@freebsd.org Fri Jun 10 18:47:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F977ADABF8; Fri, 10 Jun 2016 18:47:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CDD52B24; Fri, 10 Jun 2016 18:47:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIlBgq037765; Fri, 10 Jun 2016 18:47:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIlB21037764; Fri, 10 Jun 2016 18:47:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101847.u5AIlB21037764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301813 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:47:12 -0000 Author: ngie Date: Fri Jun 10 18:47:11 2016 New Revision: 301813 URL: https://svnweb.freebsd.org/changeset/base/301813 Log: Record mergeinfo for all complete commits done in the ioat(4) merge in r300661 This will make it easier for someone to determine what's missing when running `svn mergeinfo --show-revs eligible` r299353 wasn't recorded intentionally because it was only a "partial" merge Sponsored by: EMC / Isilon Storage Division Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Fri Jun 10 21:47:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15862AEF677; Fri, 10 Jun 2016 21:47:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D98AF2DFF; Fri, 10 Jun 2016 21:47:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ALlcWu004799; Fri, 10 Jun 2016 21:47:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ALlcaZ004798; Fri, 10 Jun 2016 21:47:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606102147.u5ALlcaZ004798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 10 Jun 2016 21:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301816 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 21:47:39 -0000 Author: pfg Date: Fri Jun 10 21:47:37 2016 New Revision: 301816 URL: https://svnweb.freebsd.org/changeset/base/301816 Log: MFC r300333: gas: Implement the .inst assembler directive for arm. We normally use the binutils from ports but on other systems this is required for building gcc 4.9. Obtained from: OpenBSD (CVS rev. 1.5) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-arm.c Fri Jun 10 19:29:55 2016 (r301815) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Fri Jun 10 21:47:37 2016 (r301816) @@ -2284,6 +2284,37 @@ s_unreq (int a ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +static void +s_inst(int unused ATTRIBUTE_UNUSED) +{ + expressionS exp; + + if (thumb_mode) { + as_bad(".inst not implemented for Thumb mode"); + ignore_rest_of_line(); + return; + } + + if (is_it_end_of_statement()) { + demand_empty_rest_of_line(); + return; + } + + do { + expression(&exp); + + if (exp.X_op != O_constant) + as_bad("constant expression required"); + else + emit_expr(&exp, 4); + + } while (*input_line_pointer++ == ','); + + /* Put terminator back into stream. */ + input_line_pointer--; + demand_empty_rest_of_line(); +} + /* Directives: Instruction set selection. */ #ifdef OBJ_ELF @@ -3895,6 +3926,7 @@ const pseudo_typeS md_pseudo_table[] = { "object_arch", s_arm_object_arch, 0 }, { "fpu", s_arm_fpu, 0 }, { "arch_extension", s_arm_arch_extension, 0 }, + { "inst", s_inst, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, From owner-svn-src-stable-10@freebsd.org Fri Jun 10 22:07:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18DA2AEF8D7; Fri, 10 Jun 2016 22:07:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44F62517; Fri, 10 Jun 2016 22:07:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AM7IEC012124; Fri, 10 Jun 2016 22:07:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AM7HBI012123; Fri, 10 Jun 2016 22:07:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606102207.u5AM7HBI012123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 10 Jun 2016 22:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301817 - stable/10/contrib/gcc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 22:07:19 -0000 Author: pfg Date: Fri Jun 10 22:07:17 2016 New Revision: 301817 URL: https://svnweb.freebsd.org/changeset/base/301817 Log: MFC r300301, r300319: GCC: Add support for named initializers for anonymous structs/unions. This is a C11 feature that is starting to get used in places such as Mesa. This implementation takes a different approach to upstream and is therefore not covered by GPLv3. Obtained from: OpenBSD (CVS rev. 1.2) Modified: stable/10/contrib/gcc/c-typeck.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/c-typeck.c ============================================================================== --- stable/10/contrib/gcc/c-typeck.c Fri Jun 10 21:47:37 2016 (r301816) +++ stable/10/contrib/gcc/c-typeck.c Fri Jun 10 22:07:17 2016 (r301817) @@ -6041,6 +6041,7 @@ set_init_index (tree first, tree last) void set_init_label (tree fieldname) { + tree anon = NULL_TREE; tree tail; if (set_designator (0)) @@ -6058,19 +6059,39 @@ set_init_label (tree fieldname) for (tail = TYPE_FIELDS (constructor_type); tail; tail = TREE_CHAIN (tail)) { + if (DECL_NAME (tail) == NULL_TREE + && (TREE_CODE (TREE_TYPE (tail)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (tail)) == UNION_TYPE)) + { + anon = lookup_field (tail, fieldname); + if (anon) + break; + } + if (DECL_NAME (tail) == fieldname) break; } if (tail == 0) error ("unknown field %qE specified in initializer", fieldname); - else + + while (tail) { constructor_fields = tail; designator_depth++; designator_erroneous = 0; if (constructor_range_stack) push_range_stack (NULL_TREE); + + if (anon) + { + if (set_designator (0)) + return; + tail = TREE_VALUE(anon); + anon = TREE_CHAIN(anon); + } + else + tail = NULL_TREE; } } From owner-svn-src-stable-10@freebsd.org Sat Jun 11 01:34:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD059AD9BDE; Sat, 11 Jun 2016 01:34:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6FD28FA; Sat, 11 Jun 2016 01:34:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B1Yf8U089055; Sat, 11 Jun 2016 01:34:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B1YfxD089054; Sat, 11 Jun 2016 01:34:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606110134.u5B1YfxD089054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 01:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301818 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 01:34:42 -0000 Author: ngie Date: Sat Jun 11 01:34:41 2016 New Revision: 301818 URL: https://svnweb.freebsd.org/changeset/base/301818 Log: MFC r301683: Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream) PR: 210146 Modified: stable/10/etc/defaults/rc.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Fri Jun 10 22:07:17 2016 (r301817) +++ stable/10/etc/defaults/rc.conf Sat Jun 11 01:34:41 2016 (r301818) @@ -485,7 +485,7 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. -ipv6_cpe_wanif="NO" # Set to the upstram interface name if this +ipv6_cpe_wanif="NO" # Set to the upstream interface name if this # node will work as a router to forward IPv6 # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs From owner-svn-src-stable-10@freebsd.org Sat Jun 11 01:38:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E1FAD9DAE; Sat, 11 Jun 2016 01:38:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DEE02C41; Sat, 11 Jun 2016 01:38:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B1bx5k089320; Sat, 11 Jun 2016 01:37:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B1bxYx089319; Sat, 11 Jun 2016 01:37:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606110137.u5B1bxYx089319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 01:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301820 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 01:38:00 -0000 Author: ngie Date: Sat Jun 11 01:37:59 2016 New Revision: 301820 URL: https://svnweb.freebsd.org/changeset/base/301820 Log: MFC r301704: Test for strchr(3) returning NULL, not 0 Modified: stable/10/lib/libc/rpc/getnetpath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetpath.c ============================================================================== --- stable/10/lib/libc/rpc/getnetpath.c Sat Jun 11 01:35:34 2016 (r301819) +++ stable/10/lib/libc/rpc/getnetpath.c Sat Jun 11 01:37:59 2016 (r301820) @@ -264,7 +264,7 @@ int token; /* char to parse string for *cp++ = '\0'; /* null-terminate token */ /* get rid of any backslash escapes */ ep = npp; - while ((np = strchr(ep, '\\')) != 0) { + while ((np = strchr(ep, '\\')) != NULL) { if (np[1] == '\\') np++; strcpy(np, (ep = &np[1])); /* XXX: overlapping string copy */ From owner-svn-src-stable-10@freebsd.org Sat Jun 11 03:59:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D2C0AEF4C4; Sat, 11 Jun 2016 03:59:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3022B7B; Sat, 11 Jun 2016 03:58:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B3wxM0041258; Sat, 11 Jun 2016 03:58:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B3wxtF041257; Sat, 11 Jun 2016 03:58:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606110358.u5B3wxtF041257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 11 Jun 2016 03:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301822 - stable/10/gnu/lib/libsupc++ X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 03:59:00 -0000 Author: pfg Date: Sat Jun 11 03:58:59 2016 New Revision: 301822 URL: https://svnweb.freebsd.org/changeset/base/301822 Log: MFC r301570: libsupc++: Fix typo in symbol map. This went mostly unnoticed with the deprecation of the GNU toolchain in tier 1 platforms. Fix it now for the rest. PR: 169901 Modified: stable/10/gnu/lib/libsupc++/Version.map Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/lib/libsupc++/Version.map ============================================================================== --- stable/10/gnu/lib/libsupc++/Version.map Sat Jun 11 01:44:27 2016 (r301821) +++ stable/10/gnu/lib/libsupc++/Version.map Sat Jun 11 03:58:59 2016 (r301822) @@ -132,7 +132,7 @@ CXXABI_1.3 { GLIBCXX_3.4 { # operator new and new[] - _Znai[jm]; + _Zna[jm]; _Zna[jm]RKSt9nothrow_t; _Znw[jm]; _Znw[jm]RKSt9nothrow_t; From owner-svn-src-stable-10@freebsd.org Sat Jun 11 05:53:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECB79AEF812; Sat, 11 Jun 2016 05:53:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD77025BB; Sat, 11 Jun 2016 05:53:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B5roqB085042; Sat, 11 Jun 2016 05:53:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B5rolj085041; Sat, 11 Jun 2016 05:53:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201606110553.u5B5rolj085041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Jun 2016 05:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301824 - stable/10/release/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 05:53:52 -0000 Author: delphij Date: Sat Jun 11 05:53:50 2016 New Revision: 301824 URL: https://svnweb.freebsd.org/changeset/base/301824 Log: MFC r301584: Apply mergemaster r255428: Pass -n (do not emit comments) when saving mtree information for future mergemaster(8) runs. Modified: stable/10/release/scripts/mm-mtree.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/mm-mtree.sh ============================================================================== --- stable/10/release/scripts/mm-mtree.sh Sat Jun 11 03:59:44 2016 (r301823) +++ stable/10/release/scripts/mm-mtree.sh Sat Jun 11 05:53:50 2016 (r301824) @@ -147,7 +147,7 @@ find -d ${TEMPROOT} -type d -empty -dele # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` -mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null +mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" From owner-svn-src-stable-10@freebsd.org Sat Jun 11 11:24:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88A9AEF9F5; Sat, 11 Jun 2016 11:24:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB6B216A; Sat, 11 Jun 2016 11:24:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5BBOUEl005744; Sat, 11 Jun 2016 11:24:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5BBOUWE005743; Sat, 11 Jun 2016 11:24:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606111124.u5BBOUWE005743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301831 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 11:24:31 -0000 Author: ngie Date: Sat Jun 11 11:24:30 2016 New Revision: 301831 URL: https://svnweb.freebsd.org/changeset/base/301831 Log: MFC r300220,r300223: Differential Revision: https://reviews.freebsd.org/D6803 Reviewed by: alc, kib Sponsored by: EMC / Isilon Storage Division r300220 (by cem): sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative value (it is only ever set to a fraction of v_free_min, which is unsigned and also obviously non-negative). But I'm not going to try and convert every non-negative scalar in the VM to unsigned today, so just cast it for the comparison. r300223 (by cem): vm/vm_page.h: Fix trivial '-Wpointer-sign' warning pq_vcnt, as a count of real things, has no business being negative. It is only ever initialized by a u_int counter. The warning came from the atomic_add_int() in vm_pagequeue_cnt_add(). Rectify the warning by changing the variable to u_int. No functional change. Suggested by: Clang 3.3 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Sat Jun 11 11:25:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 917B8AEFAB2; Sat, 11 Jun 2016 11:25:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4F42416; Sat, 11 Jun 2016 11:25:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5BBPnQT005848; Sat, 11 Jun 2016 11:25:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5BBPneq005847; Sat, 11 Jun 2016 11:25:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606111125.u5BBPneq005847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 11:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301832 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 11:25:50 -0000 Author: ngie Date: Sat Jun 11 11:25:49 2016 New Revision: 301832 URL: https://svnweb.freebsd.org/changeset/base/301832 Log: Revert r301831 -- I forgot to add the diff from Phabricator Pointyhat to: ngie (never commit without svn status half asleep) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Sat Jun 11 11:28:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68274AEFCE3; Sat, 11 Jun 2016 11:28:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A42526D4; Sat, 11 Jun 2016 11:28:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5BBSUeF005992; Sat, 11 Jun 2016 11:28:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5BBSUeD005988; Sat, 11 Jun 2016 11:28:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606111128.u5BBSUeD005988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 11:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301833 - in stable/10/sys: sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 11:28:31 -0000 Author: ngie Date: Sat Jun 11 11:28:29 2016 New Revision: 301833 URL: https://svnweb.freebsd.org/changeset/base/301833 Log: Redo MFC r300220,r300223: Differential Revision: https://reviews.freebsd.org/D6803 Reviewed by: alc, kib Sponsored by: EMC / Isilon Storage Division r300220 (by cem): sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative value (it is only ever set to a fraction of v_free_min, which is unsigned and also obviously non-negative). But I'm not going to try and convert every non-negative scalar in the VM to unsigned today, so just cast it for the comparison. r300223 (by cem): vm/vm_page.h: Fix trivial '-Wpointer-sign' warning pq_vcnt, as a count of real things, has no business being negative. It is only ever initialized by a u_int counter. The warning came from the atomic_add_int() in vm_pagequeue_cnt_add(). Rectify the warning by changing the variable to u_int. No functional change. Suggested by: Clang 3.3 Modified: stable/10/sys/sys/vmmeter.h stable/10/sys/vm/vm_page.c stable/10/sys/vm/vm_page.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/vmmeter.h ============================================================================== --- stable/10/sys/sys/vmmeter.h Sat Jun 11 11:25:49 2016 (r301832) +++ stable/10/sys/sys/vmmeter.h Sat Jun 11 11:28:29 2016 (r301833) @@ -183,7 +183,8 @@ static __inline int vm_paging_needed(void) { - return (cnt.v_free_count + cnt.v_cache_count < vm_pageout_wakeup_thresh); + return (cnt.v_free_count + cnt.v_cache_count < + (u_int)vm_pageout_wakeup_thresh); } #endif Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Sat Jun 11 11:25:49 2016 (r301832) +++ stable/10/sys/vm/vm_page.c Sat Jun 11 11:28:29 2016 (r301833) @@ -253,11 +253,11 @@ vm_page_domain_init(struct vm_domain *vm *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = &cnt.v_inactive_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_name) = "vm active pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = &cnt.v_active_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; Modified: stable/10/sys/vm/vm_page.h ============================================================================== --- stable/10/sys/vm/vm_page.h Sat Jun 11 11:25:49 2016 (r301832) +++ stable/10/sys/vm/vm_page.h Sat Jun 11 11:28:29 2016 (r301833) @@ -215,7 +215,7 @@ struct vm_pagequeue { struct mtx pq_mutex; struct pglist pq_pl; int pq_cnt; - int * const pq_vcnt; + u_int * const pq_vcnt; const char * const pq_name; } __aligned(CACHE_LINE_SIZE);