From owner-svn-src-stable@freebsd.org Sun Jun 7 00:41:44 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABF4C3426FF; Sun, 7 Jun 2020 00:41:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49fcyc3vS8z4JCb; Sun, 7 Jun 2020 00:41:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80CD0AB6C; Sun, 7 Jun 2020 00:41:44 +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 0570fiB0020048; Sun, 7 Jun 2020 00:41:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0570fi7L020046; Sun, 7 Jun 2020 00:41:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006070041.0570fi7L020046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 7 Jun 2020 00:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361881 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 361881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 00:41:44 -0000 Author: kib Date: Sun Jun 7 00:41:43 2020 New Revision: 361881 URL: https://svnweb.freebsd.org/changeset/base/361881 Log: MFC r361672, r361675, r361676, r361680: rtld direct exec: add -b and -v options. Modified: stable/12/libexec/rtld-elf/rtld.1 stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.1 ============================================================================== --- stable/12/libexec/rtld-elf/rtld.1 Sun Jun 7 00:07:21 2020 (r361880) +++ stable/12/libexec/rtld-elf/rtld.1 Sun Jun 7 00:41:43 2020 (r361881) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2017 +.Dd June 1, 2020 .Dt RTLD 1 .Os .Sh NAME @@ -302,6 +302,7 @@ Execution options may be specified. The syntax of the direct invocation is .Bd -ragged -offset indent .Pa /libexec/ld-elf.so.1 +.Op Fl b Ar exe .Op Fl f Ar fd .Op Fl p .Op Fl - @@ -311,6 +312,17 @@ The syntax of the direct invocation is .Pp The options are: .Bl -tag -width indent +.It Fl b Ar exe +Use the executable +.Fa exe +instead of +.Fa image_path +for activation. +If this option is specified, +.Ar image_path +is only used to provide the +.Va argv[0] +value to the program. .It Fl f Ar fd File descriptor .Ar fd @@ -333,6 +345,8 @@ character, uses the search path provided by the environment variable .Dv PATH to find the binary to execute. +.It Fl v +Display information about this run-time linker binary, then exit. .It Fl - Ends the .Nm Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Sun Jun 7 00:07:21 2020 (r361880) +++ stable/12/libexec/rtld-elf/rtld.c Sun Jun 7 00:41:43 2020 (r361881) @@ -136,7 +136,8 @@ static void objlist_put_after(Objlist *, Obj_Entry *, static void objlist_remove(Objlist *, Obj_Entry *); static int open_binary_fd(const char *argv0, bool search_in_path, const char **binpath_res); -static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp); +static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, + const char **argv0); static int parse_integer(const char *); static void *path_enumerate(const char *, path_enum_proc, const char *, void *); static void print_usage(const char *argv0); @@ -439,8 +440,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr } dbg("opening main program in direct exec mode"); if (argc >= 2) { - rtld_argc = parse_args(argv, argc, &search_in_path, &fd); - argv0 = argv[rtld_argc]; + rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0); explicit_fd = (fd != -1); binpath = NULL; if (!explicit_fd) @@ -5563,15 +5563,20 @@ open_binary_fd(const char *argv0, bool search_in_path, * Parse a set of command-line arguments. */ static int -parse_args(char* argv[], int argc, bool *use_pathp, int *fdp) +parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, + const char **argv0) { const char *arg; - int fd, i, j, arglen; + char machine[64]; + size_t sz; + int arglen, fd, i, j, mib[2]; char opt; + bool seen_b, seen_f; dbg("Parsing command-line arguments"); *use_pathp = false; *fdp = -1; + seen_b = seen_f = false; for (i = 1; i < argc; i++ ) { arg = argv[i]; @@ -5598,7 +5603,21 @@ parse_args(char* argv[], int argc, bool *use_pathp, in if (opt == 'h') { print_usage(argv[0]); _exit(0); + } else if (opt == 'b') { + if (seen_f) { + _rtld_error("Both -b and -f specified"); + rtld_die(); + } + i++; + *argv0 = argv[i]; + seen_b = true; + break; } else if (opt == 'f') { + if (seen_b) { + _rtld_error("Both -b and -f specified"); + rtld_die(); + } + /* * -f XX can be used to specify a * descriptor for the binary named at @@ -5622,9 +5641,28 @@ parse_args(char* argv[], int argc, bool *use_pathp, in rtld_die(); } *fdp = fd; + seen_f = true; break; } else if (opt == 'p') { *use_pathp = true; + } else if (opt == 'v') { + machine[0] = '\0'; + mib[0] = CTL_HW; + mib[1] = HW_MACHINE; + sz = sizeof(machine); + sysctl(mib, nitems(mib), machine, &sz, NULL, 0); + rtld_printf( + "FreeBSD ld-elf.so.1 %s\n" + "FreeBSD_version %d\n" + "Default lib path %s\n" + "Env prefix %s\n" + "Hint file %s\n" + "libmap file %s\n", + machine, + __FreeBSD_version, ld_standard_library_path, + ld_env_prefix, ld_elf_hints_default, + ld_path_libmap_conf); + _exit(0); } else { _rtld_error("Invalid argument: '%s'", arg); print_usage(argv[0]); @@ -5633,6 +5671,8 @@ parse_args(char* argv[], int argc, bool *use_pathp, in } } + if (!seen_b) + *argv0 = argv[i]; return (i); } @@ -5667,15 +5707,18 @@ static void print_usage(const char *argv0) { - rtld_printf("Usage: %s [-h] [-f ] [--] []\n" - "\n" - "Options:\n" - " -h Display this help message\n" - " -p Search in PATH for named binary\n" - " -f Execute instead of searching for \n" - " -- End of RTLD options\n" - " Name of process to execute\n" - " Arguments to the executed process\n", argv0); + rtld_printf( + "Usage: %s [-h] [-b ] [-f ] [-p] [--] []\n" + "\n" + "Options:\n" + " -h Display this help message\n" + " -b Execute instead of , arg0 is \n" + " -f Execute instead of searching for \n" + " -p Search in PATH for named binary\n" + " -v Display identification information\n" + " -- End of RTLD options\n" + " Name of process to execute\n" + " Arguments to the executed process\n", argv0); } /* From owner-svn-src-stable@freebsd.org Sun Jun 7 09:38:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 379C834E10D; Sun, 7 Jun 2020 09:38:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49frtG0cchz4Jwv; Sun, 7 Jun 2020 09:38:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BDFB10E55; Sun, 7 Jun 2020 09:38:46 +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 0579cjnc047383; Sun, 7 Jun 2020 09:38:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0579cj9l047381; Sun, 7 Jun 2020 09:38:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006070938.0579cj9l047381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 7 Jun 2020 09:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361889 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 361889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 09:38:46 -0000 Author: kib Date: Sun Jun 7 09:38:45 2020 New Revision: 361889 URL: https://svnweb.freebsd.org/changeset/base/361889 Log: MFC r360201: Fix ldd for PIE binaries with static TLS segment. PR: 245677 Modified: stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sun Jun 7 09:17:57 2020 (r361888) +++ stable/11/libexec/rtld-elf/rtld.c Sun Jun 7 09:38:45 2020 (r361889) @@ -3303,7 +3303,7 @@ rtld_dlopen(const char *name, int fd, int mode) if (mode & RTLD_DEEPBIND) lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) - lo_flags |= RTLD_LO_TRACE; + lo_flags |= RTLD_LO_TRACE | RTLD_LO_IGNSTLS; return (dlopen_object(name, fd, obj_main, lo_flags, mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL)); @@ -3356,15 +3356,15 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if ((lo_flags & RTLD_LO_DEEPBIND) != 0) obj->symbolic = true; result = 0; - if ((lo_flags & RTLD_LO_EARLY) == 0 && obj->static_tls && - !allocate_tls_offset(obj)) { + if ((lo_flags & (RTLD_LO_EARLY | RTLD_LO_IGNSTLS)) == 0 && + obj->static_tls && !allocate_tls_offset(obj)) { _rtld_error("%s: No space available " "for static Thread Local Storage", obj->path); result = -1; } if (result != -1) result = load_needed_objects(obj, lo_flags & (RTLD_LO_DLOPEN | - RTLD_LO_EARLY)); + RTLD_LO_EARLY | RTLD_LO_IGNSTLS)); init_dag(obj); ref_dag(obj); if (result != -1) Modified: stable/11/libexec/rtld-elf/rtld.h ============================================================================== --- stable/11/libexec/rtld-elf/rtld.h Sun Jun 7 09:17:57 2020 (r361888) +++ stable/11/libexec/rtld-elf/rtld.h Sun Jun 7 09:38:45 2020 (r361889) @@ -303,6 +303,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_FILTEES 0x10 /* Loading filtee. */ #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ +#define RTLD_LO_IGNSTLS 0x40 /* Do not allocate static TLS */ #define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* From owner-svn-src-stable@freebsd.org Sun Jun 7 16:42:05 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EA41330BC4; Sun, 7 Jun 2020 16:42:05 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49g2Gj0QQyz4Bym; Sun, 7 Jun 2020 16:42:05 +0000 (UTC) (envelope-from mr@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 098901651A; Sun, 7 Jun 2020 16:42:05 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 057Gg55T011693; Sun, 7 Jun 2020 16:42:05 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 057Gg3on011686; Sun, 7 Jun 2020 16:42:03 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202006071642.057Gg3on011686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Sun, 7 Jun 2020 16:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361896 - stable/12/usr.bin/systat X-SVN-Group: stable-12 X-SVN-Commit-Author: mr X-SVN-Commit-Paths: stable/12/usr.bin/systat X-SVN-Commit-Revision: 361896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 16:42:05 -0000 Author: mr Date: Sun Jun 7 16:42:03 2020 New Revision: 361896 URL: https://svnweb.freebsd.org/changeset/base/361896 Log: MFC r360919,r360929,r361084: Patch systat -zarc to display cumulative rate and round down large numbers by SI units Introduce sysputpage() to display large page size with human readable format. Using UI units allows to fit larger numbers in columns. Stop calling v_page_size - this is a value that doesn't change at runtime. Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable. Use bit-shift to convert page size to byte. PR: 237664, 246458 Submitted by: ota@j.email.ne.jp Added: stable/12/usr.bin/systat/sysput.c - copied, changed from r360929, head/usr.bin/systat/sysput.c Modified: stable/12/usr.bin/systat/Makefile stable/12/usr.bin/systat/extern.h stable/12/usr.bin/systat/fetch.c stable/12/usr.bin/systat/main.c stable/12/usr.bin/systat/vmstat.c stable/12/usr.bin/systat/zarc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/systat/Makefile ============================================================================== --- stable/12/usr.bin/systat/Makefile Sun Jun 7 14:39:20 2020 (r361895) +++ stable/12/usr.bin/systat/Makefile Sun Jun 7 16:42:03 2020 (r361896) @@ -4,7 +4,7 @@ .include PROG= systat -SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ +SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c sysput.c \ netcmds.c netstat.c pigs.c swap.c icmp.c \ mode.c ip.c sctp.c tcp.c zarc.c \ vmstat.c convtbl.c ifcmds.c ifstat.c Modified: stable/12/usr.bin/systat/extern.h ============================================================================== --- stable/12/usr.bin/systat/extern.h Sun Jun 7 14:39:20 2020 (r361895) +++ stable/12/usr.bin/systat/extern.h Sun Jun 7 16:42:03 2020 (r361896) @@ -165,6 +165,11 @@ void showtcp(void); void status(void); void suspend(int); char *sysctl_dynread(const char *, size_t *); +void sysputpage(WINDOW* , int, int, int, uint64_t, int); +void sysputspaces(WINDOW* , int, int, int); +void sysputstrs(WINDOW* , int, int, int); +void sysputuint64(WINDOW* , int, int, int, uint64_t, int); +void sysputwuint64(WINDOW* , int, int, int, uint64_t, int); #define SYSTAT_CMD(name) \ void close ## name(WINDOW *); \ @@ -176,4 +181,4 @@ char *sysctl_dynread(const char *, size_t *); void show ## name(void) SYSTAT_CMD( zarc ); -SYSTAT_CMD ( sctp ); +SYSTAT_CMD( sctp ); Modified: stable/12/usr.bin/systat/fetch.c ============================================================================== --- stable/12/usr.bin/systat/fetch.c Sun Jun 7 14:39:20 2020 (r361895) +++ stable/12/usr.bin/systat/fetch.c Sun Jun 7 16:42:03 2020 (r361896) @@ -60,9 +60,11 @@ kvm_ckread(void *a, void *b, int l) return (1); } -void getsysctl(const char *name, void *ptr, size_t len) +void +getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; + if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) { error("sysctl(%s...) failed: %s", name, strerror(errno)); Modified: stable/12/usr.bin/systat/main.c ============================================================================== --- stable/12/usr.bin/systat/main.c Sun Jun 7 14:39:20 2020 (r361895) +++ stable/12/usr.bin/systat/main.c Sun Jun 7 16:42:03 2020 (r361896) @@ -300,17 +300,8 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.dbuf_size", arc_stat); arc[6] += arc_stat; wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < nitems(arc); i++) { - if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { - wprintw(wload, "%7lluG", arc[i] >> 30); - } - else if (arc[i] > 10 * 1024 * 1024 ) { - wprintw(wload, "%7lluM", arc[i] >> 20); - } - else { - wprintw(wload, "%7lluK", arc[i] >> 10); - } - } + for (i = 0 ; i < nitems(arc); i++) + sysputuint64(wload, 0, i*8+2, 6, arc[i], 0); } } (*curcmd->c_refresh)(); Copied and modified: stable/12/usr.bin/systat/sysput.c (from r360929, head/usr.bin/systat/sysput.c) ============================================================================== --- head/usr.bin/systat/sysput.c Mon May 11 21:22:16 2020 (r360929, copy source) +++ stable/12/usr.bin/systat/sysput.c Sun Jun 7 16:42:03 2020 (r361896) @@ -41,15 +41,23 @@ __FBSDID("$FreeBSD$"); #include "extern.h" void -sysputstrs(WINDOW *wnd, int row, int col, int width) +sysputspaces(WINDOW *wd, int row, int col, int width) { + static char str40[] = " "; + + mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1); +} + +void +sysputstrs(WINDOW *wd, int row, int col, int width) +{ static char str40[] = "****************************************"; mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); } void -sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags) +sysputuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) { char unit, *ptr, *start, wrtbuf[width + width + 1]; int len; @@ -69,9 +77,42 @@ sysputuint64(WINDOW *wnd, int row, int col, int width, memset(wrtbuf + len, ' ', width - len); start += len; - mvwaddstr(wnd, row, col, start); + mvwaddstr(wd, row, col, start); return; error: - sysputstrs(wnd, row, col, width); + sysputstrs(wd, row, col, width); +} + +void +sysputwuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) +{ + if(val == 0) + sysputspaces(wd, row, col, width); + else + sysputuint64(wd, row, col, width, val, flags); +} + +static int +calc_page_shift() +{ + u_int page_size; + int shifts; + + shifts = 0; + GETSYSCTL("vm.stats.vm.v_page_size", page_size); + for(; page_size > 1; page_size >>= 1) + shifts++; + return shifts; +} + +void +sysputpage(WINDOW *wd, int row, int col, int width, uint64_t pages, int flags) +{ + static int shifts = 0; + + if (shifts == 0) + shifts = calc_page_shift(); + pages <<= shifts; + sysputuint64(wd, row, col, width, pages, flags); } Modified: stable/12/usr.bin/systat/vmstat.c ============================================================================== --- stable/12/usr.bin/systat/vmstat.c Sun Jun 7 14:39:20 2020 (r361895) +++ stable/12/usr.bin/systat/vmstat.c Sun Jun 7 16:42:03 2020 (r361896) @@ -104,7 +104,6 @@ static struct Info { /* * Distribution of page usages. */ - u_int v_page_size; /* page size in bytes */ u_int v_free_count; /* number of pages free */ u_int v_wire_count; /* number of pages wired down */ u_int v_active_count; /* number of pages active */ @@ -173,15 +172,15 @@ closekre(WINDOW *w) #define STATCOL 0 #define MEMROW 2 /* uses 4 rows and 45 cols */ #define MEMCOL 0 -#define PAGEROW 2 /* uses 4 rows and 30 cols */ +#define PAGEROW 1 /* uses 4 rows and 30 cols */ #define PAGECOL 47 -#define INTSROW 6 /* uses all rows to bottom and 16 cols */ +#define INTSROW 5 /* uses all rows to bottom and 16 cols */ #define INTSCOL 64 #define PROCSROW 6 /* uses 3 rows and 19 cols */ #define PROCSCOL 0 #define GENSTATROW 7 /* uses 2 rows and 29 cols */ #define GENSTATCOL 21 -#define VMSTATROW 7 /* uses 17 rows and 12-14 cols */ +#define VMSTATROW 5 /* uses 17 rows and 12-14 cols */ #define VMSTATCOL 49 /* actually 50-51 for some fields */ #define GRAPHROW 10 /* uses 3 rows and 49-51 cols */ #define GRAPHCOL 0 @@ -304,7 +303,7 @@ labelkre(void) clear(); mvprintw(STATROW, STATCOL + 6, "users Load"); mvprintw(STATROW + 1, STATCOL + 3, "Mem usage: %%Phy %%Kmem"); - mvprintw(MEMROW, MEMCOL, "Mem: KB REAL VIRTUAL"); + mvprintw(MEMROW, MEMCOL, "Mem: REAL VIRTUAL"); mvprintw(MEMROW + 1, MEMCOL, " Tot Share Tot Share"); mvprintw(MEMROW + 2, MEMCOL, "Act"); mvprintw(MEMROW + 3, MEMCOL, "All"); @@ -373,7 +372,7 @@ labelkre(void) #define PUTRATE(fld, l, c, w) \ do { \ Y(fld); \ - putint((int)((float)s.fld/etime + 0.5), l, c, w); \ + sysputwuint64(wnd, l, c, w, (s.fld/etime + 0.5), 0); \ } while (0) #define MAXFAIL 5 @@ -454,21 +453,20 @@ showkre(void) putfloat(avenrun[1], STATROW, STATCOL + 26, 5, 2, 0); putfloat(avenrun[2], STATROW, STATCOL + 32, 5, 2, 0); mvaddstr(STATROW, STATCOL + 55, buf); -#define pgtokb(pg) ((pg) * (s.v_page_size / 1024)) putfloat(100.0 * (v_page_count - total.t_free) / v_page_count, STATROW + 1, STATCOL + 15, 2, 0, 1); putfloat(100.0 * s.v_kmem_map_size / kmem_size, STATROW + 1, STATCOL + 22, 2, 0, 1); - putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); - putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); - putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); - putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); - putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); - putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); - putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); - putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); - putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); + sysputpage(wnd, MEMROW + 2, MEMCOL + 4, 7, total.t_arm, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 12, 7, total.t_armshr, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 20, 8, total.t_avm, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 29, 8, total.t_avmshr, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 4, 7, total.t_rm, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 12, 7, total.t_rmshr, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 20, 8, total.t_vm, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 29, 8, total.t_vmshr, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 38, 7, total.t_free, 0); putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); @@ -487,13 +485,13 @@ showkre(void) PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); - putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); - putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); - putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); - putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); - putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); + sysputpage(wnd, VMSTATROW + 12, VMSTATCOL + 2, 8 - 2, s.v_wire_count, 0); + sysputpage(wnd, VMSTATROW + 13, VMSTATCOL + 2, 8 - 2, s.v_active_count, 0); + sysputpage(wnd, VMSTATROW + 14, VMSTATCOL + 2, 8 - 2, s.v_inactive_count, 0); + sysputpage(wnd, VMSTATROW + 15, VMSTATCOL + 2, 8 - 2, s.v_laundry_count, 0); + sysputpage(wnd, VMSTATROW + 16, VMSTATCOL + 2, 8 - 2, s.v_free_count, 0); if (LINES - 1 > VMSTATROW + 17) - putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); + sysputuint64(wnd, VMSTATROW + 17, VMSTATCOL + 2, 8 - 2, s.bufspace, 0); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); @@ -773,7 +771,6 @@ getinfo(struct Info *ls) GETSYSCTL("vm.stats.vm.v_dfree", ls->v_dfree); GETSYSCTL("vm.stats.vm.v_pfree", ls->v_pfree); GETSYSCTL("vm.stats.vm.v_tfree", ls->v_tfree); - GETSYSCTL("vm.stats.vm.v_page_size", ls->v_page_size); GETSYSCTL("vm.stats.vm.v_free_count", ls->v_free_count); GETSYSCTL("vm.stats.vm.v_wire_count", ls->v_wire_count); GETSYSCTL("vm.stats.vm.v_active_count", ls->v_active_count); Modified: stable/12/usr.bin/systat/zarc.c ============================================================================== --- stable/12/usr.bin/systat/zarc.c Sun Jun 7 14:39:20 2020 (r361895) +++ stable/12/usr.bin/systat/zarc.c Sun Jun 7 16:42:03 2020 (r361896) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 - 2017 Yoshihiro Ota + * Copyright (c) 2014 - 2017, 2019 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,16 +32,16 @@ __FBSDID("$FreeBSD$"); #include #include -/* #include */ #include #include #include +#include #include "systat.h" #include "extern.h" #include "devs.h" -struct zfield{ +struct zfield { uint64_t arcstats; uint64_t arcstats_demand_data; uint64_t arcstats_demand_metadata; @@ -57,18 +57,25 @@ static struct zarcstats { struct zfield misses; } curstat, initstat, oldstat; +struct zarcrates { + struct zfield current; + struct zfield total; +}; + static void getinfo(struct zarcstats *ls); WINDOW * openzarc(void) { - return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); + + return (subwin(stdscr, LINES - 3 - 1, 0, MAINWIN_ROW, 0)); } void closezarc(WINDOW *w) { + if (w == NULL) return; wclear(w); @@ -80,12 +87,12 @@ void labelzarc(void) { int row = 1; + wmove(wnd, 0, 0); wclrtoeol(wnd); - mvwprintw(wnd, 0, 31+1, "%4.4s %7.7s %7.7s %12.12s %12.12s", - "rate", "hits", "misses", "total hits", "total misses"); -#define L(str) mvwprintw(wnd, row, 5, #str); \ - mvwprintw(wnd, row, 31, ":"); \ - mvwprintw(wnd, row, 31+4, "%%"); ++row + mvwprintw(wnd, 0, 31+1, "%4.4s %6.6s %6.6s | Total %4.4s %6.6s %6.6s", + "Rate", "Hits", "Misses", "Rate", "Hits", "Misses"); +#define L(str) mvwprintw(wnd, row++, 5, \ + "%-26.26s: %% | %%", #str) L(arcstats); L(arcstats.demand_data); L(arcstats.demand_metadata); @@ -98,21 +105,23 @@ labelzarc(void) dslabel(12, 0, 18); } -static int calc(uint64_t hits, uint64_t misses) +static int +calc_rate(uint64_t hits, uint64_t misses) { - if( hits ) - return 100 * hits / ( hits + misses ); + if(hits) + return 100 * hits / (hits + misses); else return 0; } static void -domode(struct zarcstats *delta, struct zarcstats *rate) +domode(struct zarcstats *delta, struct zarcrates *rate) { #define DO(stat) \ delta->hits.stat = (curstat.hits.stat - oldstat.hits.stat); \ delta->misses.stat = (curstat.misses.stat - oldstat.misses.stat); \ - rate->hits.stat = calc(delta->hits.stat, delta->misses.stat) + rate->current.stat = calc_rate(delta->hits.stat, delta->misses.stat); \ + rate->total.stat = calc_rate(curstat.hits.stat, curstat.misses.stat) DO(arcstats); DO(arcstats_demand_data); DO(arcstats_demand_metadata); @@ -136,21 +145,20 @@ void showzarc(void) { int row = 1; - struct zarcstats delta, rate; + struct zarcstats delta = {}; + struct zarcrates rate = {}; - memset(&delta, 0, sizeof delta); - memset(&rate, 0, sizeof rate); - domode(&delta, &rate); -#define DO(stat, col, fmt) \ - mvwprintw(wnd, row, col, fmt, stat) -#define R(stat) DO(rate.hits.stat, 31+1, "%3"PRIu64) -#define H(stat) DO(delta.hits.stat, 31+1+5, "%7"PRIu64); \ - DO(curstat.hits.stat, 31+1+5+8+8, "%12"PRIu64) -#define M(stat) DO(delta.misses.stat, 31+1+5+8, "%7"PRIu64); \ - DO(curstat.misses.stat, 31+1+5+8+8+13, "%12"PRIu64) -#define E(stat) R(stat); H(stat); M(stat); ++row +#define DO(stat, col, width) \ + sysputuint64(wnd, row, col, width, stat, HN_DIVISOR_1000) +#define RATES(stat) mvwprintw(wnd, row, 31+1, "%3"PRIu64, rate.current.stat);\ + mvwprintw(wnd, row, 31+1+5+7+7+8, "%3"PRIu64, rate.total.stat) +#define HITS(stat) DO(delta.hits.stat, 31+1+5, 6); \ + DO(curstat.hits.stat, 31+1+5+7+7+8+5, 6) +#define MISSES(stat) DO(delta.misses.stat, 31+1+5+7, 6); \ + DO(curstat.misses.stat, 31+1+5+7+7+8+5+7, 6) +#define E(stat) RATES(stat); HITS(stat); MISSES(stat); ++row E(arcstats); E(arcstats_demand_data); E(arcstats_demand_metadata); @@ -161,9 +169,9 @@ showzarc(void) E(vdev_cache_stats); #undef DO #undef E -#undef M -#undef H -#undef R +#undef MISSES +#undef HITS +#undef RATES dsshow(12, 0, 18, &cur_dev, &last_dev); } @@ -180,6 +188,7 @@ initzarc(void) void resetzarc(void) { + initzarc(); } @@ -193,11 +202,11 @@ getinfo(struct zarcstats *ls) cur_dev.dinfo = tmp_dinfo; last_dev.snap_time = cur_dev.snap_time; - dsgetinfo( &cur_dev ); + dsgetinfo(&cur_dev); - size_t size = sizeof( ls->hits.arcstats ); - if ( sysctlbyname("kstat.zfs.misc.arcstats.hits", - &ls->hits.arcstats, &size, NULL, 0 ) != 0 ) + size_t size = sizeof(ls->hits.arcstats); + if (sysctlbyname("kstat.zfs.misc.arcstats.hits", + &ls->hits.arcstats, &size, NULL, 0) != 0) return; GETSYSCTL("kstat.zfs.misc.arcstats.misses", ls->misses.arcstats); @@ -234,6 +243,7 @@ getinfo(struct zarcstats *ls) void fetchzarc(void) { + oldstat = curstat; getinfo(&curstat); } From owner-svn-src-stable@freebsd.org Sun Jun 7 17:40:30 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC8373329C0; Sun, 7 Jun 2020 17:40:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49g3Z649hPz4Llv; Sun, 7 Jun 2020 17:40:30 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA65168E6; Sun, 7 Jun 2020 17:40:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 057HeUho045861; Sun, 7 Jun 2020 17:40:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 057HeU9F045860; Sun, 7 Jun 2020 17:40:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006071740.057HeU9F045860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 7 Jun 2020 17:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361897 - stable/12/sys/amd64/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/amd64/linux X-SVN-Commit-Revision: 361897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 17:40:30 -0000 Author: markj Date: Sun Jun 7 17:40:29 2020 New Revision: 361897 URL: https://svnweb.freebsd.org/changeset/base/361897 Log: MFC r361664: Handle getcpu() calls in vsyscall emulation on amd64. PR: 246339 Modified: stable/12/sys/amd64/linux/linux_sysvec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/12/sys/amd64/linux/linux_sysvec.c Sun Jun 7 16:42:03 2020 (r361896) +++ stable/12/sys/amd64/linux/linux_sysvec.c Sun Jun 7 17:40:29 2020 (r361897) @@ -667,7 +667,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse const unsigned long linux_vsyscall_vector[] = { LINUX_SYS_gettimeofday, LINUX_SYS_linux_time, - /* getcpu not implemented */ + LINUX_SYS_linux_getcpu, }; static int From owner-svn-src-stable@freebsd.org Mon Jun 8 00:20:16 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E416733BE96; Mon, 8 Jun 2020 00:20:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gDRN5pSpz3gZq; Mon, 8 Jun 2020 00:20:16 +0000 (UTC) (envelope-from gonzo@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C29441BB22; Mon, 8 Jun 2020 00:20:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0580KG6b091695; Mon, 8 Jun 2020 00:20:16 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0580KG93091692; Mon, 8 Jun 2020 00:20:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202006080020.0580KG93091692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 8 Jun 2020 00:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361899 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 361899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 00:20:17 -0000 Author: gonzo Date: Mon Jun 8 00:20:15 2020 New Revision: 361899 URL: https://svnweb.freebsd.org/changeset/base/361899 Log: MFC r352028: [rpi] Inherit framebuffer BPP value from the VideoCore firmware Instead of using hardcoded bpp of 24, obtain current/configured value from VideoCore. This solves certain problems with Xorg/Qt apps that require bpp of 32 to work properly. The mode can be forced by setting framebuffer_depth value in config.txt PR: 235363 Submitted by: Steve Peurifoy Tested by: Johnathan Chen (stabe/12 patch) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.c stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Jun 7 19:56:17 2020 (r361898) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Mon Jun 8 00:20:15 2020 (r361899) @@ -85,7 +85,13 @@ bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_ memset(fb, 0, sizeof(*fb)); if (bcm2835_mbox_fb_get_w_h(fb) != 0) return (ENXIO); - fb->bpp = FB_DEPTH; + if (bcm2835_mbox_fb_get_bpp(fb) != 0) + return (ENXIO); + if (fb->bpp < FB_DEPTH) { + device_printf(sc->dev, "changing fb bpp from %d to %d\n", fb->bpp, FB_DEPTH); + fb->bpp = FB_DEPTH; + } else + device_printf(sc->dev, "keeping existing fb bpp of %d\n", fb->bpp); fb->vxres = fb->xres; fb->vyres = fb->yres; Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Jun 7 19:56:17 2020 (r361898) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Jun 8 00:20:15 2020 (r361899) @@ -499,6 +499,26 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *fb) } int +bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *fb) +{ + int err; + struct msg_fb_get_bpp msg; + + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + BCM2835_MBOX_INIT_TAG(&msg.bpp, GET_DEPTH); + msg.bpp.tag_hdr.val_len = 0; + msg.end_tag = 0; + + err = bcm2835_mbox_property(&msg, sizeof(msg)); + if (err == 0) + fb->bpp = msg.bpp.body.resp.bpp; + + return (err); +} + +int bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb) { int err; Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Jun 7 19:56:17 2020 (r361898) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Jun 8 00:20:15 2020 (r361899) @@ -475,6 +475,14 @@ struct msg_fb_get_w_h { int bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *); +struct msg_fb_get_bpp { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_depth bpp; + uint32_t end_tag; +}; + +int bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *); + struct msg_fb_setup { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_fb_w_h physical_w_h; From owner-svn-src-stable@freebsd.org Mon Jun 8 09:23:52 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB0E1328863; Mon, 8 Jun 2020 09:23:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSVc3SW3z41Lf; Mon, 8 Jun 2020 09:23:52 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71EE221EF8; Mon, 8 Jun 2020 09:23:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589NqPV029459; Mon, 8 Jun 2020 09:23:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589NqS7029458; Mon, 8 Jun 2020 09:23:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080923.0589NqS7029458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361906 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 361906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:23:52 -0000 Author: hselasky Date: Mon Jun 8 09:23:52 2020 New Revision: 361906 URL: https://svnweb.freebsd.org/changeset/base/361906 Log: MFC r361577: Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/usb_device.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usb_device.c ============================================================================== --- stable/12/sys/dev/usb/usb_device.c Mon Jun 8 08:52:02 2020 (r361905) +++ stable/12/sys/dev/usb/usb_device.c Mon Jun 8 09:23:52 2020 (r361906) @@ -1402,7 +1402,7 @@ usbd_set_parent_iface(struct usb_device *udev, uint8_t { struct usb_interface *iface; - if (udev == NULL) { + if (udev == NULL || iface_index == parent_index) { /* nothing to do */ return; } From owner-svn-src-stable@freebsd.org Mon Jun 8 09:24:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EA52328B9D; Mon, 8 Jun 2020 09:24:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSWJ3fWSz41Kb; Mon, 8 Jun 2020 09:24:28 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7891D22158; Mon, 8 Jun 2020 09:24:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589OShR029548; Mon, 8 Jun 2020 09:24:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589OSvm029547; Mon, 8 Jun 2020 09:24:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080924.0589OSvm029547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361907 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 361907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:24:28 -0000 Author: hselasky Date: Mon Jun 8 09:24:28 2020 New Revision: 361907 URL: https://svnweb.freebsd.org/changeset/base/361907 Log: MFC r361577: Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usb_device.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_device.c ============================================================================== --- stable/11/sys/dev/usb/usb_device.c Mon Jun 8 09:23:52 2020 (r361906) +++ stable/11/sys/dev/usb/usb_device.c Mon Jun 8 09:24:28 2020 (r361907) @@ -1400,7 +1400,7 @@ usbd_set_parent_iface(struct usb_device *udev, uint8_t { struct usb_interface *iface; - if (udev == NULL) { + if (udev == NULL || iface_index == parent_index) { /* nothing to do */ return; } From owner-svn-src-stable@freebsd.org Mon Jun 8 09:25:02 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B350328C8D; Mon, 8 Jun 2020 09:25:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSWy1lvvz41NV; Mon, 8 Jun 2020 09:25:02 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3781221EF9; Mon, 8 Jun 2020 09:25:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589P2lK029648; Mon, 8 Jun 2020 09:25:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589P2Be029647; Mon, 8 Jun 2020 09:25:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080925.0589P2Be029647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:25:02 +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: r361908 - stable/10/sys/dev/usb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb X-SVN-Commit-Revision: 361908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:25:02 -0000 Author: hselasky Date: Mon Jun 8 09:25:01 2020 New Revision: 361908 URL: https://svnweb.freebsd.org/changeset/base/361908 Log: MFC r361577: Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/usb_device.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_device.c ============================================================================== --- stable/10/sys/dev/usb/usb_device.c Mon Jun 8 09:24:28 2020 (r361907) +++ stable/10/sys/dev/usb/usb_device.c Mon Jun 8 09:25:01 2020 (r361908) @@ -1274,7 +1274,7 @@ usbd_set_parent_iface(struct usb_device *udev, uint8_t { struct usb_interface *iface; - if (udev == NULL) { + if (udev == NULL || iface_index == parent_index) { /* nothing to do */ return; } From owner-svn-src-stable@freebsd.org Mon Jun 8 09:25:41 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F2063288D9; Mon, 8 Jun 2020 09:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSXj10G3z41d7; Mon, 8 Jun 2020 09:25:41 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D72C21CFF; Mon, 8 Jun 2020 09:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589PeZI029733; Mon, 8 Jun 2020 09:25:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589PeF2029732; Mon, 8 Jun 2020 09:25:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080925.0589PeF2029732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361909 - stable/9/sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb X-SVN-Commit-Revision: 361909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:25:41 -0000 Author: hselasky Date: Mon Jun 8 09:25:40 2020 New Revision: 361909 URL: https://svnweb.freebsd.org/changeset/base/361909 Log: MFC r361577: Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/usb_device.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Mon Jun 8 09:25:01 2020 (r361908) +++ stable/9/sys/dev/usb/usb_device.c Mon Jun 8 09:25:40 2020 (r361909) @@ -1241,7 +1241,7 @@ usbd_set_parent_iface(struct usb_device *udev, uint8_t { struct usb_interface *iface; - if (udev == NULL) { + if (udev == NULL || iface_index == parent_index) { /* nothing to do */ return; } From owner-svn-src-stable@freebsd.org Mon Jun 8 09:26:51 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E904D328E83; Mon, 8 Jun 2020 09:26:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSZ23Bw3z41sD; Mon, 8 Jun 2020 09:26:49 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E951222B3; Mon, 8 Jun 2020 09:26:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589QkoR029843; Mon, 8 Jun 2020 09:26:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589Qk0u029842; Mon, 8 Jun 2020 09:26:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080926.0589Qk0u029842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361910 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 361910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:26:52 -0000 Author: hselasky Date: Mon Jun 8 09:26:46 2020 New Revision: 361910 URL: https://svnweb.freebsd.org/changeset/base/361910 Log: MFC r361581: Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/usb_transfer.c stable/12/sys/dev/usb/usbdi.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/12/sys/dev/usb/usb_transfer.c Mon Jun 8 09:25:40 2020 (r361909) +++ stable/12/sys/dev/usb/usb_transfer.c Mon Jun 8 09:26:46 2020 (r361910) @@ -374,6 +374,81 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_params #endif /*------------------------------------------------------------------------* + * usbd_get_max_frame_length + * + * This function returns the maximum single frame length as computed by + * usbd_transfer_setup(). It is useful when computing buffer sizes for + * devices having multiple alternate settings. The SuperSpeed endpoint + * companion pointer is allowed to be NULL. + *------------------------------------------------------------------------*/ +uint32_t +usbd_get_max_frame_length(const struct usb_endpoint_descriptor *edesc, + const struct usb_endpoint_ss_comp_descriptor *ecomp, + enum usb_dev_speed speed) +{ + uint32_t max_packet_size; + uint32_t max_packet_count; + uint8_t type; + + max_packet_size = UGETW(edesc->wMaxPacketSize); + max_packet_count = 1; + type = (edesc->bmAttributes & UE_XFERTYPE); + + switch (speed) { + case USB_SPEED_HIGH: + switch (type) { + case UE_ISOCHRONOUS: + case UE_INTERRUPT: + max_packet_count += + (max_packet_size >> 11) & 3; + + /* check for invalid max packet count */ + if (max_packet_count > 3) + max_packet_count = 3; + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + case USB_SPEED_SUPER: + max_packet_count += (max_packet_size >> 11) & 3; + + if (ecomp != NULL) + max_packet_count += ecomp->bMaxBurst; + + if ((max_packet_count == 0) || + (max_packet_count > 16)) + max_packet_count = 16; + + switch (type) { + case UE_CONTROL: + max_packet_count = 1; + break; + case UE_ISOCHRONOUS: + if (ecomp != NULL) { + uint8_t mult; + + mult = UE_GET_SS_ISO_MULT( + ecomp->bmAttributes) + 1; + if (mult > 3) + mult = 3; + + max_packet_count *= mult; + } + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + default: + break; + } + return (max_packet_size * max_packet_count); +} + +/*------------------------------------------------------------------------* * usbd_transfer_setup_sub - transfer setup subroutine * * This function must be called from the "xfer_setup" callback of the Modified: stable/12/sys/dev/usb/usbdi.h ============================================================================== --- stable/12/sys/dev/usb/usbdi.h Mon Jun 8 09:25:40 2020 (r361909) +++ stable/12/sys/dev/usb/usbdi.h Mon Jun 8 09:26:46 2020 (r361910) @@ -605,6 +605,9 @@ uint8_t usbd_get_interface_altindex(struct usb_interfa usb_error_t usbd_set_alt_interface_index(struct usb_device *udev, uint8_t iface_index, uint8_t alt_index); uint32_t usbd_get_isoc_fps(struct usb_device *udev); +uint32_t usbd_get_max_frame_length(const struct usb_endpoint_descriptor *, + const struct usb_endpoint_ss_comp_descriptor *, + enum usb_dev_speed); usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **pxfer, const struct usb_config *setup_start, uint16_t n_setup, From owner-svn-src-stable@freebsd.org Mon Jun 8 09:27:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E2A8328F13; Mon, 8 Jun 2020 09:27:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSb90ydhz4267; Mon, 8 Jun 2020 09:27:49 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C5C922500; Mon, 8 Jun 2020 09:27:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589RmlJ029961; Mon, 8 Jun 2020 09:27:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589Rm3B029960; Mon, 8 Jun 2020 09:27:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080927.0589Rm3B029960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361911 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 361911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:27:49 -0000 Author: hselasky Date: Mon Jun 8 09:27:48 2020 New Revision: 361911 URL: https://svnweb.freebsd.org/changeset/base/361911 Log: MFC r361581: Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usb_transfer.c stable/11/sys/dev/usb/usbdi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/11/sys/dev/usb/usb_transfer.c Mon Jun 8 09:26:46 2020 (r361910) +++ stable/11/sys/dev/usb/usb_transfer.c Mon Jun 8 09:27:48 2020 (r361911) @@ -373,6 +373,81 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_params #endif /*------------------------------------------------------------------------* + * usbd_get_max_frame_length + * + * This function returns the maximum single frame length as computed by + * usbd_transfer_setup(). It is useful when computing buffer sizes for + * devices having multiple alternate settings. The SuperSpeed endpoint + * companion pointer is allowed to be NULL. + *------------------------------------------------------------------------*/ +uint32_t +usbd_get_max_frame_length(const struct usb_endpoint_descriptor *edesc, + const struct usb_endpoint_ss_comp_descriptor *ecomp, + enum usb_dev_speed speed) +{ + uint32_t max_packet_size; + uint32_t max_packet_count; + uint8_t type; + + max_packet_size = UGETW(edesc->wMaxPacketSize); + max_packet_count = 1; + type = (edesc->bmAttributes & UE_XFERTYPE); + + switch (speed) { + case USB_SPEED_HIGH: + switch (type) { + case UE_ISOCHRONOUS: + case UE_INTERRUPT: + max_packet_count += + (max_packet_size >> 11) & 3; + + /* check for invalid max packet count */ + if (max_packet_count > 3) + max_packet_count = 3; + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + case USB_SPEED_SUPER: + max_packet_count += (max_packet_size >> 11) & 3; + + if (ecomp != NULL) + max_packet_count += ecomp->bMaxBurst; + + if ((max_packet_count == 0) || + (max_packet_count > 16)) + max_packet_count = 16; + + switch (type) { + case UE_CONTROL: + max_packet_count = 1; + break; + case UE_ISOCHRONOUS: + if (ecomp != NULL) { + uint8_t mult; + + mult = UE_GET_SS_ISO_MULT( + ecomp->bmAttributes) + 1; + if (mult > 3) + mult = 3; + + max_packet_count *= mult; + } + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + default: + break; + } + return (max_packet_size * max_packet_count); +} + +/*------------------------------------------------------------------------* * usbd_transfer_setup_sub - transfer setup subroutine * * This function must be called from the "xfer_setup" callback of the Modified: stable/11/sys/dev/usb/usbdi.h ============================================================================== --- stable/11/sys/dev/usb/usbdi.h Mon Jun 8 09:26:46 2020 (r361910) +++ stable/11/sys/dev/usb/usbdi.h Mon Jun 8 09:27:48 2020 (r361911) @@ -552,6 +552,9 @@ uint8_t usbd_get_interface_altindex(struct usb_interfa usb_error_t usbd_set_alt_interface_index(struct usb_device *udev, uint8_t iface_index, uint8_t alt_index); uint32_t usbd_get_isoc_fps(struct usb_device *udev); +uint32_t usbd_get_max_frame_length(const struct usb_endpoint_descriptor *, + const struct usb_endpoint_ss_comp_descriptor *, + enum usb_dev_speed); usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **pxfer, const struct usb_config *setup_start, uint16_t n_setup, From owner-svn-src-stable@freebsd.org Mon Jun 8 09:28:27 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 146E7328F29; Mon, 8 Jun 2020 09:28:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSbt6r39z42L8; Mon, 8 Jun 2020 09:28:26 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5CB421FDF; Mon, 8 Jun 2020 09:28:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589SQvF030052; Mon, 8 Jun 2020 09:28:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589SQPD030050; Mon, 8 Jun 2020 09:28:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080928.0589SQPD030050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:28: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: r361912 - stable/10/sys/dev/usb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb X-SVN-Commit-Revision: 361912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:28:27 -0000 Author: hselasky Date: Mon Jun 8 09:28:26 2020 New Revision: 361912 URL: https://svnweb.freebsd.org/changeset/base/361912 Log: MFC r361581: Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/usb_transfer.c stable/10/sys/dev/usb/usbdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/10/sys/dev/usb/usb_transfer.c Mon Jun 8 09:27:48 2020 (r361911) +++ stable/10/sys/dev/usb/usb_transfer.c Mon Jun 8 09:28:26 2020 (r361912) @@ -373,6 +373,81 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_params #endif /*------------------------------------------------------------------------* + * usbd_get_max_frame_length + * + * This function returns the maximum single frame length as computed by + * usbd_transfer_setup(). It is useful when computing buffer sizes for + * devices having multiple alternate settings. The SuperSpeed endpoint + * companion pointer is allowed to be NULL. + *------------------------------------------------------------------------*/ +uint32_t +usbd_get_max_frame_length(const struct usb_endpoint_descriptor *edesc, + const struct usb_endpoint_ss_comp_descriptor *ecomp, + enum usb_dev_speed speed) +{ + uint32_t max_packet_size; + uint32_t max_packet_count; + uint8_t type; + + max_packet_size = UGETW(edesc->wMaxPacketSize); + max_packet_count = 1; + type = (edesc->bmAttributes & UE_XFERTYPE); + + switch (speed) { + case USB_SPEED_HIGH: + switch (type) { + case UE_ISOCHRONOUS: + case UE_INTERRUPT: + max_packet_count += + (max_packet_size >> 11) & 3; + + /* check for invalid max packet count */ + if (max_packet_count > 3) + max_packet_count = 3; + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + case USB_SPEED_SUPER: + max_packet_count += (max_packet_size >> 11) & 3; + + if (ecomp != NULL) + max_packet_count += ecomp->bMaxBurst; + + if ((max_packet_count == 0) || + (max_packet_count > 16)) + max_packet_count = 16; + + switch (type) { + case UE_CONTROL: + max_packet_count = 1; + break; + case UE_ISOCHRONOUS: + if (ecomp != NULL) { + uint8_t mult; + + mult = UE_GET_SS_ISO_MULT( + ecomp->bmAttributes) + 1; + if (mult > 3) + mult = 3; + + max_packet_count *= mult; + } + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + default: + break; + } + return (max_packet_size * max_packet_count); +} + +/*------------------------------------------------------------------------* * usbd_transfer_setup_sub - transfer setup subroutine * * This function must be called from the "xfer_setup" callback of the Modified: stable/10/sys/dev/usb/usbdi.h ============================================================================== --- stable/10/sys/dev/usb/usbdi.h Mon Jun 8 09:27:48 2020 (r361911) +++ stable/10/sys/dev/usb/usbdi.h Mon Jun 8 09:28:26 2020 (r361912) @@ -519,6 +519,9 @@ uint8_t usbd_get_interface_altindex(struct usb_interfa usb_error_t usbd_set_alt_interface_index(struct usb_device *udev, uint8_t iface_index, uint8_t alt_index); uint32_t usbd_get_isoc_fps(struct usb_device *udev); +uint32_t usbd_get_max_frame_length(const struct usb_endpoint_descriptor *, + const struct usb_endpoint_ss_comp_descriptor *, + enum usb_dev_speed); usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **pxfer, const struct usb_config *setup_start, uint16_t n_setup, From owner-svn-src-stable@freebsd.org Mon Jun 8 09:29:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A132B328CEA; Mon, 8 Jun 2020 09:29:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gScj3tGWz42Tb; Mon, 8 Jun 2020 09:29:09 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 806AA21FE0; Mon, 8 Jun 2020 09:29:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589T9x7030170; Mon, 8 Jun 2020 09:29:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589T9lX030169; Mon, 8 Jun 2020 09:29:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080929.0589T9lX030169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361913 - stable/9/sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb X-SVN-Commit-Revision: 361913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:29:09 -0000 Author: hselasky Date: Mon Jun 8 09:29:08 2020 New Revision: 361913 URL: https://svnweb.freebsd.org/changeset/base/361913 Log: MFC r361581: Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/usb_transfer.c stable/9/sys/dev/usb/usbdi.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/9/sys/dev/usb/usb_transfer.c Mon Jun 8 09:28:26 2020 (r361912) +++ stable/9/sys/dev/usb/usb_transfer.c Mon Jun 8 09:29:08 2020 (r361913) @@ -299,6 +299,81 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_params #endif /*------------------------------------------------------------------------* + * usbd_get_max_frame_length + * + * This function returns the maximum single frame length as computed by + * usbd_transfer_setup(). It is useful when computing buffer sizes for + * devices having multiple alternate settings. The SuperSpeed endpoint + * companion pointer is allowed to be NULL. + *------------------------------------------------------------------------*/ +uint32_t +usbd_get_max_frame_length(const struct usb_endpoint_descriptor *edesc, + const struct usb_endpoint_ss_comp_descriptor *ecomp, + enum usb_dev_speed speed) +{ + uint32_t max_packet_size; + uint32_t max_packet_count; + uint8_t type; + + max_packet_size = UGETW(edesc->wMaxPacketSize); + max_packet_count = 1; + type = (edesc->bmAttributes & UE_XFERTYPE); + + switch (speed) { + case USB_SPEED_HIGH: + switch (type) { + case UE_ISOCHRONOUS: + case UE_INTERRUPT: + max_packet_count += + (max_packet_size >> 11) & 3; + + /* check for invalid max packet count */ + if (max_packet_count > 3) + max_packet_count = 3; + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + case USB_SPEED_SUPER: + max_packet_count += (max_packet_size >> 11) & 3; + + if (ecomp != NULL) + max_packet_count += ecomp->bMaxBurst; + + if ((max_packet_count == 0) || + (max_packet_count > 16)) + max_packet_count = 16; + + switch (type) { + case UE_CONTROL: + max_packet_count = 1; + break; + case UE_ISOCHRONOUS: + if (ecomp != NULL) { + uint8_t mult; + + mult = UE_GET_SS_ISO_MULT( + ecomp->bmAttributes) + 1; + if (mult > 3) + mult = 3; + + max_packet_count *= mult; + } + break; + default: + break; + } + max_packet_size &= 0x7FF; + break; + default: + break; + } + return (max_packet_size * max_packet_count); +} + +/*------------------------------------------------------------------------* * usbd_transfer_setup_sub - transfer setup subroutine * * This function must be called from the "xfer_setup" callback of the Modified: stable/9/sys/dev/usb/usbdi.h ============================================================================== --- stable/9/sys/dev/usb/usbdi.h Mon Jun 8 09:28:26 2020 (r361912) +++ stable/9/sys/dev/usb/usbdi.h Mon Jun 8 09:29:08 2020 (r361913) @@ -496,6 +496,9 @@ uint8_t usbd_get_interface_altindex(struct usb_interfa usb_error_t usbd_set_alt_interface_index(struct usb_device *udev, uint8_t iface_index, uint8_t alt_index); uint32_t usbd_get_isoc_fps(struct usb_device *udev); +uint32_t usbd_get_max_frame_length(const struct usb_endpoint_descriptor *, + const struct usb_endpoint_ss_comp_descriptor *, + enum usb_dev_speed); usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **pxfer, const struct usb_config *setup_start, uint16_t n_setup, From owner-svn-src-stable@freebsd.org Mon Jun 8 09:30:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1BFD328DE4; Mon, 8 Jun 2020 09:30:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSds3jZXz42jr; Mon, 8 Jun 2020 09:30:09 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A98822269; Mon, 8 Jun 2020 09:30:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589U98n030394; Mon, 8 Jun 2020 09:30:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589U9nF030393; Mon, 8 Jun 2020 09:30:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080930.0589U9nF030393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361914 - stable/12/sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 361914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:30:09 -0000 Author: hselasky Date: Mon Jun 8 09:30:08 2020 New Revision: 361914 URL: https://svnweb.freebsd.org/changeset/base/361914 Log: MFC r361582: Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Modified: stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:29:08 2020 (r361913) +++ stable/12/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:30:08 2020 (r361914) @@ -623,7 +623,7 @@ ubt_attach(device_t dev) struct usb_endpoint_descriptor *ed; struct usb_interface_descriptor *id; struct usb_interface *iface; - uint16_t wMaxPacketSize; + uint32_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -713,9 +713,10 @@ ubt_attach(device_t dev) if ((ed->bDescriptorType == UDESC_ENDPOINT) && (ed->bLength >= sizeof(*ed)) && (i == 1)) { - uint16_t temp; + uint32_t temp; - temp = UGETW(ed->wMaxPacketSize); + temp = usbd_get_max_frame_length( + ed, NULL, usbd_get_speed(uaa->device)); if (temp > wMaxPacketSize) { wMaxPacketSize = temp; alt_index = j; From owner-svn-src-stable@freebsd.org Mon Jun 8 09:30:43 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9FB7329188; Mon, 8 Jun 2020 09:30:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSfW604cz42hv; Mon, 8 Jun 2020 09:30:43 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C803522504; Mon, 8 Jun 2020 09:30:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589Uhid031983; Mon, 8 Jun 2020 09:30:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589Uh7T031982; Mon, 8 Jun 2020 09:30:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080930.0589Uh7T031982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361915 - stable/11/sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 361915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:30:44 -0000 Author: hselasky Date: Mon Jun 8 09:30:43 2020 New Revision: 361915 URL: https://svnweb.freebsd.org/changeset/base/361915 Log: MFC r361582: Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Modified: stable/11/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/11/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:30:08 2020 (r361914) +++ stable/11/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:30:43 2020 (r361915) @@ -540,7 +540,7 @@ ubt_attach(device_t dev) struct usb_endpoint_descriptor *ed; struct usb_interface_descriptor *id; struct usb_interface *iface; - uint16_t wMaxPacketSize; + uint32_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -630,9 +630,10 @@ ubt_attach(device_t dev) if ((ed->bDescriptorType == UDESC_ENDPOINT) && (ed->bLength >= sizeof(*ed)) && (i == 1)) { - uint16_t temp; + uint32_t temp; - temp = UGETW(ed->wMaxPacketSize); + temp = usbd_get_max_frame_length( + ed, NULL, usbd_get_speed(uaa->device)); if (temp > wMaxPacketSize) { wMaxPacketSize = temp; alt_index = j; From owner-svn-src-stable@freebsd.org Mon Jun 8 09:31:15 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F33F328EDC; Mon, 8 Jun 2020 09:31:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSg65yYWz432Z; Mon, 8 Jun 2020 09:31:14 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7DED22274; Mon, 8 Jun 2020 09:31:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589VEN7034505; Mon, 8 Jun 2020 09:31:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589VEDh034504; Mon, 8 Jun 2020 09:31:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080931.0589VEDh034504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:31:14 +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: r361916 - stable/10/sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 361916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:31:15 -0000 Author: hselasky Date: Mon Jun 8 09:31:14 2020 New Revision: 361916 URL: https://svnweb.freebsd.org/changeset/base/361916 Log: MFC r361582: Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Modified: stable/10/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:30:43 2020 (r361915) +++ stable/10/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:31:14 2020 (r361916) @@ -540,7 +540,7 @@ ubt_attach(device_t dev) struct usb_endpoint_descriptor *ed; struct usb_interface_descriptor *id; struct usb_interface *iface; - uint16_t wMaxPacketSize; + uint32_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -630,9 +630,10 @@ ubt_attach(device_t dev) if ((ed->bDescriptorType == UDESC_ENDPOINT) && (ed->bLength >= sizeof(*ed)) && (i == 1)) { - uint16_t temp; + uint32_t temp; - temp = UGETW(ed->wMaxPacketSize); + temp = usbd_get_max_frame_length( + ed, NULL, usbd_get_speed(uaa->device)); if (temp > wMaxPacketSize) { wMaxPacketSize = temp; alt_index = j; From owner-svn-src-stable@freebsd.org Mon Jun 8 09:31:52 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8EC4329387; Mon, 8 Jun 2020 09:31:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSgr52v6z43JP; Mon, 8 Jun 2020 09:31:52 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A87FD223F0; Mon, 8 Jun 2020 09:31:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589VqV9035445; Mon, 8 Jun 2020 09:31:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589VqWu035444; Mon, 8 Jun 2020 09:31:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080931.0589VqWu035444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361917 - stable/9/sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 361917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:31:52 -0000 Author: hselasky Date: Mon Jun 8 09:31:52 2020 New Revision: 361917 URL: https://svnweb.freebsd.org/changeset/base/361917 Log: MFC r361582: Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Modified: stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:31:14 2020 (r361916) +++ stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Mon Jun 8 09:31:52 2020 (r361917) @@ -506,7 +506,7 @@ ubt_attach(device_t dev) struct ubt_softc *sc = device_get_softc(dev); struct usb_endpoint_descriptor *ed; struct usb_interface_descriptor *id; - uint16_t wMaxPacketSize; + uint32_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -596,9 +596,10 @@ ubt_attach(device_t dev) if ((ed->bDescriptorType == UDESC_ENDPOINT) && (ed->bLength >= sizeof(*ed)) && (i == 1)) { - uint16_t temp; + uint32_t temp; - temp = UGETW(ed->wMaxPacketSize); + temp = usbd_get_max_frame_length( + ed, NULL, usbd_get_speed(uaa->device)); if (temp > wMaxPacketSize) { wMaxPacketSize = temp; alt_index = j; From owner-svn-src-stable@freebsd.org Mon Jun 8 09:32:58 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0282E32905A; Mon, 8 Jun 2020 09:32:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSj54zsKz43fQ; Mon, 8 Jun 2020 09:32:57 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2E812269D; Mon, 8 Jun 2020 09:32:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589Wv5w036385; Mon, 8 Jun 2020 09:32:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589WvjR036383; Mon, 8 Jun 2020 09:32:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080932.0589WvjR036383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361918 - in stable/12: lib/libusbhid sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12: lib/libusbhid sys/dev/usb X-SVN-Commit-Revision: 361918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:32:58 -0000 Author: hselasky Date: Mon Jun 8 09:32:57 2020 New Revision: 361918 URL: https://svnweb.freebsd.org/changeset/base/361918 Log: MFC r361827: USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Modified: stable/12/lib/libusbhid/parse.c stable/12/sys/dev/usb/usb_hid.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libusbhid/parse.c ============================================================================== --- stable/12/lib/libusbhid/parse.c Mon Jun 8 09:31:52 2020 (r361917) +++ stable/12/lib/libusbhid/parse.c Mon Jun 8 09:32:57 2020 (r361918) @@ -403,26 +403,28 @@ hid_get_item_raw(hid_data_t s, hid_item_t *h) s->loc_count = dval & mask; break; case 10: /* Push */ + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) + return (0); s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->report_size = s->loc_size; - c->report_count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->report_size = s->loc_size; + c->report_count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) + return (0); s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->report_size; - s->loc_count = c->report_count; - c->report_size = 0; - c->report_count = 0; - } + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->report_size; + s->loc_count = c->report_count; + c->report_size = 0; + c->report_count = 0; break; default: break; Modified: stable/12/sys/dev/usb/usb_hid.c ============================================================================== --- stable/12/sys/dev/usb/usb_hid.c Mon Jun 8 09:31:52 2020 (r361917) +++ stable/12/sys/dev/usb/usb_hid.c Mon Jun 8 09:32:57 2020 (r361918) @@ -436,36 +436,36 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->loc_count = dval & mask; break; case 10: /* Push */ - s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->loc.size = s->loc_size; - c->loc.count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } else { - DPRINTFN(0, "Cannot push " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) { + DPRINTFN(0, "Cannot push item @ %d\n", s->pushlevel); + return (0); } + s->pushlevel ++; + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->loc.size = s->loc_size; + c->loc.count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ - s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - /* preserve position */ - oldpos = c->loc.pos; - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->loc.size; - s->loc_count = c->loc.count; - /* set default item location */ - c->loc.pos = oldpos; - c->loc.size = 0; - c->loc.count = 0; - } else { - DPRINTFN(0, "Cannot pop " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) { + DPRINTFN(0, "Cannot pop item @ 0\n"); + return (0); } + s->pushlevel --; + /* preserve position */ + oldpos = c->loc.pos; + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->loc.size; + s->loc_count = c->loc.count; + /* set default item location */ + c->loc.pos = oldpos; + c->loc.size = 0; + c->loc.count = 0; break; default: DPRINTFN(0, "Global bTag=%d\n", bTag); From owner-svn-src-stable@freebsd.org Mon Jun 8 09:33:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 328E8329510; Mon, 8 Jun 2020 09:33:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSjt0c5bz43XT; Mon, 8 Jun 2020 09:33:38 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 101A4224CE; Mon, 8 Jun 2020 09:33:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589Xbvi036512; Mon, 8 Jun 2020 09:33:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589Xb2O036511; Mon, 8 Jun 2020 09:33:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080933.0589Xb2O036511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361919 - in stable/11: lib/libusbhid sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: lib/libusbhid sys/dev/usb X-SVN-Commit-Revision: 361919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:33:38 -0000 Author: hselasky Date: Mon Jun 8 09:33:37 2020 New Revision: 361919 URL: https://svnweb.freebsd.org/changeset/base/361919 Log: MFC r361827: USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Modified: stable/11/lib/libusbhid/parse.c stable/11/sys/dev/usb/usb_hid.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libusbhid/parse.c ============================================================================== --- stable/11/lib/libusbhid/parse.c Mon Jun 8 09:32:57 2020 (r361918) +++ stable/11/lib/libusbhid/parse.c Mon Jun 8 09:33:37 2020 (r361919) @@ -401,26 +401,28 @@ hid_get_item_raw(hid_data_t s, hid_item_t *h) s->loc_count = dval & mask; break; case 10: /* Push */ + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) + return (0); s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->report_size = s->loc_size; - c->report_count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->report_size = s->loc_size; + c->report_count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) + return (0); s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->report_size; - s->loc_count = c->report_count; - c->report_size = 0; - c->report_count = 0; - } + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->report_size; + s->loc_count = c->report_count; + c->report_size = 0; + c->report_count = 0; break; default: break; Modified: stable/11/sys/dev/usb/usb_hid.c ============================================================================== --- stable/11/sys/dev/usb/usb_hid.c Mon Jun 8 09:32:57 2020 (r361918) +++ stable/11/sys/dev/usb/usb_hid.c Mon Jun 8 09:33:37 2020 (r361919) @@ -434,36 +434,36 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->loc_count = dval & mask; break; case 10: /* Push */ - s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->loc.size = s->loc_size; - c->loc.count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } else { - DPRINTFN(0, "Cannot push " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) { + DPRINTFN(0, "Cannot push item @ %d\n", s->pushlevel); + return (0); } + s->pushlevel ++; + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->loc.size = s->loc_size; + c->loc.count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ - s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - /* preserve position */ - oldpos = c->loc.pos; - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->loc.size; - s->loc_count = c->loc.count; - /* set default item location */ - c->loc.pos = oldpos; - c->loc.size = 0; - c->loc.count = 0; - } else { - DPRINTFN(0, "Cannot pop " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) { + DPRINTFN(0, "Cannot pop item @ 0\n"); + return (0); } + s->pushlevel --; + /* preserve position */ + oldpos = c->loc.pos; + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->loc.size; + s->loc_count = c->loc.count; + /* set default item location */ + c->loc.pos = oldpos; + c->loc.size = 0; + c->loc.count = 0; break; default: DPRINTFN(0, "Global bTag=%d\n", bTag); From owner-svn-src-stable@freebsd.org Mon Jun 8 09:34:16 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D81C3329682; Mon, 8 Jun 2020 09:34:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSkc5R5Mz4448; Mon, 8 Jun 2020 09:34:16 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5C39225A7; Mon, 8 Jun 2020 09:34:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589YG7U036651; Mon, 8 Jun 2020 09:34:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589YGDX036649; Mon, 8 Jun 2020 09:34:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080934.0589YGDX036649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:34:16 +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: r361921 - in stable/10: lib/libusbhid sys/dev/usb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10: lib/libusbhid sys/dev/usb X-SVN-Commit-Revision: 361921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:34:16 -0000 Author: hselasky Date: Mon Jun 8 09:34:16 2020 New Revision: 361921 URL: https://svnweb.freebsd.org/changeset/base/361921 Log: MFC r361827: USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Modified: stable/10/lib/libusbhid/parse.c stable/10/sys/dev/usb/usb_hid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusbhid/parse.c ============================================================================== --- stable/10/lib/libusbhid/parse.c Mon Jun 8 09:33:45 2020 (r361920) +++ stable/10/lib/libusbhid/parse.c Mon Jun 8 09:34:16 2020 (r361921) @@ -401,26 +401,28 @@ hid_get_item_raw(hid_data_t s, hid_item_t *h) s->loc_count = dval & mask; break; case 10: /* Push */ + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) + return (0); s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->report_size = s->loc_size; - c->report_count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->report_size = s->loc_size; + c->report_count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) + return (0); s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->report_size; - s->loc_count = c->report_count; - c->report_size = 0; - c->report_count = 0; - } + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->report_size; + s->loc_count = c->report_count; + c->report_size = 0; + c->report_count = 0; break; default: break; Modified: stable/10/sys/dev/usb/usb_hid.c ============================================================================== --- stable/10/sys/dev/usb/usb_hid.c Mon Jun 8 09:33:45 2020 (r361920) +++ stable/10/sys/dev/usb/usb_hid.c Mon Jun 8 09:34:16 2020 (r361921) @@ -434,36 +434,36 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->loc_count = dval & mask; break; case 10: /* Push */ - s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->loc.size = s->loc_size; - c->loc.count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } else { - DPRINTFN(0, "Cannot push " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) { + DPRINTFN(0, "Cannot push item @ %d\n", s->pushlevel); + return (0); } + s->pushlevel ++; + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->loc.size = s->loc_size; + c->loc.count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ - s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - /* preserve position */ - oldpos = c->loc.pos; - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->loc.size; - s->loc_count = c->loc.count; - /* set default item location */ - c->loc.pos = oldpos; - c->loc.size = 0; - c->loc.count = 0; - } else { - DPRINTFN(0, "Cannot pop " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) { + DPRINTFN(0, "Cannot pop item @ 0\n"); + return (0); } + s->pushlevel --; + /* preserve position */ + oldpos = c->loc.pos; + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->loc.size; + s->loc_count = c->loc.count; + /* set default item location */ + c->loc.pos = oldpos; + c->loc.size = 0; + c->loc.count = 0; break; default: DPRINTFN(0, "Global bTag=%d\n", bTag); From owner-svn-src-stable@freebsd.org Mon Jun 8 09:35:33 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FDCC3294F1; Mon, 8 Jun 2020 09:35:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSm512gsz449L; Mon, 8 Jun 2020 09:35:33 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EF7F225A9; Mon, 8 Jun 2020 09:35:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589ZXUH036788; Mon, 8 Jun 2020 09:35:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589ZWds036786; Mon, 8 Jun 2020 09:35:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080935.0589ZWds036786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361922 - in stable/9: lib/libusbhid sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/9: lib/libusbhid sys/dev/usb X-SVN-Commit-Revision: 361922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:35:33 -0000 Author: hselasky Date: Mon Jun 8 09:35:32 2020 New Revision: 361922 URL: https://svnweb.freebsd.org/changeset/base/361922 Log: MFC r361827: USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Modified: stable/9/lib/libusbhid/parse.c stable/9/sys/dev/usb/usb_hid.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusbhid/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libusbhid/parse.c ============================================================================== --- stable/9/lib/libusbhid/parse.c Mon Jun 8 09:34:16 2020 (r361921) +++ stable/9/lib/libusbhid/parse.c Mon Jun 8 09:35:32 2020 (r361922) @@ -401,26 +401,28 @@ hid_get_item_raw(hid_data_t s, hid_item_t *h) s->loc_count = dval & mask; break; case 10: /* Push */ + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) + return (0); s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->report_size = s->loc_size; - c->report_count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->report_size = s->loc_size; + c->report_count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) + return (0); s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->report_size; - s->loc_count = c->report_count; - c->report_size = 0; - c->report_count = 0; - } + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->report_size; + s->loc_count = c->report_count; + c->report_size = 0; + c->report_count = 0; break; default: break; Modified: stable/9/sys/dev/usb/usb_hid.c ============================================================================== --- stable/9/sys/dev/usb/usb_hid.c Mon Jun 8 09:34:16 2020 (r361921) +++ stable/9/sys/dev/usb/usb_hid.c Mon Jun 8 09:35:32 2020 (r361922) @@ -433,36 +433,36 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->loc_count = dval & mask; break; case 10: /* Push */ - s->pushlevel ++; - if (s->pushlevel < MAXPUSH) { - s->cur[s->pushlevel] = *c; - /* store size and count */ - c->loc.size = s->loc_size; - c->loc.count = s->loc_count; - /* update current item pointer */ - c = &s->cur[s->pushlevel]; - } else { - DPRINTFN(0, "Cannot push " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if ((s->pushlevel + 1) >= MAXPUSH) { + DPRINTFN(0, "Cannot push item @ %d\n", s->pushlevel); + return (0); } + s->pushlevel ++; + s->cur[s->pushlevel] = *c; + /* store size and count */ + c->loc.size = s->loc_size; + c->loc.count = s->loc_count; + /* update current item pointer */ + c = &s->cur[s->pushlevel]; break; case 11: /* Pop */ - s->pushlevel --; - if (s->pushlevel < MAXPUSH) { - /* preserve position */ - oldpos = c->loc.pos; - c = &s->cur[s->pushlevel]; - /* restore size and count */ - s->loc_size = c->loc.size; - s->loc_count = c->loc.count; - /* set default item location */ - c->loc.pos = oldpos; - c->loc.size = 0; - c->loc.count = 0; - } else { - DPRINTFN(0, "Cannot pop " - "item @ %d\n", s->pushlevel); + /* stop parsing, if invalid push level */ + if (s->pushlevel == 0) { + DPRINTFN(0, "Cannot pop item @ 0\n"); + return (0); } + s->pushlevel --; + /* preserve position */ + oldpos = c->loc.pos; + c = &s->cur[s->pushlevel]; + /* restore size and count */ + s->loc_size = c->loc.size; + s->loc_count = c->loc.count; + /* set default item location */ + c->loc.pos = oldpos; + c->loc.size = 0; + c->loc.count = 0; break; default: DPRINTFN(0, "Global bTag=%d\n", bTag); From owner-svn-src-stable@freebsd.org Mon Jun 8 09:37:22 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00D053295E4; Mon, 8 Jun 2020 09:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSp95gkLz44DP; Mon, 8 Jun 2020 09:37:21 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A418822796; Mon, 8 Jun 2020 09:37:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589bL9F036926; Mon, 8 Jun 2020 09:37:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589bLLS036924; Mon, 8 Jun 2020 09:37:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080937.0589bLLS036924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361923 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:37:22 -0000 Author: hselasky Date: Mon Jun 8 09:37:20 2020 New Revision: 361923 URL: https://svnweb.freebsd.org/changeset/base/361923 Log: MFC r361498: Sync with Linux packet pacing enhancements in mlx5en(4). Linux commit: 05d3ac978ed25b753bfe34fe76c50c31ee506a82 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_rl.c stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_rl.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_rl.c Mon Jun 8 09:35:32 2020 (r361922) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_rl.c Mon Jun 8 09:37:20 2020 (r361923) @@ -58,16 +58,14 @@ static struct mlx5_rl_entry *find_rl_entry(struct mlx5 static int mlx5_set_rate_limit_cmd(struct mlx5_core_dev *dev, u32 rate, u32 burst, u16 index) { - u32 in[MLX5_ST_SZ_DW(set_rate_limit_in)] = {0}; - u32 out[MLX5_ST_SZ_DW(set_rate_limit_out)] = {0}; + u32 in[MLX5_ST_SZ_DW(set_rate_limit_in)] = {}; + u32 out[MLX5_ST_SZ_DW(set_rate_limit_out)] = {}; - MLX5_SET(set_rate_limit_in, in, opcode, - MLX5_CMD_OP_SET_RATE_LIMIT); + MLX5_SET(set_rate_limit_in, in, opcode, MLX5_CMD_OP_SET_RATE_LIMIT); MLX5_SET(set_rate_limit_in, in, rate_limit_index, index); MLX5_SET(set_rate_limit_in, in, rate_limit, rate); - - if (MLX5_CAP_QOS(dev, packet_pacing_burst_bound)) - MLX5_SET(set_rate_limit_in, in, burst_upper_bound, burst); + MLX5_SET(set_rate_limit_in, in, burst_upper_bound, burst); + MLX5_SET(set_rate_limit_in, in, typical_packet_size, 0 /* use MTU */); return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); } Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Jun 8 09:35:32 2020 (r361922) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Jun 8 09:37:20 2020 (r361923) @@ -667,7 +667,8 @@ struct mlx5_ifc_qos_cap_bits { u8 esw_rate_limit[0x1]; u8 hll[0x1]; u8 packet_pacing_burst_bound[0x1]; - u8 reserved_at_6[0x1a]; + u8 packet_pacing_typical_size[0x1]; + u8 reserved_at_7[0x19]; u8 reserved_at_20[0x20]; @@ -7672,7 +7673,13 @@ struct mlx5_ifc_set_rate_limit_in_bits { u8 reserved_at_60[0x20]; u8 rate_limit[0x20]; + u8 burst_upper_bound[0x20]; + + u8 reserved_at_c0[0x10]; + u8 typical_packet_size[0x10]; + + u8 reserved_at_e0[0x120]; }; struct mlx5_ifc_access_register_out_bits { From owner-svn-src-stable@freebsd.org Mon Jun 8 09:39:16 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABD9B3297C2; Mon, 8 Jun 2020 09:39:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSrN480xz44RM; Mon, 8 Jun 2020 09:39:16 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899B1224CF; Mon, 8 Jun 2020 09:39:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589dGEg037064; Mon, 8 Jun 2020 09:39:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589dGtJ037063; Mon, 8 Jun 2020 09:39:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080939.0589dGtJ037063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361924 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:39:16 -0000 Author: hselasky Date: Mon Jun 8 09:39:16 2020 New Revision: 361924 URL: https://svnweb.freebsd.org/changeset/base/361924 Log: MFC r361110: Implement synchronize_srcu_expedited() in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24798 Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h Mon Jun 8 09:37:20 2020 (r361923) +++ stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h Mon Jun 8 09:39:16 2020 (r361924) @@ -49,4 +49,8 @@ extern void srcu_barrier(struct srcu_struct *); extern int init_srcu_struct(struct srcu_struct *); extern void cleanup_srcu_struct(struct srcu_struct *); +#define synchronize_srcu_expedited(srcu) do { \ + synchronize_srcu(srcu); \ +} while (0) + #endif /* _LINUX_SRCU_H_ */ From owner-svn-src-stable@freebsd.org Mon Jun 8 09:39:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 452DD32984C; Mon, 8 Jun 2020 09:39:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gSs117rRz44gY; Mon, 8 Jun 2020 09:39:49 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21EC82251B; Mon, 8 Jun 2020 09:39:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0589dnKo037151; Mon, 8 Jun 2020 09:39:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0589dn7I037150; Mon, 8 Jun 2020 09:39:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006080939.0589dn7I037150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jun 2020 09:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361925 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 09:39:49 -0000 Author: hselasky Date: Mon Jun 8 09:39:48 2020 New Revision: 361925 URL: https://svnweb.freebsd.org/changeset/base/361925 Log: MFC r361110: Implement synchronize_srcu_expedited() in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24798 Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h Mon Jun 8 09:39:16 2020 (r361924) +++ stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h Mon Jun 8 09:39:48 2020 (r361925) @@ -49,4 +49,8 @@ extern void srcu_barrier(struct srcu_struct *); extern int init_srcu_struct(struct srcu_struct *); extern void cleanup_srcu_struct(struct srcu_struct *); +#define synchronize_srcu_expedited(srcu) do { \ + synchronize_srcu(srcu); \ +} while (0) + #endif /* _LINUX_SRCU_H_ */ From owner-svn-src-stable@freebsd.org Mon Jun 8 13:27:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F249D32F347; Mon, 8 Jun 2020 13:27:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gYw15ZdNz4Vnx; Mon, 8 Jun 2020 13:27:45 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAC3F25308; Mon, 8 Jun 2020 13:27:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 058DRjl6080784; Mon, 8 Jun 2020 13:27:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058DRj9r080782; Mon, 8 Jun 2020 13:27:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006081327.058DRj9r080782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jun 2020 13:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361927 - stable/12/lib/librtld_db X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/librtld_db X-SVN-Commit-Revision: 361927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 13:27:46 -0000 Author: markj Date: Mon Jun 8 13:27:45 2020 New Revision: 361927 URL: https://svnweb.freebsd.org/changeset/base/361927 Log: MFC r361844: librtld_db: Handle anonymous mappings below the first file mapping. Modified: stable/12/lib/librtld_db/rtld_db.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/librtld_db/rtld_db.c ============================================================================== --- stable/12/lib/librtld_db/rtld_db.c Mon Jun 8 11:48:07 2020 (r361926) +++ stable/12/lib/librtld_db/rtld_db.c Mon Jun 8 13:27:45 2020 (r361927) @@ -186,11 +186,15 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void * file, but we want the mapping offset relative to the base * mapping. */ - if (kve->kve_type == KVME_TYPE_VNODE && - kve->kve_vn_fileid != fileid) { - base = kve->kve_start; - fileid = kve->kve_vn_fileid; - path = kve->kve_path; + if (kve->kve_type == KVME_TYPE_VNODE) { + if (kve->kve_vn_fileid != fileid) { + base = kve->kve_start; + fileid = kve->kve_vn_fileid; + path = kve->kve_path; + } + } else { + base = 0; + path = NULL; } memset(&rdl, 0, sizeof(rdl)); /* @@ -205,7 +209,8 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void rdl.rdl_prot |= RD_RDL_W; if (kve->kve_protection & KVME_PROT_EXEC) rdl.rdl_prot |= RD_RDL_X; - strlcpy(rdl.rdl_path, path, sizeof(rdl.rdl_path)); + if (path != NULL) + strlcpy(rdl.rdl_path, path, sizeof(rdl.rdl_path)); if ((*cb)(&rdl, clnt_data) != 0) { ret = RD_ERR; break; From owner-svn-src-stable@freebsd.org Mon Jun 8 14:00:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA19833046A; Mon, 8 Jun 2020 14:00:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gZdS4QBBz4ZK6; Mon, 8 Jun 2020 14:00:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8353C255F4; Mon, 8 Jun 2020 14:00:12 +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 058E0CU1099670; Mon, 8 Jun 2020 14:00:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058E0CGa099669; Mon, 8 Jun 2020 14:00:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006081400.058E0CGa099669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 8 Jun 2020 14:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361928 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 361928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 14:00:12 -0000 Author: cy Date: Mon Jun 8 14:00:11 2020 New Revision: 361928 URL: https://svnweb.freebsd.org/changeset/base/361928 Log: MFC 361721: Per-rule hit counts (-h) can be used with either -i (input) or -o (output) filter rule lists. Modified: stable/12/contrib/ipfilter/man/ipfstat.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ipfstat.8 stable/11/contrib/ipfilter/man/ipfstat.8 Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ipfstat.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ipfstat.8 Mon Jun 8 13:27:45 2020 (r361927) +++ stable/12/contrib/ipfilter/man/ipfstat.8 Mon Jun 8 14:00:11 2020 (r361928) @@ -69,8 +69,7 @@ the kernel) if any is present. Show groups currently configured (both active and inactive). .TP .B \-h -Show per-rule the number of times each one scores a "hit". For use in -combination with \fB\-i\fP. +Show per-rule the number of times each one scores a "hit". .TP .B \-i Display the filter list used for the input side of the kernel IP processing. From owner-svn-src-stable@freebsd.org Mon Jun 8 14:00:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E877330677; Mon, 8 Jun 2020 14:00:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gZdT01b3z4ZRl; Mon, 8 Jun 2020 14:00:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF0C4255F5; Mon, 8 Jun 2020 14:00:12 +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 058E0CPK099676; Mon, 8 Jun 2020 14:00:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058E0Cww099675; Mon, 8 Jun 2020 14:00:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006081400.058E0Cww099675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 8 Jun 2020 14:00:12 +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: r361928 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 361928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 14:00:13 -0000 Author: cy Date: Mon Jun 8 14:00:11 2020 New Revision: 361928 URL: https://svnweb.freebsd.org/changeset/base/361928 Log: MFC 361721: Per-rule hit counts (-h) can be used with either -i (input) or -o (output) filter rule lists. Modified: stable/10/contrib/ipfilter/man/ipfstat.8 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ipfstat.8 stable/12/contrib/ipfilter/man/ipfstat.8 Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/contrib/ipfilter/man/ipfstat.8 ============================================================================== --- stable/10/contrib/ipfilter/man/ipfstat.8 Mon Jun 8 13:27:45 2020 (r361927) +++ stable/10/contrib/ipfilter/man/ipfstat.8 Mon Jun 8 14:00:11 2020 (r361928) @@ -69,8 +69,7 @@ the kernel) if any is present. Show groups currently configured (both active and inactive). .TP .B \-h -Show per-rule the number of times each one scores a "hit". For use in -combination with \fB\-i\fP. +Show per-rule the number of times each one scores a "hit". .TP .B \-i Display the filter list used for the input side of the kernel IP processing. From owner-svn-src-stable@freebsd.org Mon Jun 8 14:00:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94E423305E0; Mon, 8 Jun 2020 14:00:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gZdS1d7tz4ZDR; Mon, 8 Jun 2020 14:00:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F01A256D9; Mon, 8 Jun 2020 14:00:12 +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 058E0CFt099664; Mon, 8 Jun 2020 14:00:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058E0ClQ099663; Mon, 8 Jun 2020 14:00:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006081400.058E0ClQ099663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 8 Jun 2020 14:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361928 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 361928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 14:00:12 -0000 Author: cy Date: Mon Jun 8 14:00:11 2020 New Revision: 361928 URL: https://svnweb.freebsd.org/changeset/base/361928 Log: MFC 361721: Per-rule hit counts (-h) can be used with either -i (input) or -o (output) filter rule lists. Modified: stable/11/contrib/ipfilter/man/ipfstat.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ipfstat.8 stable/12/contrib/ipfilter/man/ipfstat.8 Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ipfstat.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ipfstat.8 Mon Jun 8 13:27:45 2020 (r361927) +++ stable/11/contrib/ipfilter/man/ipfstat.8 Mon Jun 8 14:00:11 2020 (r361928) @@ -69,8 +69,7 @@ the kernel) if any is present. Show groups currently configured (both active and inactive). .TP .B \-h -Show per-rule the number of times each one scores a "hit". For use in -combination with \fB\-i\fP. +Show per-rule the number of times each one scores a "hit". .TP .B \-i Display the filter list used for the input side of the kernel IP processing. From owner-svn-src-stable@freebsd.org Mon Jun 8 15:27:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4760633366D; Mon, 8 Jun 2020 15:27:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gcZT1Fkwz3XmT; Mon, 8 Jun 2020 15:27:45 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 213FA26727; Mon, 8 Jun 2020 15:27:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 058FRirF055828; Mon, 8 Jun 2020 15:27:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058FRiMf055827; Mon, 8 Jun 2020 15:27:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006081527.058FRiMf055827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jun 2020 15:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361929 - stable/12/usr.sbin/pmc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/pmc X-SVN-Commit-Revision: 361929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 15:27:45 -0000 Author: markj Date: Mon Jun 8 15:27:44 2020 New Revision: 361929 URL: https://svnweb.freebsd.org/changeset/base/361929 Log: MFC r359601 (by brooks): pmc: diable position-independent builds, they fail to link on amd64 PR: 245189 Modified: stable/12/usr.sbin/pmc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/pmc/Makefile ============================================================================== --- stable/12/usr.sbin/pmc/Makefile Mon Jun 8 14:00:11 2020 (r361928) +++ stable/12/usr.sbin/pmc/Makefile Mon Jun 8 15:27:44 2020 (r361929) @@ -10,6 +10,9 @@ CXXFLAGS+= -O0 CXXSTD= c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls +# Does not link when built position-independent. +MK_PIE=no + LIBADD= kvm pmc m ncursesw pmcstat elf SRCS= pmc.c pmc_util.c cmd_pmc_stat.c \ From owner-svn-src-stable@freebsd.org Mon Jun 8 21:35:24 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE5133BCE2; Mon, 8 Jun 2020 21:35:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gmkh5Y8Kz4c2q; Mon, 8 Jun 2020 21:35:24 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B99BFB30D; Mon, 8 Jun 2020 21:35:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 058LZO0F093274; Mon, 8 Jun 2020 21:35:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058LZOEn093273; Mon, 8 Jun 2020 21:35:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006082135.058LZOEn093273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jun 2020 21:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361941 - stable/12/sbin/dhclient X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dhclient X-SVN-Commit-Revision: 361941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 21:35:25 -0000 Author: markj Date: Mon Jun 8 21:35:24 2020 New Revision: 361941 URL: https://svnweb.freebsd.org/changeset/base/361941 Log: MFC r361793: dhclient: Fix a logic bug remove_protocol(). PR: 245971 Modified: stable/12/sbin/dhclient/dispatch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dhclient/dispatch.c ============================================================================== --- stable/12/sbin/dhclient/dispatch.c Mon Jun 8 21:11:34 2020 (r361940) +++ stable/12/sbin/dhclient/dispatch.c Mon Jun 8 21:35:24 2020 (r361941) @@ -474,13 +474,16 @@ add_protocol(const char *name, int fd, void (*handler) void remove_protocol(struct protocol *proto) { - struct protocol *p, *next; + struct protocol *p, *prev; - for (p = protocols; p; p = next) { - next = p->next; + for (p = protocols, prev = NULL; p != NULL; prev = p, p = p->next) { if (p == proto) { - protocols = p->next; + if (prev == NULL) + protocols = p->next; + else + prev->next = p->next; free(p); + break; } } } From owner-svn-src-stable@freebsd.org Mon Jun 8 21:38:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A910533C13A; Mon, 8 Jun 2020 21:38:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gmpj437pz4cWL; Mon, 8 Jun 2020 21:38:53 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B9CDB198; Mon, 8 Jun 2020 21:38:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 058LcrId093850; Mon, 8 Jun 2020 21:38:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058LcqSs093847; Mon, 8 Jun 2020 21:38:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006082138.058LcqSs093847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 8 Jun 2020 21:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361942 - in stable/12: share/man/man4 sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/conf X-SVN-Commit-Revision: 361942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2020 21:38:53 -0000 Author: markj Date: Mon Jun 8 21:38:52 2020 New Revision: 361942 URL: https://svnweb.freebsd.org/changeset/base/361942 Log: MFC r361792: Update vt(4) config option names to chase r303043. PR: 246080 Modified: stable/12/share/man/man4/vt.4 stable/12/sys/conf/NOTES stable/12/sys/conf/options Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/vt.4 ============================================================================== --- stable/12/share/man/man4/vt.4 Mon Jun 8 21:35:24 2020 (r361941) +++ stable/12/share/man/man4/vt.4 Mon Jun 8 21:38:52 2020 (r361942) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 2017 +.Dd June 4, 2020 .Dt "VT" 4 .Os .Sh NAME @@ -145,11 +145,11 @@ In effect, this makes the right-hand mouse button perf These options are checked in the order shown. .It Dv SC_NO_CUTPASTE Disable mouse support. -.It VT_FB_DEFAULT_WIDTH=X -Set the default width to +.It VT_FB_MAX_WIDTH=X +Set the maximum width to .Fa X . -.It VT_FB_DEFAULT_HEIGHT=Y -Set the default height to +.It VT_FB_MAX_HEIGHT=Y +Set the maximum height to .Fa Y . .El .Sh BACKWARDS COMPATIBILITY Modified: stable/12/sys/conf/NOTES ============================================================================== --- stable/12/sys/conf/NOTES Mon Jun 8 21:35:24 2020 (r361941) +++ stable/12/sys/conf/NOTES Mon Jun 8 21:38:52 2020 (r361942) @@ -1535,9 +1535,9 @@ options VT_ALT_TO_ESC_HACK=1 # Prepend ESC sequence t options VT_MAXWINDOWS=16 # Number of virtual consoles options VT_TWOBUTTON_MOUSE # Use right mouse button to paste -# The following options set the default framebuffer size. -options VT_FB_DEFAULT_HEIGHT=480 -options VT_FB_DEFAULT_WIDTH=640 +# The following options set the maximum framebuffer size. +options VT_FB_MAX_HEIGHT=480 +options VT_FB_MAX_WIDTH=640 # The following options will let you change the default vt terminal colors. options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK) Modified: stable/12/sys/conf/options ============================================================================== --- stable/12/sys/conf/options Mon Jun 8 21:35:24 2020 (r361941) +++ stable/12/sys/conf/options Mon Jun 8 21:38:52 2020 (r361942) @@ -797,8 +797,8 @@ SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h VT_ALT_TO_ESC_HACK opt_syscons.h -VT_FB_DEFAULT_WIDTH opt_syscons.h -VT_FB_DEFAULT_HEIGHT opt_syscons.h +VT_FB_MAX_WIDTH opt_syscons.h +VT_FB_MAX_HEIGHT opt_syscons.h VT_MAXWINDOWS opt_syscons.h VT_TWOBUTTON_MOUSE opt_syscons.h DEV_SC opt_syscons.h From owner-svn-src-stable@freebsd.org Tue Jun 9 00:25:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F3D633F2E0; Tue, 9 Jun 2020 00:25:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49grWQ0Cxbz3yqg; Tue, 9 Jun 2020 00:25:54 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2476D052; Tue, 9 Jun 2020 00:25:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0590PrPx099757; Tue, 9 Jun 2020 00:25:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0590PrxR099755; Tue, 9 Jun 2020 00:25:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006090025.0590PrxR099755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Jun 2020 00:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361946 - in stable/12/contrib/llvm-project/llvm: include/llvm/BinaryFormat tools/llvm-readobj X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/contrib/llvm-project/llvm: include/llvm/BinaryFormat tools/llvm-readobj X-SVN-Commit-Revision: 361946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 00:25:54 -0000 Author: emaste Date: Tue Jun 9 00:25:53 2020 New Revision: 361946 URL: https://svnweb.freebsd.org/changeset/base/361946 Log: MFC r361739: llvm: Add DF_1_PIE Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h stable/12/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h ============================================================================== --- stable/12/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h Mon Jun 8 22:29:52 2020 (r361945) +++ stable/12/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h Tue Jun 9 00:25:53 2020 (r361946) @@ -1290,7 +1290,8 @@ enum { DF_1_NORELOC = 0x00400000, DF_1_SYMINTPOSE = 0x00800000, // Object has individual interposers. DF_1_GLOBAUDIT = 0x01000000, // Global auditing required. - DF_1_SINGLETON = 0x02000000 // Singleton symbols are used. + DF_1_SINGLETON = 0x02000000, // Singleton symbols are used. + DF_1_PIE = 0x08000000, // Object is a position-independent executable. }; // DT_MIPS_FLAGS values. Modified: stable/12/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp Mon Jun 8 22:29:52 2020 (r361945) +++ stable/12/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp Tue Jun 9 00:25:53 2020 (r361946) @@ -2213,7 +2213,8 @@ static const EnumEntry ElfDynamicDTFlags1[] LLVM_READOBJ_DT_FLAG_ENT(DF_1, NORELOC), LLVM_READOBJ_DT_FLAG_ENT(DF_1, SYMINTPOSE), LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAUDIT), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON) + LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, PIE), }; static const EnumEntry ElfDynamicDTMipsFlags[] = { From owner-svn-src-stable@freebsd.org Tue Jun 9 00:26:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0409C33F5A4; Tue, 9 Jun 2020 00:26:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49grX66PPSz3yvY; Tue, 9 Jun 2020 00:26:30 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D707ECE7E; Tue, 9 Jun 2020 00:26:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0590QUK7099840; Tue, 9 Jun 2020 00:26:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0590QUVI099838; Tue, 9 Jun 2020 00:26:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006090026.0590QUVI099838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Jun 2020 00:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361947 - in stable/11/contrib/llvm-project/llvm: include/llvm/BinaryFormat tools/llvm-readobj X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/contrib/llvm-project/llvm: include/llvm/BinaryFormat tools/llvm-readobj X-SVN-Commit-Revision: 361947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 00:26:31 -0000 Author: emaste Date: Tue Jun 9 00:26:30 2020 New Revision: 361947 URL: https://svnweb.freebsd.org/changeset/base/361947 Log: MFC r361739: llvm: Add DF_1_PIE Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h stable/11/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/llvm/ (props changed) Modified: stable/11/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h ============================================================================== --- stable/11/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h Tue Jun 9 00:25:53 2020 (r361946) +++ stable/11/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ELF.h Tue Jun 9 00:26:30 2020 (r361947) @@ -1290,7 +1290,8 @@ enum { DF_1_NORELOC = 0x00400000, DF_1_SYMINTPOSE = 0x00800000, // Object has individual interposers. DF_1_GLOBAUDIT = 0x01000000, // Global auditing required. - DF_1_SINGLETON = 0x02000000 // Singleton symbols are used. + DF_1_SINGLETON = 0x02000000, // Singleton symbols are used. + DF_1_PIE = 0x08000000, // Object is a position-independent executable. }; // DT_MIPS_FLAGS values. Modified: stable/11/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp ============================================================================== --- stable/11/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp Tue Jun 9 00:25:53 2020 (r361946) +++ stable/11/contrib/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp Tue Jun 9 00:26:30 2020 (r361947) @@ -2213,7 +2213,8 @@ static const EnumEntry ElfDynamicDTFlags1[] LLVM_READOBJ_DT_FLAG_ENT(DF_1, NORELOC), LLVM_READOBJ_DT_FLAG_ENT(DF_1, SYMINTPOSE), LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAUDIT), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON) + LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, PIE), }; static const EnumEntry ElfDynamicDTMipsFlags[] = { From owner-svn-src-stable@freebsd.org Tue Jun 9 00:27:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8795333F4C9; Tue, 9 Jun 2020 00:27:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49grYl2hy4z40KN; Tue, 9 Jun 2020 00:27:55 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57FA3D280; Tue, 9 Jun 2020 00:27:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0590RtsZ099964; Tue, 9 Jun 2020 00:27:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0590RtLS099963; Tue, 9 Jun 2020 00:27:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006090027.0590RtLS099963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Jun 2020 00:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361948 - in stable: 11/contrib/llvm-project/lld/ELF 12/contrib/llvm-project/lld/ELF X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/lld/ELF 12/contrib/llvm-project/lld/ELF X-SVN-Commit-Revision: 361948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 00:27:55 -0000 Author: emaste Date: Tue Jun 9 00:27:54 2020 New Revision: 361948 URL: https://svnweb.freebsd.org/changeset/base/361948 Log: MFC r361740: lld: Set DF_1_PIE for -pie DF_1_PIE originated from Solaris[1]. GNU ld[2] sets the flag on non-Solaris platforms. It can help distinguish PIE from ET_DYN. eu-classify from elfutils uses this to recognize PIE[3]. glibc uses this flag to reject dlopen'ing a PIE[4] [1] https://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html [2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5fe2850dd96483f176858fd75c098313d5b20bc2 [3] https://sourceware.org/git/?p=elfutils.git;a=commit;h=3f489b5c7c78df6d52f8982f79c36e9a220e8951 [4] https://sourceware.org/bugzilla/show_bug.cgi?id=24323 Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/lld/ (props changed) Modified: stable/12/contrib/llvm-project/lld/ELF/SyntheticSections.cpp ============================================================================== --- stable/12/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Tue Jun 9 00:26:30 2020 (r361947) +++ stable/12/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Tue Jun 9 00:27:54 2020 (r361948) @@ -1315,6 +1315,8 @@ template void DynamicSection::final dtFlags1 |= DF_1_NODELETE; if (config->zNodlopen) dtFlags1 |= DF_1_NOOPEN; + if (config->pie) + dtFlags1 |= DF_1_PIE; if (config->zNow) { dtFlags |= DF_BIND_NOW; dtFlags1 |= DF_1_NOW; From owner-svn-src-stable@freebsd.org Tue Jun 9 00:27:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CECE333F6C6; Tue, 9 Jun 2020 00:27:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49grYl53GFz40HL; Tue, 9 Jun 2020 00:27:55 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8736D119; Tue, 9 Jun 2020 00:27:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0590Rtaw099970; Tue, 9 Jun 2020 00:27:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0590RtUl099969; Tue, 9 Jun 2020 00:27:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006090027.0590RtUl099969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Jun 2020 00:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361948 - in stable: 11/contrib/llvm-project/lld/ELF 12/contrib/llvm-project/lld/ELF X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/lld/ELF 12/contrib/llvm-project/lld/ELF X-SVN-Commit-Revision: 361948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 00:27:55 -0000 Author: emaste Date: Tue Jun 9 00:27:54 2020 New Revision: 361948 URL: https://svnweb.freebsd.org/changeset/base/361948 Log: MFC r361740: lld: Set DF_1_PIE for -pie DF_1_PIE originated from Solaris[1]. GNU ld[2] sets the flag on non-Solaris platforms. It can help distinguish PIE from ET_DYN. eu-classify from elfutils uses this to recognize PIE[3]. glibc uses this flag to reject dlopen'ing a PIE[4] [1] https://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html [2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5fe2850dd96483f176858fd75c098313d5b20bc2 [3] https://sourceware.org/git/?p=elfutils.git;a=commit;h=3f489b5c7c78df6d52f8982f79c36e9a220e8951 [4] https://sourceware.org/bugzilla/show_bug.cgi?id=24323 Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/lld/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/lld/ELF/SyntheticSections.cpp ============================================================================== --- stable/11/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Tue Jun 9 00:26:30 2020 (r361947) +++ stable/11/contrib/llvm-project/lld/ELF/SyntheticSections.cpp Tue Jun 9 00:27:54 2020 (r361948) @@ -1315,6 +1315,8 @@ template void DynamicSection::final dtFlags1 |= DF_1_NODELETE; if (config->zNodlopen) dtFlags1 |= DF_1_NOOPEN; + if (config->pie) + dtFlags1 |= DF_1_PIE; if (config->zNow) { dtFlags |= DF_BIND_NOW; dtFlags1 |= DF_1_NOW; From owner-svn-src-stable@freebsd.org Tue Jun 9 02:00:36 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 998CB34351E; Tue, 9 Jun 2020 02:00:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gtch3bX1z4C9m; Tue, 9 Jun 2020 02:00:36 +0000 (UTC) (envelope-from mav@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7687EE1B2; Tue, 9 Jun 2020 02:00:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05920aXS056078; Tue, 9 Jun 2020 02:00:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05920ahS056077; Tue, 9 Jun 2020 02:00:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006090200.05920ahS056077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 9 Jun 2020 02:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361950 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 361950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 02:00:36 -0000 Author: mav Date: Tue Jun 9 02:00:36 2020 New Revision: 361950 URL: https://svnweb.freebsd.org/changeset/base/361950 Log: MFC r361609: Remove PDU_TOTAL_TRANSFER_LEN() macro. I don't see a point to copy io->scsiio.kern_total_len into the request PDU private field. The io is going to stay with us till the end, and kern_total_len field is not changed after being first initialized. Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jun 9 01:06:45 2020 (r361949) +++ stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jun 9 02:00:36 2020 (r361950) @@ -144,7 +144,6 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxtags, CTL #define CONN_SESSION(X) ((struct cfiscsi_session *)(X)->ic_prv0) #define PDU_SESSION(X) CONN_SESSION((X)->ip_conn) #define PDU_EXPDATASN(X) (X)->ip_prv0 -#define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1 #define PDU_R2TSN(X) (X)->ip_prv2 static int cfiscsi_init(void); @@ -2446,13 +2445,6 @@ cfiscsi_datamove_in(union ctl_io *io) } /* - * This is the total amount of data to be transferred within the current - * SCSI command. We need to record it so that we can properly report - * underflow/underflow. - */ - PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; - - /* * This is the offset within the current SCSI command; for the first * call to cfiscsi_datamove() it will be 0, and for subsequent ones * it will be the sum of lengths of previous ones. @@ -2611,17 +2603,17 @@ cfiscsi_datamove_in(union ctl_io *io) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; if (io->io_hdr.status == CTL_SUCCESS) { bhsdi->bhsdi_flags |= BHSDI_FLAGS_S; - if (PDU_TOTAL_TRANSFER_LEN(request) < + if (io->scsiio.kern_total_len < ntohl(bhssc->bhssc_expected_data_transfer_length)) { bhsdi->bhsdi_flags |= BHSSR_FLAGS_RESIDUAL_UNDERFLOW; bhsdi->bhsdi_residual_count = htonl(ntohl(bhssc->bhssc_expected_data_transfer_length) - - PDU_TOTAL_TRANSFER_LEN(request)); - } else if (PDU_TOTAL_TRANSFER_LEN(request) > + io->scsiio.kern_total_len); + } else if (io->scsiio.kern_total_len > ntohl(bhssc->bhssc_expected_data_transfer_length)) { bhsdi->bhsdi_flags |= BHSSR_FLAGS_RESIDUAL_OVERFLOW; bhsdi->bhsdi_residual_count = - htonl(PDU_TOTAL_TRANSFER_LEN(request) - + htonl(io->scsiio.kern_total_len - ntohl(bhssc->bhssc_expected_data_transfer_length)); } bhsdi->bhsdi_status = io->scsiio.scsi_status; @@ -2657,12 +2649,6 @@ cfiscsi_datamove_out(union ctl_io *io) ("bhssc->bhssc_opcode != ISCSI_BHS_OPCODE_SCSI_COMMAND")); /* - * We need to record it so that we can properly report - * underflow/underflow. - */ - PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; - - /* * Complete write underflow. Not a single byte to read. Return. */ expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); @@ -2851,19 +2837,18 @@ cfiscsi_scsi_command_done(union ctl_io *io) * XXX: We don't deal with bidirectional under/overflows; * does anything actually support those? */ - if (PDU_TOTAL_TRANSFER_LEN(request) < + if (io->scsiio.kern_total_len < ntohl(bhssc->bhssc_expected_data_transfer_length)) { bhssr->bhssr_flags |= BHSSR_FLAGS_RESIDUAL_UNDERFLOW; bhssr->bhssr_residual_count = htonl(ntohl(bhssc->bhssc_expected_data_transfer_length) - - PDU_TOTAL_TRANSFER_LEN(request)); + io->scsiio.kern_total_len); //CFISCSI_SESSION_DEBUG(cs, "underflow; residual count %d", // ntohl(bhssr->bhssr_residual_count)); - } else if (PDU_TOTAL_TRANSFER_LEN(request) > + } else if (io->scsiio.kern_total_len > ntohl(bhssc->bhssc_expected_data_transfer_length)) { bhssr->bhssr_flags |= BHSSR_FLAGS_RESIDUAL_OVERFLOW; - bhssr->bhssr_residual_count = - htonl(PDU_TOTAL_TRANSFER_LEN(request) - + bhssr->bhssr_residual_count = htonl(io->scsiio.kern_total_len - ntohl(bhssc->bhssc_expected_data_transfer_length)); //CFISCSI_SESSION_DEBUG(cs, "overflow; residual count %d", // ntohl(bhssr->bhssr_residual_count)); From owner-svn-src-stable@freebsd.org Tue Jun 9 02:01:10 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8190D3433F6; Tue, 9 Jun 2020 02:01:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gtdL2sKbz4CSR; Tue, 9 Jun 2020 02:01:10 +0000 (UTC) (envelope-from mav@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D687DE62; Tue, 9 Jun 2020 02:01:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05921ACC058578; Tue, 9 Jun 2020 02:01:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05921A5A058577; Tue, 9 Jun 2020 02:01:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006090201.05921A5A058577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 9 Jun 2020 02:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361951 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 361951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 02:01:10 -0000 Author: mav Date: Tue Jun 9 02:01:09 2020 New Revision: 361951 URL: https://svnweb.freebsd.org/changeset/base/361951 Log: MFC r361616: Move EXPDATASN/R2TSN from PDU to CTL_PRIV_FRONTEND. We any way have per-I/O space in CTL_PRIV_FRONTEND, while for PDU private fields I have better use ideas. Plus to me such use of PDU fields looked a layering violation. Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jun 9 02:00:36 2020 (r361950) +++ stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jun 9 02:01:09 2020 (r361951) @@ -143,9 +143,18 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxtags, CTL #define CONN_SESSION(X) ((struct cfiscsi_session *)(X)->ic_prv0) #define PDU_SESSION(X) CONN_SESSION((X)->ip_conn) -#define PDU_EXPDATASN(X) (X)->ip_prv0 -#define PDU_R2TSN(X) (X)->ip_prv2 +struct cfiscsi_priv { + void *request; + uint32_t expdatasn; + uint32_t r2tsn; +}; +#define PRIV(io) \ + ((struct cfiscsi_priv *)&(io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND]) +#define PRIV_REQUEST(io) PRIV(io)->request +#define PRIV_EXPDATASN(io) PRIV(io)->expdatasn +#define PRIV_R2TSN(io) PRIV(io)->r2tsn + static int cfiscsi_init(void); static int cfiscsi_shutdown(void); static void cfiscsi_online(void *arg); @@ -512,7 +521,7 @@ cfiscsi_pdu_handle_scsi_command(struct icl_pdu *reques } io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); ctl_zero_io(io); - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; + PRIV_REQUEST(io) = request; io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; @@ -568,7 +577,7 @@ cfiscsi_pdu_handle_task_request(struct icl_pdu *reques bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); ctl_zero_io(io); - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; + PRIV_REQUEST(io) = request; io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; @@ -1105,7 +1114,7 @@ cfiscsi_session_terminate_tasks(struct cfiscsi_session return; /* No target yet, so nothing to do. */ io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); ctl_zero_io(io); - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = cs; + PRIV_REQUEST(io) = cs; io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; @@ -2426,7 +2435,7 @@ cfiscsi_datamove_in(union ctl_io *io) const char *sg_addr; int ctl_sg_count, error, i; - request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + request = PRIV_REQUEST(io); cs = PDU_SESSION(request); bhssc = (const struct iscsi_bhs_scsi_command *)request->ip_bhs; @@ -2495,8 +2504,7 @@ cfiscsi_datamove_in(union ctl_io *io) bhsdi->bhsdi_initiator_task_tag = bhssc->bhssc_initiator_task_tag; bhsdi->bhsdi_target_transfer_tag = 0xffffffff; - bhsdi->bhsdi_datasn = htonl(PDU_EXPDATASN(request)); - PDU_EXPDATASN(request)++; + bhsdi->bhsdi_datasn = htonl(PRIV_EXPDATASN(io)++); bhsdi->bhsdi_buffer_offset = htonl(buffer_offset); } @@ -2640,7 +2648,7 @@ cfiscsi_datamove_out(union ctl_io *io) uint32_t target_transfer_tag; bool done; - request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + request = PRIV_REQUEST(io); cs = PDU_SESSION(request); bhssc = (const struct iscsi_bhs_scsi_command *)request->ip_bhs; @@ -2753,8 +2761,7 @@ cfiscsi_datamove_out(union ctl_io *io) * be running concurrently on several CPUs for a given * command. */ - bhsr2t->bhsr2t_r2tsn = htonl(PDU_R2TSN(request)); - PDU_R2TSN(request)++; + bhsr2t->bhsr2t_r2tsn = htonl(PRIV_R2TSN(io)++); /* * This is the offset within the current SCSI command; * i.e. for the first call of datamove(), it will be 0, @@ -2799,7 +2806,7 @@ cfiscsi_scsi_command_done(union ctl_io *io) struct cfiscsi_session *cs; uint16_t sense_length; - request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + request = PRIV_REQUEST(io); cs = PDU_SESSION(request); bhssc = (struct iscsi_bhs_scsi_command *)request->ip_bhs; KASSERT((bhssc->bhssc_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == @@ -2856,7 +2863,7 @@ cfiscsi_scsi_command_done(union ctl_io *io) bhssr->bhssr_response = BHSSR_RESPONSE_COMMAND_COMPLETED; bhssr->bhssr_status = io->scsiio.scsi_status; bhssr->bhssr_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - bhssr->bhssr_expdatasn = htonl(PDU_EXPDATASN(request)); + bhssr->bhssr_expdatasn = htonl(PRIV_EXPDATASN(io)); if (io->scsiio.sense_len > 0) { #if 0 @@ -2886,7 +2893,7 @@ cfiscsi_task_management_done(union ctl_io *io) struct cfiscsi_softc *softc; int cold_reset = 0; - request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + request = PRIV_REQUEST(io); cs = PDU_SESSION(request); bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; KASSERT((bhstmr->bhstmr_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == @@ -2982,7 +2989,7 @@ cfiscsi_done(union ctl_io *io) /* * Implicit task termination has just completed; nothing to do. */ - cs = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + cs = PRIV_REQUEST(io); cs->cs_tasks_aborted = true; refcount_release(&cs->cs_outstanding_ctl_pdus); wakeup(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus)); @@ -2990,7 +2997,7 @@ cfiscsi_done(union ctl_io *io) return; } - request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + request = PRIV_REQUEST(io); cs = PDU_SESSION(request); switch (request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) { From owner-svn-src-stable@freebsd.org Tue Jun 9 02:01:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC6F9343849; Tue, 9 Jun 2020 02:01:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gtdw4d7Kz4CmZ; Tue, 9 Jun 2020 02:01:40 +0000 (UTC) (envelope-from mav@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99EBCE238; Tue, 9 Jun 2020 02:01:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05921e7B059509; Tue, 9 Jun 2020 02:01:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05921eKX059507; Tue, 9 Jun 2020 02:01:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006090201.05921eKX059507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 9 Jun 2020 02:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361952 - in stable/12: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sys/cam/ctl usr.sbin/ctladm X-SVN-Commit-Revision: 361952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 02:01:40 -0000 Author: mav Date: Tue Jun 9 02:01:39 2020 New Revision: 361952 URL: https://svnweb.freebsd.org/changeset/base/361952 Log: MFC r361625: Report STATUS_QUEUED/SENT in `ctladm dumpooa` output. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/ctl/ctl_ioctl.h stable/12/usr.sbin/ctladm/ctladm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Tue Jun 9 02:01:09 2020 (r361951) +++ stable/12/sys/cam/ctl/ctl.c Tue Jun 9 02:01:39 2020 (r361952) @@ -2431,6 +2431,12 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_ if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) entry->cmd_flags |= CTL_OOACMD_FLAG_DMA_QUEUED; + + if (io->io_hdr.flags & CTL_FLAG_STATUS_QUEUED) + entry->cmd_flags |= CTL_OOACMD_FLAG_STATUS_QUEUED; + + if (io->io_hdr.flags & CTL_FLAG_STATUS_SENT) + entry->cmd_flags |= CTL_OOACMD_FLAG_STATUS_SENT; } mtx_unlock(&lun->lun_lock); } Modified: stable/12/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/12/sys/cam/ctl/ctl_ioctl.h Tue Jun 9 02:01:09 2020 (r361951) +++ stable/12/sys/cam/ctl/ctl_ioctl.h Tue Jun 9 02:01:39 2020 (r361952) @@ -247,7 +247,9 @@ typedef enum { CTL_OOACMD_FLAG_BLOCKED = 0x02, CTL_OOACMD_FLAG_ABORT = 0x04, CTL_OOACMD_FLAG_RTR = 0x08, - CTL_OOACMD_FLAG_DMA_QUEUED = 0x10 + CTL_OOACMD_FLAG_DMA_QUEUED = 0x10, + CTL_OOACMD_FLAG_STATUS_QUEUED = 0x20, + CTL_OOACMD_FLAG_STATUS_SENT = 0x40 } ctl_ooa_cmd_flags; struct ctl_ooa_entry { Modified: stable/12/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/12/usr.sbin/ctladm/ctladm.c Tue Jun 9 02:01:09 2020 (r361951) +++ stable/12/usr.sbin/ctladm/ctladm.c Tue Jun 9 02:01:39 2020 (r361952) @@ -336,17 +336,20 @@ retry: if (ts.tv_nsec > 0) cmd_latency += ts.tv_nsec / 1000000; - fprintf(stdout, "LUN %jd tag 0x%04x%s%s%s%s%s: %s. CDB: %s " + fprintf(stdout, "LUN %jd tag 0x%04x%s%s%s%s%s%s%s: %s. CDB: %s " "(%0.0Lf ms)\n", (intmax_t)entry->lun_num, entry->tag_num, (entry->cmd_flags & CTL_OOACMD_FLAG_BLOCKED) ? " BLOCKED" : "", - (entry->cmd_flags & CTL_OOACMD_FLAG_DMA) ? " DMA" : "", + (entry->cmd_flags & CTL_OOACMD_FLAG_RTR) ? " RTR" :"", (entry->cmd_flags & CTL_OOACMD_FLAG_DMA_QUEUED) ? " DMAQUEUED" : "", + (entry->cmd_flags & CTL_OOACMD_FLAG_DMA) ? " DMA" : "", + (entry->cmd_flags & CTL_OOACMD_FLAG_STATUS_QUEUED) ? + " STATUSQUEUED" : "", + (entry->cmd_flags & CTL_OOACMD_FLAG_STATUS_SENT) ? " STATUS" : "", (entry->cmd_flags & CTL_OOACMD_FLAG_ABORT) ? " ABORT" : "", - (entry->cmd_flags & CTL_OOACMD_FLAG_RTR) ? " RTR" :"", scsi_op_desc(entry->cdb[0], NULL), scsi_cdb_string(entry->cdb, cdb_str, sizeof(cdb_str)), cmd_latency); From owner-svn-src-stable@freebsd.org Tue Jun 9 02:03:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D737343732; Tue, 9 Jun 2020 02:03:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49gth32Jd0z4D9l; Tue, 9 Jun 2020 02:03:31 +0000 (UTC) (envelope-from mav@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3084DE1D9; Tue, 9 Jun 2020 02:03:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05923VE0062164; Tue, 9 Jun 2020 02:03:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05923VSK062163; Tue, 9 Jun 2020 02:03:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006090203.05923VSK062163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 9 Jun 2020 02:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361953 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 361953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 02:03:31 -0000 Author: mav Date: Tue Jun 9 02:03:30 2020 New Revision: 361953 URL: https://svnweb.freebsd.org/changeset/base/361953 Log: MFC r361630: Remove session locking from cfiscsi_pdu_update_cmdsn(). cs_cmdsn can be incremented with single atomic. expcmdsn/maxcmdsn set in cfiscsi_pdu_prepare() based on cs_cmdsn are not required to be updated synchronously, only monotonically, that is achieved with lock there. Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jun 9 02:01:39 2020 (r361952) +++ stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jun 9 02:03:30 2020 (r361953) @@ -211,7 +211,7 @@ cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request { const struct iscsi_bhs_scsi_command *bhssc; struct cfiscsi_session *cs; - uint32_t cmdsn, expstatsn; + uint32_t cmdsn, curcmdsn; cs = PDU_SESSION(request); @@ -220,16 +220,20 @@ cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request * The purpose of the timeout is to reset the connection when it stalls; * we don't want this to happen when NOP-In or NOP-Out ends up delayed * in some queue. - * - * XXX: Locking? */ cs->cs_timeout = 0; /* + * Immediate commands carry cmdsn, but it is neither incremented nor + * verified. + */ + if (request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) + return (false); + + /* * Data-Out PDUs don't contain CmdSN. */ - if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == - ISCSI_BHS_OPCODE_SCSI_DATA_OUT) + if (request->ip_bhs->bhs_opcode == ISCSI_BHS_OPCODE_SCSI_DATA_OUT) return (false); /* @@ -237,50 +241,37 @@ cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request * (initiator -> target) PDUs. */ bhssc = (const struct iscsi_bhs_scsi_command *)request->ip_bhs; - cmdsn = ntohl(bhssc->bhssc_cmdsn); - expstatsn = ntohl(bhssc->bhssc_expstatsn); + curcmdsn = cmdsn = ntohl(bhssc->bhssc_cmdsn); - CFISCSI_SESSION_LOCK(cs); -#if 0 - if (expstatsn != cs->cs_statsn) { - CFISCSI_SESSION_DEBUG(cs, "received PDU with ExpStatSN %d, " - "while current StatSN is %d", expstatsn, - cs->cs_statsn); - } -#endif + /* + * Increment session cmdsn and exit if we received the expected value. + */ + do { + if (atomic_fcmpset_32(&cs->cs_cmdsn, &curcmdsn, cmdsn + 1)) + return (false); + } while (curcmdsn == cmdsn); - if ((request->ip_bhs->bhs_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0) { - /* - * The target MUST silently ignore any non-immediate command - * outside of this range. - */ - if (ISCSI_SNLT(cmdsn, cs->cs_cmdsn) || - ISCSI_SNGT(cmdsn, cs->cs_cmdsn - 1 + maxtags)) { - CFISCSI_SESSION_UNLOCK(cs); - CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " - "while expected %u", cmdsn, cs->cs_cmdsn); - return (true); - } - - /* - * We don't support multiple connections now, so any - * discontinuity in CmdSN means lost PDUs. Since we don't - * support PDU retransmission -- terminate the connection. - */ - if (cmdsn != cs->cs_cmdsn) { - CFISCSI_SESSION_UNLOCK(cs); - CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " - "while expected %u; dropping connection", - cmdsn, cs->cs_cmdsn); - cfiscsi_session_terminate(cs); - return (true); - } - cs->cs_cmdsn++; + /* + * The target MUST silently ignore any non-immediate command outside + * of this range. + */ + if (ISCSI_SNLT(cmdsn, curcmdsn) || + ISCSI_SNGT(cmdsn, curcmdsn - 1 + maxtags)) { + CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " + "while expected %u", cmdsn, curcmdsn); + return (true); } - CFISCSI_SESSION_UNLOCK(cs); - - return (false); + /* + * We don't support multiple connections now, so any discontinuity in + * CmdSN means lost PDUs. Since we don't support PDU retransmission -- + * terminate the connection. + */ + CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " + "while expected %u; dropping connection", + cmdsn, curcmdsn); + cfiscsi_session_terminate(cs); + return (true); } static void @@ -367,6 +358,7 @@ cfiscsi_pdu_prepare(struct icl_pdu *response) struct cfiscsi_session *cs; struct iscsi_bhs_scsi_response *bhssr; bool advance_statsn = true; + uint32_t cmdsn; cs = PDU_SESSION(response); @@ -408,8 +400,9 @@ cfiscsi_pdu_prepare(struct icl_pdu *response) if (bhssr->bhssr_opcode != ISCSI_BHS_OPCODE_SCSI_DATA_IN || (bhssr->bhssr_flags & BHSDI_FLAGS_S)) bhssr->bhssr_statsn = htonl(cs->cs_statsn); - bhssr->bhssr_expcmdsn = htonl(cs->cs_cmdsn); - bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn - 1 + + cmdsn = cs->cs_cmdsn; + bhssr->bhssr_expcmdsn = htonl(cmdsn); + bhssr->bhssr_maxcmdsn = htonl(cmdsn - 1 + imax(0, maxtags - cs->cs_outstanding_ctl_pdus)); if (advance_statsn) @@ -2461,19 +2454,14 @@ cfiscsi_datamove_in(union ctl_io *io) buffer_offset = io->scsiio.kern_rel_offset; /* - * This is the transfer length expected by the initiator. In theory, - * it could be different from the correct amount of data from the SCSI - * point of view, even if that doesn't make any sense. + * This is the transfer length expected by the initiator. It can be + * different from the amount of data from the SCSI point of view. */ expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); -#if 0 - if (expected_len != io->scsiio.kern_total_len) { - CFISCSI_SESSION_DEBUG(cs, "expected transfer length %zd, " - "actual length %zd", expected_len, - (size_t)io->scsiio.kern_total_len); - } -#endif + /* + * If the transfer is outside of expected length -- we are done. + */ if (buffer_offset >= expected_len) { #if 0 CFISCSI_SESSION_DEBUG(cs, "buffer_offset = %zd, " From owner-svn-src-stable@freebsd.org Tue Jun 9 09:04:58 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CCA934E2B0; Tue, 9 Jun 2020 09:04:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49h42L2Lf5z44jx; Tue, 9 Jun 2020 09:04:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4952B133AB; Tue, 9 Jun 2020 09:04:58 +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 05994wb1022789; Tue, 9 Jun 2020 09:04:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05994v4H022787; Tue, 9 Jun 2020 09:04:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006090904.05994v4H022787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jun 2020 09:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361963 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 361963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 09:04:58 -0000 Author: kib Date: Tue Jun 9 09:04:57 2020 New Revision: 361963 URL: https://svnweb.freebsd.org/changeset/base/361963 Log: MFC r361725, r361728: Do not allow to load ET_DYN object with DF_1_PIE flag set. Modified: stable/12/libexec/rtld-elf/rtld.c stable/12/libexec/rtld-elf/rtld.h Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Tue Jun 9 07:07:29 2020 (r361962) +++ stable/12/libexec/rtld-elf/rtld.c Tue Jun 9 09:04:57 2020 (r361963) @@ -1321,6 +1321,8 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D obj->z_interpose = true; if (dynp->d_un.d_val & DF_1_NODEFLIB) obj->z_nodeflib = true; + if (dynp->d_un.d_val & DF_1_PIE) + obj->z_pie = true; break; default: @@ -2533,6 +2535,10 @@ do_load_object(int fd, const char *name, char *path, s obj->path = path; if (!digest_dynamic(obj, 0)) goto errp; + if (obj->z_pie) { + _rtld_error("Cannot load PIE binary %s as DSO", obj->path); + goto errp; + } dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path, obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount); if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == Modified: stable/12/libexec/rtld-elf/rtld.h ============================================================================== --- stable/12/libexec/rtld-elf/rtld.h Tue Jun 9 07:07:29 2020 (r361962) +++ stable/12/libexec/rtld-elf/rtld.h Tue Jun 9 09:04:57 2020 (r361963) @@ -258,6 +258,7 @@ typedef struct Struct_Obj_Entry { bool z_interpose : 1; /* Interpose all objects but main */ bool z_nodeflib : 1; /* Don't search default library path */ bool z_global : 1; /* Make the object global */ + bool z_pie : 1; /* Object proclaimed itself PIE executable */ bool static_tls : 1; /* Needs static TLS allocation */ bool static_tls_copied : 1; /* Needs static TLS copying */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ From owner-svn-src-stable@freebsd.org Tue Jun 9 14:20:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6671132E943; Tue, 9 Jun 2020 14:20:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hC2926yDz3S27; Tue, 9 Jun 2020 14:20:17 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F7CF16F85; Tue, 9 Jun 2020 14:20:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 059EKGTs013723; Tue, 9 Jun 2020 14:20:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 059EKGlU013722; Tue, 9 Jun 2020 14:20:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202006091420.059EKGlU013722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 9 Jun 2020 14:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361966 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 361966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 14:20:17 -0000 Author: emaste Date: Tue Jun 9 14:20:16 2020 New Revision: 361966 URL: https://svnweb.freebsd.org/changeset/base/361966 Log: MFC r361657: elf_common.h: define DF_1_PIE DF_1_PIE indicates that the object is a position-independent executable. Reference: https://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/sys/elf_common.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/elf_common.h ============================================================================== --- stable/11/sys/sys/elf_common.h Tue Jun 9 14:16:18 2020 (r361965) +++ stable/11/sys/sys/elf_common.h Tue Jun 9 14:20:16 2020 (r361966) @@ -732,6 +732,7 @@ typedef struct { #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ #define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ +#define DF_1_PIE 0x08000000 /* Is position-independent executable */ /* Values for l_flags. */ #define LL_NONE 0x0 /* no flags */ From owner-svn-src-stable@freebsd.org Tue Jun 9 17:34:29 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDA20337AA3; Tue, 9 Jun 2020 17:34:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hHLF4jJcz4CkG; Tue, 9 Jun 2020 17:34:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C6AF19753; Tue, 9 Jun 2020 17:34:29 +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 059HYT7T038972; Tue, 9 Jun 2020 17:34:29 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 059HYTgI038971; Tue, 9 Jun 2020 17:34:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006091734.059HYTgI038971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 9 Jun 2020 17:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361978 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 361978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 17:34:29 -0000 Author: gjb Date: Tue Jun 9 17:34:29 2020 New Revision: 361978 URL: https://svnweb.freebsd.org/changeset/base/361978 Log: Document SA-20:17, EN-20:11, EN-20:12. Fix a copy/paste error while here. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Jun 9 17:17:43 2020 (r361977) +++ stable/11/release/doc/share/xml/security.xml Tue Jun 9 17:34:29 2020 (r361978) @@ -211,9 +211,17 @@ FreeBSD-SA-20:14.cryptodev + xlink:href="&security.url;/FreeBSD-SA-20:15.cryptodev.asc">FreeBSD-SA-20:15.cryptodev 12 May 2020 Use-after-free condition + + + + FreeBSD-SA-20:17.usb + 9 June 2020 + HID descripter parsing + error From owner-svn-src-stable@freebsd.org Tue Jun 9 19:07:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59C2333998E; Tue, 9 Jun 2020 19:07:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hKPs1mWvz4PXm; Tue, 9 Jun 2020 19:07:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37C001A81C; Tue, 9 Jun 2020 19:07:45 +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 059J7j3R095342; Tue, 9 Jun 2020 19:07:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 059J7jpK095341; Tue, 9 Jun 2020 19:07:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006091907.059J7jpK095341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 9 Jun 2020 19:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361981 - releng/11.4/release/doc/share/xml stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/share/xml stable/11/release/doc/share/xml X-SVN-Commit-Revision: 361981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 19:07:45 -0000 Author: gjb Date: Tue Jun 9 19:07:44 2020 New Revision: 361981 URL: https://svnweb.freebsd.org/changeset/base/361981 Log: Fix a typo. Submitted by: yuripv Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: releng/11.4/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Jun 9 18:13:52 2020 (r361980) +++ stable/11/release/doc/share/xml/security.xml Tue Jun 9 19:07:44 2020 (r361981) @@ -220,7 +220,7 @@ FreeBSD-SA-20:17.usb 9 June 2020 - HID descripter parsing + HID descriptor parsing error From owner-svn-src-stable@freebsd.org Tue Jun 9 19:16:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A960339D85; Tue, 9 Jun 2020 19:16:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hKcL1LfVz4Qks; Tue, 9 Jun 2020 19:16:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2958D1A6B3; Tue, 9 Jun 2020 19:16:50 +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 059JGnbF001813; Tue, 9 Jun 2020 19:16:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 059JGnU7001811; Tue, 9 Jun 2020 19:16:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006091916.059JGnU7001811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 9 Jun 2020 19:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361983 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 361983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 19:16:50 -0000 Author: kib Date: Tue Jun 9 19:16:49 2020 New Revision: 361983 URL: https://svnweb.freebsd.org/changeset/base/361983 Log: MFC r361725, r361728: Do not allow to load ET_DYN object with DF_1_PIE flag set. Modified: stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Tue Jun 9 19:15:43 2020 (r361982) +++ stable/11/libexec/rtld-elf/rtld.c Tue Jun 9 19:16:49 2020 (r361983) @@ -1313,6 +1313,8 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D obj->z_interpose = true; if (dynp->d_un.d_val & DF_1_NODEFLIB) obj->z_nodeflib = true; + if (dynp->d_un.d_val & DF_1_PIE) + obj->z_pie = true; break; default: @@ -2510,6 +2512,10 @@ do_load_object(int fd, const char *name, char *path, s obj->path = path; if (!digest_dynamic(obj, 0)) goto errp; + if (obj->z_pie) { + _rtld_error("Cannot load PIE binary %s as DSO", obj->path); + goto errp; + } dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path, obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount); if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == Modified: stable/11/libexec/rtld-elf/rtld.h ============================================================================== --- stable/11/libexec/rtld-elf/rtld.h Tue Jun 9 19:15:43 2020 (r361982) +++ stable/11/libexec/rtld-elf/rtld.h Tue Jun 9 19:16:49 2020 (r361983) @@ -253,6 +253,7 @@ typedef struct Struct_Obj_Entry { bool z_interpose : 1; /* Interpose all objects but main */ bool z_nodeflib : 1; /* Don't search default library path */ bool z_global : 1; /* Make the object global */ + bool z_pie : 1; /* Object proclaimed itself PIE executable */ bool static_tls : 1; /* Needs static TLS allocation */ bool static_tls_copied : 1; /* Needs static TLS copying */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ From owner-svn-src-stable@freebsd.org Tue Jun 9 22:15:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6283C33EEB7; Tue, 9 Jun 2020 22:15:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hPZp0nnBz3bdh; Tue, 9 Jun 2020 22:15:46 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 167C41CDE4; Tue, 9 Jun 2020 22:15:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 059MFjax014348; Tue, 9 Jun 2020 22:15:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 059MFjDK014347; Tue, 9 Jun 2020 22:15:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202006092215.059MFjDK014347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 9 Jun 2020 22:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361989 - stable/9/sys/dev/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb X-SVN-Commit-Revision: 361989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 22:15:46 -0000 Author: hselasky Date: Tue Jun 9 22:15:45 2020 New Revision: 361989 URL: https://svnweb.freebsd.org/changeset/base/361989 Log: Adapt merge of r361581 to 9-stable to unbreak kernel compilation. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/usb_transfer.c Modified: stable/9/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/9/sys/dev/usb/usb_transfer.c Tue Jun 9 21:59:13 2020 (r361988) +++ stable/9/sys/dev/usb/usb_transfer.c Tue Jun 9 22:15:45 2020 (r361989) @@ -354,8 +354,7 @@ usbd_get_max_frame_length(const struct usb_endpoint_de if (ecomp != NULL) { uint8_t mult; - mult = UE_GET_SS_ISO_MULT( - ecomp->bmAttributes) + 1; + mult = (ecomp->bmAttributes & 3) + 1; if (mult > 3) mult = 3; From owner-svn-src-stable@freebsd.org Wed Jun 10 03:57:11 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E5D334700F; Wed, 10 Jun 2020 03:57:11 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hY8l2cQ8z4Z3P; Wed, 10 Jun 2020 03:57:11 +0000 (UTC) (envelope-from freqlabs@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5467720CA3; Wed, 10 Jun 2020 03:57:11 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05A3vBhC025626; Wed, 10 Jun 2020 03:57:11 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05A3vA4p025622; Wed, 10 Jun 2020 03:57:10 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202006100357.05A3vA4p025622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Wed, 10 Jun 2020 03:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362001 - in stable/12/sys: fs/tmpfs sys X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable/12/sys: fs/tmpfs sys X-SVN-Commit-Revision: 362001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 03:57:11 -0000 Author: freqlabs Date: Wed Jun 10 03:57:10 2020 New Revision: 362001 URL: https://svnweb.freebsd.org/changeset/base/362001 Log: MFC r361748: tmpfs: Preserve alignment of struct fid fields On 64-bit platforms, the two short fields in `struct tmpfs_fid` are padded to the 64-bit alignment of the long field. This pushes the offsets of the subsequent fields by 4 bytes and makes `struct tmpfs_fid` bigger than `struct fid`. `tmpfs_vptofh()` casts a `struct fid *` to `struct tmpfs_fid *`, causing 4 bytes of adjacent memory to be overwritten when the struct fields are set. Through several layers of indirection and embedded structs, the adjacent memory for one particular call to `tmpfs_vptofh()` happens to be the stack canary for `nfsrvd_compound()`. Half of the canary ends up being clobbered, going unnoticed until eventually the stack check fails when `nfsrvd_compound()` returns and a panic is triggered. Instead of duplicating fields of `struct fid` in `struct tmpfs_fid`, narrow the struct to cover only the unique fields for tmpfs and assert at compile time that the struct fits in the allotted space. This way we don't have to replicate the offsets of `struct fid` fields, we just use them directly. Reviewed by: kib, mav, rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25077 Modified: stable/12/sys/fs/tmpfs/tmpfs.h stable/12/sys/fs/tmpfs/tmpfs_vfsops.c stable/12/sys/fs/tmpfs/tmpfs_vnops.c stable/12/sys/sys/mount.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs.h Wed Jun 10 03:36:17 2020 (r362000) +++ stable/12/sys/fs/tmpfs/tmpfs.h Wed Jun 10 03:57:10 2020 (r362001) @@ -37,6 +37,7 @@ #ifndef _FS_TMPFS_TMPFS_H_ #define _FS_TMPFS_TMPFS_H_ +#include #include #include @@ -391,12 +392,12 @@ struct tmpfs_mount { * This structure maps a file identifier to a tmpfs node. Used by the * NFS code. */ -struct tmpfs_fid { - uint16_t tf_len; - uint16_t tf_pad; - ino_t tf_id; - unsigned long tf_gen; +struct tmpfs_fid_data { + ino_t tfd_id; + unsigned long tfd_gen; }; +_Static_assert(sizeof(struct tmpfs_fid_data) <= MAXFIDSZ, + "(struct tmpfs_fid_data) is larger than (struct fid).fid_data"); struct tmpfs_dir_cursor { struct tmpfs_dirent *tdc_current; Modified: stable/12/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Wed Jun 10 03:36:17 2020 (r362000) +++ stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Wed Jun 10 03:57:10 2020 (r362001) @@ -560,24 +560,29 @@ static int tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) { - struct tmpfs_fid *tfhp; + struct tmpfs_fid_data tfd; struct tmpfs_mount *tmp; struct tmpfs_node *node; int error; + if (fhp->fid_len != sizeof(tfd)) + return (EINVAL); + + /* + * Copy from fid_data onto the stack to avoid unaligned pointer use. + * See the comment in sys/mount.h on struct fid for details. + */ + memcpy(&tfd, fhp->fid_data, fhp->fid_len); + tmp = VFS_TO_TMPFS(mp); - tfhp = (struct tmpfs_fid *)fhp; - if (tfhp->tf_len != sizeof(struct tmpfs_fid)) + if (tfd.tfd_id >= tmp->tm_nodes_max) return (EINVAL); - if (tfhp->tf_id >= tmp->tm_nodes_max) - return (EINVAL); - TMPFS_LOCK(tmp); LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) { - if (node->tn_id == tfhp->tf_id && - node->tn_gen == tfhp->tf_gen) { + if (node->tn_id == tfd.tfd_id && + node->tn_gen == tfd.tfd_gen) { tmpfs_ref_node(node); break; } Modified: stable/12/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vnops.c Wed Jun 10 03:36:17 2020 (r362000) +++ stable/12/sys/fs/tmpfs/tmpfs_vnops.c Wed Jun 10 03:57:10 2020 (r362001) @@ -1410,16 +1410,28 @@ tmpfs_pathconf(struct vop_pathconf_args *v) static int tmpfs_vptofh(struct vop_vptofh_args *ap) +/* +vop_vptofh { + IN struct vnode *a_vp; + IN struct fid *a_fhp; +}; +*/ { - struct tmpfs_fid *tfhp; + struct tmpfs_fid_data tfd; struct tmpfs_node *node; + struct fid *fhp; - tfhp = (struct tmpfs_fid *)ap->a_fhp; node = VP_TO_TMPFS_NODE(ap->a_vp); + fhp = ap->a_fhp; + fhp->fid_len = sizeof(tfd); - tfhp->tf_len = sizeof(struct tmpfs_fid); - tfhp->tf_id = node->tn_id; - tfhp->tf_gen = node->tn_gen; + /* + * Copy into fid_data from the stack to avoid unaligned pointer use. + * See the comment in sys/mount.h on struct fid for details. + */ + tfd.tfd_id = node->tn_id; + tfd.tfd_gen = node->tn_gen; + memcpy(fhp->fid_data, &tfd, fhp->fid_len); return (0); } Modified: stable/12/sys/sys/mount.h ============================================================================== --- stable/12/sys/sys/mount.h Wed Jun 10 03:36:17 2020 (r362000) +++ stable/12/sys/sys/mount.h Wed Jun 10 03:57:10 2020 (r362001) @@ -57,6 +57,9 @@ typedef struct fsid { int32_t val[2]; } fsid_t; /* fil /* * File identifier. * These are unique per filesystem on a single machine. + * + * Note that the offset of fid_data is 4 bytes, so care must be taken to avoid + * undefined behavior accessing unaligned fields within an embedded struct. */ #define MAXFIDSZ 16 From owner-svn-src-stable@freebsd.org Wed Jun 10 13:06:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1449333F9C; Wed, 10 Jun 2020 13:06:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hnLG57Qwz3yMh; Wed, 10 Jun 2020 13:06:14 +0000 (UTC) (envelope-from ae@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB1BF272B0; Wed, 10 Jun 2020 13:06:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AD6EtD063945; Wed, 10 Jun 2020 13:06:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AD6Dmf063941; Wed, 10 Jun 2020 13:06:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202006101306.05AD6Dmf063941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 10 Jun 2020 13:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362009 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 362009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 13:06:14 -0000 Author: ae Date: Wed Jun 10 13:06:13 2020 New Revision: 362009 URL: https://svnweb.freebsd.org/changeset/base/362009 Log: MFC r361749: Add if_reassign method to all tunneling interfaces. After r339550 tunneling interfaces have started handle appearing and disappearing of ingress IP address on the host system. When such interfaces are moving into VNET jail, they lose ability to properly handle ifaddr_event_ext event. And this leads to need to reconfigure tunnel to make it working again. Since moving an interface into VNET jail leads to removing of all IP addresses, it looks consistent, that tunnel configuration should also be cleared. This is what will do if_reassign method. Reported by: John W. O'Brien Modified: stable/12/sys/net/if_gif.c stable/12/sys/net/if_gre.c stable/12/sys/net/if_ipsec.c stable/12/sys/net/if_me.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_gif.c ============================================================================== --- stable/12/sys/net/if_gif.c Wed Jun 10 09:31:37 2020 (r362008) +++ stable/12/sys/net/if_gif.c Wed Jun 10 13:06:13 2020 (r362009) @@ -104,6 +104,9 @@ void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struc void (*ng_gif_attach_p)(struct ifnet *ifp); void (*ng_gif_detach_p)(struct ifnet *ifp); +#ifdef VIMAGE +static void gif_reassign(struct ifnet *, struct vnet *, char *); +#endif static void gif_delete_tunnel(struct gif_softc *); static int gif_ioctl(struct ifnet *, u_long, caddr_t); static int gif_transmit(struct ifnet *, struct mbuf *); @@ -150,6 +153,9 @@ gif_clone_create(struct if_clone *ifc, int unit, caddr GIF2IFP(sc)->if_transmit = gif_transmit; GIF2IFP(sc)->if_qflush = gif_qflush; GIF2IFP(sc)->if_output = gif_output; +#ifdef VIMAGE + GIF2IFP(sc)->if_reassign = gif_reassign; +#endif GIF2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; GIF2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; if_attach(GIF2IFP(sc)); @@ -159,6 +165,21 @@ gif_clone_create(struct if_clone *ifc, int unit, caddr return (0); } + +#ifdef VIMAGE +static void +gif_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, + char *unused __unused) +{ + struct gif_softc *sc; + + sx_xlock(&gif_ioctl_sx); + sc = ifp->if_softc; + if (sc != NULL) + gif_delete_tunnel(sc); + sx_xunlock(&gif_ioctl_sx); +} +#endif /* VIMAGE */ static void gif_clone_destroy(struct ifnet *ifp) Modified: stable/12/sys/net/if_gre.c ============================================================================== --- stable/12/sys/net/if_gre.c Wed Jun 10 09:31:37 2020 (r362008) +++ stable/12/sys/net/if_gre.c Wed Jun 10 13:06:13 2020 (r362009) @@ -107,6 +107,9 @@ static void gre_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone *, gre_cloner); #define V_gre_cloner VNET(gre_cloner) +#ifdef VIMAGE +static void gre_reassign(struct ifnet *, struct vnet *, char *); +#endif static void gre_qflush(struct ifnet *); static int gre_transmit(struct ifnet *, struct mbuf *); static int gre_ioctl(struct ifnet *, u_long, caddr_t); @@ -183,12 +186,30 @@ gre_clone_create(struct if_clone *ifc, int unit, caddr GRE2IFP(sc)->if_ioctl = gre_ioctl; GRE2IFP(sc)->if_transmit = gre_transmit; GRE2IFP(sc)->if_qflush = gre_qflush; +#ifdef VIMAGE + GRE2IFP(sc)->if_reassign = gre_reassign; +#endif GRE2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; GRE2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; if_attach(GRE2IFP(sc)); bpfattach(GRE2IFP(sc), DLT_NULL, sizeof(u_int32_t)); return (0); } + +#ifdef VIMAGE +static void +gre_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, + char *unused __unused) +{ + struct gre_softc *sc; + + sx_xlock(&gre_ioctl_sx); + sc = ifp->if_softc; + if (sc != NULL) + gre_delete_tunnel(sc); + sx_xunlock(&gre_ioctl_sx); +} +#endif /* VIMAGE */ static void gre_clone_destroy(struct ifnet *ifp) Modified: stable/12/sys/net/if_ipsec.c ============================================================================== --- stable/12/sys/net/if_ipsec.c Wed Jun 10 09:31:37 2020 (r362008) +++ stable/12/sys/net/if_ipsec.c Wed Jun 10 13:06:13 2020 (r362009) @@ -169,6 +169,9 @@ static int ipsec_set_addresses(struct ifnet *, struct static int ipsec_set_reqid(struct ipsec_softc *, uint32_t); static void ipsec_set_running(struct ipsec_softc *); +#ifdef VIMAGE +static void ipsec_reassign(struct ifnet *, struct vnet *, char *); +#endif static void ipsec_srcaddr(void *, const struct sockaddr *, int); static int ipsec_ioctl(struct ifnet *, u_long, caddr_t); static int ipsec_transmit(struct ifnet *, struct mbuf *); @@ -200,11 +203,29 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad ifp->if_transmit = ipsec_transmit; ifp->if_qflush = ipsec_qflush; ifp->if_output = ipsec_output; +#ifdef VIMAGE + ifp->if_reassign = ipsec_reassign; +#endif if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(uint32_t)); return (0); } + +#ifdef VIMAGE +static void +ipsec_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, + char *unused __unused) +{ + struct ipsec_softc *sc; + + sx_xlock(&ipsec_ioctl_sx); + sc = ifp->if_softc; + if (sc != NULL) + ipsec_delete_tunnel(sc); + sx_xunlock(&ipsec_ioctl_sx); +} +#endif /* VIMAGE */ static void ipsec_clone_destroy(struct ifnet *ifp) Modified: stable/12/sys/net/if_me.c ============================================================================== --- stable/12/sys/net/if_me.c Wed Jun 10 09:31:37 2020 (r362008) +++ stable/12/sys/net/if_me.c Wed Jun 10 13:06:13 2020 (r362009) @@ -113,6 +113,9 @@ static void me_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone *, me_cloner); #define V_me_cloner VNET(me_cloner) +#ifdef VIMAGE +static void me_reassign(struct ifnet *, struct vnet *, char *); +#endif static void me_qflush(struct ifnet *); static int me_transmit(struct ifnet *, struct mbuf *); static int me_ioctl(struct ifnet *, u_long, caddr_t); @@ -200,12 +203,30 @@ me_clone_create(struct if_clone *ifc, int unit, caddr_ ME2IFP(sc)->if_ioctl = me_ioctl; ME2IFP(sc)->if_transmit = me_transmit; ME2IFP(sc)->if_qflush = me_qflush; +#ifdef VIMAGE + ME2IFP(sc)->if_reassign = me_reassign; +#endif ME2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; ME2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; if_attach(ME2IFP(sc)); bpfattach(ME2IFP(sc), DLT_NULL, sizeof(u_int32_t)); return (0); } + +#ifdef VIMAGE +static void +me_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, + char *unused __unused) +{ + struct me_softc *sc; + + sx_xlock(&me_ioctl_sx); + sc = ifp->if_softc; + if (sc != NULL) + me_delete_tunnel(sc); + sx_xunlock(&me_ioctl_sx); +} +#endif /* VIMAGE */ static void me_clone_destroy(struct ifnet *ifp) From owner-svn-src-stable@freebsd.org Wed Jun 10 19:55:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EA3F33DE85; Wed, 10 Jun 2020 19:55:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyQc6rrHz4T8j; Wed, 10 Jun 2020 19:55:36 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E62BBC15F; Wed, 10 Jun 2020 19:55:36 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AJtamX025361; Wed, 10 Jun 2020 19:55:36 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AJtaqm025360; Wed, 10 Jun 2020 19:55:36 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006101955.05AJtaqm025360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 19:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362018 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 19:55:37 -0000 Author: vmaffione Date: Wed Jun 10 19:55:36 2020 New Revision: 362018 URL: https://svnweb.freebsd.org/changeset/base/362018 Log: MFC r361696 netmap: vtnet: fix RX virtqueue initialization bug The vtnet_netmap_rxq_populate() function erroneously assumed that kring->nr_hwcur = 0, i.e. the kring was in the initial state. However, this is not always the case: for example, when a vtnet reinit is triggered by some changes in the interface flags or capenable. This patch changes the behaviour of vtnet_netmap_kring_refill() so that it always starts publishing the netmap buffers starting from the current value of kring->nr_hwcur. Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:23:58 2020 (r362017) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:55:36 2020 (r362018) @@ -232,14 +232,20 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl return 0; } +/* + * Publish (up to) num netmap receive buffers to the host, + * starting from the first one that the user made available + * (kring->nr_hwcur). + */ static int -vtnet_netmap_kring_refill(struct netmap_kring *kring, u_int nm_i, u_int head) +vtnet_netmap_kring_refill(struct netmap_kring *kring, u_int num) { struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int const lim = kring->nkr_num_slots - 1; + u_int nm_i = kring->nr_hwcur; /* device-specific */ struct vtnet_softc *sc = ifp->if_softc; @@ -250,7 +256,7 @@ vtnet_netmap_kring_refill(struct netmap_kring *kring, struct sglist_seg ss[2]; struct sglist sg = { ss, 0, 0, 2 }; - for (; nm_i != head; nm_i = nm_next(nm_i, lim)) { + for (; num > 0; nm_i = nm_next(nm_i, lim), num--) { struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(na, slot, &paddr); @@ -302,10 +308,11 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) kring->nr_pending_mode == NKR_NETMAP_ON)) return -1; - /* Expose all the RX netmap buffers. Note that the number of - * netmap slots in the RX ring matches the maximum number of - * 2-elements sglist that the RX virtqueue can accommodate. */ - error = vtnet_netmap_kring_refill(kring, 0, na->num_rx_desc); + /* Expose all the RX netmap buffers we can. In case of no indirect + * buffers, the number of netmap slots in the RX ring matches the + * maximum number of 2-elements sglist that the RX virtqueue can + * accommodate. */ + error = vtnet_netmap_kring_refill(kring, na->num_rx_desc); virtqueue_notify(rxq->vtnrx_vq); return error < 0 ? ENXIO : 0; @@ -381,7 +388,12 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl */ nm_i = kring->nr_hwcur; /* netmap ring index */ if (nm_i != head) { - int nm_j = vtnet_netmap_kring_refill(kring, nm_i, head); + int howmany = head - nm_i; + int nm_j; + + if (howmany < 0) + howmany += kring->nkr_num_slots; + nm_j = vtnet_netmap_kring_refill(kring, howmany); if (nm_j < 0) return nm_j; kring->nr_hwcur = nm_j; From owner-svn-src-stable@freebsd.org Wed Jun 10 19:57:10 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E611033E03D; Wed, 10 Jun 2020 19:57:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hySQ5g9tz4TZk; Wed, 10 Jun 2020 19:57:10 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDBE2BF4E; Wed, 10 Jun 2020 19:57:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AJvAqv025596; Wed, 10 Jun 2020 19:57:10 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AJvAlD025595; Wed, 10 Jun 2020 19:57:10 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006101957.05AJvAlD025595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 19:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362019 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 19:57:11 -0000 Author: vmaffione Date: Wed Jun 10 19:57:10 2020 New Revision: 362019 URL: https://svnweb.freebsd.org/changeset/base/362019 Log: MFC r361697 netmap: if_vtnet: replace vtnet_free_used() The functionality contained in this function is duplicated, as it is already available in vtnet_txq_free_mbufs() and vtnet_rxq_free_mbufs(). Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:55:36 2020 (r362018) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:57:10 2020 (r362019) @@ -52,37 +52,6 @@ vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txr na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON); } -static void -vtnet_free_used(struct virtqueue *vq, int netmap_bufs, enum txrx t, int idx) -{ - void *cookie; - int deq = 0; - - while ((cookie = virtqueue_dequeue(vq, NULL)) != NULL) { - if (netmap_bufs) { - /* These are netmap buffers: there is nothing to do. */ - } else { - /* These are mbufs that we need to free. */ - struct mbuf *m; - - if (t == NR_TX) { - struct vtnet_tx_header *txhdr = cookie; - m = txhdr->vth_mbuf; - m_freem(m); - uma_zfree(vtnet_tx_header_zone, txhdr); - } else { - m = cookie; - m_freem(m); - } - } - deq++; - } - - if (deq) - nm_prinf("%d sgs dequeued from %s-%d (netmap=%d)", - deq, nm_txrx2str(t), idx, netmap_bufs); -} - /* Register and unregister. */ static int vtnet_netmap_reg(struct netmap_adapter *na, int state) @@ -113,18 +82,13 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state) for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { struct vtnet_txq *txq = &sc->vtnet_txqs[i]; struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; - struct netmap_kring *kring; VTNET_TXQ_LOCK(txq); - kring = NMR(na, NR_TX)[i]; - vtnet_free_used(txq->vtntx_vq, - kring->nr_mode == NKR_NETMAP_ON, NR_TX, i); + vtnet_txq_free_mbufs(txq); VTNET_TXQ_UNLOCK(txq); VTNET_RXQ_LOCK(rxq); - kring = NMR(na, NR_RX)[i]; - vtnet_free_used(rxq->vtnrx_vq, - kring->nr_mode == NKR_NETMAP_ON, NR_RX, i); + vtnet_rxq_free_mbufs(rxq); VTNET_RXQ_UNLOCK(rxq); } vtnet_init_locked(sc); From owner-svn-src-stable@freebsd.org Wed Jun 10 19:58:04 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FB1333DBF4; Wed, 10 Jun 2020 19:58:04 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyTS11K1z4Tml; Wed, 10 Jun 2020 19:58:04 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E100C2C4; Wed, 10 Jun 2020 19:58:04 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AJw3Dp025698; Wed, 10 Jun 2020 19:58:03 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AJw3mj025697; Wed, 10 Jun 2020 19:58:03 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006101958.05AJw3mj025697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 19:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362020 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 19:58:04 -0000 Author: vmaffione Date: Wed Jun 10 19:58:03 2020 New Revision: 362020 URL: https://svnweb.freebsd.org/changeset/base/362020 Log: MFC r361698 netmap: if_vtnet: avoid netmap ring wraparound netmap assumes the one "slot" is left unused to distinguish the empty ring and full ring conditions. This assumption was violated by vtnet_netmap_rxq_populate(). Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:57:10 2020 (r362019) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:58:03 2020 (r362020) @@ -275,8 +275,8 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) /* Expose all the RX netmap buffers we can. In case of no indirect * buffers, the number of netmap slots in the RX ring matches the * maximum number of 2-elements sglist that the RX virtqueue can - * accommodate. */ - error = vtnet_netmap_kring_refill(kring, na->num_rx_desc); + * accommodate (minus 1 to avoid netmap ring wraparound). */ + error = vtnet_netmap_kring_refill(kring, na->num_rx_desc - 1); virtqueue_notify(rxq->vtnrx_vq); return error < 0 ? ENXIO : 0; From owner-svn-src-stable@freebsd.org Wed Jun 10 19:59:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82DDD33DD5C; Wed, 10 Jun 2020 19:59:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyVm2vsnz4TwB; Wed, 10 Jun 2020 19:59:12 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F3CEBDDC; Wed, 10 Jun 2020 19:59:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AJxCwp025828; Wed, 10 Jun 2020 19:59:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AJxCDN025827; Wed, 10 Jun 2020 19:59:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006101959.05AJxCDN025827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 19:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362021 - stable/12/sys/dev/virtio/network X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/virtio/network X-SVN-Commit-Revision: 362021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 19:59:12 -0000 Author: vmaffione Date: Wed Jun 10 19:59:11 2020 New Revision: 362021 URL: https://svnweb.freebsd.org/changeset/base/362021 Log: MFC r361744 netmap: vtnet: honor NM_IRQ_RESCHED The netmap_rx_irq() function may return NM_IRQ_RESCHED to inform the driver that more work is pending, and that netmap expects netmap_rx_irq() to be called again as soon as possible. This change implements this behaviour in the vtnet driver. Modified: stable/12/sys/dev/virtio/network/if_vtnet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnet.c Wed Jun 10 19:58:03 2020 (r362020) +++ stable/12/sys/dev/virtio/network/if_vtnet.c Wed Jun 10 19:59:11 2020 (r362021) @@ -1853,6 +1853,9 @@ vtnet_rx_vq_intr(void *xrxq) struct vtnet_rxq *rxq; struct ifnet *ifp; int tries, more; +#ifdef DEV_NETMAP + int nmirq; +#endif /* DEV_NETMAP */ rxq = xrxq; sc = rxq->vtnrx_sc; @@ -1871,8 +1874,13 @@ vtnet_rx_vq_intr(void *xrxq) } #ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, rxq->vtnrx_id, &more) != NM_IRQ_PASS) + nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); + if (nmirq != NM_IRQ_PASS) { + if (nmirq == NM_IRQ_RESCHED) { + taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); + } return; + } #endif /* DEV_NETMAP */ VTNET_RXQ_LOCK(rxq); @@ -1908,10 +1916,23 @@ vtnet_rxq_tq_intr(void *xrxq, int pending) struct vtnet_rxq *rxq; struct ifnet *ifp; int more; +#ifdef DEV_NETMAP + int nmirq; +#endif /* DEV_NETMAP */ rxq = xrxq; sc = rxq->vtnrx_sc; ifp = sc->vtnet_ifp; + +#ifdef DEV_NETMAP + nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); + if (nmirq != NM_IRQ_PASS) { + if (nmirq == NM_IRQ_RESCHED) { + taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); + } + return; + } +#endif /* DEV_NETMAP */ VTNET_RXQ_LOCK(rxq); From owner-svn-src-stable@freebsd.org Wed Jun 10 20:02:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EF1933E3EA; Wed, 10 Jun 2020 20:02:39 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyZl2FDsz4VPM; Wed, 10 Jun 2020 20:02:39 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FB11C2FB; Wed, 10 Jun 2020 20:02:39 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AK2ddu031515; Wed, 10 Jun 2020 20:02:39 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AK2dMV031514; Wed, 10 Jun 2020 20:02:39 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006102002.05AK2dMV031514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 20:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362022 - stable/12/sys/dev/virtio/network X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/virtio/network X-SVN-Commit-Revision: 362022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 20:02:39 -0000 Author: vmaffione Date: Wed Jun 10 20:02:38 2020 New Revision: 362022 URL: https://svnweb.freebsd.org/changeset/base/362022 Log: MFC r361745 netmap: vtnet: call netmap_rx_irq() under VQ lock The netmap_rx_irq() function normally wakes up user-space threads waiting for more packets. In this case, it is not necessary to call it under the driver queue lock. However, if the interface is attached to a VALE switch, netmap_rx_irq() ends up calling rxsync on the interface (see netmap_bwrap_intr_notify()). Although concurrent rxsyncs are serialized through the kring lock (see nm_kr_tryget()), the lock acquire operation is not blocking. As a result, it may happen that netmap_rx_irq() is called on an RX ring while another instance is running, causing the second call to fail, and received packets stall in the receive VQ. We fix this issue by calling netmap_irx_irq() under the VQ lock. Modified: stable/12/sys/dev/virtio/network/if_vtnet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnet.c Wed Jun 10 19:59:11 2020 (r362021) +++ stable/12/sys/dev/virtio/network/if_vtnet.c Wed Jun 10 20:02:38 2020 (r362022) @@ -1873,9 +1873,20 @@ vtnet_rx_vq_intr(void *xrxq) return; } + VTNET_RXQ_LOCK(rxq); + #ifdef DEV_NETMAP + /* + * We call netmap_rx_irq() under lock to prevent concurrent calls. + * This is not necessary to serialize the access to the RX vq, but + * rather to avoid races that may happen if this interface is + * attached to a VALE switch, which would cause received packets + * to stall in the RX queue (nm_kr_tryget() could find the kring + * busy when called from netmap_bwrap_intr_notify()). + */ nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); if (nmirq != NM_IRQ_PASS) { + VTNET_RXQ_UNLOCK(rxq); if (nmirq == NM_IRQ_RESCHED) { taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); } @@ -1883,8 +1894,6 @@ vtnet_rx_vq_intr(void *xrxq) } #endif /* DEV_NETMAP */ - VTNET_RXQ_LOCK(rxq); - again: if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { VTNET_RXQ_UNLOCK(rxq); @@ -1924,17 +1933,18 @@ vtnet_rxq_tq_intr(void *xrxq, int pending) sc = rxq->vtnrx_sc; ifp = sc->vtnet_ifp; + VTNET_RXQ_LOCK(rxq); + #ifdef DEV_NETMAP nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); if (nmirq != NM_IRQ_PASS) { + VTNET_RXQ_UNLOCK(rxq); if (nmirq == NM_IRQ_RESCHED) { taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); } return; } #endif /* DEV_NETMAP */ - - VTNET_RXQ_LOCK(rxq); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { VTNET_RXQ_UNLOCK(rxq); From owner-svn-src-stable@freebsd.org Wed Jun 10 20:03:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89FFC33E31A; Wed, 10 Jun 2020 20:03:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hybN39qjz4VY6; Wed, 10 Jun 2020 20:03:12 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68395BEDA; Wed, 10 Jun 2020 20:03:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AK3CjH031602; Wed, 10 Jun 2020 20:03:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AK3Cus031601; Wed, 10 Jun 2020 20:03:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006102003.05AK3Cus031601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 20:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362023 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 20:03:12 -0000 Author: vmaffione Date: Wed Jun 10 20:03:11 2020 New Revision: 362023 URL: https://svnweb.freebsd.org/changeset/base/362023 Log: MFC r361746 netmap: vale: fix disabled logs Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:02:38 2020 (r362022) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:03:11 2020 (r362023) @@ -129,7 +129,6 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl /* * First part: process new packets to send. */ - rmb(); nm_i = kring->nr_hwcur; if (nm_i != head) { /* we have new packets to send */ @@ -302,7 +301,6 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; struct virtqueue *vq = rxq->vtnrx_vq; - rmb(); /* * First part: import newly received packets. * Only accept our own buffers (matching the token). We should only get From owner-svn-src-stable@freebsd.org Wed Jun 10 20:04:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0E4633E32C; Wed, 10 Jun 2020 20:04:21 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hycj4gGnz4VFG; Wed, 10 Jun 2020 20:04:21 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B668C496; Wed, 10 Jun 2020 20:04:21 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AK4LbO031710; Wed, 10 Jun 2020 20:04:21 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AK4L5H031708; Wed, 10 Jun 2020 20:04:21 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006102004.05AK4L5H031708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 20:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362024 - in stable/12/sys/dev: netmap virtio/network X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12/sys/dev: netmap virtio/network X-SVN-Commit-Revision: 362024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 20:04:21 -0000 Author: vmaffione Date: Wed Jun 10 20:04:20 2020 New Revision: 362024 URL: https://svnweb.freebsd.org/changeset/base/362024 Log: MFC r361758 netmap: vtnet: add vtnrx_nm_refill index to receive queues The new index tracks the next netmap slot that is going to be enqueued into the virtqueue. The index is necessary to prevent the receive VQ and the netmap rx ring from going out of sync, considering that we never enqueue N slots, but at most N-1. This change fixes a bug that causes the VQ and the netmap ring to go out of sync after N-1 packets have been received. Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h stable/12/sys/dev/virtio/network/if_vtnetvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:03:11 2020 (r362023) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:04:20 2020 (r362024) @@ -196,9 +196,11 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl } /* - * Publish (up to) num netmap receive buffers to the host, - * starting from the first one that the user made available - * (kring->nr_hwcur). + * Publish 'num 'netmap receive buffers to the host, starting + * from the next available one (rx->vtnrx_nm_refill). + * Return a positive error code on error, and 0 on success. + * If we could not publish all of the buffers that's an error, + * since the netmap ring and the virtqueue would go out of sync. */ static int vtnet_netmap_kring_refill(struct netmap_kring *kring, u_int num) @@ -208,7 +210,7 @@ vtnet_netmap_kring_refill(struct netmap_kring *kring, struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int const lim = kring->nkr_num_slots - 1; - u_int nm_i = kring->nr_hwcur; + u_int nm_i; /* device-specific */ struct vtnet_softc *sc = ifp->if_softc; @@ -219,7 +221,8 @@ vtnet_netmap_kring_refill(struct netmap_kring *kring, struct sglist_seg ss[2]; struct sglist sg = { ss, 0, 0, 2 }; - for (; num > 0; nm_i = nm_next(nm_i, lim), num--) { + for (nm_i = rxq->vtnrx_nm_refill; num > 0; + nm_i = nm_next(nm_i, lim), num--) { struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(na, slot, &paddr); @@ -227,7 +230,7 @@ vtnet_netmap_kring_refill(struct netmap_kring *kring, if (addr == NETMAP_BUF_BASE(na)) { /* bad buf */ if (netmap_ring_reinit(kring)) - return -1; + return EFAULT; } slot->flags &= ~NS_BUF_CHANGED; @@ -240,14 +243,14 @@ vtnet_netmap_kring_refill(struct netmap_kring *kring, err = virtqueue_enqueue(vq, /*cookie=*/rxq, &sg, /*readable=*/0, /*writeable=*/sg.sg_nseg); if (unlikely(err)) { - if (err != ENOSPC) - nm_prerr("virtqueue_enqueue(%s) failed: %d", - kring->name, err); + nm_prerr("virtqueue_enqueue(%s) failed: %d", + kring->name, err); break; } } + rxq->vtnrx_nm_refill = nm_i; - return nm_i; + return num == 0 ? 0 : ENOSPC; } /* @@ -274,11 +277,14 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) /* Expose all the RX netmap buffers we can. In case of no indirect * buffers, the number of netmap slots in the RX ring matches the * maximum number of 2-elements sglist that the RX virtqueue can - * accommodate (minus 1 to avoid netmap ring wraparound). */ + * accommodate. We need to start from kring->nr_hwcur, which is 0 + * on netmap register and may be different from 0 if a virtio + * re-init happens while the device is in use by netmap. */ + rxq->vtnrx_nm_refill = kring->nr_hwcur; error = vtnet_netmap_kring_refill(kring, na->num_rx_desc - 1); virtqueue_notify(rxq->vtnrx_vq); - return error < 0 ? ENXIO : 0; + return error; } /* Reconcile kernel and user view of the receive ring. */ @@ -350,15 +356,19 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl */ nm_i = kring->nr_hwcur; /* netmap ring index */ if (nm_i != head) { - int howmany = head - nm_i; - int nm_j; + int released; + int error; - if (howmany < 0) - howmany += kring->nkr_num_slots; - nm_j = vtnet_netmap_kring_refill(kring, howmany); - if (nm_j < 0) - return nm_j; - kring->nr_hwcur = nm_j; + released = head - nm_i; + if (released < 0) + released += kring->nkr_num_slots; + error = vtnet_netmap_kring_refill(kring, released); + if (error) { + nm_prerr("Failed to replenish RX VQ with %u sgs", + released); + return error; + } + kring->nr_hwcur = head; virtqueue_notify(vq); } Modified: stable/12/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnetvar.h Wed Jun 10 20:03:11 2020 (r362023) +++ stable/12/sys/dev/virtio/network/if_vtnetvar.h Wed Jun 10 20:04:20 2020 (r362024) @@ -80,6 +80,7 @@ struct vtnet_rxq { struct taskqueue *vtnrx_tq; struct task vtnrx_intrtask; #ifdef DEV_NETMAP + uint32_t vtnrx_nm_refill; struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr; #endif /* DEV_NETMAP */ char vtnrx_name[16]; From owner-svn-src-stable@freebsd.org Wed Jun 10 20:05:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4176A33E53C; Wed, 10 Jun 2020 20:05:08 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hydc0ymgz4VXN; Wed, 10 Jun 2020 20:05:08 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C70FC5B8; Wed, 10 Jun 2020 20:05:08 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AK57Ei031824; Wed, 10 Jun 2020 20:05:07 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AK572r031823; Wed, 10 Jun 2020 20:05:07 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006102005.05AK572r031823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 20:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362025 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 20:05:08 -0000 Author: vmaffione Date: Wed Jun 10 20:05:07 2020 New Revision: 362025 URL: https://svnweb.freebsd.org/changeset/base/362025 Log: MFC r361759 netmap: vtnet: fix race condition in rxsync This change prevents a race that happens when rxsync dequeues N-1 rx packets (with N being the size of the netmap rx ring). In this situation, the loop exits without re-enabling the rx interrupts, thus causing the VQ to stall. Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:04:20 2020 (r362024) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:05:07 2020 (r362025) @@ -310,8 +310,11 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl /* * First part: import newly received packets. * Only accept our own buffers (matching the token). We should only get - * matching buffers. We may need to stop early to avoid hwtail to overrun - * hwcur. + * matching buffers. The hwtail should never overrun hwcur, because + * we publish only N-1 receive buffers (and non N). + * In any case we must not leave this routine with the interrupts + * disabled, pending packets in the VQ and hwtail == (hwcur - 1), + * otherwise the pending packets could stall. */ if (netmap_no_pendintr || force_update) { uint32_t hwtail_lim = nm_prev(kring->nr_hwcur, lim); @@ -320,10 +323,17 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl vtnet_rxq_disable_intr(rxq); nm_i = kring->nr_hwtail; - while (nm_i != hwtail_lim) { + for (;;) { int len; token = virtqueue_dequeue(vq, &len); if (token == NULL) { + /* + * Enable the interrupts again and double-check + * for more work. We can go on until we win the + * race condition, since we are not replenishing + * in the meanwhile, and thus we will process at + * most N-1 slots. + */ if (interrupts && vtnet_rxq_enable_intr(rxq)) { vtnet_rxq_disable_intr(rxq); continue; @@ -333,6 +343,11 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl if (unlikely(token != (void *)rxq)) { nm_prerr("BUG: RX token mismatch"); } else { + if (nm_i == hwtail_lim) { + KASSERT(false, ("hwtail would " + "overrun hwcur")); + } + /* Skip the virtio-net header. */ len -= sc->vtnet_hdr_size; if (unlikely(len < 0)) { From owner-svn-src-stable@freebsd.org Wed Jun 10 20:05:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FBC533E2C9; Wed, 10 Jun 2020 20:05:54 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyfV01MMz4VdG; Wed, 10 Jun 2020 20:05:54 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9ADC32F; Wed, 10 Jun 2020 20:05:53 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AK5r8E031907; Wed, 10 Jun 2020 20:05:53 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AK5rf3031906; Wed, 10 Jun 2020 20:05:53 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006102005.05AK5rf3031906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 20:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362026 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 20:05:54 -0000 Author: vmaffione Date: Wed Jun 10 20:05:53 2020 New Revision: 362026 URL: https://svnweb.freebsd.org/changeset/base/362026 Log: MFC r361760 netmap: vtnet: clean up rxsync disabled logs Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:05:07 2020 (r362025) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 20:05:53 2020 (r362026) @@ -363,8 +363,6 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl kring->nr_hwtail = nm_i; kring->nr_kflags &= ~NKR_PENDINTR; } - nm_prdis("[B] h %d c %d hwcur %d hwtail %d", ring->head, ring->cur, - kring->nr_hwcur, kring->nr_hwtail); /* * Second part: skip past packets that userspace has released. @@ -387,8 +385,8 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl virtqueue_notify(vq); } - nm_prdis("[C] h %d c %d t %d hwcur %d hwtail %d", ring->head, ring->cur, - ring->tail, kring->nr_hwcur, kring->nr_hwtail); + nm_prdis("h %d c %d t %d hwcur %d hwtail %d", kring->rhead, + kring->rcur, kring->rtail, kring->nr_hwcur, kring->nr_hwtail); return 0; } From owner-svn-src-stable@freebsd.org Thu Jun 11 05:26:24 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DBC634B2E7; Thu, 11 Jun 2020 05:26:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jC5D0s3Zz44lR; Thu, 11 Jun 2020 05:26:24 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 140A312AD0; Thu, 11 Jun 2020 05:26:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05B5QNaW077468; Thu, 11 Jun 2020 05:26:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05B5QNN6077467; Thu, 11 Jun 2020 05:26:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202006110526.05B5QNN6077467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 11 Jun 2020 05:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362040 - stable/12/sbin/ifconfig X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sbin/ifconfig X-SVN-Commit-Revision: 362040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 05:26:24 -0000 Author: avg Date: Thu Jun 11 05:26:23 2020 New Revision: 362040 URL: https://svnweb.freebsd.org/changeset/base/362040 Log: MFC r361787: ifconfig.8: fix cpability and flag descriptions for list scan / sta Some capability descriptions under list scan actually described flags. Some capability descriptions were missing. Some flag descriptions under list sta actually described capabilites. Modified: stable/12/sbin/ifconfig/ifconfig.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/12/sbin/ifconfig/ifconfig.8 Thu Jun 11 03:03:52 2020 (r362039) +++ stable/12/sbin/ifconfig/ifconfig.8 Thu Jun 11 05:26:23 2020 (r362040) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd December 17, 2019 +.Dd June 4, 2020 .Dt IFCONFIG 8 .Os .Sh NAME @@ -1476,39 +1476,30 @@ Depending on the capabilities of the stations the foll flags can be included in the output: .Bl -tag -width 3n .It Li A -Authorized. -Indicates that the station is permitted to send/receive data frames. +Channel agility. +.It Li B +PBCC modulation. +.It Li C +Poll request capability. +.It Li D +DSSS/OFDM capability. .It Li E -Extended Rate Phy (ERP). -Indicates that the station is operating in an 802.11g network -using extended transmit rates. -.It Li H -High Throughput (HT). -Indicates that the station is using HT transmit rates. -If a `+' follows immediately after then the station associated -using deprecated mechanisms supported only when -.Cm htcompat -is enabled. +Extended Service Set (ESS). +.It Li I +Independent Basic Service Set (IBSS). .It Li P -Power Save. -Indicates that the station is operating in power save mode. -.It Li Q -Quality of Service (QoS). -Indicates that the station is using QoS encapsulation for -data frame. -QoS encapsulation is enabled only when WME mode is enabled. +Privacy capability. +The station requires authentication. +.It Li R +Robust Secure Network (RSN). .It Li S Short Preamble. Indicates that the station is doing short preamble to optionally improve throughput performance with 802.11g and 802.11b. -.It Li T -Transitional Security Network (TSN). -Indicates that the station associated using TSN; see also -.Cm tsn -below. -.It Li W -Wi-Fi Protected Setup (WPS). -Indicates that the station associated using WPS. +.It Li c +Pollable capability. +.It Li s +Short slot time capability. .El .Pp By default interesting information elements captured from the neighboring @@ -1550,8 +1541,7 @@ Capabilities advertised by the stations are described the .Cm scan request. -Depending on the capabilities of the stations the following -flags can be included in the output: +The following flags can be included in the output: .Bl -tag -width 3n .It Li A Authorized. @@ -1563,7 +1553,9 @@ using extended transmit rates. .It Li H High Throughput (HT). Indicates that the station is using HT transmit rates. -If a `+' follows immediately after then the station associated +If a +.Sq Li + +follows immediately after then the station associated using deprecated mechanisms supported only when .Cm htcompat is enabled. @@ -1576,9 +1568,10 @@ Indicates that the station is using QoS encapsulation data frame. QoS encapsulation is enabled only when WME mode is enabled. .It Li S -Short Preamble. -Indicates that the station is doing short preamble to optionally -improve throughput performance with 802.11g and 802.11b. +Short GI in HT 40MHz mode enabled. +If a +.Sq Li + +follows immediately after then short GI in HT 20MHz mode is enabled as well. .It Li T Transitional Security Network (TSN). Indicates that the station associated using TSN; see also @@ -1587,6 +1580,8 @@ below. .It Li W Wi-Fi Protected Setup (WPS). Indicates that the station associated using WPS. +.It Li s +Short GI in HT 20MHz mode enabled. .El .Pp By default information elements received from associated stations From owner-svn-src-stable@freebsd.org Thu Jun 11 05:28:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A72A34B462; Thu, 11 Jun 2020 05:28:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jC7F1hbwz44vD; Thu, 11 Jun 2020 05:28:09 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30F1412F1C; Thu, 11 Jun 2020 05:28:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05B5S9Nr077617; Thu, 11 Jun 2020 05:28:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05B5S9lL077616; Thu, 11 Jun 2020 05:28:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202006110528.05B5S9lL077616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 11 Jun 2020 05:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362041 - stable/12/sys/dev/superio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/superio X-SVN-Commit-Revision: 362041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 05:28:09 -0000 Author: avg Date: Thu Jun 11 05:28:08 2020 New Revision: 362041 URL: https://svnweb.freebsd.org/changeset/base/362041 Log: MFC r361788: superio: do not assume that current LDN cannot change after config exit That assumption should be true when superio(4) uses the hardware exlusively. But it turns out to not hold on some real systems. So, err on the side of correctness rather than performance. Clear current_ldn in sio_conf_exit. Modified: stable/12/sys/dev/superio/superio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/superio/superio.c ============================================================================== --- stable/12/sys/dev/superio/superio.c Thu Jun 11 05:26:23 2020 (r362040) +++ stable/12/sys/dev/superio/superio.c Thu Jun 11 05:28:08 2020 (r362041) @@ -190,6 +190,7 @@ static void sio_conf_exit(struct siosc *sc) { sc->methods->exit(sc->io_res, sc->io_port); + sc->current_ldn = 0xff; mtx_unlock(&sc->conf_lock); } From owner-svn-src-stable@freebsd.org Thu Jun 11 10:00:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F18E23290E3; Thu, 11 Jun 2020 10:00:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jKB069z0z4LQq; Thu, 11 Jun 2020 10:00:56 +0000 (UTC) (envelope-from bcr@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF71F16588; Thu, 11 Jun 2020 10:00:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05BA0ubU043472; Thu, 11 Jun 2020 10:00:56 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BA0uTR043471; Thu, 11 Jun 2020 10:00:56 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202006111000.05BA0uTR043471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Thu, 11 Jun 2020 10:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362046 - stable/12/usr.bin/uniq X-SVN-Group: stable-12 X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: stable/12/usr.bin/uniq X-SVN-Commit-Revision: 362046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 10:00:57 -0000 Author: bcr (doc committer) Date: Thu Jun 11 10:00:56 2020 New Revision: 362046 URL: https://svnweb.freebsd.org/changeset/base/362046 Log: MFC r361891: Add EXAMPLES to cover all flags except -f since it is analogous to -s. An EXAMPLE section was adding with some basic examples that show the use of uniq(1) with various flags. Submitted by: fernape@ Approved by: bcr@ Relnotes: yes (EXAMPLE section for uniq(1)) Differential Revision: https://reviews.freebsd.org/D25149 Modified: stable/12/usr.bin/uniq/uniq.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/uniq/uniq.1 ============================================================================== --- stable/12/usr.bin/uniq/uniq.1 Thu Jun 11 09:41:54 2020 (r362045) +++ stable/12/usr.bin/uniq/uniq.1 Thu Jun 11 10:00:56 2020 (r362046) @@ -31,7 +31,7 @@ .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 15, 2019 +.Dd June 7, 2020 .Dt UNIQ 1 .Os .Sh NAME @@ -147,6 +147,56 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Assuming a file named cities.txt with the following content: +.Bd -literal -offset indent +Madrid +Lisbon +Madrid +.Ed +.Pp +The following command reports three different lines since identical elements +are not adjacent: +.Bd -literal -offset indent +$ uniq -u cities.txt +Madrid +Lisbon +Madrid +.Ed +.Pp +Sort the file and count the number of identical lines: +.Bd -literal -offset indent +$ sort cities.txt | uniq -c + 1 Lisbon + 2 Madrid +.Ed +.Pp +Assuming the following content for the file cities.txt: +.Bd -literal -offset indent +madrid +Madrid +Lisbon +.Ed +.Pp +Show repeated lines ignoring case sensitiveness: +.Bd -literal -offset indent +$ uniq -d -i cities.txt +madrid +.Ed +.Pp +Same as above but showing the whole group of repeated lines: +.Bd -literal -offset indent +$ uniq -D -i cities.txt +madrid +Madrid +.Ed +.Pp +Report the number of identical lines ignoring the first character of every line: +.Bd -literal -offset indent +$ uniq -s 1 -c cities.txt + 2 madrid + 1 Lisbon +.Ed .Sh COMPATIBILITY The historic .Cm \&\(pl Ns Ar number From owner-svn-src-stable@freebsd.org Thu Jun 11 11:36:52 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3346432B9B0; Thu, 11 Jun 2020 11:36:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jMJh0s3Rz4RgG; Thu, 11 Jun 2020 11:36:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18673176BE; Thu, 11 Jun 2020 11:36:52 +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 05BBapuR005358; Thu, 11 Jun 2020 11:36:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BBaoHF005350; Thu, 11 Jun 2020 11:36:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006111136.05BBaoHF005350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jun 2020 11:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362049 - in stable/12/sys/ufs: ffs ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/ufs: ffs ufs X-SVN-Commit-Revision: 362049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 11:36:52 -0000 Author: kib Date: Thu Jun 11 11:36:49 2020 New Revision: 362049 URL: https://svnweb.freebsd.org/changeset/base/362049 Log: MFC r361785, r361801 (by mckusick), r361803 (by se), r361814 (by mckusick), r361875 (by mckusick): Fixes for UFS fdatasync(2). Modified: stable/12/sys/ufs/ffs/ffs_alloc.c stable/12/sys/ufs/ffs/ffs_balloc.c stable/12/sys/ufs/ffs/ffs_inode.c stable/12/sys/ufs/ffs/ffs_snapshot.c stable/12/sys/ufs/ffs/ffs_softdep.c stable/12/sys/ufs/ffs/ffs_vnops.c stable/12/sys/ufs/ufs/inode.h stable/12/sys/ufs/ufs/ufs_lookup.c stable/12/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_alloc.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ffs/ffs_alloc.c Thu Jun 11 11:36:49 2020 (r362049) @@ -3248,7 +3248,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; ip = VTOI(vp); DIP_SET(ip, i_size, cmd.size); - ip->i_flag |= IN_CHANGE | IN_MODIFIED; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_MODIFIED; error = ffs_update(vp, 1); vput(vp); break; Modified: stable/12/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_balloc.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ffs/ffs_balloc.c Thu Jun 11 11:36:49 2020 (r362049) @@ -154,7 +154,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i ip->i_size = smalllblktosize(fs, nb + 1); dp->di_size = ip->i_size; dp->di_db[nb] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE | + IN_IBLKDATA; if (flags & IO_SYNC) bwrite(bp); else if (DOINGASYNC(vp)) @@ -226,7 +227,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i nsize, 0, bp); } dp->di_db[lbn] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; *bpp = bp; return (0); } @@ -282,7 +283,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i } allocib = &dp->di_ib[indirs[0].in_off]; *allocib = nb; - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; } /* * Fetch through the indirect blocks, allocating as necessary. @@ -648,7 +649,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i dp->di_extsize = smalllblktosize(fs, nb + 1); dp->di_extb[nb] = dbtofsb(fs, bp->b_blkno); bp->b_xflags |= BX_ALTDATA; - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_IBLKDATA; if (flags & IO_SYNC) bwrite(bp); else @@ -724,7 +725,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i nsize, 0, bp); } dp->di_extb[lbn] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_CHANGE | IN_IBLKDATA; *bpp = bp; return (0); } @@ -753,7 +754,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i ip->i_size = smalllblktosize(fs, nb + 1); dp->di_size = ip->i_size; dp->di_db[nb] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE | + IN_IBLKDATA; if (flags & IO_SYNC) bwrite(bp); else @@ -825,7 +827,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i nsize, 0, bp); } dp->di_db[lbn] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; *bpp = bp; return (0); } @@ -882,7 +884,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i } allocib = &dp->di_ib[indirs[0].in_off]; *allocib = nb; - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; } /* * Fetch through the indirect blocks, allocating as necessary. Modified: stable/12/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_inode.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ffs/ffs_inode.c Thu Jun 11 11:36:49 2020 (r362049) @@ -94,6 +94,26 @@ ffs_update(vp, waitfor) if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0) return (0); ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); + /* + * The IN_SIZEMOD and IN_IBLKDATA flags indicate changes to the + * file size and block pointer fields in the inode. When these + * fields have been changed, the fsync() and fsyncdata() system + * calls must write the inode to ensure their semantics that the + * file is on stable store. + * + * The IN_SIZEMOD and IN_IBLKDATA flags cannot be cleared until + * a synchronous write of the inode is done. If they are cleared + * on an asynchronous write, then the inode may not yet have been + * written to the disk when an fsync() or fsyncdata() call is done. + * Absent these flags, these calls would not know that they needed + * to write the inode. Thus, these flags only can be cleared on + * synchronous writes of the inode. Since the inode will be locked + * for the duration of the I/O that writes it to disk, no fsync() + * or fsyncdata() will be able to run before the on-disk inode + * is complete. + */ + if (waitfor) + ip->i_flag &= ~(IN_SIZEMOD | IN_IBLKDATA); fs = ITOFS(ip); if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0) return (0); @@ -268,7 +288,7 @@ ffs_truncate(vp, length, flags, cred) oldblks[i] = ip->i_din2->di_extb[i]; ip->i_din2->di_extb[i] = 0; } - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; if ((error = ffs_update(vp, waitforupdate))) return (error); for (i = 0; i < UFS_NXADDR; i++) { @@ -292,7 +312,7 @@ ffs_truncate(vp, length, flags, cred) bzero(SHORTLINK(ip), (u_int)ip->i_size); ip->i_size = 0; DIP_SET(ip, i_size, 0); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; if (needextclean) goto extclean; return (ffs_update(vp, waitforupdate)); @@ -332,7 +352,7 @@ ffs_truncate(vp, length, flags, cred) bdwrite(bp); else bawrite(bp); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; return (ffs_update(vp, waitforupdate)); } /* @@ -418,6 +438,7 @@ ffs_truncate(vp, length, flags, cred) if (blkno != 0 && offset == 0) { ip->i_size = length; DIP_SET(ip, i_size, length); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; } else { lbn = lblkno(fs, length); flags |= BA_CLRBUF; @@ -452,6 +473,7 @@ ffs_truncate(vp, length, flags, cred) bdwrite(bp); else bawrite(bp); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; } /* * Calculate index into inode's block list of @@ -501,6 +523,7 @@ ffs_truncate(vp, length, flags, cred) } ip->i_size = osize; DIP_SET(ip, i_size, osize); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; error = vtruncbuf(vp, length, fs->fs_bsize); if (error && (allerror == 0)) @@ -567,6 +590,7 @@ ffs_truncate(vp, length, flags, cred) oldspace = blksize(fs, ip, lastblock); ip->i_size = length; DIP_SET(ip, i_size, length); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; newspace = blksize(fs, ip, lastblock); if (newspace == 0) panic("ffs_truncate: newspace"); @@ -607,7 +631,7 @@ done: DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); else /* sanity */ DIP_SET(ip, i_blocks, 0); - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; #ifdef QUOTA (void) chkdq(ip, -blocksreleased, NOCRED, FORCE); #endif Modified: stable/12/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_snapshot.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ffs/ffs_snapshot.c Thu Jun 11 11:36:49 2020 (r362049) @@ -317,7 +317,7 @@ restart: goto out; ip->i_size = lblktosize(fs, (off_t)numblks); DIP_SET(ip, i_size, ip->i_size); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; error = readblock(vp, bp, numblks - 1); bawrite(bp); if (error != 0) Modified: stable/12/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_softdep.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ffs/ffs_softdep.c Thu Jun 11 11:36:49 2020 (r362049) @@ -6654,6 +6654,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) } ip->i_size = length; DIP_SET(ip, i_size, ip->i_size); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; datablocks = DIP(ip, i_blocks) - extblocks; if (length != 0) datablocks = blkcount(fs, datablocks, length); @@ -6664,6 +6665,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) setup_freeext(freeblks, ip, i, needj); ip->i_din2->di_extsize = 0; datablocks += extblocks; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ @@ -6772,7 +6774,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) } ip->i_size = length; DIP_SET(ip, i_size, length); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; allocbuf(bp, frags); ffs_update(vp, 0); bawrite(bp); @@ -6919,6 +6921,7 @@ softdep_setup_freeblocks(ip, length, flags) setup_freeindir(freeblks, ip, i, -lbn -i, 0); ip->i_size = 0; DIP_SET(ip, i_size, 0); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; datablocks = DIP(ip, i_blocks) - extblocks; } if ((flags & IO_EXT) != 0) { @@ -6926,6 +6929,7 @@ softdep_setup_freeblocks(ip, length, flags) setup_freeext(freeblks, ip, i, 0); ip->i_din2->di_extsize = 0; datablocks += extblocks; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ Modified: stable/12/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_vnops.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ffs/ffs_vnops.c Thu Jun 11 11:36:49 2020 (r362049) @@ -387,6 +387,8 @@ next: error = ffs_update(vp, 1); if (DOINGSUJ(vp)) softdep_journal_fsync(VTOI(vp)); + } else if ((ip->i_flags & (IN_SIZEMOD | IN_IBLKDATA)) != 0) { + error = ffs_update(vp, 1); } return (error); } @@ -782,6 +784,7 @@ ffs_write(ap) if (uio->uio_offset + xfersize > ip->i_size) { ip->i_size = uio->uio_offset + xfersize; DIP_SET(ip, i_size, ip->i_size); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; } size = blksize(fs, ip, lbn) - bp->b_resid; @@ -1062,8 +1065,10 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int io if ((bp->b_flags & B_CACHE) == 0 && fs->fs_bsize <= xfersize) vfs_bio_clrbuf(bp); - if (uio->uio_offset + xfersize > dp->di_extsize) + if (uio->uio_offset + xfersize > dp->di_extsize) { dp->di_extsize = uio->uio_offset + xfersize; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; + } size = sblksize(fs, dp->di_extsize, lbn) - bp->b_resid; if (size < xfersize) Modified: stable/12/sys/ufs/ufs/inode.h ============================================================================== --- stable/12/sys/ufs/ufs/inode.h Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ufs/inode.h Thu Jun 11 11:36:49 2020 (r362049) @@ -127,12 +127,13 @@ struct inode { #define IN_LAZYMOD 0x0020 /* Modified, but don't write yet. */ #define IN_LAZYACCESS 0x0040 /* Process IN_ACCESS after the suspension finished */ -#define IN_EA_LOCKED 0x0080 -#define IN_EA_LOCKWAIT 0x0100 - +#define IN_EA_LOCKED 0x0080 /* Extended attributes locked */ +#define IN_EA_LOCKWAIT 0x0100 /* Want extended attributes lock */ #define IN_TRUNCATED 0x0200 /* Journaled truncation pending. */ - #define IN_UFS2 0x0400 /* UFS2 vs UFS1 */ +#define IN_IBLKDATA 0x0800 /* datasync requires inode block + update */ +#define IN_SIZEMOD 0x1000 /* Inode size has been modified */ #define i_dirhash i_un.dirhash #define i_snapblklist i_un.snapblklist Modified: stable/12/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_lookup.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ufs/ufs_lookup.c Thu Jun 11 11:36:49 2020 (r362049) @@ -556,7 +556,7 @@ found: ufs_dirbad(dp, i_offset, "i_size too small"); dp->i_size = i_offset + DIRSIZ(OFSFMT(vdp), ep); DIP_SET(dp, i_size, dp->i_size); - dp->i_flag |= IN_CHANGE | IN_UPDATE; + dp->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; } brelse(bp); @@ -918,7 +918,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) dp->i_size = dp->i_offset + DIRBLKSIZ; DIP_SET(dp, i_size, dp->i_size); dp->i_endoff = dp->i_size; - dp->i_flag |= IN_CHANGE | IN_UPDATE; + dp->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; dirp->d_reclen = DIRBLKSIZ; blkoff = dp->i_offset & (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); @@ -1004,6 +1004,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) if (dp->i_offset + dp->i_count > dp->i_size) { dp->i_size = dp->i_offset + dp->i_count; DIP_SET(dp, i_size, dp->i_size); + dp->i_flag |= IN_SIZEMOD | IN_MODIFIED; } /* * Get the block containing the space for the new directory entry. Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Thu Jun 11 11:35:30 2020 (r362048) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Thu Jun 11 11:36:49 2020 (r362049) @@ -1926,7 +1926,7 @@ ufs_mkdir(ap) goto bad; ip->i_size = DIRBLKSIZ; DIP_SET(ip, i_size, DIRBLKSIZ); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; bcopy((caddr_t)&dirtemplate, (caddr_t)bp->b_data, sizeof dirtemplate); if (DOINGSOFTDEP(tvp)) { /* @@ -2113,7 +2113,7 @@ ufs_symlink(ap) bcopy(ap->a_target, SHORTLINK(ip), len); ip->i_size = len; DIP_SET(ip, i_size, len); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; error = UFS_UPDATE(vp, 0); } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, From owner-svn-src-stable@freebsd.org Thu Jun 11 11:45:32 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B951D32B8F8; Thu, 11 Jun 2020 11:45:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jMVh4xN3z4SMN; Thu, 11 Jun 2020 11:45:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4AE8179A2; Thu, 11 Jun 2020 11:45:32 +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 05BBjWnd011394; Thu, 11 Jun 2020 11:45:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BBjUH0011385; Thu, 11 Jun 2020 11:45:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202006111145.05BBjUH0011385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 11 Jun 2020 11:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362050 - in stable/11/sys/ufs: ffs ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/ufs: ffs ufs X-SVN-Commit-Revision: 362050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 11:45:32 -0000 Author: kib Date: Thu Jun 11 11:45:30 2020 New Revision: 362050 URL: https://svnweb.freebsd.org/changeset/base/362050 Log: MFC r361785, r361801 (by mckusick), r361803 (by se), r361814 (by mckusick), r361875 (by mckusick): Fixes for UFS fdatasync(2). Modified: stable/11/sys/ufs/ffs/ffs_alloc.c stable/11/sys/ufs/ffs/ffs_balloc.c stable/11/sys/ufs/ffs/ffs_inode.c stable/11/sys/ufs/ffs/ffs_snapshot.c stable/11/sys/ufs/ffs/ffs_softdep.c stable/11/sys/ufs/ffs/ffs_vnops.c stable/11/sys/ufs/ufs/inode.h stable/11/sys/ufs/ufs/ufs_lookup.c stable/11/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_alloc.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ffs/ffs_alloc.c Thu Jun 11 11:45:30 2020 (r362050) @@ -2897,7 +2897,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; ip = VTOI(vp); DIP_SET(ip, i_size, cmd.size); - ip->i_flag |= IN_CHANGE | IN_MODIFIED; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_MODIFIED; error = ffs_update(vp, 1); vput(vp); break; Modified: stable/11/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_balloc.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ffs/ffs_balloc.c Thu Jun 11 11:45:30 2020 (r362050) @@ -152,7 +152,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i ip->i_size = smalllblktosize(fs, nb + 1); dp->di_size = ip->i_size; dp->di_db[nb] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE | + IN_IBLKDATA; if (flags & IO_SYNC) bwrite(bp); else @@ -222,7 +223,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i nsize, 0, bp); } dp->di_db[lbn] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; *bpp = bp; return (0); } @@ -279,7 +280,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i } allocib = &dp->di_ib[indirs[0].in_off]; *allocib = nb; - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; } /* * Fetch through the indirect blocks, allocating as necessary. @@ -632,7 +633,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i dp->di_extsize = smalllblktosize(fs, nb + 1); dp->di_extb[nb] = dbtofsb(fs, bp->b_blkno); bp->b_xflags |= BX_ALTDATA; - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_IBLKDATA; if (flags & IO_SYNC) bwrite(bp); else @@ -708,7 +709,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i nsize, 0, bp); } dp->di_extb[lbn] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_CHANGE | IN_IBLKDATA; *bpp = bp; return (0); } @@ -737,7 +738,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i ip->i_size = smalllblktosize(fs, nb + 1); dp->di_size = ip->i_size; dp->di_db[nb] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE | + IN_IBLKDATA; if (flags & IO_SYNC) bwrite(bp); else @@ -809,7 +811,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i nsize, 0, bp); } dp->di_db[lbn] = dbtofsb(fs, bp->b_blkno); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; *bpp = bp; return (0); } @@ -867,7 +869,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i } allocib = &dp->di_ib[indirs[0].in_off]; *allocib = nb; - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_CHANGE | IN_UPDATE | IN_IBLKDATA; } /* * Fetch through the indirect blocks, allocating as necessary. Modified: stable/11/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_inode.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ffs/ffs_inode.c Thu Jun 11 11:45:30 2020 (r362050) @@ -92,6 +92,26 @@ ffs_update(vp, waitfor) if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0) return (0); ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); + /* + * The IN_SIZEMOD and IN_IBLKDATA flags indicate changes to the + * file size and block pointer fields in the inode. When these + * fields have been changed, the fsync() and fsyncdata() system + * calls must write the inode to ensure their semantics that the + * file is on stable store. + * + * The IN_SIZEMOD and IN_IBLKDATA flags cannot be cleared until + * a synchronous write of the inode is done. If they are cleared + * on an asynchronous write, then the inode may not yet have been + * written to the disk when an fsync() or fsyncdata() call is done. + * Absent these flags, these calls would not know that they needed + * to write the inode. Thus, these flags only can be cleared on + * synchronous writes of the inode. Since the inode will be locked + * for the duration of the I/O that writes it to disk, no fsync() + * or fsyncdata() will be able to run before the on-disk inode + * is complete. + */ + if (waitfor) + ip->i_flag &= ~(IN_SIZEMOD | IN_IBLKDATA); fs = ITOFS(ip); if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0) return (0); @@ -263,7 +283,7 @@ ffs_truncate(vp, length, flags, cred) oldblks[i] = ip->i_din2->di_extb[i]; ip->i_din2->di_extb[i] = 0; } - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; if ((error = ffs_update(vp, !DOINGASYNC(vp)))) return (error); for (i = 0; i < NXADDR; i++) { @@ -287,7 +307,7 @@ ffs_truncate(vp, length, flags, cred) bzero(SHORTLINK(ip), (u_int)ip->i_size); ip->i_size = 0; DIP_SET(ip, i_size, 0); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; if (needextclean) goto extclean; return (ffs_update(vp, !DOINGASYNC(vp))); @@ -327,7 +347,7 @@ ffs_truncate(vp, length, flags, cred) bdwrite(bp); else bawrite(bp); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; return (ffs_update(vp, !DOINGASYNC(vp))); } /* @@ -413,6 +433,7 @@ ffs_truncate(vp, length, flags, cred) if (blkno != 0 && offset == 0) { ip->i_size = length; DIP_SET(ip, i_size, length); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; } else { lbn = lblkno(fs, length); flags |= BA_CLRBUF; @@ -447,6 +468,7 @@ ffs_truncate(vp, length, flags, cred) bdwrite(bp); else bawrite(bp); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; } /* * Calculate index into inode's block list of @@ -496,6 +518,7 @@ ffs_truncate(vp, length, flags, cred) } ip->i_size = osize; DIP_SET(ip, i_size, osize); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; error = vtruncbuf(vp, length, fs->fs_bsize); if (error && (allerror == 0)) @@ -560,6 +583,7 @@ ffs_truncate(vp, length, flags, cred) oldspace = blksize(fs, ip, lastblock); ip->i_size = length; DIP_SET(ip, i_size, length); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; newspace = blksize(fs, ip, lastblock); if (newspace == 0) panic("ffs_truncate: newspace"); @@ -599,7 +623,7 @@ done: DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); else /* sanity */ DIP_SET(ip, i_blocks, 0); - ip->i_flag |= IN_CHANGE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; #ifdef QUOTA (void) chkdq(ip, -blocksreleased, NOCRED, 0); #endif Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Thu Jun 11 11:45:30 2020 (r362050) @@ -315,7 +315,7 @@ restart: goto out; ip->i_size = lblktosize(fs, (off_t)numblks); DIP_SET(ip, i_size, ip->i_size); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; error = readblock(vp, bp, numblks - 1); bawrite(bp); if (error != 0) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Thu Jun 11 11:45:30 2020 (r362050) @@ -6617,6 +6617,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) } ip->i_size = length; DIP_SET(ip, i_size, ip->i_size); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; datablocks = DIP(ip, i_blocks) - extblocks; if (length != 0) datablocks = blkcount(fs, datablocks, length); @@ -6627,6 +6628,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) setup_freeext(freeblks, ip, i, needj); ip->i_din2->di_extsize = 0; datablocks += extblocks; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ @@ -6735,7 +6737,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) } ip->i_size = length; DIP_SET(ip, i_size, length); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; allocbuf(bp, frags); ffs_update(vp, 0); bawrite(bp); @@ -6881,6 +6883,7 @@ softdep_setup_freeblocks(ip, length, flags) setup_freeindir(freeblks, ip, i, -lbn -i, 0); ip->i_size = 0; DIP_SET(ip, i_size, 0); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; datablocks = DIP(ip, i_blocks) - extblocks; } if ((flags & IO_EXT) != 0) { @@ -6888,6 +6891,7 @@ softdep_setup_freeblocks(ip, length, flags) setup_freeext(freeblks, ip, i, 0); ip->i_din2->di_extsize = 0; datablocks += extblocks; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ Modified: stable/11/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vnops.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ffs/ffs_vnops.c Thu Jun 11 11:45:30 2020 (r362050) @@ -385,6 +385,8 @@ next: error = ffs_update(vp, 1); if (DOINGSUJ(vp)) softdep_journal_fsync(VTOI(vp)); + } else if ((ip->i_flags & (IN_SIZEMOD | IN_IBLKDATA)) != 0) { + error = ffs_update(vp, 1); } return (error); } @@ -758,6 +760,7 @@ ffs_write(ap) if (uio->uio_offset + xfersize > ip->i_size) { ip->i_size = uio->uio_offset + xfersize; DIP_SET(ip, i_size, ip->i_size); + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; } size = blksize(fs, ip, lbn) - bp->b_resid; @@ -1037,8 +1040,10 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int io if ((bp->b_flags & B_CACHE) == 0 && fs->fs_bsize <= xfersize) vfs_bio_clrbuf(bp); - if (uio->uio_offset + xfersize > dp->di_extsize) + if (uio->uio_offset + xfersize > dp->di_extsize) { dp->di_extsize = uio->uio_offset + xfersize; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE; + } size = sblksize(fs, dp->di_extsize, lbn) - bp->b_resid; if (size < xfersize) Modified: stable/11/sys/ufs/ufs/inode.h ============================================================================== --- stable/11/sys/ufs/ufs/inode.h Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ufs/inode.h Thu Jun 11 11:45:30 2020 (r362050) @@ -125,12 +125,13 @@ struct inode { #define IN_LAZYMOD 0x0020 /* Modified, but don't write yet. */ #define IN_LAZYACCESS 0x0040 /* Process IN_ACCESS after the suspension finished */ -#define IN_EA_LOCKED 0x0080 -#define IN_EA_LOCKWAIT 0x0100 - +#define IN_EA_LOCKED 0x0080 /* Extended attributes locked */ +#define IN_EA_LOCKWAIT 0x0100 /* Want extended attributes lock */ #define IN_TRUNCATED 0x0200 /* Journaled truncation pending. */ - #define IN_UFS2 0x0400 /* UFS2 vs UFS1 */ +#define IN_IBLKDATA 0x0800 /* datasync requires inode block + update */ +#define IN_SIZEMOD 0x1000 /* Inode size has been modified */ #define i_dirhash i_un.dirhash #define i_snapblklist i_un.snapblklist Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Thu Jun 11 11:45:30 2020 (r362050) @@ -554,7 +554,7 @@ found: ufs_dirbad(dp, i_offset, "i_size too small"); dp->i_size = i_offset + DIRSIZ(OFSFMT(vdp), ep); DIP_SET(dp, i_size, dp->i_size); - dp->i_flag |= IN_CHANGE | IN_UPDATE; + dp->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; } brelse(bp); @@ -916,7 +916,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) dp->i_size = dp->i_offset + DIRBLKSIZ; DIP_SET(dp, i_size, dp->i_size); dp->i_endoff = dp->i_size; - dp->i_flag |= IN_CHANGE | IN_UPDATE; + dp->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; dirp->d_reclen = DIRBLKSIZ; blkoff = dp->i_offset & (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); @@ -1002,6 +1002,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) if (dp->i_offset + dp->i_count > dp->i_size) { dp->i_size = dp->i_offset + dp->i_count; DIP_SET(dp, i_size, dp->i_size); + dp->i_flag |= IN_SIZEMOD | IN_MODIFIED; } /* * Get the block containing the space for the new directory entry. Modified: stable/11/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_vnops.c Thu Jun 11 11:36:49 2020 (r362049) +++ stable/11/sys/ufs/ufs/ufs_vnops.c Thu Jun 11 11:45:30 2020 (r362050) @@ -1925,7 +1925,7 @@ ufs_mkdir(ap) goto bad; ip->i_size = DIRBLKSIZ; DIP_SET(ip, i_size, DIRBLKSIZ); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; bcopy((caddr_t)&dirtemplate, (caddr_t)bp->b_data, sizeof dirtemplate); if (DOINGSOFTDEP(tvp)) { /* @@ -2112,7 +2112,7 @@ ufs_symlink(ap) bcopy(ap->a_target, SHORTLINK(ip), len); ip->i_size = len; DIP_SET(ip, i_size, len); - ip->i_flag |= IN_CHANGE | IN_UPDATE; + ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE; error = UFS_UPDATE(vp, 0); } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, From owner-svn-src-stable@freebsd.org Thu Jun 11 14:48:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2675D333C49; Thu, 11 Jun 2020 14:48:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jRYc752tz3XB6; Thu, 11 Jun 2020 14:48:20 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECFE7197EE; Thu, 11 Jun 2020 14:48:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05BEmK59025556; Thu, 11 Jun 2020 14:48:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BEmKUI025555; Thu, 11 Jun 2020 14:48:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006111448.05BEmKUI025555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Jun 2020 14:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362057 - stable/12/sys/dev/mps X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/mps X-SVN-Commit-Revision: 362057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 14:48:21 -0000 Author: markj Date: Thu Jun 11 14:48:20 2020 New Revision: 362057 URL: https://svnweb.freebsd.org/changeset/base/362057 Log: MFC r342660 (by scottl): Port over the SCSI sense handling fix from mpr(4) in r342528, and fix whitespace to match. PR: 223813 Reported and tested by: farrokhi Modified: stable/12/sys/dev/mps/mps_user.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mps/mps_user.c ============================================================================== --- stable/12/sys/dev/mps/mps_user.c Thu Jun 11 14:31:51 2020 (r362056) +++ stable/12/sys/dev/mps/mps_user.c Thu Jun 11 14:48:20 2020 (r362057) @@ -1036,10 +1036,12 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru if (((MPI2_SCSI_IO_REPLY *)rpl)->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) { sense_len = - MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)->SenseCount)), - sizeof(struct scsi_sense_data)); + MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)-> + SenseCount)), sizeof(struct + scsi_sense_data)); mps_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mps_lock(sc); } } From owner-svn-src-stable@freebsd.org Thu Jun 11 14:49:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1210333F1D; Thu, 11 Jun 2020 14:49:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jRb64L4cz3XH8; Thu, 11 Jun 2020 14:49:38 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 901F619AD0; Thu, 11 Jun 2020 14:49:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05BEnc9j025666; Thu, 11 Jun 2020 14:49:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BEncQc025665; Thu, 11 Jun 2020 14:49:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202006111449.05BEncQc025665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Jun 2020 14:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362058 - stable/11/sys/dev/mps X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/mps X-SVN-Commit-Revision: 362058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 14:49:38 -0000 Author: markj Date: Thu Jun 11 14:49:38 2020 New Revision: 362058 URL: https://svnweb.freebsd.org/changeset/base/362058 Log: MFC r342660 (by scottl): Port over the SCSI sense handling fix from mpr(4) in r342528, and fix whitespace to match. PR: 223813 Reported and tested by: farrokhi Modified: stable/11/sys/dev/mps/mps_user.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mps/mps_user.c ============================================================================== --- stable/11/sys/dev/mps/mps_user.c Thu Jun 11 14:48:20 2020 (r362057) +++ stable/11/sys/dev/mps/mps_user.c Thu Jun 11 14:49:38 2020 (r362058) @@ -1036,10 +1036,12 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru if (((MPI2_SCSI_IO_REPLY *)rpl)->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) { sense_len = - MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)->SenseCount)), - sizeof(struct scsi_sense_data)); + MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)-> + SenseCount)), sizeof(struct + scsi_sense_data)); mps_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mps_lock(sc); } } From owner-svn-src-stable@freebsd.org Thu Jun 11 16:51:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45234339AE3; Thu, 11 Jun 2020 16:51:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jVHQ1C1gz43VL; Thu, 11 Jun 2020 16:51:14 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2330E1B713; Thu, 11 Jun 2020 16:51:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05BGpETW002316; Thu, 11 Jun 2020 16:51:14 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BGpEQt002315; Thu, 11 Jun 2020 16:51:14 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202006111651.05BGpEQt002315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 11 Jun 2020 16:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362064 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 362064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 16:51:14 -0000 Author: kp Date: Thu Jun 11 16:51:13 2020 New Revision: 362064 URL: https://svnweb.freebsd.org/changeset/base/362064 Log: MFC r357061: pf: Apply kif flags to new group members If we have a 'set skip on ' rule this flag it set on the group kif, but must also be set on all members. pfctl does this when the rules are set, but if groups are added afterwards we must also apply the flags to the new member. If not, new group members will not be skipped until the rules are reloaded. Modified: stable/12/sys/netpfil/pf/pf_if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf_if.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_if.c Thu Jun 11 15:59:49 2020 (r362063) +++ stable/12/sys/netpfil/pf/pf_if.c Thu Jun 11 16:51:13 2020 (r362064) @@ -463,13 +463,27 @@ static void pfi_kif_update(struct pfi_kif *kif) { struct ifg_list *ifgl; + struct ifg_member *ifgm; struct pfi_dynaddr *p; + struct pfi_kif *tmpkif; PF_RULES_WASSERT(); /* update all dynaddr */ TAILQ_FOREACH(p, &kif->pfik_dynaddrs, entry) pfi_dynaddr_update(p); + + /* Apply group flags to new members. */ + if (kif->pfik_group != NULL) { + CK_STAILQ_FOREACH(ifgm, &kif->pfik_group->ifg_members, + ifgm_next) { + tmpkif = (struct pfi_kif *)ifgm->ifgm_ifp->if_pf_kif; + if (tmpkif == NULL) + continue; + + tmpkif->pfik_flags |= kif->pfik_flags; + } + } /* again for all groups kif is member of */ if (kif->pfik_ifp != NULL) { From owner-svn-src-stable@freebsd.org Thu Jun 11 19:52:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EFFD33FC4E; Thu, 11 Jun 2020 19:52:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jZJx0xbqz4JyP; Thu, 11 Jun 2020 19:52:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BB1B1DA2E; Thu, 11 Jun 2020 19:52:49 +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 05BJqms7022305; Thu, 11 Jun 2020 19:52:48 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BJqmVX022304; Thu, 11 Jun 2020 19:52:48 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202006111952.05BJqmVX022304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 11 Jun 2020 19:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362073 - stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Commit-Revision: 362073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 19:52:49 -0000 Author: gjb Date: Thu Jun 11 19:52:48 2020 New Revision: 362073 URL: https://svnweb.freebsd.org/changeset/base/362073 Log: Sync the stable/11 errata page for 11.4 with the releng/11.4 version. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 11 18:59:57 2020 (r362072) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 11 19:52:48 2020 (r362073) @@ -49,8 +49,7 @@ &os;. This errata document for &os; &release; will be maintained - until the release of &os; &release.next; (if - applicable). + until &os; &release; reaches end-of-life. @@ -97,38 +96,21 @@ - [2019-07-04] An issue which can cause a crash when - connecting to a &man.bhyve.4; instance with - a VNC client under certain circumstances - had been reported. An errata notice is planned - post-release. - + [2020-06-11] Source-based upgrades from &os; 11.2 on the + &arch.i386; architecture may fail to compile + clang due to the amount of + RAM consumed. - - [2019-07-04] An issue booting &man.bhyve.4; virtual - machines compiled with &man.clang.1; version 8.0.0 or later - had been reported late in the release cycle. An errata - notice is planned post-release. + Adding CFLAGS+=-O1 to + /etc/make.conf or + /etc/src.conf has been observed to work + around the compile-time RAM exhaustion. - This issue is believed to only affect OpenBSD virtual - machines compiled with &man.clang.1;. + See + PR + 246274 for additional details. - - - [2019-07-04] An issue when upgrading from &os; 11.3 - to &os; 12.0 (which occurred earlier in time, - comparatively), had been reported where the - com.delphix:spacemap_v2 &man.zpool.8; - feature does not exist on &os; 12.0, will fail to - import the ZFS pool. - - At this time, it is advised to defer migrating from - &os; 11.3 to &os; 12.x until &os; 12.1 is - available. - - Upgrading from earlier &os; 11.x releases to - &os; 12.0 are believed to be unaffected. - @@ -137,27 +119,7 @@ - [2019-12-06] An issue has been reported with the - &os; 11.3-RELEASE images on the Google Compute Engine - platform which causes virtual machines to fail to start - properly. - - While we intend to investigate how to handle similar - situations should they arise in the future, updated images - will not be provided as of this time. - - Users wanting to use &os; in Google Compute Engine are - advised to use 12.0-RELEASE or 12.1-RELEASE, or for those - who wish to track 11.X, the - freebsd-11-3-stable-amd64-v20190801 - snapshot from stable/11 has been - - reported to work correctly. - - More details can be found in PR - 242303. + No late-breaking news. From owner-svn-src-stable@freebsd.org Fri Jun 12 00:42:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18B9E34797F; Fri, 12 Jun 2020 00:42:07 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jhkk6zH3z4fTV; Fri, 12 Jun 2020 00:42:06 +0000 (UTC) (envelope-from erj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1F44210A0; Fri, 12 Jun 2020 00:42:06 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05C0g6oP003332; Fri, 12 Jun 2020 00:42:06 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C0g5SY003327; Fri, 12 Jun 2020 00:42:05 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202006120042.05C0g5SY003327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 12 Jun 2020 00:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362080 - stable/12/sys/dev/e1000 X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/dev/e1000 X-SVN-Commit-Revision: 362080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 00:42:07 -0000 Author: erj Date: Fri Jun 12 00:42:05 2020 New Revision: 362080 URL: https://svnweb.freebsd.org/changeset/base/362080 Log: MFC r361805: em(4): Add support for Comet Lake Mobile Platform This change introduces Comet Lake Mobile Platform support in the e1000 driver along with shared code patches described below. - Cast return value of e1000_ltr2ns() to higher type to avoid overflow - Remove useless statement of assigning act_offset - Add initialization of identification LED - Fix flow control setup after connected standby: After connected standby the driver blocks resets during "AdapterStart" and skips flow control setup. This change adds condition in e1000_setup_link_ich8lan() to always setup flow control and to setup physical interface only when there is no need to block resets. Sponsored by: Intel Corporation Modified: stable/12/sys/dev/e1000/e1000_api.c stable/12/sys/dev/e1000/e1000_hw.h stable/12/sys/dev/e1000/e1000_i210.c stable/12/sys/dev/e1000/e1000_ich8lan.c stable/12/sys/dev/e1000/if_em.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_api.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_api.c Fri Jun 12 00:42:05 2020 (r362080) @@ -309,6 +309,8 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_SPT_I219_V4: case E1000_DEV_ID_PCH_SPT_I219_LM5: case E1000_DEV_ID_PCH_SPT_I219_V5: + case E1000_DEV_ID_PCH_CMP_I219_LM12: + case E1000_DEV_ID_PCH_CMP_I219_V12: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_PCH_CNP_I219_LM6: @@ -319,7 +321,10 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_ICP_I219_V8: case E1000_DEV_ID_PCH_ICP_I219_LM9: case E1000_DEV_ID_PCH_ICP_I219_V9: - case E1000_DEV_ID_PCH_ICP_I219_V10: + case E1000_DEV_ID_PCH_CMP_I219_LM10: + case E1000_DEV_ID_PCH_CMP_I219_V10: + case E1000_DEV_ID_PCH_CMP_I219_LM11: + case E1000_DEV_ID_PCH_CMP_I219_V11: mac->type = e1000_pch_cnp; break; case E1000_DEV_ID_82575EB_COPPER: Modified: stable/12/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/12/sys/dev/e1000/e1000_hw.h Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_hw.h Fri Jun 12 00:42:05 2020 (r362080) @@ -155,7 +155,12 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 #define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 #define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 -#define E1000_DEV_ID_PCH_ICP_I219_V10 0x0D4F +#define E1000_DEV_ID_PCH_CMP_I219_LM10 0x0D4E +#define E1000_DEV_ID_PCH_CMP_I219_V10 0x0D4F +#define E1000_DEV_ID_PCH_CMP_I219_LM11 0x0D4C +#define E1000_DEV_ID_PCH_CMP_I219_V11 0x0D4D +#define E1000_DEV_ID_PCH_CMP_I219_LM12 0x0D53 +#define E1000_DEV_ID_PCH_CMP_I219_V12 0x0D55 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 Modified: stable/12/sys/dev/e1000/e1000_i210.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_i210.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_i210.c Fri Jun 12 00:42:05 2020 (r362080) @@ -774,6 +774,7 @@ static s32 e1000_get_cfg_done_i210(struct e1000_hw *hw **/ s32 e1000_init_hw_i210(struct e1000_hw *hw) { + struct e1000_mac_info *mac = &hw->mac; s32 ret_val; DEBUGFUNC("e1000_init_hw_i210"); @@ -784,6 +785,10 @@ s32 e1000_init_hw_i210(struct e1000_hw *hw) return ret_val; } hw->phy.ops.get_cfg_done = e1000_get_cfg_done_i210; + + /* Initialize identification LED */ + mac->ops.id_led_init(hw); + ret_val = e1000_init_hw_82575(hw); return ret_val; } Modified: stable/12/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- stable/12/sys/dev/e1000/e1000_ich8lan.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/e1000_ich8lan.c Fri Jun 12 00:42:05 2020 (r362080) @@ -1091,7 +1091,7 @@ static u64 e1000_ltr2ns(u16 ltr) value = ltr & E1000_LTRV_VALUE_MASK; scale = (ltr & E1000_LTRV_SCALE_MASK) >> E1000_LTRV_SCALE_SHIFT; - return value * (1 << (scale * E1000_LTRV_SCALE_FACTOR)); + return value * (1ULL << (scale * E1000_LTRV_SCALE_FACTOR)); } /** @@ -4161,13 +4161,6 @@ static s32 e1000_update_nvm_checksum_spt(struct e1000_ if (ret_val) goto release; - /* And invalidate the previously valid segment by setting - * its signature word (0x13) high_byte to 0b. This can be - * done without an erase because flash erase sets all bits - * to 1's. We can write 1's to 0's without an erase - */ - act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1; - /* offset in words but we read dword*/ act_offset = old_bank_offset + E1000_ICH_NVM_SIG_WORD - 1; ret_val = e1000_read_flash_dword_ich8lan(hw, act_offset, &dword); @@ -5235,9 +5228,6 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *h DEBUGFUNC("e1000_setup_link_ich8lan"); - if (hw->phy.ops.check_reset_block(hw)) - return E1000_SUCCESS; - /* ICH parts do not have a word in the NVM to determine * the default flow control setting, so we explicitly * set it to full. @@ -5253,10 +5243,12 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *h DEBUGOUT1("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode); - /* Continue to configure the copper link. */ - ret_val = hw->mac.ops.setup_physical_interface(hw); - if (ret_val) - return ret_val; + if (!hw->phy.ops.check_reset_block(hw)) { + /* Continue to configure the copper link. */ + ret_val = hw->mac.ops.setup_physical_interface(hw); + if (ret_val) + return ret_val; + } E1000_WRITE_REG(hw, E1000_FCTTV, hw->fc.pause_time); if ((hw->phy.type == e1000_phy_82578) || Modified: stable/12/sys/dev/e1000/if_em.c ============================================================================== --- stable/12/sys/dev/e1000/if_em.c Fri Jun 12 00:01:15 2020 (r362079) +++ stable/12/sys/dev/e1000/if_em.c Fri Jun 12 00:42:05 2020 (r362080) @@ -174,7 +174,12 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM10, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V10, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM11, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V11, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM12, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V12, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; From owner-svn-src-stable@freebsd.org Fri Jun 12 01:03:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05C0E328062; Fri, 12 Jun 2020 01:03:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jjCr6Mktz3Rfl; Fri, 12 Jun 2020 01:03:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D53F92107D; Fri, 12 Jun 2020 01:03:52 +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 05C13qdI015876; Fri, 12 Jun 2020 01:03:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C13q0e015872; Fri, 12 Jun 2020 01:03:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006120103.05C13q0e015872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 12 Jun 2020 01:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362081 - in stable: 11/contrib/wpa/src/wps 12/contrib/wpa/src/wps X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/wpa/src/wps 12/contrib/wpa/src/wps X-SVN-Commit-Revision: 362081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 01:03:53 -0000 Author: cy Date: Fri Jun 12 01:03:51 2020 New Revision: 362081 URL: https://svnweb.freebsd.org/changeset/base/362081 Log: MFC r361957-r361960 r361957: MFV r361936: Upstream commit message: [PATCH 1/3] WPS UPnP: Do not allow event subscriptions with URLs to other networks The UPnP Device Architecture 2.0 specification errata ("UDA errata 16-04-2020.docx") addresses a problem with notifications being allowed to go out to other domains by disallowing such cases. Do such filtering for the notification callback URLs to avoid undesired connections to external networks based on subscriptions that any device in the local network could request when WPS support for external registrars is enabled (the upnp_iface parameter in hostapd configuration). Obtained from: https://w1.fi/security/2020-1/\ 0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch Security: VU#339275 and CVE-2020-12695 r361958: MFV r361937: Upstream commit message: [PATCH 2/3] WPS UPnP: Fix event message generation using a long URL path More than about 700 character URL ended up overflowing the wpabuf used for building the event notification and this resulted in the wpabuf buffer overflow checks terminating the hostapd process. Fix this by allocating the buffer to be large enough to contain the full URL path. However, since that around 700 character limit has been the practical limit for more than ten years, start explicitly enforcing that as the limit or the callback URLs since any longer ones had not worked before and there is no need to enable them now either. Obtained from: https://w1.fi/security/2020-1/\ 0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch Security: VU#339275 and CVE-2020-12695 r361959: MFV r361938: Upstream commit message: [PATCH 3/3] WPS UPnP: Handle HTTP initiation failures for events more properly While it is appropriate to try to retransmit the event to another callback URL on a failure to initiate the HTTP client connection, there is no point in trying the exact same operation multiple times in a row. Replve the event_retry() calls with event_addr_failure() for these cases to avoid busy loops trying to repeat the same failing operation. These potential busy loops would go through eloop callbacks, so the process is not completely stuck on handling them, but unnecessary CPU would be used to process the continues retries that will keep failing for the same reason. Obtained from: https://w1.fi/security/2020-1/\ 0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch Security: VU#339275 and CVE-2020-12695 r361960: Post CVE-2020-12695 cleanup patch: Resolve a Linuxism to fix the build. Modified: stable/11/contrib/wpa/src/wps/wps_er.c stable/11/contrib/wpa/src/wps/wps_upnp.c stable/11/contrib/wpa/src/wps/wps_upnp_event.c stable/11/contrib/wpa/src/wps/wps_upnp_i.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/wpa/src/wps/wps_er.c stable/12/contrib/wpa/src/wps/wps_upnp.c stable/12/contrib/wpa/src/wps/wps_upnp_event.c stable/12/contrib/wpa/src/wps/wps_upnp_i.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/wpa/src/wps/wps_er.c ============================================================================== --- stable/11/contrib/wpa/src/wps/wps_er.c Fri Jun 12 00:42:05 2020 (r362080) +++ stable/11/contrib/wpa/src/wps/wps_er.c Fri Jun 12 01:03:51 2020 (r362081) @@ -1298,7 +1298,7 @@ wps_er_init(struct wps_context *wps, const char *ifnam "with %s", filter); } if (get_netif_info(er->ifname, &er->ip_addr, &er->ip_addr_text, - er->mac_addr)) { + NULL, er->mac_addr)) { wpa_printf(MSG_INFO, "WPS UPnP: Could not get IP/MAC address " "for %s. Does it have IP address?", er->ifname); wps_er_deinit(er, NULL, NULL); Modified: stable/11/contrib/wpa/src/wps/wps_upnp.c ============================================================================== --- stable/11/contrib/wpa/src/wps/wps_upnp.c Fri Jun 12 00:42:05 2020 (r362080) +++ stable/11/contrib/wpa/src/wps/wps_upnp.c Fri Jun 12 01:03:51 2020 (r362081) @@ -303,6 +303,14 @@ static void subscr_addr_free_all(struct subscription * } +static int local_network_addr(struct upnp_wps_device_sm *sm, + struct sockaddr_in *addr) +{ + return (addr->sin_addr.s_addr & sm->netmask.s_addr) == + (sm->ip_addr & sm->netmask.s_addr); +} + + /* subscr_addr_add_url -- add address(es) for one url to subscription */ static void subscr_addr_add_url(struct subscription *s, const char *url, size_t url_len) @@ -320,9 +328,14 @@ static void subscr_addr_add_url(struct subscription *s int rerr; size_t host_len, path_len; - /* url MUST begin with http: */ - if (url_len < 7 || os_strncasecmp(url, "http://", 7)) + /* URL MUST begin with HTTP scheme. In addition, limit the length of + * the URL to 700 characters which is around the limit that was + * implicitly enforced for more than 10 years due to a bug in + * generating the event messages. */ + if (url_len < 7 || os_strncasecmp(url, "http://", 7) || url_len > 700) { + wpa_printf(MSG_DEBUG, "WPS UPnP: Reject an unacceptable URL"); goto fail; + } url += 7; url_len -= 7; @@ -381,6 +394,7 @@ static void subscr_addr_add_url(struct subscription *s for (rp = result; rp; rp = rp->ai_next) { struct subscr_addr *a; + struct sockaddr_in *addr = (struct sockaddr_in *) rp->ai_addr; /* Limit no. of address to avoid denial of service attack */ if (dl_list_len(&s->addr_list) >= MAX_ADDR_PER_SUBSCRIPTION) { @@ -389,6 +403,13 @@ static void subscr_addr_add_url(struct subscription *s break; } + if (!local_network_addr(s->sm, addr)) { + wpa_printf(MSG_INFO, + "WPS UPnP: Ignore a delivery URL that points to another network %s", + inet_ntoa(addr->sin_addr)); + continue; + } + a = os_zalloc(sizeof(*a) + alloc_len); if (a == NULL) break; @@ -889,11 +910,12 @@ static int eth_get(const char *device, u8 ea[ETH_ALEN] * @net_if: Selected network interface name * @ip_addr: Buffer for returning IP address in network byte order * @ip_addr_text: Buffer for returning a pointer to allocated IP address text + * @netmask: Buffer for returning netmask or %NULL if not needed * @mac: Buffer for returning MAC address * Returns: 0 on success, -1 on failure */ int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, - u8 mac[ETH_ALEN]) + struct in_addr *netmask, u8 mac[ETH_ALEN]) { struct ifreq req; int sock = -1; @@ -919,6 +941,23 @@ int get_netif_info(const char *net_if, unsigned *ip_ad in_addr.s_addr = *ip_addr; os_snprintf(*ip_addr_text, 16, "%s", inet_ntoa(in_addr)); + if (netmask) { + os_memset(&req, 0, sizeof(req)); + os_strlcpy(req.ifr_name, net_if, sizeof(req.ifr_name)); + if (ioctl(sock, SIOCGIFNETMASK, &req) < 0) { + wpa_printf(MSG_ERROR, + "WPS UPnP: SIOCGIFNETMASK failed: %d (%s)", + errno, strerror(errno)); + goto fail; + } +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + addr = (struct sockaddr_in *) &req.ifr_addr; +#else + addr = (struct sockaddr_in *) &req.ifr_netmask; +#endif + netmask->s_addr = addr->sin_addr.s_addr; + } + #ifdef __linux__ os_strlcpy(req.ifr_name, net_if, sizeof(req.ifr_name)); if (ioctl(sock, SIOCGIFHWADDR, &req) < 0) { @@ -1025,11 +1064,15 @@ static int upnp_wps_device_start(struct upnp_wps_devic /* Determine which IP and mac address we're using */ if (get_netif_info(net_if, &sm->ip_addr, &sm->ip_addr_text, - sm->mac_addr)) { + &sm->netmask, sm->mac_addr)) { wpa_printf(MSG_INFO, "WPS UPnP: Could not get IP/MAC address " "for %s. Does it have IP address?", net_if); goto fail; } + wpa_printf(MSG_DEBUG, "WPS UPnP: Local IP address %s netmask %s hwaddr " + MACSTR, + sm->ip_addr_text, inet_ntoa(sm->netmask), + MAC2STR(sm->mac_addr)); /* Listen for incoming TCP connections so that others * can fetch our "xml files" from us. Modified: stable/11/contrib/wpa/src/wps/wps_upnp_event.c ============================================================================== --- stable/11/contrib/wpa/src/wps/wps_upnp_event.c Fri Jun 12 00:42:05 2020 (r362080) +++ stable/11/contrib/wpa/src/wps/wps_upnp_event.c Fri Jun 12 01:03:51 2020 (r362081) @@ -147,7 +147,8 @@ static struct wpabuf * event_build_message(struct wps_ struct wpabuf *buf; char *b; - buf = wpabuf_alloc(1000 + wpabuf_len(e->data)); + buf = wpabuf_alloc(1000 + os_strlen(e->addr->path) + + wpabuf_len(e->data)); if (buf == NULL) return NULL; wpabuf_printf(buf, "NOTIFY %s HTTP/1.1\r\n", e->addr->path); @@ -293,7 +294,7 @@ static int event_send_start(struct subscription *s) buf = event_build_message(e); if (buf == NULL) { - event_retry(e, 0); + event_addr_failure(e); return -1; } @@ -301,7 +302,7 @@ static int event_send_start(struct subscription *s) event_http_cb, e); if (e->http_event == NULL) { wpabuf_free(buf); - event_retry(e, 0); + event_addr_failure(e); return -1; } Modified: stable/11/contrib/wpa/src/wps/wps_upnp_i.h ============================================================================== --- stable/11/contrib/wpa/src/wps/wps_upnp_i.h Fri Jun 12 00:42:05 2020 (r362080) +++ stable/11/contrib/wpa/src/wps/wps_upnp_i.h Fri Jun 12 01:03:51 2020 (r362081) @@ -128,6 +128,7 @@ struct upnp_wps_device_sm { u8 mac_addr[ETH_ALEN]; /* mac addr of network i.f. we use */ char *ip_addr_text; /* IP address of network i.f. we use */ unsigned ip_addr; /* IP address of network i.f. we use (host order) */ + struct in_addr netmask; int multicast_sd; /* send multicast messages over this socket */ int ssdp_sd; /* receive discovery UPD packets on socket */ int ssdp_sd_registered; /* nonzero if we must unregister */ @@ -158,7 +159,7 @@ struct subscription * subscription_find(struct upnp_wp const u8 uuid[UUID_LEN]); void subscr_addr_delete(struct subscr_addr *a); int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, - u8 mac[ETH_ALEN]); + struct in_addr *netmask, u8 mac[ETH_ALEN]); /* wps_upnp_ssdp.c */ void msearchreply_state_machine_stop(struct advertisement_state_machine *a); From owner-svn-src-stable@freebsd.org Fri Jun 12 01:03:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCDBE3286A8; Fri, 12 Jun 2020 01:03:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jjCs5ZP6z3Rfm; Fri, 12 Jun 2020 01:03:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA940210E5; Fri, 12 Jun 2020 01:03:53 +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 05C13r2q015885; Fri, 12 Jun 2020 01:03:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C13r9h015882; Fri, 12 Jun 2020 01:03:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202006120103.05C13r9h015882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 12 Jun 2020 01:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362081 - in stable: 11/contrib/wpa/src/wps 12/contrib/wpa/src/wps X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/wpa/src/wps 12/contrib/wpa/src/wps X-SVN-Commit-Revision: 362081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 01:03:53 -0000 Author: cy Date: Fri Jun 12 01:03:51 2020 New Revision: 362081 URL: https://svnweb.freebsd.org/changeset/base/362081 Log: MFC r361957-r361960 r361957: MFV r361936: Upstream commit message: [PATCH 1/3] WPS UPnP: Do not allow event subscriptions with URLs to other networks The UPnP Device Architecture 2.0 specification errata ("UDA errata 16-04-2020.docx") addresses a problem with notifications being allowed to go out to other domains by disallowing such cases. Do such filtering for the notification callback URLs to avoid undesired connections to external networks based on subscriptions that any device in the local network could request when WPS support for external registrars is enabled (the upnp_iface parameter in hostapd configuration). Obtained from: https://w1.fi/security/2020-1/\ 0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch Security: VU#339275 and CVE-2020-12695 r361958: MFV r361937: Upstream commit message: [PATCH 2/3] WPS UPnP: Fix event message generation using a long URL path More than about 700 character URL ended up overflowing the wpabuf used for building the event notification and this resulted in the wpabuf buffer overflow checks terminating the hostapd process. Fix this by allocating the buffer to be large enough to contain the full URL path. However, since that around 700 character limit has been the practical limit for more than ten years, start explicitly enforcing that as the limit or the callback URLs since any longer ones had not worked before and there is no need to enable them now either. Obtained from: https://w1.fi/security/2020-1/\ 0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch Security: VU#339275 and CVE-2020-12695 r361959: MFV r361938: Upstream commit message: [PATCH 3/3] WPS UPnP: Handle HTTP initiation failures for events more properly While it is appropriate to try to retransmit the event to another callback URL on a failure to initiate the HTTP client connection, there is no point in trying the exact same operation multiple times in a row. Replve the event_retry() calls with event_addr_failure() for these cases to avoid busy loops trying to repeat the same failing operation. These potential busy loops would go through eloop callbacks, so the process is not completely stuck on handling them, but unnecessary CPU would be used to process the continues retries that will keep failing for the same reason. Obtained from: https://w1.fi/security/2020-1/\ 0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch Security: VU#339275 and CVE-2020-12695 r361960: Post CVE-2020-12695 cleanup patch: Resolve a Linuxism to fix the build. Modified: stable/12/contrib/wpa/src/wps/wps_er.c stable/12/contrib/wpa/src/wps/wps_upnp.c stable/12/contrib/wpa/src/wps/wps_upnp_event.c stable/12/contrib/wpa/src/wps/wps_upnp_i.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/wpa/src/wps/wps_er.c stable/11/contrib/wpa/src/wps/wps_upnp.c stable/11/contrib/wpa/src/wps/wps_upnp_event.c stable/11/contrib/wpa/src/wps/wps_upnp_i.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/wpa/src/wps/wps_er.c ============================================================================== --- stable/12/contrib/wpa/src/wps/wps_er.c Fri Jun 12 00:42:05 2020 (r362080) +++ stable/12/contrib/wpa/src/wps/wps_er.c Fri Jun 12 01:03:51 2020 (r362081) @@ -1298,7 +1298,7 @@ wps_er_init(struct wps_context *wps, const char *ifnam "with %s", filter); } if (get_netif_info(er->ifname, &er->ip_addr, &er->ip_addr_text, - er->mac_addr)) { + NULL, er->mac_addr)) { wpa_printf(MSG_INFO, "WPS UPnP: Could not get IP/MAC address " "for %s. Does it have IP address?", er->ifname); wps_er_deinit(er, NULL, NULL); Modified: stable/12/contrib/wpa/src/wps/wps_upnp.c ============================================================================== --- stable/12/contrib/wpa/src/wps/wps_upnp.c Fri Jun 12 00:42:05 2020 (r362080) +++ stable/12/contrib/wpa/src/wps/wps_upnp.c Fri Jun 12 01:03:51 2020 (r362081) @@ -303,6 +303,14 @@ static void subscr_addr_free_all(struct subscription * } +static int local_network_addr(struct upnp_wps_device_sm *sm, + struct sockaddr_in *addr) +{ + return (addr->sin_addr.s_addr & sm->netmask.s_addr) == + (sm->ip_addr & sm->netmask.s_addr); +} + + /* subscr_addr_add_url -- add address(es) for one url to subscription */ static void subscr_addr_add_url(struct subscription *s, const char *url, size_t url_len) @@ -320,9 +328,14 @@ static void subscr_addr_add_url(struct subscription *s int rerr; size_t host_len, path_len; - /* url MUST begin with http: */ - if (url_len < 7 || os_strncasecmp(url, "http://", 7)) + /* URL MUST begin with HTTP scheme. In addition, limit the length of + * the URL to 700 characters which is around the limit that was + * implicitly enforced for more than 10 years due to a bug in + * generating the event messages. */ + if (url_len < 7 || os_strncasecmp(url, "http://", 7) || url_len > 700) { + wpa_printf(MSG_DEBUG, "WPS UPnP: Reject an unacceptable URL"); goto fail; + } url += 7; url_len -= 7; @@ -381,6 +394,7 @@ static void subscr_addr_add_url(struct subscription *s for (rp = result; rp; rp = rp->ai_next) { struct subscr_addr *a; + struct sockaddr_in *addr = (struct sockaddr_in *) rp->ai_addr; /* Limit no. of address to avoid denial of service attack */ if (dl_list_len(&s->addr_list) >= MAX_ADDR_PER_SUBSCRIPTION) { @@ -389,6 +403,13 @@ static void subscr_addr_add_url(struct subscription *s break; } + if (!local_network_addr(s->sm, addr)) { + wpa_printf(MSG_INFO, + "WPS UPnP: Ignore a delivery URL that points to another network %s", + inet_ntoa(addr->sin_addr)); + continue; + } + a = os_zalloc(sizeof(*a) + alloc_len); if (a == NULL) break; @@ -889,11 +910,12 @@ static int eth_get(const char *device, u8 ea[ETH_ALEN] * @net_if: Selected network interface name * @ip_addr: Buffer for returning IP address in network byte order * @ip_addr_text: Buffer for returning a pointer to allocated IP address text + * @netmask: Buffer for returning netmask or %NULL if not needed * @mac: Buffer for returning MAC address * Returns: 0 on success, -1 on failure */ int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, - u8 mac[ETH_ALEN]) + struct in_addr *netmask, u8 mac[ETH_ALEN]) { struct ifreq req; int sock = -1; @@ -919,6 +941,23 @@ int get_netif_info(const char *net_if, unsigned *ip_ad in_addr.s_addr = *ip_addr; os_snprintf(*ip_addr_text, 16, "%s", inet_ntoa(in_addr)); + if (netmask) { + os_memset(&req, 0, sizeof(req)); + os_strlcpy(req.ifr_name, net_if, sizeof(req.ifr_name)); + if (ioctl(sock, SIOCGIFNETMASK, &req) < 0) { + wpa_printf(MSG_ERROR, + "WPS UPnP: SIOCGIFNETMASK failed: %d (%s)", + errno, strerror(errno)); + goto fail; + } +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + addr = (struct sockaddr_in *) &req.ifr_addr; +#else + addr = (struct sockaddr_in *) &req.ifr_netmask; +#endif + netmask->s_addr = addr->sin_addr.s_addr; + } + #ifdef __linux__ os_strlcpy(req.ifr_name, net_if, sizeof(req.ifr_name)); if (ioctl(sock, SIOCGIFHWADDR, &req) < 0) { @@ -1025,11 +1064,15 @@ static int upnp_wps_device_start(struct upnp_wps_devic /* Determine which IP and mac address we're using */ if (get_netif_info(net_if, &sm->ip_addr, &sm->ip_addr_text, - sm->mac_addr)) { + &sm->netmask, sm->mac_addr)) { wpa_printf(MSG_INFO, "WPS UPnP: Could not get IP/MAC address " "for %s. Does it have IP address?", net_if); goto fail; } + wpa_printf(MSG_DEBUG, "WPS UPnP: Local IP address %s netmask %s hwaddr " + MACSTR, + sm->ip_addr_text, inet_ntoa(sm->netmask), + MAC2STR(sm->mac_addr)); /* Listen for incoming TCP connections so that others * can fetch our "xml files" from us. Modified: stable/12/contrib/wpa/src/wps/wps_upnp_event.c ============================================================================== --- stable/12/contrib/wpa/src/wps/wps_upnp_event.c Fri Jun 12 00:42:05 2020 (r362080) +++ stable/12/contrib/wpa/src/wps/wps_upnp_event.c Fri Jun 12 01:03:51 2020 (r362081) @@ -147,7 +147,8 @@ static struct wpabuf * event_build_message(struct wps_ struct wpabuf *buf; char *b; - buf = wpabuf_alloc(1000 + wpabuf_len(e->data)); + buf = wpabuf_alloc(1000 + os_strlen(e->addr->path) + + wpabuf_len(e->data)); if (buf == NULL) return NULL; wpabuf_printf(buf, "NOTIFY %s HTTP/1.1\r\n", e->addr->path); @@ -293,7 +294,7 @@ static int event_send_start(struct subscription *s) buf = event_build_message(e); if (buf == NULL) { - event_retry(e, 0); + event_addr_failure(e); return -1; } @@ -301,7 +302,7 @@ static int event_send_start(struct subscription *s) event_http_cb, e); if (e->http_event == NULL) { wpabuf_free(buf); - event_retry(e, 0); + event_addr_failure(e); return -1; } Modified: stable/12/contrib/wpa/src/wps/wps_upnp_i.h ============================================================================== --- stable/12/contrib/wpa/src/wps/wps_upnp_i.h Fri Jun 12 00:42:05 2020 (r362080) +++ stable/12/contrib/wpa/src/wps/wps_upnp_i.h Fri Jun 12 01:03:51 2020 (r362081) @@ -128,6 +128,7 @@ struct upnp_wps_device_sm { u8 mac_addr[ETH_ALEN]; /* mac addr of network i.f. we use */ char *ip_addr_text; /* IP address of network i.f. we use */ unsigned ip_addr; /* IP address of network i.f. we use (host order) */ + struct in_addr netmask; int multicast_sd; /* send multicast messages over this socket */ int ssdp_sd; /* receive discovery UPD packets on socket */ int ssdp_sd_registered; /* nonzero if we must unregister */ @@ -158,7 +159,7 @@ struct subscription * subscription_find(struct upnp_wp const u8 uuid[UUID_LEN]); void subscr_addr_delete(struct subscr_addr *a); int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, - u8 mac[ETH_ALEN]); + struct in_addr *netmask, u8 mac[ETH_ALEN]); /* wps_upnp_ssdp.c */ void msearchreply_state_machine_stop(struct advertisement_state_machine *a); From owner-svn-src-stable@freebsd.org Fri Jun 12 07:23:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D51F331BC5; Fri, 12 Jun 2020 07:23:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jsdr2lfdz44RB; Fri, 12 Jun 2020 07:23:28 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5986125EB4; Fri, 12 Jun 2020 07:23:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05C7NSS1049895; Fri, 12 Jun 2020 07:23:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C7NSAC049894; Fri, 12 Jun 2020 07:23:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202006120723.05C7NSAC049894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 12 Jun 2020 07:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362086 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 362086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 07:23:28 -0000 Author: avg Date: Fri Jun 12 07:23:27 2020 New Revision: 362086 URL: https://svnweb.freebsd.org/changeset/base/362086 Log: MFC r361620: corefile_open_last: don't keep a locked vnode while locking other ones Consider this scenario: - kern.corefile=/var/coredumps/%N.%U.%I.core - multiple processes with the same name crash at the same time It's possible that one process selects existing file N as oldvp while it keeps looking for an unused file number. Another process scans through files and stumbles upon N. That process would be blocked on the vnode lock while holding the directory vnode exclusively locked. The first process would, thus, get blocked on the directory's vnode lock. More generally, holding a file's vnode lock (oldvp) while trying to lock its directory (for the next lookup) is a violation of the vnode locking order. I have observed this deadlock in the wild. So, the change to keep oldvp "opened" but unlocked and to lock it again only if it's to be returned as the result. As kib noted, an alternative would be to keep the directory locked and to use VOP_LOOKUP directly for scanning through existing core files. Modified: stable/12/sys/kern/kern_sig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Fri Jun 12 06:10:27 2020 (r362085) +++ stable/12/sys/kern/kern_sig.c Fri Jun 12 07:23:27 2020 (r362086) @@ -3423,8 +3423,9 @@ corefile_open_last(struct thread *td, char *name, int (lasttime.tv_sec == vattr.va_mtime.tv_sec && lasttime.tv_nsec >= vattr.va_mtime.tv_nsec)) { if (oldvp != NULL) - vnode_close_locked(td, oldvp); + vn_close(oldvp, FWRITE, td->td_ucred, td); oldvp = vp; + VOP_UNLOCK(oldvp); lasttime = vattr.va_mtime; } else { vnode_close_locked(td, vp); @@ -3435,12 +3436,18 @@ corefile_open_last(struct thread *td, char *name, int if (nextvp == NULL) { if ((td->td_proc->p_flag & P_SUGID) != 0) { error = EFAULT; - vnode_close_locked(td, oldvp); + vn_close(oldvp, FWRITE, td->td_ucred, td); } else { nextvp = oldvp; + error = vn_lock(nextvp, LK_EXCLUSIVE); + if (error != 0) { + vn_close(nextvp, FWRITE, td->td_ucred, + td); + nextvp = NULL; + } } } else { - vnode_close_locked(td, oldvp); + vn_close(oldvp, FWRITE, td->td_ucred, td); } } if (error != 0) { From owner-svn-src-stable@freebsd.org Fri Jun 12 07:25:41 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D688331F25; Fri, 12 Jun 2020 07:25:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jshN6zQXz44cn; Fri, 12 Jun 2020 07:25:40 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0B2925A69; Fri, 12 Jun 2020 07:25:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05C7PedL050063; Fri, 12 Jun 2020 07:25:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C7Pe4M050061; Fri, 12 Jun 2020 07:25:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202006120725.05C7Pe4M050061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 12 Jun 2020 07:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362087 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 362087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 07:25:41 -0000 Author: avg Date: Fri Jun 12 07:25:40 2020 New Revision: 362087 URL: https://svnweb.freebsd.org/changeset/base/362087 Log: MFC r361621: do not enable pci bridge decoding on resume until I/O windows are restored PCI bus driver restores most but not all of a child PCI-PCI bridge configuration. The bridge's I/O windows are restored by pcib driver and that happens later in time. This can be problematic because the Command register is restored before the windows are restored. If the firmware programs the windows incorrectly or even does not program them at all, then the bridge can start claiming I/O cycles that are not intended for it. This will continue until the correct windows are restored. I have observed this problem with a buggy BIOS where after resuming from S3 an I/O port window of a PCI-PCI bridge was configured with zero base and limit causing the bridge to claim 0x0 - 0xFFF port range. That interfered with ACPI port access including ACPI PM Timer at port 0x808, thus wreaking havoc in the time keeping. The solution is to restore the Command register of PCI-PCI bridges after the windows are restored in pcib driver. While here, I decided that for other PCI device types (normal and cardbus) it's better to restore the Command register after their BARs are restored. Modified: stable/12/sys/dev/pci/pci.c stable/12/sys/dev/pci/pci_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/pci.c ============================================================================== --- stable/12/sys/dev/pci/pci.c Fri Jun 12 07:23:27 2020 (r362086) +++ stable/12/sys/dev/pci/pci.c Fri Jun 12 07:25:40 2020 (r362087) @@ -5933,7 +5933,6 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinf */ if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) pci_set_powerstate(dev, PCI_POWERSTATE_D0); - pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2); pci_write_config(dev, PCIR_INTLINE, dinfo->cfg.intline, 1); pci_write_config(dev, PCIR_INTPIN, dinfo->cfg.intpin, 1); pci_write_config(dev, PCIR_CACHELNSZ, dinfo->cfg.cachelnsz, 1); @@ -5971,6 +5970,9 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinf break; } pci_restore_bars(dev); + + if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_BRIDGE) + pci_write_config(dev, PCIR_COMMAND, dinfo->cfg.cmdreg, 2); /* * Restore extended capabilities for PCI-Express and PCI-X Modified: stable/12/sys/dev/pci/pci_pci.c ============================================================================== --- stable/12/sys/dev/pci/pci_pci.c Fri Jun 12 07:23:27 2020 (r362086) +++ stable/12/sys/dev/pci/pci_pci.c Fri Jun 12 07:25:40 2020 (r362087) @@ -1786,6 +1786,12 @@ pcib_resume(device_t dev) { pcib_cfg_restore(device_get_softc(dev)); + + /* + * Restore the Command register only after restoring the windows. + * The bridge should not be claiming random windows. + */ + pci_write_config(dev, PCIR_COMMAND, pci_get_cmdreg(dev), 2); return (bus_generic_resume(dev)); } From owner-svn-src-stable@freebsd.org Fri Jun 12 07:36:32 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B27F4331FB9; Fri, 12 Jun 2020 07:36:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jsww4BzFz459q; Fri, 12 Jun 2020 07:36:32 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B62D259FA; Fri, 12 Jun 2020 07:36:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05C7aWVE056445; Fri, 12 Jun 2020 07:36:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05C7aWZ3056444; Fri, 12 Jun 2020 07:36:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202006120736.05C7aWZ3056444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 12 Jun 2020 07:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362088 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 362088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 07:36:32 -0000 Author: avg Date: Fri Jun 12 07:36:32 2020 New Revision: 362088 URL: https://svnweb.freebsd.org/changeset/base/362088 Log: fix up r362086, MFC of r361620, add missing VOP_UNLOCK argument The useless argument has been dropped in head, but not in this branch. Pointy hat to: avg Modified: stable/12/sys/kern/kern_sig.c Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Fri Jun 12 07:25:40 2020 (r362087) +++ stable/12/sys/kern/kern_sig.c Fri Jun 12 07:36:32 2020 (r362088) @@ -3425,7 +3425,7 @@ corefile_open_last(struct thread *td, char *name, int if (oldvp != NULL) vn_close(oldvp, FWRITE, td->td_ucred, td); oldvp = vp; - VOP_UNLOCK(oldvp); + VOP_UNLOCK(oldvp, 0); lasttime = vattr.va_mtime; } else { vnode_close_locked(td, vp); From owner-svn-src-stable@freebsd.org Fri Jun 12 13:44:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98D5933AFA4; Fri, 12 Jun 2020 13:44:55 +0000 (UTC) (envelope-from zec@fer.hr) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80074.outbound.protection.outlook.com [40.107.8.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49k25x4MV6z4WtX; Fri, 12 Jun 2020 13:44:53 +0000 (UTC) (envelope-from zec@fer.hr) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QF9FyzyHTbaJYy2q4qn1fVlniyDDAkk5KsItFN36uS1rSTk58d9xL+6tN18YJ9ndntOpJyFf5rCKFDtEf6iF+FLTaf6WdXn1+G5kLQxtljNEzhUyy4CM+sFBnLHjt0fk3azHJolOImc8rQI7BcfkLablcAQPvhKhgi/0oPctiA7YsopjwNedTKFOV8pr66weEOHq4aZ72MTSOXzVmia5BLFTVyekBjsHRi41q0G8RusxWUBD5wbc0zt4C3YXVEEvXAtfiShYwWZGwzOxRIPuyrmuyZXn/iQnLKliUmYMR/tGqvZdv2O7nG3/uwb/bbih/qnQNB7M7f6k0Wk6zF0Sqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ZrLcZ2aOH1osNn3ut1ykx1ZXpJWr2YIIjgmPEPUSuA=; b=UL9PSD1Ccmkbi9vp6z3Zlr50YgXIsURAViIls6vw0H56IpZZfR+8aqBrD9dcxcVAejQeA+72pF0iYh4WGnK3It0PugU06pXDcHkJm34su3/WtXcD56x7UBY5BOUSuxPAa0rtj1kdFNpG8Q8Sr0XICuHoo5Ippv5OiibOhgcYPKk4gNclW1EMaszS+3xSjsPATe3D9WZ2Gcsnc3NsuG4KjLBnJOH1b+dkuBD+H9zZLvIzDnOMesuMx/GShBfvEwW+SjTIO2OLSICYghalcaXZXpJXwPR4rnUZKsm0XRH94ixS38zY5VWKGTqbC5WXJQlAeUIk0CZuOict7Rbn0JdBFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fer.hr; dmarc=pass action=none header.from=fer.hr; dkim=pass header.d=fer.hr; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ferhr.onmicrosoft.com; s=selector2-ferhr-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ZrLcZ2aOH1osNn3ut1ykx1ZXpJWr2YIIjgmPEPUSuA=; b=Mqh3f9xBVk2GbiZqfsGu1ONU8KkvAxTWh0sKNS6x7LqQOdz9KYiPO6PCcomxMOY9bIpDSmb8uORMxw+i0POkI1l2wAe6uDtW7UHdWnrL1UdQDCPf4An6OSH5fEPqXj5GXIi9wE8WiogtYicH21OOQRTLjfsjEI8+5RxV2WHqvMs= Received: from VE1PR08MB4783.eurprd08.prod.outlook.com (2603:10a6:802:a9::16) by VE1PR08MB4670.eurprd08.prod.outlook.com (2603:10a6:802:ac::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18; Fri, 12 Jun 2020 13:44:50 +0000 Received: from VE1PR08MB4783.eurprd08.prod.outlook.com ([fe80::c8e:e335:c7:319b]) by VE1PR08MB4783.eurprd08.prod.outlook.com ([fe80::c8e:e335:c7:319b%3]) with mapi id 15.20.3088.021; Fri, 12 Jun 2020 13:44:50 +0000 Date: Fri, 12 Jun 2020 15:44:42 +0200 From: Marko Zec To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r362009 - stable/12/sys/net Message-ID: <20200612154442.59f6da7b@x23> In-Reply-To: <202006101306.05AD6Dmf063941@repo.freebsd.org> References: <202006101306.05AD6Dmf063941@repo.freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd11.3) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0341.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::17) To VE1PR08MB4783.eurprd08.prod.outlook.com (2603:10a6:802:a9::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from x23 (31.147.3.0) by LO2P265CA0341.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18 via Frontend Transport; Fri, 12 Jun 2020 13:44:47 +0000 X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd11.3) X-Originating-IP: [31.147.3.0] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 883d36f6-3734-4fc4-e440-08d80ed6c6dc X-MS-TrafficTypeDiagnostic: VE1PR08MB4670: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 0432A04947 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oN7yHYpajn3d0wGPj2ntONFiTM/PPOKfpvAMPNQ94oOgwmSZfTyeTIPWtMB2PWRJxulX95K634Do2I9WZkLcX4vZkHWDcgVv3LZYpUVolKg5FX4PSCJLf7wXm2FwZ9s6HruDE9Bzj9GDcDaOyey4eEsbMu5/JIrWD7hl2kMcLLt4l7EqEaAJpbR83HrTmRnlaRnWe8yvI7x0p2kA272q3keqeyxwbx6AzTwsYL8xNrnGdI/Y3tKWiU9U18UF8RZSX+Ug88TbOGWKDkqlNJEN+n2oVW7taAmSD54/6psFibnpqzElGZQjulDX4ViCUzcWEagC3mH0uzFkckl4Zxt+uJarwwaSHIdRMBe6aFYjJRzIwwiIAOxfJZXTFGixweIiydE19rkq35DRNLyQEt3k9w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4783.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(136003)(39850400004)(396003)(366004)(55016002)(478600001)(16526019)(52116002)(33716001)(66556008)(9686003)(66946007)(4326008)(8676002)(8936002)(1076003)(186003)(9576002)(6496006)(966005)(83380400001)(450100002)(2906002)(66476007)(86362001)(6916009)(956004)(316002)(26005)(6666004)(786003)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: WtiDYJCvV+zz6SeN6vk7AnjhVeZz77nXE2Eb/2LAZpbuobIIQoBquKtigZLpUnfre0xcAPlKVugjIw1WkAbNrQ4FlkEUEjohr9hZwLVdV/lThHZAdHodxvEqysnKDjefxsnKyzuBEv4QbRKIUfNsXKQRuoWJKP6W5dbF/8ijCWZJtC3Bibp5o5pnPAU2f2PU0z+BLav2Fwd/S9y8VYqmrAxL0hgKNpDLvAdJMRgSxGiYWvroAlGO593aP1L0eVR9MUpOaaTPyZnEA75EULnB9I/fzWVVJDN3FEKt2/30SPPSXUCXNUXovZhEidfQXAlS7rDgM2s5eLmUoTieGbywiHIRsWEh3d97HVmooK8HppAB3+Psd6bVgTTLu0/JLTh4H8syxhDRHfO4mi2UeQfjjsUtnUr6noFDP1UEUT19VCp4CtxvjtrzemHVMnTLKt9GnvEhZedUGZNx28UiJjMuo7hJVec4OR2d0zGCU5B+LNY= X-OriginatorOrg: fer.hr X-MS-Exchange-CrossTenant-Network-Message-Id: 883d36f6-3734-4fc4-e440-08d80ed6c6dc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2020 13:44:50.2026 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: ca71eddc-cc7b-4e5b-95bd-55b658e696be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0sippQWR24kVXdSbpZKkzN2V9LXhoVW0PfmjUfLqYYq/dSTbkpn2IHlhotdSFwGr X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4670 X-Rspamd-Queue-Id: 49k25x4MV6z4WtX X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ferhr.onmicrosoft.com header.s=selector2-ferhr-onmicrosoft-com header.b=Mqh3f9xB; dmarc=none; spf=pass (mx1.freebsd.org: domain of zec@fer.hr designates 40.107.8.74 as permitted sender) smtp.mailfrom=zec@fer.hr X-Spamd-Result: default: False [-3.67 / 15.00]; NEURAL_HAM_MEDIUM(-0.94)[-0.944]; R_DKIM_ALLOW(-0.20)[ferhr.onmicrosoft.com:s=selector2-ferhr-onmicrosoft-com]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[fer.hr]; NEURAL_HAM_LONG(-0.99)[-0.988]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; RECEIVED_SPAMHAUS_PBL(0.00)[31.147.3.0:received]; DKIM_TRACE(0.00)[ferhr.onmicrosoft.com:+]; NEURAL_HAM_SHORT(-0.64)[-0.644]; RCVD_IN_DNSWL_LOW(-0.10)[40.107.8.74:from]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.8.74:from] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 13:44:55 -0000 On Wed, 10 Jun 2020 13:06:13 +0000 (UTC) "Andrey V. Elsukov" wrote: > Author: ae > Date: Wed Jun 10 13:06:13 2020 > New Revision: 362009 > URL: https://svnweb.freebsd.org/changeset/base/362009 > > Log: > MFC r361749: > Add if_reassign method to all tunneling interfaces. > > After r339550 tunneling interfaces have started handle appearing > and disappearing of ingress IP address on the host system. > When such interfaces are moving into VNET jail, they lose ability > to properly handle ifaddr_event_ext event. And this leads to need to > reconfigure tunnel to make it working again. > > Since moving an interface into VNET jail leads to removing of all > IP addresses, it looks consistent, that tunnel configuration should > also be cleared. This is what will do if_reassign method. Sorry for not noticing this one before, but albeit jumping in late, I have to state two objections: 1) what exactly is the use-case / purpose of moving clonable interfaces from one vnet to another while removing their tunnel configs? Apparently gif / gre already have virtualized cloners, so if a vnet owner needs a new instance of gif / gre, it can create it there? We should either entirely prohibit moving such ifnets to child vnets, or allow their tunnel endpoints to exist in the parent vnet space, while permitting the traffic from child vnets to be encapsulated. 2) the behavior introduced by this change is inconsistent with how other clonable interfaces have worked since 8.0, e.g if_vlan instances can be moved (loaned) to a child vnet, and in such cases they remain tied to their parent (physical) ethernet ifnets. Similarly, ng_eiface can be loaned to a chiled vnet, but its netgraph part remains in the parent vnet. So now we got a confusion++, perhaps for a good reason, but I fail to see the proper justification (execpt that someone wanted to see this patch commited). Cheers, Marko > > Reported by: John W. O'Brien > > Modified: > stable/12/sys/net/if_gif.c > stable/12/sys/net/if_gre.c > stable/12/sys/net/if_ipsec.c > stable/12/sys/net/if_me.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/net/if_gif.c > ============================================================================== > --- stable/12/sys/net/if_gif.c Wed Jun 10 09:31:37 2020 > (r362008) +++ stable/12/sys/net/if_gif.c Wed Jun 10 13:06:13 > 2020 (r362009) @@ -104,6 +104,9 @@ void > (*ng_gif_input_orphan_p)(struct ifnet *ifp, struc void > (*ng_gif_attach_p)(struct ifnet *ifp); void > (*ng_gif_detach_p)(struct ifnet *ifp); > +#ifdef VIMAGE > +static void gif_reassign(struct ifnet *, struct vnet *, char > *); +#endif > static void gif_delete_tunnel(struct gif_softc *); > static int gif_ioctl(struct ifnet *, u_long, caddr_t); > static int gif_transmit(struct ifnet *, struct mbuf *); > @@ -150,6 +153,9 @@ gif_clone_create(struct if_clone *ifc, int unit, > caddr GIF2IFP(sc)->if_transmit = gif_transmit; > GIF2IFP(sc)->if_qflush = gif_qflush; > GIF2IFP(sc)->if_output = gif_output; > +#ifdef VIMAGE > + GIF2IFP(sc)->if_reassign = gif_reassign; > +#endif > GIF2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; > GIF2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; > if_attach(GIF2IFP(sc)); > @@ -159,6 +165,21 @@ gif_clone_create(struct if_clone *ifc, int unit, > caddr > return (0); > } > + > +#ifdef VIMAGE > +static void > +gif_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, > + char *unused __unused) > +{ > + struct gif_softc *sc; > + > + sx_xlock(&gif_ioctl_sx); > + sc = ifp->if_softc; > + if (sc != NULL) > + gif_delete_tunnel(sc); > + sx_xunlock(&gif_ioctl_sx); > +} > +#endif /* VIMAGE */ > > static void > gif_clone_destroy(struct ifnet *ifp) > > Modified: stable/12/sys/net/if_gre.c > ============================================================================== > --- stable/12/sys/net/if_gre.c Wed Jun 10 09:31:37 2020 > (r362008) +++ stable/12/sys/net/if_gre.c Wed Jun 10 13:06:13 > 2020 (r362009) @@ -107,6 +107,9 @@ static void > gre_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone > *, gre_cloner); #define V_gre_cloner VNET(gre_cloner) > > +#ifdef VIMAGE > +static void gre_reassign(struct ifnet *, struct vnet *, char > *); +#endif > static void gre_qflush(struct ifnet *); > static int gre_transmit(struct ifnet *, struct mbuf *); > static int gre_ioctl(struct ifnet *, u_long, caddr_t); > @@ -183,12 +186,30 @@ gre_clone_create(struct if_clone *ifc, int > unit, caddr GRE2IFP(sc)->if_ioctl = gre_ioctl; > GRE2IFP(sc)->if_transmit = gre_transmit; > GRE2IFP(sc)->if_qflush = gre_qflush; > +#ifdef VIMAGE > + GRE2IFP(sc)->if_reassign = gre_reassign; > +#endif > GRE2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; > GRE2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; > if_attach(GRE2IFP(sc)); > bpfattach(GRE2IFP(sc), DLT_NULL, sizeof(u_int32_t)); > return (0); > } > + > +#ifdef VIMAGE > +static void > +gre_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, > + char *unused __unused) > +{ > + struct gre_softc *sc; > + > + sx_xlock(&gre_ioctl_sx); > + sc = ifp->if_softc; > + if (sc != NULL) > + gre_delete_tunnel(sc); > + sx_xunlock(&gre_ioctl_sx); > +} > +#endif /* VIMAGE */ > > static void > gre_clone_destroy(struct ifnet *ifp) > > Modified: stable/12/sys/net/if_ipsec.c > ============================================================================== > --- stable/12/sys/net/if_ipsec.c Wed Jun 10 09:31:37 > 2020 (r362008) +++ stable/12/sys/net/if_ipsec.c Wed Jun > 10 13:06:13 2020 (r362009) @@ -169,6 +169,9 @@ static > int ipsec_set_addresses(struct ifnet *, struct static > int ipsec_set_reqid(struct ipsec_softc *, uint32_t); static > void ipsec_set_running(struct ipsec_softc *); > +#ifdef VIMAGE > +static void ipsec_reassign(struct ifnet *, struct vnet *, > char *); +#endif > static void ipsec_srcaddr(void *, const struct sockaddr *, > int); static int ipsec_ioctl(struct ifnet *, u_long, caddr_t); > static int ipsec_transmit(struct ifnet *, struct mbuf *); > @@ -200,11 +203,29 @@ ipsec_clone_create(struct if_clone *ifc, int > unit, cad ifp->if_transmit = ipsec_transmit; > ifp->if_qflush = ipsec_qflush; > ifp->if_output = ipsec_output; > +#ifdef VIMAGE > + ifp->if_reassign = ipsec_reassign; > +#endif > if_attach(ifp); > bpfattach(ifp, DLT_NULL, sizeof(uint32_t)); > > return (0); > } > + > +#ifdef VIMAGE > +static void > +ipsec_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, > + char *unused __unused) > +{ > + struct ipsec_softc *sc; > + > + sx_xlock(&ipsec_ioctl_sx); > + sc = ifp->if_softc; > + if (sc != NULL) > + ipsec_delete_tunnel(sc); > + sx_xunlock(&ipsec_ioctl_sx); > +} > +#endif /* VIMAGE */ > > static void > ipsec_clone_destroy(struct ifnet *ifp) > > Modified: stable/12/sys/net/if_me.c > ============================================================================== > --- stable/12/sys/net/if_me.c Wed Jun 10 09:31:37 2020 > (r362008) +++ stable/12/sys/net/if_me.c Wed Jun 10 13:06:13 > 2020 (r362009) @@ -113,6 +113,9 @@ static void > me_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone > *, me_cloner); #define V_me_cloner VNET(me_cloner) > > +#ifdef VIMAGE > +static void me_reassign(struct ifnet *, struct vnet *, char > *); +#endif > static void me_qflush(struct ifnet *); > static int me_transmit(struct ifnet *, struct mbuf *); > static int me_ioctl(struct ifnet *, u_long, caddr_t); > @@ -200,12 +203,30 @@ me_clone_create(struct if_clone *ifc, int unit, > caddr_ ME2IFP(sc)->if_ioctl = me_ioctl; > ME2IFP(sc)->if_transmit = me_transmit; > ME2IFP(sc)->if_qflush = me_qflush; > +#ifdef VIMAGE > + ME2IFP(sc)->if_reassign = me_reassign; > +#endif > ME2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE; > ME2IFP(sc)->if_capenable |= IFCAP_LINKSTATE; > if_attach(ME2IFP(sc)); > bpfattach(ME2IFP(sc), DLT_NULL, sizeof(u_int32_t)); > return (0); > } > + > +#ifdef VIMAGE > +static void > +me_reassign(struct ifnet *ifp, struct vnet *new_vnet __unused, > + char *unused __unused) > +{ > + struct me_softc *sc; > + > + sx_xlock(&me_ioctl_sx); > + sc = ifp->if_softc; > + if (sc != NULL) > + me_delete_tunnel(sc); > + sx_xunlock(&me_ioctl_sx); > +} > +#endif /* VIMAGE */ > > static void > me_clone_destroy(struct ifnet *ifp) From owner-svn-src-stable@freebsd.org Fri Jun 12 13:52:11 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C10FE33B201; Fri, 12 Jun 2020 13:52:11 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49k2GM4mHxz4XCS; Fri, 12 Jun 2020 13:52:11 +0000 (UTC) (envelope-from fsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ED5FAB63; Fri, 12 Jun 2020 13:52:11 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CDqBlR092529; Fri, 12 Jun 2020 13:52:11 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CDqBJK092528; Fri, 12 Jun 2020 13:52:11 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202006121352.05CDqBJK092528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Fri, 12 Jun 2020 13:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362096 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 362096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 13:52:11 -0000 Author: fsu Date: Fri Jun 12 13:52:11 2020 New Revision: 362096 URL: https://svnweb.freebsd.org/changeset/base/362096 Log: MFC r361133: Add inode bitmap tail initialization. Make ext2fs compatible with changes introduced in e2fsprogs v1.45.2. Now the tail of inode bitmap is filled with 0xff pattern explicitly during bitmap initialization phase to avoid e2fsck error like: "Padding at end of inode bitmap is not set." Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Fri Jun 12 13:02:44 2020 (r362095) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Fri Jun 12 13:52:11 2020 (r362096) @@ -1286,6 +1286,16 @@ ext2_zero_inode_table(struct inode *ip, int cg) return (0); } +static void +ext2_fix_bitmap_tail(unsigned char *bitmap, int first, int last) +{ + int i; + + for (i = first; i <= last; i++) + bitmap[i] = 0xff; +} + + /* * Determine whether an inode can be allocated. * @@ -1298,7 +1308,7 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr struct m_ext2fs *fs; struct buf *bp; struct ext2mount *ump; - int error, start, len, ifree; + int error, start, len, ifree, ibytes; char *ibp, *loc; ipref--; /* to avoid a lot of (ipref -1) */ @@ -1320,7 +1330,10 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) { - memset(bp->b_data, 0, fs->e2fs_bsize); + ibytes = fs->e2fs_ipg / 8; + memset(bp->b_data, 0, ibytes - 1); + ext2_fix_bitmap_tail(bp->b_data, ibytes, + fs->e2fs_bsize - 1); fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT; } ext2_gd_i_bitmap_csum_set(fs, cg, bp); From owner-svn-src-stable@freebsd.org Fri Jun 12 13:53:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B309533B063; Fri, 12 Jun 2020 13:53:50 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49k2JG4JPMz4Xjg; Fri, 12 Jun 2020 13:53:50 +0000 (UTC) (envelope-from fsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EED7AB6E; Fri, 12 Jun 2020 13:53:50 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CDroEr095136; Fri, 12 Jun 2020 13:53:50 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CDrohh095135; Fri, 12 Jun 2020 13:53:50 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202006121353.05CDrohh095135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Fri, 12 Jun 2020 13:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362097 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 362097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 13:53:50 -0000 Author: fsu Date: Fri Jun 12 13:53:50 2020 New Revision: 362097 URL: https://svnweb.freebsd.org/changeset/base/362097 Log: MFC r361134: Fix incorrect inode link count check in case of rename. The check was incorrect because the directory inode link count have min value 2 after dir_nlink extfs feature introduction. Modified: stable/12/sys/fs/ext2fs/ext2_vnops.c Modified: stable/12/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vnops.c Fri Jun 12 13:52:11 2020 (r362096) +++ stable/12/sys/fs/ext2fs/ext2_vnops.c Fri Jun 12 13:53:50 2020 (r362097) @@ -1016,10 +1016,11 @@ abortit: */ ext2_dec_nlink(xp); if (doingdirectory) { - if (--xp->i_nlink != 0) + if (xp->i_nlink > 2) panic("ext2_rename: linked directory"); error = ext2_truncate(tvp, (off_t)0, IO_SYNC, tcnp->cn_cred, tcnp->cn_thread); + xp->i_nlink = 0; } xp->i_flag |= IN_CHANGE; vput(tvp); From owner-svn-src-stable@freebsd.org Fri Jun 12 13:54:42 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79E2133B478; Fri, 12 Jun 2020 13:54:42 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49k2KG2dJFz4Xvv; Fri, 12 Jun 2020 13:54:42 +0000 (UTC) (envelope-from fsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55846A961; Fri, 12 Jun 2020 13:54:42 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CDsgXk095235; Fri, 12 Jun 2020 13:54:42 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CDsgrn095234; Fri, 12 Jun 2020 13:54:42 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202006121354.05CDsgrn095234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Fri, 12 Jun 2020 13:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362098 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 362098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 13:54:42 -0000 Author: fsu Date: Fri Jun 12 13:54:41 2020 New Revision: 362098 URL: https://svnweb.freebsd.org/changeset/base/362098 Log: MFC r361135: Restrict the max runp and runb return values in case of extents mapping. This restriction already present in case of indirect mapping, do the same in case of extents. PR: 246182 Reported by: Teran McKinney Modified: stable/12/sys/fs/ext2fs/ext2_bmap.c Modified: stable/12/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_bmap.c Fri Jun 12 13:53:50 2020 (r362097) +++ stable/12/sys/fs/ext2fs/ext2_bmap.c Fri Jun 12 13:54:41 2020 (r362098) @@ -94,21 +94,28 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn { struct inode *ip; struct m_ext2fs *fs; + struct mount *mp; + struct ext2mount *ump; struct ext4_extent_header *ehp; struct ext4_extent *ep; struct ext4_extent_path *path = NULL; daddr_t lbn; - int error, depth; + int error, depth, maxrun = 0, bsize; ip = VTOI(vp); fs = ip->i_e2fs; + mp = vp->v_mount; + ump = VFSTOEXT2(mp); lbn = bn; ehp = (struct ext4_extent_header *)ip->i_data; depth = ehp->eh_depth; + bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); *bnp = -1; - if (runp != NULL) + if (runp != NULL) { + maxrun = mp->mnt_iosize_max / bsize - 1; *runp = 0; + } if (runb != NULL) *runb = 0; @@ -119,18 +126,21 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ep = path[depth].ep_ext; if(ep) { if (lbn < ep->e_blk) { - if (runp != NULL) - *runp = ep->e_blk - lbn - 1; + if (runp != NULL) { + *runp = min(maxrun, ep->e_blk - lbn - 1); + } } else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) { *bnp = fsbtodb(fs, lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; + if (runp != NULL) { + *runp = min(maxrun, + ep->e_len - (lbn - ep->e_blk) - 1); + } if (runb != NULL) - *runb = lbn - ep->e_blk; + *runb = min(maxrun, lbn - ep->e_blk); } else { if (runb != NULL) - *runb = ep->e_blk + lbn - ep->e_len; + *runb = min(maxrun, ep->e_blk + lbn - ep->e_len); } } From owner-svn-src-stable@freebsd.org Fri Jun 12 15:37:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1157133D75A; Fri, 12 Jun 2020 15:37:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49k4cM6TYRz4fgf; Fri, 12 Jun 2020 15:37:55 +0000 (UTC) (envelope-from mav@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9756BB3D; Fri, 12 Jun 2020 15:37:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CFbtYl057329; Fri, 12 Jun 2020 15:37:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CFbtbT057328; Fri, 12 Jun 2020 15:37:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202006121537.05CFbtbT057328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 12 Jun 2020 15:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362105 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 362105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 15:37:56 -0000 Author: mav Date: Fri Jun 12 15:37:55 2020 New Revision: 362105 URL: https://svnweb.freebsd.org/changeset/base/362105 Log: MFC r351516: Announce PCI Segment Groups supported to PCI host _OSC. According to ACPI 6.3 specification: The OS sets this bit to 1 if it supports PCI Segment Groups as defined by the _SEG object, and access to the configuration space of devices in PCI Segment Groups as described by this specification. Otherwise, the OS sets this bit to 0. As far as I see we support both of those as PCI domains for quite a while. Modified: stable/12/sys/dev/acpica/acpi_pcib_acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_pcib_acpi.c Fri Jun 12 14:37:50 2020 (r362104) +++ stable/12/sys/dev/acpica/acpi_pcib_acpi.c Fri Jun 12 15:37:55 2020 (r362105) @@ -323,9 +323,9 @@ acpi_pcib_osc(struct acpi_hpcib_softc *sc, uint32_t os if (osc_ctl != 0 && (sc->ap_osc_ctl & osc_ctl) == osc_ctl) return (0); - /* Support Field: Extended PCI Config Space, MSI */ + /* Support Field: Extended PCI Config Space, PCI Segment Groups, MSI */ cap_set[PCI_OSC_SUPPORT] = PCIM_OSC_SUPPORT_EXT_PCI_CONF | - PCIM_OSC_SUPPORT_MSI; + PCIM_OSC_SUPPORT_SEG_GROUP | PCIM_OSC_SUPPORT_MSI; /* Control Field */ cap_set[PCI_OSC_CTL] = sc->ap_osc_ctl | osc_ctl; From owner-svn-src-stable@freebsd.org Fri Jun 12 20:11:26 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 542CC3448E4; Fri, 12 Jun 2020 20:11:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kBgy1bC7z416y; Fri, 12 Jun 2020 20:11:26 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31DE1F1AB; Fri, 12 Jun 2020 20:11:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CKBQ71025136; Fri, 12 Jun 2020 20:11:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CKBPCG025131; Fri, 12 Jun 2020 20:11:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202006122011.05CKBPCG025131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jun 2020 20:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362114 - stable/12/tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/fs/fusefs X-SVN-Commit-Revision: 362114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 20:11:26 -0000 Author: asomers Date: Fri Jun 12 20:11:25 2020 New Revision: 362114 URL: https://svnweb.freebsd.org/changeset/base/362114 Log: MFC r361223: fusefs: fix intermittency in some ENOENT tests When a FUSE operation other than LOOKUP returns ENOENT, the kernel will reclaim that vnode, resuling in a FUSE_FORGET being sent a short while later. Many of the ENOENT tests weren't expecting those FUSE_FORGET operations. They usually passed by luck since FUSE_FORGET is often delayed. This commit adds appropriate expectations. Modified: stable/12/tests/sys/fs/fusefs/getattr.cc stable/12/tests/sys/fs/fusefs/open.cc stable/12/tests/sys/fs/fusefs/opendir.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fs/fusefs/getattr.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/getattr.cc Fri Jun 12 19:56:19 2020 (r362113) +++ stable/12/tests/sys/fs/fusefs/getattr.cc Fri Jun 12 20:11:25 2020 (r362114) @@ -32,6 +32,8 @@ extern "C" { #include + +#include } #include "mockfs.hh" @@ -172,7 +174,10 @@ TEST_F(Getattr, enoent) const char RELPATH[] = "some_file.txt"; struct stat sb; const uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1, 0, 0); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { @@ -181,8 +186,15 @@ TEST_F(Getattr, enoent) }, Eq(true)), _) ).WillOnce(Invoke(ReturnErrno(ENOENT))); + // Since FUSE_GETATTR returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); + EXPECT_NE(0, stat(FULLPATH, &sb)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } TEST_F(Getattr, ok) Modified: stable/12/tests/sys/fs/fusefs/open.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/open.cc Fri Jun 12 19:56:19 2020 (r362113) +++ stable/12/tests/sys/fs/fusefs/open.cc Fri Jun 12 20:11:25 2020 (r362114) @@ -32,7 +32,9 @@ extern "C" { #include + #include +#include } #include "mockfs.hh" @@ -105,7 +107,10 @@ TEST_F(Open, enoent) const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -114,8 +119,15 @@ TEST_F(Open, enoent) }, Eq(true)), _) ).WillOnce(Invoke(ReturnErrno(ENOENT))); + // Since FUSE_OPEN returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); + ASSERT_EQ(-1, open(FULLPATH, O_RDONLY)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } /* Modified: stable/12/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/opendir.cc Fri Jun 12 19:56:19 2020 (r362113) +++ stable/12/tests/sys/fs/fusefs/opendir.cc Fri Jun 12 20:11:25 2020 (r362114) @@ -32,7 +32,9 @@ extern "C" { #include + #include +#include } #include "mockfs.hh" @@ -82,12 +84,21 @@ TEST_F(Opendir, enoent) const char FULLPATH[] = "mountpoint/some_dir"; const char RELPATH[] = "some_dir"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino); expect_opendir(ino, O_RDONLY, ReturnErrno(ENOENT)); + // Since FUSE_OPENDIR returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); ASSERT_EQ(-1, open(FULLPATH, O_DIRECTORY)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } /* From owner-svn-src-stable@freebsd.org Fri Jun 12 20:27:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 763E2344BED; Fri, 12 Jun 2020 20:27:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kC2f2ZcKz425J; Fri, 12 Jun 2020 20:27:38 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A38F689; Fri, 12 Jun 2020 20:27:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CKRcGW036422; Fri, 12 Jun 2020 20:27:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CKRcPs036421; Fri, 12 Jun 2020 20:27:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202006122027.05CKRcPs036421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jun 2020 20:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362115 - stable/12/sys/fs/fuse X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/fs/fuse X-SVN-Commit-Revision: 362115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 20:27:38 -0000 Author: asomers Date: Fri Jun 12 20:27:37 2020 New Revision: 362115 URL: https://svnweb.freebsd.org/changeset/base/362115 Log: MFC r361399: Disable nullfs cacheing on top of fusefs Nullfs cacheing can keep a large number of vnodes active. That results in more active FUSE file handles, causing some FUSE servers to use extra resources. Disable nullfs cacheing for fusefs, just like we already do for NFSv4. PR: 245688 Reported by: MooseFS FreeBSD Team Modified: stable/12/sys/fs/fuse/fuse_vfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_vfsops.c Fri Jun 12 20:11:25 2020 (r362114) +++ stable/12/sys/fs/fuse/fuse_vfsops.c Fri Jun 12 20:27:37 2020 (r362115) @@ -425,6 +425,11 @@ fuse_vfsop_mount(struct mount *mp) */ mp->mnt_flag &= ~MNT_LOCAL; mp->mnt_kern_flag |= MNTK_USES_BCACHE; + /* + * Disable nullfs cacheing because it can consume too many resources in + * the FUSE server. + */ + mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ mp->mnt_stat.f_iosize = maxbcachebuf; From owner-svn-src-stable@freebsd.org Fri Jun 12 20:32:29 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A8D7345634; Fri, 12 Jun 2020 20:32:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kC8F0GFhz42YX; Fri, 12 Jun 2020 20:32:29 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00534F795; Fri, 12 Jun 2020 20:32:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CKWSdq042513; Fri, 12 Jun 2020 20:32:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CKWRCN041667; Fri, 12 Jun 2020 20:32:27 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202006122032.05CKWRCN041667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jun 2020 20:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362116 - in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 362116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 20:32:29 -0000 Author: asomers Date: Fri Jun 12 20:32:26 2020 New Revision: 362116 URL: https://svnweb.freebsd.org/changeset/base/362116 Log: MFC r361401: Fix issues with FUSE_ACCESS when default_permissions is disabled This patch fixes two issues relating to FUSE_ACCESS when the default_permissions mount option is disabled: * VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent of VADMIN, so we must evaluate such things kernel-side, regardless of the default_permissions setting. * The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes: for the access(2) syscall and to check directory permissions for searchability during lookup. FreeBSD sends it much more frequently, due to differences between our VFS and Linux's, for which FUSE was designed. But this patch does eliminate several cases not required by the FUSE protocol: * for any FUSE_*XATTR operation * when creating a new file * when deleting a file * when setting timestamps, such as by utimensat(2). * Additionally, when default_permissions is disabled, this patch removes one FUSE_GETATTR operation when deleting a file. PR: 245689 Reported by: MooseFS FreeBSD Team Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D24777 Modified: stable/12/sys/fs/fuse/fuse_internal.c stable/12/sys/fs/fuse/fuse_vnops.c stable/12/tests/sys/fs/fusefs/access.cc stable/12/tests/sys/fs/fusefs/rename.cc stable/12/tests/sys/fs/fusefs/rmdir.cc stable/12/tests/sys/fs/fusefs/unlink.cc stable/12/tests/sys/fs/fusefs/utils.cc stable/12/tests/sys/fs/fusefs/utils.hh stable/12/tests/sys/fs/fusefs/xattr.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.c Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/sys/fs/fuse/fuse_internal.c Fri Jun 12 20:32:26 2020 (r362116) @@ -158,6 +158,7 @@ fuse_internal_get_cached_vnode(struct mount* mp, ino_t return 0; } +SDT_PROBE_DEFINE0(fusefs, , internal, access_vadmin); /* Synchronously send a FUSE_ACCESS operation */ int fuse_internal_access(struct vnode *vp, @@ -210,10 +211,18 @@ fuse_internal_access(struct vnode *vp, va.va_gid, mode, cred, NULL); } + if (mode & VADMIN) { + /* + * The FUSE protocol doesn't have an equivalent of VADMIN, so + * it's a bug if we ever reach this point with that bit set. + */ + SDT_PROBE0(fusefs, , internal, access_vadmin); + } + if (!fsess_isimpl(mp, FUSE_ACCESS)) return 0; - if ((mode & (VWRITE | VAPPEND | VADMIN)) != 0) + if ((mode & (VWRITE | VAPPEND)) != 0) mask |= W_OK; if ((mode & VREAD) != 0) mask |= R_OK; Modified: stable/12/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_vnops.c Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/sys/fs/fuse/fuse_vnops.c Fri Jun 12 20:32:26 2020 (r362116) @@ -233,6 +233,7 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru { struct mount *mp = vnode_mount(vp); struct fuse_data *data = fuse_get_mpdata(mp); + int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; /* * Kernel-invoked always succeeds. @@ -246,13 +247,16 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru */ switch (ns) { case EXTATTR_NAMESPACE_SYSTEM: - if (data->dataflags & FSESS_DEFAULT_PERMISSIONS) { + if (default_permissions) { return (priv_check_cred(cred, PRIV_VFS_EXTATTR_SYSTEM, 0)); } - /* FALLTHROUGH */ + return (0); case EXTATTR_NAMESPACE_USER: - return (fuse_internal_access(vp, accmode, td, cred)); + if (default_permissions) { + return (fuse_internal_access(vp, accmode, td, cred)); + } + return (0); default: return (EPERM); } @@ -984,6 +988,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) int wantparent = flags & (LOCKPARENT | WANTPARENT); int islastcn = flags & ISLASTCN; struct mount *mp = vnode_mount(dvp); + struct fuse_data *data = fuse_get_mpdata(mp); + int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; int err = 0; int lookup_err = 0; @@ -1107,7 +1113,11 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) if (lookup_err) { /* Entry not found */ if ((nameiop == CREATE || nameiop == RENAME) && islastcn) { - err = fuse_internal_access(dvp, VWRITE, td, cred); + if (default_permissions) + err = fuse_internal_access(dvp, VWRITE, td, + cred); + else + err = 0; if (!err) { /* * Set the SAVENAME flag to hold onto the @@ -1190,7 +1200,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) &fvdat->entry_cache_timeout); if ((nameiop == DELETE || nameiop == RENAME) && - islastcn) + islastcn && default_permissions) { struct vattr dvattr; @@ -1828,7 +1838,11 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) if (vfs_isrdonly(mp)) return EROFS; - err = fuse_internal_access(vp, accmode, td, cred); + if (checkperm) { + err = fuse_internal_access(vp, accmode, td, cred); + } else { + err = 0; + } if (err) return err; else Modified: stable/12/tests/sys/fs/fusefs/access.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/access.cc Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/access.cc Fri Jun 12 20:32:26 2020 (r362116) @@ -31,6 +31,9 @@ */ extern "C" { +#include +#include + #include #include } @@ -42,10 +45,33 @@ using namespace testing; class Access: public FuseTest { public: +virtual void SetUp() { + FuseTest::SetUp(); + // Clear the default FUSE_ACCESS expectation + Mock::VerifyAndClearExpectations(m_mock); +} + void expect_lookup(const char *relpath, uint64_t ino) { FuseTest::expect_lookup(relpath, ino, S_IFREG | 0644, 0, 1); } + +/* + * Expect tha FUSE_ACCESS will never be called for the given inode, with any + * bits in the supplied access_mask set + */ +void expect_noaccess(uint64_t ino, mode_t access_mask) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_ACCESS && + in.header.nodeid == ino && + in.body.access.mask & access_mask); + }, Eq(true)), + _) + ).Times(0); +} + }; class RofsAccess: public Access { @@ -56,6 +82,68 @@ virtual void SetUp() { } }; +/* + * Change the mode of a file. + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, chmod) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t newmode = 0644; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_lookup(RELPATH, ino); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_SETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.mode = S_IFREG | newmode; + }))); + + EXPECT_EQ(0, chmod(FULLPATH, newmode)) << strerror(errno); +} + +/* + * Create a new file + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, create) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + mode_t mode = S_IFREG | 0755; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, R_OK | W_OK); + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke(ReturnErrno(ENOENT))); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_CREATE); + }, Eq(true)), + _) + ).WillOnce(ReturnErrno(EPERM)); + + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(EPERM, errno); +} + /* The error case of FUSE_ACCESS. */ TEST_F(Access, eaccess) { @@ -105,6 +193,33 @@ TEST_F(RofsAccess, erofs) ASSERT_EQ(EROFS, errno); } + +/* + * Lookup an extended attribute + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, Getxattr) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + char data[80]; + int ns = EXTATTR_NAMESPACE_USER; + ssize_t r; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_lookup(RELPATH, ino); + expect_noaccess(ino, 0); + expect_getxattr(ino, "user.foo", ReturnErrno(ENOATTR)); + + r = extattr_get_file(FULLPATH, ns, "foo", data, sizeof(data)); + ASSERT_EQ(-1, r); + ASSERT_EQ(ENOATTR, errno); +} + /* The successful case of FUSE_ACCESS. */ TEST_F(Access, ok) { @@ -118,4 +233,71 @@ TEST_F(Access, ok) expect_access(ino, access_mode, 0); ASSERT_EQ(0, access(FULLPATH, access_mode)) << strerror(errno); +} + +/* + * Unlink a file + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, unlink) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, W_OK | R_OK); + expect_noaccess(ino, 0); + expect_lookup(RELPATH, ino); + expect_unlink(1, RELPATH, EPERM); + + ASSERT_NE(0, unlink(FULLPATH)); + ASSERT_EQ(EPERM, errno); +} + +/* + * Unlink a file whose parent diretory's sticky bit is set + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, unlink_sticky_directory) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, W_OK | R_OK); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) + { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = FUSE_ROOT_ID; + out.body.attr.attr.mode = S_IFDIR | 01777; + out.body.attr.attr.uid = 0; + out.body.attr.attr_valid = UINT64_MAX; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_ACCESS && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(0); + expect_lookup(RELPATH, ino); + expect_unlink(FUSE_ROOT_ID, RELPATH, EPERM); + + ASSERT_EQ(-1, unlink(FULLPATH)); + ASSERT_EQ(EPERM, errno); } Modified: stable/12/tests/sys/fs/fusefs/rename.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/rename.cc Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/rename.cc Fri Jun 12 20:32:26 2020 (r362116) @@ -53,24 +53,6 @@ class Rename: public FuseTest { FuseTest::TearDown(); } - - void expect_getattr(uint64_t ino, mode_t mode) - { - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke( - ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); - } - }; // EINVAL, dst is subdir of src @@ -82,7 +64,6 @@ TEST_F(Rename, einval) const char RELSRC[] = "src"; uint64_t src_ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, src_ino, S_IFDIR | 0755, 0, 2); EXPECT_LOOKUP(src_ino, RELDST).WillOnce(Invoke(ReturnErrno(ENOENT))); @@ -123,7 +104,6 @@ TEST_F(Rename, entry_cache_negative) */ struct timespec entry_valid = {.tv_sec = 0, .tv_nsec = 0}; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); /* LOOKUP returns a negative cache entry for dst */ EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) @@ -158,7 +138,6 @@ TEST_F(Rename, entry_cache_negative_purge) uint64_t ino = 42; struct timespec entry_valid = {.tv_sec = TIME_T_MAX, .tv_nsec = 0}; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); /* LOOKUP returns a negative cache entry for dst */ EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) @@ -196,7 +175,6 @@ TEST_F(Rename, exdev) tmpfd = mkstemp(tmpfile); ASSERT_LE(0, tmpfd) << strerror(errno); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELB, b_ino, S_IFREG | 0644, 0, 2); ASSERT_NE(0, rename(tmpfile, FULLB)); @@ -215,7 +193,6 @@ TEST_F(Rename, ok) uint64_t dst_dir_ino = FUSE_ROOT_ID; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) .WillOnce(Invoke(ReturnErrno(ENOENT))); @@ -251,7 +228,6 @@ TEST_F(Rename, parent) struct stat sb; expect_lookup(RELSRC, ino, S_IFDIR | 0755, 0, 1); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); EXPECT_LOOKUP(FUSE_ROOT_ID, RELDSTDIR) .WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { SET_OUT_HEADER_LEN(out, entry); @@ -303,7 +279,6 @@ TEST_F(Rename, overwrite) uint64_t dst_dir_ino = FUSE_ROOT_ID; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); expect_lookup(RELDST, dst_ino, S_IFREG | 0644, 0, 1); EXPECT_CALL(*m_mock, process( Modified: stable/12/tests/sys/fs/fusefs/rmdir.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/rmdir.cc Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/rmdir.cc Fri Jun 12 20:32:26 2020 (r362116) @@ -42,22 +42,6 @@ using namespace testing; class Rmdir: public FuseTest { public: -void expect_getattr(uint64_t ino, mode_t mode) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); -} - void expect_lookup(const char *relpath, uint64_t ino, int times=1) { EXPECT_LOOKUP(FUSE_ROOT_ID, relpath) @@ -95,25 +79,34 @@ TEST_F(Rmdir, parent_attr_cache) struct stat sb; sem_t sem; uint64_t ino = 42; + Sequence seq; ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in.header.opcode == FUSE_RMDIR && + 0 == strcmp(RELPATH, in.body.rmdir) && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnErrno(0))); + expect_forget(ino, 1, &sem); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { return (in.header.opcode == FUSE_GETATTR && in.header.nodeid == FUSE_ROOT_ID); }, Eq(true)), _) - ).Times(2) + ).InSequence(seq) .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.ino = FUSE_ROOT_ID; out.body.attr.attr.mode = S_IFDIR | 0755; out.body.attr.attr_valid = UINT64_MAX; }))); - expect_lookup(RELPATH, ino); - expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); - expect_forget(ino, 1, &sem); ASSERT_EQ(0, rmdir(FULLPATH)) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); @@ -127,7 +120,6 @@ TEST_F(Rmdir, enotempty) const char RELPATH[] = "some_dir"; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELPATH, ino); expect_rmdir(FUSE_ROOT_ID, RELPATH, ENOTEMPTY); @@ -143,7 +135,6 @@ TEST_F(Rmdir, entry_cache) sem_t sem; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 2); expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); expect_forget(ino, 1, &sem); @@ -163,7 +154,6 @@ TEST_F(Rmdir, ok) ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELPATH, ino); expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); expect_forget(ino, 1, &sem); Modified: stable/12/tests/sys/fs/fusefs/unlink.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/unlink.cc Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/unlink.cc Fri Jun 12 20:32:26 2020 (r362116) @@ -41,22 +41,6 @@ using namespace testing; class Unlink: public FuseTest { public: -void expect_getattr(uint64_t ino, mode_t mode) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); -} - void expect_lookup(const char *relpath, uint64_t ino, int times, int nlink=1) { EXPECT_LOOKUP(FUSE_ROOT_ID, relpath) @@ -89,7 +73,6 @@ TEST_F(Unlink, attr_cache) struct stat sb_old, sb_new; int fd1; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 1, 2); expect_lookup(RELPATH1, ino, 1, 2); expect_open(ino, 0, 1); @@ -117,23 +100,32 @@ TEST_F(Unlink, parent_attr_cache) const char RELPATH[] = "some_file.txt"; struct stat sb; uint64_t ino = 42; + Sequence seq; + /* Use nlink=2 so we don't get a FUSE_FORGET */ + expect_lookup(RELPATH, ino, 1, 2); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in.header.opcode == FUSE_UNLINK && + 0 == strcmp(RELPATH, in.body.unlink) && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnErrno(0))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { return (in.header.opcode == FUSE_GETATTR && in.header.nodeid == FUSE_ROOT_ID); }, Eq(true)), _) - ).Times(2) + ).InSequence(seq) .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.ino = FUSE_ROOT_ID; out.body.attr.attr.mode = S_IFDIR | 0755; out.body.attr.attr_valid = UINT64_MAX; }))); - /* Use nlink=2 so we don't get a FUSE_FORGET */ - expect_lookup(RELPATH, ino, 1, 2); - expect_unlink(1, RELPATH, 0); ASSERT_EQ(0, unlink(FULLPATH)) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); @@ -145,7 +137,6 @@ TEST_F(Unlink, eperm) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 1); expect_unlink(1, RELPATH, EPERM); @@ -162,7 +153,6 @@ TEST_F(Unlink, entry_cache) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 2, 2); expect_unlink(1, RELPATH, 0); @@ -182,7 +172,6 @@ TEST_F(Unlink, multiply_linked) const char RELPATH1[] = "other_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 1, 2); expect_unlink(1, RELPATH0, 0); EXPECT_CALL(*m_mock, process( @@ -213,7 +202,6 @@ TEST_F(Unlink, ok) ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 1); expect_unlink(1, RELPATH, 0); expect_forget(ino, 1, &sem); @@ -233,7 +221,6 @@ TEST_F(Unlink, open_but_deleted) uint64_t ino = 42; int fd; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 2); expect_open(ino, 0, 1); expect_unlink(1, RELPATH0, 0); Modified: stable/12/tests/sys/fs/fusefs/utils.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/utils.cc Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/utils.cc Fri Jun 12 20:32:26 2020 (r362116) @@ -273,6 +273,20 @@ void FuseTest::expect_getattr(uint64_t ino, uint64_t s }))); } +void FuseTest::expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + const char *a = (const char*)in.body.bytes + + sizeof(fuse_getxattr_in); + return (in.header.opcode == FUSE_GETXATTR && + in.header.nodeid == ino && + 0 == strcmp(attr, a)); + }, Eq(true)), + _) + ).WillOnce(Invoke(r)); +} + void FuseTest::expect_lookup(const char *relpath, uint64_t ino, mode_t mode, uint64_t size, int times, uint64_t attr_valid, uid_t uid, gid_t gid) { Modified: stable/12/tests/sys/fs/fusefs/utils.hh ============================================================================== --- stable/12/tests/sys/fs/fusefs/utils.hh Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/utils.hh Fri Jun 12 20:32:26 2020 (r362116) @@ -133,6 +133,12 @@ class FuseTest : public ::testing::Test { void expect_getattr(uint64_t ino, uint64_t size); /* + * Create an expectation that FUSE_GETXATTR will be called once for the + * given inode. + */ + void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r); + + /* * Create an expectation that FUSE_LOOKUP will be called for the given * path exactly times times and cache validity period. It will respond * with inode ino, mode mode, filesize size. Modified: stable/12/tests/sys/fs/fusefs/xattr.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/xattr.cc Fri Jun 12 20:27:37 2020 (r362115) +++ stable/12/tests/sys/fs/fusefs/xattr.cc Fri Jun 12 20:32:26 2020 (r362116) @@ -62,20 +62,6 @@ void* killer(void* target) { class Xattr: public FuseTest { public: -void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - const char *a = (const char*)in.body.bytes + - sizeof(fuse_getxattr_in); - return (in.header.opcode == FUSE_GETXATTR && - in.header.nodeid == ino && - 0 == strcmp(attr, a)); - }, Eq(true)), - _) - ).WillOnce(Invoke(r)); -} - void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r, Sequence *seq = NULL) { From owner-svn-src-stable@freebsd.org Fri Jun 12 20:33:01 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F2273455DB; Fri, 12 Jun 2020 20:33:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kC8s1Vfdz4370; Fri, 12 Jun 2020 20:33:01 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B55FF8AB; Fri, 12 Jun 2020 20:33:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CKX1ST042639; Fri, 12 Jun 2020 20:33:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CKX1Lw042638; Fri, 12 Jun 2020 20:33:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202006122033.05CKX1Lw042638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jun 2020 20:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362117 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 362117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 20:33:01 -0000 Author: asomers Date: Fri Jun 12 20:33:00 2020 New Revision: 362117 URL: https://svnweb.freebsd.org/changeset/base/362117 Log: MFC r361439: [skip ci] ip.4: fix typos Modified: stable/12/share/man/man4/ip.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ip.4 ============================================================================== --- stable/12/share/man/man4/ip.4 Fri Jun 12 20:32:26 2020 (r362116) +++ stable/12/share/man/man4/ip.4 Fri Jun 12 20:33:00 2020 (r362117) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd February 22, 2019 +.Dd May 24, 2020 .Dt IP 4 .Os .Sh NAME @@ -144,7 +144,7 @@ the .Xr recvmsg 2 call will return the destination .Tn IP -address and destination port or a +address and destination port for a .Tn UDP datagram. The @@ -155,13 +155,13 @@ structure points to a buffer that contains a .Vt cmsghdr structure followed by the -.Tn in_sockkaddr -structre. +.Tn sockaddr_in +structure. The .Vt cmsghdr fields have the following values: .Bd -literal -cmsg_len = CMSG_LEN(sizeof(struct in_sockaddr)) +cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in)) cmsg_level = IPPROTO_IP cmsg_type = IP_ORIGDSTADDR .Ed From owner-svn-src-stable@freebsd.org Fri Jun 12 20:39:42 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7621345BC0; Fri, 12 Jun 2020 20:39:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kCJZ5rqXz4344; Fri, 12 Jun 2020 20:39:42 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4024F79A; Fri, 12 Jun 2020 20:39:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CKdg6W043030; Fri, 12 Jun 2020 20:39:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CKdgKX043029; Fri, 12 Jun 2020 20:39:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202006122039.05CKdgKX043029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 12 Jun 2020 20:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362118 - stable/12/sys/geom/eli X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/geom/eli X-SVN-Commit-Revision: 362118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 20:39:43 -0000 Author: asomers Date: Fri Jun 12 20:39:42 2020 New Revision: 362118 URL: https://svnweb.freebsd.org/changeset/base/362118 Log: MFC r361562: geli: fix a livelock during panic During any kind of shutdown, kern_reboot calls geli's pre_sync event hook, which tries to destroy all unused geli devices. But during a panic, geli can't destroy any devices, because the scheduler is stopped, so it can't switch threads. A livelock results, and the system never dumps core. This commit fixes the problem by refusing to destroy any devices during panic, used or otherwise. PR: 246207 Reviewed by: jhb Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D24697 Modified: stable/12/sys/geom/eli/g_eli.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/eli/g_eli.c ============================================================================== --- stable/12/sys/geom/eli/g_eli.c Fri Jun 12 20:33:00 2020 (r362117) +++ stable/12/sys/geom/eli/g_eli.c Fri Jun 12 20:39:42 2020 (r362118) @@ -1320,11 +1320,13 @@ g_eli_shutdown_pre_sync(void *arg, int howto) continue; pp = LIST_FIRST(&gp->provider); KASSERT(pp != NULL, ("No provider? gp=%p (%s)", gp, gp->name)); - if (pp->acr + pp->acw + pp->ace == 0) - error = g_eli_destroy(sc, TRUE); - else { + if (pp->acr != 0 || pp->acw != 0 || pp->ace != 0 || + SCHEDULER_STOPPED()) + { sc->sc_flags |= G_ELI_FLAG_RW_DETACH; gp->access = g_eli_access; + } else { + error = g_eli_destroy(sc, TRUE); } } g_topology_unlock(); From owner-svn-src-stable@freebsd.org Fri Jun 12 23:00:01 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E2C534978D; Fri, 12 Jun 2020 23:00:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kGQT0F2Lz4CT6; Fri, 12 Jun 2020 23:00:01 +0000 (UTC) (envelope-from mm@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F337911129; Fri, 12 Jun 2020 23:00:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CN00Pp029051; Fri, 12 Jun 2020 23:00:00 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CN00EJ029046; Fri, 12 Jun 2020 23:00:00 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202006122300.05CN00EJ029046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 12 Jun 2020 23:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362132 - in stable/12: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.b... X-SVN-Group: stable-12 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/12: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 362132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 23:00:01 -0000 Author: mm Date: Fri Jun 12 22:59:59 2020 New Revision: 362132 URL: https://svnweb.freebsd.org/changeset/base/362132 Log: MFC r361294: Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Relnotes: yes Added: stable/12/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c stable/12/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: stable/12/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c stable/12/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: stable/12/contrib/libarchive/NEWS stable/12/contrib/libarchive/README.md stable/12/contrib/libarchive/libarchive/archive.h stable/12/contrib/libarchive/libarchive/archive_digest.c stable/12/contrib/libarchive/libarchive/archive_entry.c stable/12/contrib/libarchive/libarchive/archive_entry.h stable/12/contrib/libarchive/libarchive/archive_entry_stat.3 stable/12/contrib/libarchive/libarchive/archive_read_add_passphrase.c stable/12/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/12/contrib/libarchive/libarchive/archive_read_support_filter_program.c stable/12/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/12/contrib/libarchive/libarchive/archive_write_add_filter_program.c stable/12/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c stable/12/contrib/libarchive/libarchive/archive_write_set_options.3 stable/12/contrib/libarchive/libarchive/filter_fork.h stable/12/contrib/libarchive/libarchive/filter_fork_posix.c stable/12/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c stable/12/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c stable/12/contrib/libarchive/libarchive/test/test_compat_zstd.c stable/12/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/12/contrib/libarchive/tar/bsdtar.1 stable/12/lib/libarchive/tests/Makefile stable/12/usr.bin/bsdcat/Makefile stable/12/usr.bin/cpio/Makefile stable/12/usr.bin/tar/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/libarchive/NEWS ============================================================================== --- stable/12/contrib/libarchive/NEWS Fri Jun 12 22:27:26 2020 (r362131) +++ stable/12/contrib/libarchive/NEWS Fri Jun 12 22:59:59 2020 (r362132) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: stable/12/contrib/libarchive/README.md ============================================================================== --- stable/12/contrib/libarchive/README.md Fri Jun 12 22:27:26 2020 (r362131) +++ stable/12/contrib/libarchive/README.md Fri Jun 12 22:59:59 2020 (r362132) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: stable/12/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive.h Fri Jun 12 22:27:26 2020 (r362131) +++ stable/12/contrib/libarchive/libarchive/archive.h Fri Jun 12 22:59:59 2020 (r362132) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3004002 +#define ARCHIVE_VERSION_NUMBER 3004003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.4.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/12/contrib/libarchive/libarchive/archive_digest.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_digest.c Fri Jun 12 22:27:26 2020 (r362131) +++ stable/12/contrib/libarchive/libarchive/archive_digest.c Fri Jun 12 22:59:59 2020 (r362132) @@ -109,14 +109,14 @@ win_crypto_Final(unsigned char *buf, size_t bufsize, D #if defined(ARCHIVE_CRYPTO_MD5_LIBC) static int -__archive_libc_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -124,7 +124,7 @@ __archive_libc_md5update(archive_md5_ctx *ctx, const v } static int -__archive_libc_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -133,14 +133,14 @@ __archive_libc_md5final(archive_md5_ctx *ctx, void *md #elif defined(ARCHIVE_CRYPTO_MD5_LIBMD) static int -__archive_libmd_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -148,7 +148,7 @@ __archive_libmd_md5update(archive_md5_ctx *ctx, const } static int -__archive_libmd_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -157,14 +157,14 @@ __archive_libmd_md5final(archive_md5_ctx *ctx, void *m #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) static int -__archive_libsystem_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { CC_MD5_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { CC_MD5_Update(ctx, indata, insize); @@ -172,7 +172,7 @@ __archive_libsystem_md5update(archive_md5_ctx *ctx, co } static int -__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { CC_MD5_Final(md, ctx); return (ARCHIVE_OK); @@ -181,7 +181,7 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int -__archive_mbedtls_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); if (mbedtls_md5_starts_ret(ctx) == 0) @@ -191,7 +191,7 @@ __archive_mbedtls_md5init(archive_md5_ctx *ctx) } static int -__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) @@ -201,7 +201,7 @@ __archive_mbedtls_md5update(archive_md5_ctx *ctx, cons } static int -__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { if (mbedtls_md5_finish_ret(ctx, md) == 0) { mbedtls_md5_free(ctx); @@ -215,14 +215,14 @@ __archive_mbedtls_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int -__archive_nettle_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { md5_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { md5_update(ctx, insize, indata); @@ -230,7 +230,7 @@ __archive_nettle_md5update(archive_md5_ctx *ctx, const } static int -__archive_nettle_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { md5_digest(ctx, MD5_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -239,7 +239,7 @@ __archive_nettle_md5final(archive_md5_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) static int -__archive_openssl_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -248,7 +248,7 @@ __archive_openssl_md5init(archive_md5_ctx *ctx) } static int -__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -256,7 +256,7 @@ __archive_openssl_md5update(archive_md5_ctx *ctx, cons } static int -__archive_openssl_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -273,20 +273,20 @@ __archive_openssl_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_WIN) static int -__archive_windowsapi_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { return (win_crypto_init(ctx, CALG_MD5)); } static int -__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { return (win_crypto_Final(md, 16, ctx)); } @@ -294,14 +294,14 @@ __archive_windowsapi_md5final(archive_md5_ctx *ctx, vo #else static int -__archive_stub_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -311,7 +311,7 @@ __archive_stub_md5update(archive_md5_ctx *ctx, const v } static int -__archive_stub_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -324,14 +324,14 @@ __archive_stub_md5final(archive_md5_ctx *ctx, void *md #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) static int -__archive_libc_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RMD160Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RMD160Update(ctx, indata, insize); @@ -339,7 +339,7 @@ __archive_libc_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RMD160Final(md, ctx); return (ARCHIVE_OK); @@ -348,14 +348,14 @@ __archive_libc_ripemd160final(archive_rmd160_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) static int -__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RIPEMD160_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RIPEMD160_Update(ctx, indata, insize); @@ -363,7 +363,7 @@ __archive_libmd_ripemd160update(archive_rmd160_ctx *ct } static int -__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RIPEMD160_Final(md, ctx); return (ARCHIVE_OK); @@ -372,7 +372,7 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx #elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) static int -__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); if (mbedtls_ripemd160_starts_ret(ctx) == 0) @@ -382,7 +382,7 @@ __archive_mbedtls_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) @@ -392,7 +392,7 @@ __archive_mbedtls_ripemd160update(archive_rmd160_ctx * } static int -__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { mbedtls_ripemd160_free(ctx); @@ -406,14 +406,14 @@ __archive_mbedtls_ripemd160final(archive_rmd160_ctx *c #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int -__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { ripemd160_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { ripemd160_update(ctx, insize, indata); @@ -421,7 +421,7 @@ __archive_nettle_ripemd160update(archive_rmd160_ctx *c } static int -__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -430,7 +430,7 @@ __archive_nettle_ripemd160final(archive_rmd160_ctx *ct #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) static int -__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -439,7 +439,7 @@ __archive_openssl_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -447,7 +447,7 @@ __archive_openssl_ripemd160update(archive_rmd160_ctx * } static int -__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -460,14 +460,14 @@ __archive_openssl_ripemd160final(archive_rmd160_ctx *c #else static int -__archive_stub_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -477,7 +477,7 @@ __archive_stub_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -490,14 +490,14 @@ __archive_stub_ripemd160final(archive_rmd160_ctx *ctx, #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) static int -__archive_libc_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1Update(ctx, indata, insize); @@ -505,7 +505,7 @@ __archive_libc_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1Final(md, ctx); return (ARCHIVE_OK); @@ -514,14 +514,14 @@ __archive_libc_sha1final(archive_sha1_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD) static int -__archive_libmd_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1_Update(ctx, indata, insize); @@ -529,7 +529,7 @@ __archive_libmd_sha1update(archive_sha1_ctx *ctx, cons } static int -__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -538,14 +538,14 @@ __archive_libmd_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) static int -__archive_libsystem_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { CC_SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { CC_SHA1_Update(ctx, indata, insize); @@ -553,7 +553,7 @@ __archive_libsystem_sha1update(archive_sha1_ctx *ctx, } static int -__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { CC_SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -562,7 +562,7 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int -__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); if (mbedtls_sha1_starts_ret(ctx) == 0) @@ -572,7 +572,7 @@ __archive_mbedtls_sha1init(archive_sha1_ctx *ctx) } static int -__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) @@ -582,7 +582,7 @@ __archive_mbedtls_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { if (mbedtls_sha1_finish_ret(ctx, md) == 0) { mbedtls_sha1_free(ctx); @@ -596,14 +596,14 @@ __archive_mbedtls_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int -__archive_nettle_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { sha1_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { sha1_update(ctx, insize, indata); @@ -611,7 +611,7 @@ __archive_nettle_sha1update(archive_sha1_ctx *ctx, con } static int -__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { sha1_digest(ctx, SHA1_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -620,7 +620,7 @@ __archive_nettle_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) static int -__archive_openssl_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -629,7 +629,7 @@ __archive_openssl_sha1init(archive_sha1_ctx *ctx) } static int -__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -637,7 +637,7 @@ __archive_openssl_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -654,20 +654,20 @@ __archive_openssl_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) static int -__archive_windowsapi_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA1)); } static int -__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { return (win_crypto_Final(md, 20, ctx)); } @@ -675,14 +675,14 @@ __archive_windowsapi_sha1final(archive_sha1_ctx *ctx, #else static int -__archive_stub_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -692,7 +692,7 @@ __archive_stub_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -705,14 +705,14 @@ __archive_stub_sha1final(archive_sha1_ctx *ctx, void * #if defined(ARCHIVE_CRYPTO_SHA256_LIBC) static int -__archive_libc_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -720,7 +720,7 @@ __archive_libc_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -729,14 +729,14 @@ __archive_libc_sha256final(archive_sha256_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2) static int -__archive_libc2_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -744,7 +744,7 @@ __archive_libc2_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -753,14 +753,14 @@ __archive_libc2_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3) static int -__archive_libc3_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -768,7 +768,7 @@ __archive_libc3_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -777,14 +777,14 @@ __archive_libc3_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD) static int -__archive_libmd_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -792,7 +792,7 @@ __archive_libmd_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -801,14 +801,14 @@ __archive_libmd_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) static int -__archive_libsystem_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { CC_SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { CC_SHA256_Update(ctx, indata, insize); @@ -816,7 +816,7 @@ __archive_libsystem_sha256update(archive_sha256_ctx *c } static int -__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { CC_SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -825,7 +825,7 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) static int -__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { mbedtls_sha256_init(ctx); if (mbedtls_sha256_starts_ret(ctx, 0) == 0) @@ -835,7 +835,7 @@ __archive_mbedtls_sha256init(archive_sha256_ctx *ctx) } static int -__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) @@ -845,7 +845,7 @@ __archive_mbedtls_sha256update(archive_sha256_ctx *ctx } static int -__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (mbedtls_sha256_finish_ret(ctx, md) == 0) { mbedtls_sha256_free(ctx); @@ -859,14 +859,14 @@ __archive_mbedtls_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int -__archive_nettle_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { sha256_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { sha256_update(ctx, insize, indata); @@ -874,7 +874,7 @@ __archive_nettle_sha256update(archive_sha256_ctx *ctx, } static int -__archive_nettle_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { sha256_digest(ctx, SHA256_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -883,7 +883,7 @@ __archive_nettle_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) static int -__archive_openssl_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -892,7 +892,7 @@ __archive_openssl_sha256init(archive_sha256_ctx *ctx) } static int -__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -900,7 +900,7 @@ __archive_openssl_sha256update(archive_sha256_ctx *ctx } static int -__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -913,20 +913,20 @@ __archive_openssl_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_WIN) static int -__archive_windowsapi_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA_256)); } static int -__archive_windowsapi_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { return (win_crypto_Final(md, 32, ctx)); } @@ -934,14 +934,14 @@ __archive_windowsapi_sha256final(archive_sha256_ctx *c #else static int -__archive_stub_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -951,7 +951,7 @@ __archive_stub_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_stub_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -964,14 +964,14 @@ __archive_stub_sha256final(archive_sha256_ctx *ctx, vo #if defined(ARCHIVE_CRYPTO_SHA384_LIBC) static int -__archive_libc_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384_Update(ctx, indata, insize); @@ -979,7 +979,7 @@ __archive_libc_sha384update(archive_sha384_ctx *ctx, c } static int -__archive_libc_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -988,14 +988,14 @@ __archive_libc_sha384final(archive_sha384_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2) static int -__archive_libc2_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1003,7 +1003,7 @@ __archive_libc2_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc2_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1012,14 +1012,14 @@ __archive_libc2_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3) static int -__archive_libc3_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1027,7 +1027,7 @@ __archive_libc3_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc3_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1036,14 +1036,14 @@ __archive_libc3_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) static int -__archive_libsystem_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { CC_SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { CC_SHA384_Update(ctx, indata, insize); @@ -1051,7 +1051,7 @@ __archive_libsystem_sha384update(archive_sha384_ctx *c } static int -__archive_libsystem_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { CC_SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -1060,7 +1060,7 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) static int -__archive_mbedtls_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { mbedtls_sha512_init(ctx); if (mbedtls_sha512_starts_ret(ctx, 1) == 0) @@ -1070,7 +1070,7 @@ __archive_mbedtls_sha384init(archive_sha384_ctx *ctx) } static int -__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Jun 12 23:01:30 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEDA13497A0; Fri, 12 Jun 2020 23:01:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kGSB50b4z4D5S; Fri, 12 Jun 2020 23:01:30 +0000 (UTC) (envelope-from mm@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A67951129E; Fri, 12 Jun 2020 23:01:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CN1UaL034044; Fri, 12 Jun 2020 23:01:30 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CN1TAa034040; Fri, 12 Jun 2020 23:01:29 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202006122301.05CN1TAa034040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 12 Jun 2020 23:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362133 - in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.b... X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 362133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 23:01:30 -0000 Author: mm Date: Fri Jun 12 23:01:29 2020 New Revision: 362133 URL: https://svnweb.freebsd.org/changeset/base/362133 Log: MFC r361294: Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Relnotes: yes Added: stable/11/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c stable/11/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: stable/11/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c stable/11/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/README.md stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_digest.c stable/11/contrib/libarchive/libarchive/archive_entry.c stable/11/contrib/libarchive/libarchive/archive_entry.h stable/11/contrib/libarchive/libarchive/archive_entry_stat.3 stable/11/contrib/libarchive/libarchive/archive_read_add_passphrase.c stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_read_support_filter_program.c stable/11/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_program.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c stable/11/contrib/libarchive/libarchive/archive_write_set_options.3 stable/11/contrib/libarchive/libarchive/filter_fork.h stable/11/contrib/libarchive/libarchive/filter_fork_posix.c stable/11/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c stable/11/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c stable/11/contrib/libarchive/libarchive/test/test_compat_zstd.c stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/11/contrib/libarchive/tar/bsdtar.1 stable/11/lib/libarchive/tests/Makefile stable/11/usr.bin/bsdcat/Makefile stable/11/usr.bin/cpio/Makefile stable/11/usr.bin/tar/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Fri Jun 12 22:59:59 2020 (r362132) +++ stable/11/contrib/libarchive/NEWS Fri Jun 12 23:01:29 2020 (r362133) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: stable/11/contrib/libarchive/README.md ============================================================================== --- stable/11/contrib/libarchive/README.md Fri Jun 12 22:59:59 2020 (r362132) +++ stable/11/contrib/libarchive/README.md Fri Jun 12 23:01:29 2020 (r362133) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Fri Jun 12 22:59:59 2020 (r362132) +++ stable/11/contrib/libarchive/libarchive/archive.h Fri Jun 12 23:01:29 2020 (r362133) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3004002 +#define ARCHIVE_VERSION_NUMBER 3004003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.4.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/11/contrib/libarchive/libarchive/archive_digest.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_digest.c Fri Jun 12 22:59:59 2020 (r362132) +++ stable/11/contrib/libarchive/libarchive/archive_digest.c Fri Jun 12 23:01:29 2020 (r362133) @@ -109,14 +109,14 @@ win_crypto_Final(unsigned char *buf, size_t bufsize, D #if defined(ARCHIVE_CRYPTO_MD5_LIBC) static int -__archive_libc_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -124,7 +124,7 @@ __archive_libc_md5update(archive_md5_ctx *ctx, const v } static int -__archive_libc_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -133,14 +133,14 @@ __archive_libc_md5final(archive_md5_ctx *ctx, void *md #elif defined(ARCHIVE_CRYPTO_MD5_LIBMD) static int -__archive_libmd_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -148,7 +148,7 @@ __archive_libmd_md5update(archive_md5_ctx *ctx, const } static int -__archive_libmd_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -157,14 +157,14 @@ __archive_libmd_md5final(archive_md5_ctx *ctx, void *m #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) static int -__archive_libsystem_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { CC_MD5_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { CC_MD5_Update(ctx, indata, insize); @@ -172,7 +172,7 @@ __archive_libsystem_md5update(archive_md5_ctx *ctx, co } static int -__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { CC_MD5_Final(md, ctx); return (ARCHIVE_OK); @@ -181,7 +181,7 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int -__archive_mbedtls_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); if (mbedtls_md5_starts_ret(ctx) == 0) @@ -191,7 +191,7 @@ __archive_mbedtls_md5init(archive_md5_ctx *ctx) } static int -__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) @@ -201,7 +201,7 @@ __archive_mbedtls_md5update(archive_md5_ctx *ctx, cons } static int -__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { if (mbedtls_md5_finish_ret(ctx, md) == 0) { mbedtls_md5_free(ctx); @@ -215,14 +215,14 @@ __archive_mbedtls_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int -__archive_nettle_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { md5_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { md5_update(ctx, insize, indata); @@ -230,7 +230,7 @@ __archive_nettle_md5update(archive_md5_ctx *ctx, const } static int -__archive_nettle_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { md5_digest(ctx, MD5_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -239,7 +239,7 @@ __archive_nettle_md5final(archive_md5_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) static int -__archive_openssl_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -248,7 +248,7 @@ __archive_openssl_md5init(archive_md5_ctx *ctx) } static int -__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -256,7 +256,7 @@ __archive_openssl_md5update(archive_md5_ctx *ctx, cons } static int -__archive_openssl_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -273,20 +273,20 @@ __archive_openssl_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_WIN) static int -__archive_windowsapi_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { return (win_crypto_init(ctx, CALG_MD5)); } static int -__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { return (win_crypto_Final(md, 16, ctx)); } @@ -294,14 +294,14 @@ __archive_windowsapi_md5final(archive_md5_ctx *ctx, vo #else static int -__archive_stub_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -311,7 +311,7 @@ __archive_stub_md5update(archive_md5_ctx *ctx, const v } static int -__archive_stub_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -324,14 +324,14 @@ __archive_stub_md5final(archive_md5_ctx *ctx, void *md #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) static int -__archive_libc_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RMD160Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RMD160Update(ctx, indata, insize); @@ -339,7 +339,7 @@ __archive_libc_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RMD160Final(md, ctx); return (ARCHIVE_OK); @@ -348,14 +348,14 @@ __archive_libc_ripemd160final(archive_rmd160_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) static int -__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RIPEMD160_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RIPEMD160_Update(ctx, indata, insize); @@ -363,7 +363,7 @@ __archive_libmd_ripemd160update(archive_rmd160_ctx *ct } static int -__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RIPEMD160_Final(md, ctx); return (ARCHIVE_OK); @@ -372,7 +372,7 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx #elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) static int -__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); if (mbedtls_ripemd160_starts_ret(ctx) == 0) @@ -382,7 +382,7 @@ __archive_mbedtls_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) @@ -392,7 +392,7 @@ __archive_mbedtls_ripemd160update(archive_rmd160_ctx * } static int -__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { mbedtls_ripemd160_free(ctx); @@ -406,14 +406,14 @@ __archive_mbedtls_ripemd160final(archive_rmd160_ctx *c #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int -__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { ripemd160_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { ripemd160_update(ctx, insize, indata); @@ -421,7 +421,7 @@ __archive_nettle_ripemd160update(archive_rmd160_ctx *c } static int -__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -430,7 +430,7 @@ __archive_nettle_ripemd160final(archive_rmd160_ctx *ct #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) static int -__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -439,7 +439,7 @@ __archive_openssl_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -447,7 +447,7 @@ __archive_openssl_ripemd160update(archive_rmd160_ctx * } static int -__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -460,14 +460,14 @@ __archive_openssl_ripemd160final(archive_rmd160_ctx *c #else static int -__archive_stub_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -477,7 +477,7 @@ __archive_stub_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -490,14 +490,14 @@ __archive_stub_ripemd160final(archive_rmd160_ctx *ctx, #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) static int -__archive_libc_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1Update(ctx, indata, insize); @@ -505,7 +505,7 @@ __archive_libc_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1Final(md, ctx); return (ARCHIVE_OK); @@ -514,14 +514,14 @@ __archive_libc_sha1final(archive_sha1_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD) static int -__archive_libmd_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1_Update(ctx, indata, insize); @@ -529,7 +529,7 @@ __archive_libmd_sha1update(archive_sha1_ctx *ctx, cons } static int -__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -538,14 +538,14 @@ __archive_libmd_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) static int -__archive_libsystem_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { CC_SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { CC_SHA1_Update(ctx, indata, insize); @@ -553,7 +553,7 @@ __archive_libsystem_sha1update(archive_sha1_ctx *ctx, } static int -__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { CC_SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -562,7 +562,7 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int -__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); if (mbedtls_sha1_starts_ret(ctx) == 0) @@ -572,7 +572,7 @@ __archive_mbedtls_sha1init(archive_sha1_ctx *ctx) } static int -__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) @@ -582,7 +582,7 @@ __archive_mbedtls_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { if (mbedtls_sha1_finish_ret(ctx, md) == 0) { mbedtls_sha1_free(ctx); @@ -596,14 +596,14 @@ __archive_mbedtls_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int -__archive_nettle_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { sha1_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { sha1_update(ctx, insize, indata); @@ -611,7 +611,7 @@ __archive_nettle_sha1update(archive_sha1_ctx *ctx, con } static int -__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { sha1_digest(ctx, SHA1_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -620,7 +620,7 @@ __archive_nettle_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) static int -__archive_openssl_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -629,7 +629,7 @@ __archive_openssl_sha1init(archive_sha1_ctx *ctx) } static int -__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -637,7 +637,7 @@ __archive_openssl_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -654,20 +654,20 @@ __archive_openssl_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) static int -__archive_windowsapi_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA1)); } static int -__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { return (win_crypto_Final(md, 20, ctx)); } @@ -675,14 +675,14 @@ __archive_windowsapi_sha1final(archive_sha1_ctx *ctx, #else static int -__archive_stub_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -692,7 +692,7 @@ __archive_stub_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -705,14 +705,14 @@ __archive_stub_sha1final(archive_sha1_ctx *ctx, void * #if defined(ARCHIVE_CRYPTO_SHA256_LIBC) static int -__archive_libc_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -720,7 +720,7 @@ __archive_libc_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -729,14 +729,14 @@ __archive_libc_sha256final(archive_sha256_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2) static int -__archive_libc2_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -744,7 +744,7 @@ __archive_libc2_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -753,14 +753,14 @@ __archive_libc2_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3) static int -__archive_libc3_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -768,7 +768,7 @@ __archive_libc3_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -777,14 +777,14 @@ __archive_libc3_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD) static int -__archive_libmd_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -792,7 +792,7 @@ __archive_libmd_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -801,14 +801,14 @@ __archive_libmd_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) static int -__archive_libsystem_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { CC_SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { CC_SHA256_Update(ctx, indata, insize); @@ -816,7 +816,7 @@ __archive_libsystem_sha256update(archive_sha256_ctx *c } static int -__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { CC_SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -825,7 +825,7 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) static int -__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { mbedtls_sha256_init(ctx); if (mbedtls_sha256_starts_ret(ctx, 0) == 0) @@ -835,7 +835,7 @@ __archive_mbedtls_sha256init(archive_sha256_ctx *ctx) } static int -__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) @@ -845,7 +845,7 @@ __archive_mbedtls_sha256update(archive_sha256_ctx *ctx } static int -__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (mbedtls_sha256_finish_ret(ctx, md) == 0) { mbedtls_sha256_free(ctx); @@ -859,14 +859,14 @@ __archive_mbedtls_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int -__archive_nettle_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { sha256_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { sha256_update(ctx, insize, indata); @@ -874,7 +874,7 @@ __archive_nettle_sha256update(archive_sha256_ctx *ctx, } static int -__archive_nettle_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { sha256_digest(ctx, SHA256_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -883,7 +883,7 @@ __archive_nettle_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) static int -__archive_openssl_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -892,7 +892,7 @@ __archive_openssl_sha256init(archive_sha256_ctx *ctx) } static int -__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -900,7 +900,7 @@ __archive_openssl_sha256update(archive_sha256_ctx *ctx } static int -__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -913,20 +913,20 @@ __archive_openssl_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_WIN) static int -__archive_windowsapi_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA_256)); } static int -__archive_windowsapi_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { return (win_crypto_Final(md, 32, ctx)); } @@ -934,14 +934,14 @@ __archive_windowsapi_sha256final(archive_sha256_ctx *c #else static int -__archive_stub_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -951,7 +951,7 @@ __archive_stub_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_stub_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -964,14 +964,14 @@ __archive_stub_sha256final(archive_sha256_ctx *ctx, vo #if defined(ARCHIVE_CRYPTO_SHA384_LIBC) static int -__archive_libc_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384_Update(ctx, indata, insize); @@ -979,7 +979,7 @@ __archive_libc_sha384update(archive_sha384_ctx *ctx, c } static int -__archive_libc_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -988,14 +988,14 @@ __archive_libc_sha384final(archive_sha384_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2) static int -__archive_libc2_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1003,7 +1003,7 @@ __archive_libc2_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc2_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1012,14 +1012,14 @@ __archive_libc2_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3) static int -__archive_libc3_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1027,7 +1027,7 @@ __archive_libc3_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc3_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1036,14 +1036,14 @@ __archive_libc3_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) static int -__archive_libsystem_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { CC_SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { CC_SHA384_Update(ctx, indata, insize); @@ -1051,7 +1051,7 @@ __archive_libsystem_sha384update(archive_sha384_ctx *c } static int -__archive_libsystem_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { CC_SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -1060,7 +1060,7 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) static int -__archive_mbedtls_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { mbedtls_sha512_init(ctx); if (mbedtls_sha512_starts_ret(ctx, 1) == 0) @@ -1070,7 +1070,7 @@ __archive_mbedtls_sha384init(archive_sha384_ctx *ctx) } static int -__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Jun 12 23:02:35 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D552349735; Fri, 12 Jun 2020 23:02:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49kGTR26Zcz4D20; Fri, 12 Jun 2020 23:02:35 +0000 (UTC) (envelope-from mm@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29CA411248; Fri, 12 Jun 2020 23:02:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05CN2ZQx034814; Fri, 12 Jun 2020 23:02:35 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05CN2Y2c034809; Fri, 12 Jun 2020 23:02:34 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202006122302.05CN2Y2c034809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 12 Jun 2020 23:02: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: r362134 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.b... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 362134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 23:02:35 -0000 Author: mm Date: Fri Jun 12 23:02:34 2020 New Revision: 362134 URL: https://svnweb.freebsd.org/changeset/base/362134 Log: MFC r361294: Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Added: stable/10/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c stable/10/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu - copied unchanged from r361294, head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: stable/10/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c stable/10/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/README.md stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_digest.c stable/10/contrib/libarchive/libarchive/archive_entry.c stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_entry_stat.3 stable/10/contrib/libarchive/libarchive/archive_read_add_passphrase.c stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_program.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_program.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c stable/10/contrib/libarchive/libarchive/archive_write_set_options.3 stable/10/contrib/libarchive/libarchive/filter_fork.h stable/10/contrib/libarchive/libarchive/filter_fork_posix.c stable/10/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c stable/10/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c stable/10/contrib/libarchive/libarchive/test/test_compat_zstd.c stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/10/contrib/libarchive/tar/bsdtar.1 stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/tar/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Fri Jun 12 23:01:29 2020 (r362133) +++ stable/10/contrib/libarchive/NEWS Fri Jun 12 23:02:34 2020 (r362134) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: stable/10/contrib/libarchive/README.md ============================================================================== --- stable/10/contrib/libarchive/README.md Fri Jun 12 23:01:29 2020 (r362133) +++ stable/10/contrib/libarchive/README.md Fri Jun 12 23:02:34 2020 (r362134) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Fri Jun 12 23:01:29 2020 (r362133) +++ stable/10/contrib/libarchive/libarchive/archive.h Fri Jun 12 23:02:34 2020 (r362134) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3004002 +#define ARCHIVE_VERSION_NUMBER 3004003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.4.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/10/contrib/libarchive/libarchive/archive_digest.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_digest.c Fri Jun 12 23:01:29 2020 (r362133) +++ stable/10/contrib/libarchive/libarchive/archive_digest.c Fri Jun 12 23:02:34 2020 (r362134) @@ -109,14 +109,14 @@ win_crypto_Final(unsigned char *buf, size_t bufsize, D #if defined(ARCHIVE_CRYPTO_MD5_LIBC) static int -__archive_libc_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -124,7 +124,7 @@ __archive_libc_md5update(archive_md5_ctx *ctx, const v } static int -__archive_libc_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -133,14 +133,14 @@ __archive_libc_md5final(archive_md5_ctx *ctx, void *md #elif defined(ARCHIVE_CRYPTO_MD5_LIBMD) static int -__archive_libmd_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -148,7 +148,7 @@ __archive_libmd_md5update(archive_md5_ctx *ctx, const } static int -__archive_libmd_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -157,14 +157,14 @@ __archive_libmd_md5final(archive_md5_ctx *ctx, void *m #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) static int -__archive_libsystem_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { CC_MD5_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { CC_MD5_Update(ctx, indata, insize); @@ -172,7 +172,7 @@ __archive_libsystem_md5update(archive_md5_ctx *ctx, co } static int -__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { CC_MD5_Final(md, ctx); return (ARCHIVE_OK); @@ -181,7 +181,7 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int -__archive_mbedtls_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); if (mbedtls_md5_starts_ret(ctx) == 0) @@ -191,7 +191,7 @@ __archive_mbedtls_md5init(archive_md5_ctx *ctx) } static int -__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) @@ -201,7 +201,7 @@ __archive_mbedtls_md5update(archive_md5_ctx *ctx, cons } static int -__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { if (mbedtls_md5_finish_ret(ctx, md) == 0) { mbedtls_md5_free(ctx); @@ -215,14 +215,14 @@ __archive_mbedtls_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int -__archive_nettle_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { md5_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { md5_update(ctx, insize, indata); @@ -230,7 +230,7 @@ __archive_nettle_md5update(archive_md5_ctx *ctx, const } static int -__archive_nettle_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { md5_digest(ctx, MD5_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -239,7 +239,7 @@ __archive_nettle_md5final(archive_md5_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) static int -__archive_openssl_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -248,7 +248,7 @@ __archive_openssl_md5init(archive_md5_ctx *ctx) } static int -__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -256,7 +256,7 @@ __archive_openssl_md5update(archive_md5_ctx *ctx, cons } static int -__archive_openssl_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -273,20 +273,20 @@ __archive_openssl_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_WIN) static int -__archive_windowsapi_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { return (win_crypto_init(ctx, CALG_MD5)); } static int -__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { return (win_crypto_Final(md, 16, ctx)); } @@ -294,14 +294,14 @@ __archive_windowsapi_md5final(archive_md5_ctx *ctx, vo #else static int -__archive_stub_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -311,7 +311,7 @@ __archive_stub_md5update(archive_md5_ctx *ctx, const v } static int -__archive_stub_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -324,14 +324,14 @@ __archive_stub_md5final(archive_md5_ctx *ctx, void *md #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) static int -__archive_libc_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RMD160Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RMD160Update(ctx, indata, insize); @@ -339,7 +339,7 @@ __archive_libc_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RMD160Final(md, ctx); return (ARCHIVE_OK); @@ -348,14 +348,14 @@ __archive_libc_ripemd160final(archive_rmd160_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) static int -__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RIPEMD160_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RIPEMD160_Update(ctx, indata, insize); @@ -363,7 +363,7 @@ __archive_libmd_ripemd160update(archive_rmd160_ctx *ct } static int -__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RIPEMD160_Final(md, ctx); return (ARCHIVE_OK); @@ -372,7 +372,7 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx #elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) static int -__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); if (mbedtls_ripemd160_starts_ret(ctx) == 0) @@ -382,7 +382,7 @@ __archive_mbedtls_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) @@ -392,7 +392,7 @@ __archive_mbedtls_ripemd160update(archive_rmd160_ctx * } static int -__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { mbedtls_ripemd160_free(ctx); @@ -406,14 +406,14 @@ __archive_mbedtls_ripemd160final(archive_rmd160_ctx *c #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int -__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { ripemd160_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { ripemd160_update(ctx, insize, indata); @@ -421,7 +421,7 @@ __archive_nettle_ripemd160update(archive_rmd160_ctx *c } static int -__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -430,7 +430,7 @@ __archive_nettle_ripemd160final(archive_rmd160_ctx *ct #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) static int -__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -439,7 +439,7 @@ __archive_openssl_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -447,7 +447,7 @@ __archive_openssl_ripemd160update(archive_rmd160_ctx * } static int -__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -460,14 +460,14 @@ __archive_openssl_ripemd160final(archive_rmd160_ctx *c #else static int -__archive_stub_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -477,7 +477,7 @@ __archive_stub_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -490,14 +490,14 @@ __archive_stub_ripemd160final(archive_rmd160_ctx *ctx, #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) static int -__archive_libc_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1Update(ctx, indata, insize); @@ -505,7 +505,7 @@ __archive_libc_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1Final(md, ctx); return (ARCHIVE_OK); @@ -514,14 +514,14 @@ __archive_libc_sha1final(archive_sha1_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD) static int -__archive_libmd_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1_Update(ctx, indata, insize); @@ -529,7 +529,7 @@ __archive_libmd_sha1update(archive_sha1_ctx *ctx, cons } static int -__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -538,14 +538,14 @@ __archive_libmd_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) static int -__archive_libsystem_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { CC_SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { CC_SHA1_Update(ctx, indata, insize); @@ -553,7 +553,7 @@ __archive_libsystem_sha1update(archive_sha1_ctx *ctx, } static int -__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { CC_SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -562,7 +562,7 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int -__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); if (mbedtls_sha1_starts_ret(ctx) == 0) @@ -572,7 +572,7 @@ __archive_mbedtls_sha1init(archive_sha1_ctx *ctx) } static int -__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) @@ -582,7 +582,7 @@ __archive_mbedtls_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { if (mbedtls_sha1_finish_ret(ctx, md) == 0) { mbedtls_sha1_free(ctx); @@ -596,14 +596,14 @@ __archive_mbedtls_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int -__archive_nettle_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { sha1_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { sha1_update(ctx, insize, indata); @@ -611,7 +611,7 @@ __archive_nettle_sha1update(archive_sha1_ctx *ctx, con } static int -__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { sha1_digest(ctx, SHA1_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -620,7 +620,7 @@ __archive_nettle_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) static int -__archive_openssl_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -629,7 +629,7 @@ __archive_openssl_sha1init(archive_sha1_ctx *ctx) } static int -__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -637,7 +637,7 @@ __archive_openssl_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -654,20 +654,20 @@ __archive_openssl_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) static int -__archive_windowsapi_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA1)); } static int -__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { return (win_crypto_Final(md, 20, ctx)); } @@ -675,14 +675,14 @@ __archive_windowsapi_sha1final(archive_sha1_ctx *ctx, #else static int -__archive_stub_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -692,7 +692,7 @@ __archive_stub_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -705,14 +705,14 @@ __archive_stub_sha1final(archive_sha1_ctx *ctx, void * #if defined(ARCHIVE_CRYPTO_SHA256_LIBC) static int -__archive_libc_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -720,7 +720,7 @@ __archive_libc_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -729,14 +729,14 @@ __archive_libc_sha256final(archive_sha256_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2) static int -__archive_libc2_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -744,7 +744,7 @@ __archive_libc2_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -753,14 +753,14 @@ __archive_libc2_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3) static int -__archive_libc3_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -768,7 +768,7 @@ __archive_libc3_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -777,14 +777,14 @@ __archive_libc3_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD) static int -__archive_libmd_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -792,7 +792,7 @@ __archive_libmd_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -801,14 +801,14 @@ __archive_libmd_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) static int -__archive_libsystem_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { CC_SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { CC_SHA256_Update(ctx, indata, insize); @@ -816,7 +816,7 @@ __archive_libsystem_sha256update(archive_sha256_ctx *c } static int -__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { CC_SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -825,7 +825,7 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) static int -__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { mbedtls_sha256_init(ctx); if (mbedtls_sha256_starts_ret(ctx, 0) == 0) @@ -835,7 +835,7 @@ __archive_mbedtls_sha256init(archive_sha256_ctx *ctx) } static int -__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) @@ -845,7 +845,7 @@ __archive_mbedtls_sha256update(archive_sha256_ctx *ctx } static int -__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (mbedtls_sha256_finish_ret(ctx, md) == 0) { mbedtls_sha256_free(ctx); @@ -859,14 +859,14 @@ __archive_mbedtls_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int -__archive_nettle_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { sha256_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { sha256_update(ctx, insize, indata); @@ -874,7 +874,7 @@ __archive_nettle_sha256update(archive_sha256_ctx *ctx, } static int -__archive_nettle_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { sha256_digest(ctx, SHA256_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -883,7 +883,7 @@ __archive_nettle_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) static int -__archive_openssl_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -892,7 +892,7 @@ __archive_openssl_sha256init(archive_sha256_ctx *ctx) } static int -__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -900,7 +900,7 @@ __archive_openssl_sha256update(archive_sha256_ctx *ctx } static int -__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -913,20 +913,20 @@ __archive_openssl_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_WIN) static int -__archive_windowsapi_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA_256)); } static int -__archive_windowsapi_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { return (win_crypto_Final(md, 32, ctx)); } @@ -934,14 +934,14 @@ __archive_windowsapi_sha256final(archive_sha256_ctx *c #else static int -__archive_stub_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -951,7 +951,7 @@ __archive_stub_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_stub_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -964,14 +964,14 @@ __archive_stub_sha256final(archive_sha256_ctx *ctx, vo #if defined(ARCHIVE_CRYPTO_SHA384_LIBC) static int -__archive_libc_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384_Update(ctx, indata, insize); @@ -979,7 +979,7 @@ __archive_libc_sha384update(archive_sha384_ctx *ctx, c } static int -__archive_libc_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -988,14 +988,14 @@ __archive_libc_sha384final(archive_sha384_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2) static int -__archive_libc2_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1003,7 +1003,7 @@ __archive_libc2_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc2_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1012,14 +1012,14 @@ __archive_libc2_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3) static int -__archive_libc3_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1027,7 +1027,7 @@ __archive_libc3_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc3_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1036,14 +1036,14 @@ __archive_libc3_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) static int -__archive_libsystem_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { CC_SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { CC_SHA384_Update(ctx, indata, insize); @@ -1051,7 +1051,7 @@ __archive_libsystem_sha384update(archive_sha384_ctx *c } static int -__archive_libsystem_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { CC_SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -1060,7 +1060,7 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) static int -__archive_mbedtls_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { mbedtls_sha512_init(ctx); if (mbedtls_sha512_starts_ret(ctx, 1) == 0) @@ -1070,7 +1070,7 @@ __archive_mbedtls_sha384init(archive_sha384_ctx *ctx) } static int -__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***