svn commit: r352788 - stable/12/stand/efi/loader
Author: bcran Date: Fri Sep 27 05:12:28 2019 New Revision: 352788 URL: https://svnweb.freebsd.org/changeset/base/352788 Log: MFC r344839: Add retry loop around GetMemoryMap call to fix fragmentation bug The call to BS->AllocatePages can cause the memory map to become framented, causing BS->GetMemoryMap to return EFI_BUFFER_TOO_SMALL more than once. For example this can happen on the MinnowBoard Turbot, causing the boot to stop with an error. Avoid this by calling GetMemoryMap in a loop. Modified: stable/12/stand/efi/loader/bootinfo.c stable/12/stand/efi/loader/copy.c Modified: stable/12/stand/efi/loader/bootinfo.c == --- stable/12/stand/efi/loader/bootinfo.c Fri Sep 27 02:09:20 2019 (r352787) +++ stable/12/stand/efi/loader/bootinfo.c Fri Sep 27 05:12:28 2019 (r352788) @@ -287,12 +287,12 @@ static int bi_load_efi_data(struct preloaded_file *kfp) { EFI_MEMORY_DESCRIPTOR *mm; - EFI_PHYSICAL_ADDRESS addr; + EFI_PHYSICAL_ADDRESS addr = 0; EFI_STATUS status; const char *efi_novmap; size_t efisz; UINTN efi_mapkey; - UINTN mmsz, pages, retry, sz; + UINTN dsz, pages, retry, sz; UINT32 mmver; struct efi_map_header *efihdr; bool do_vmap; @@ -323,76 +323,94 @@ bi_load_efi_data(struct preloaded_file *kfp) efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; /* -* Assgin size of EFI_MEMORY_DESCRIPTOR to keep compatible with +* Assign size of EFI_MEMORY_DESCRIPTOR to keep compatible with * u-boot which doesn't fill this value when buffer for memory * descriptors is too small (eg. 0 to obtain memory map size) */ - mmsz = sizeof(EFI_MEMORY_DESCRIPTOR); + dsz = sizeof(EFI_MEMORY_DESCRIPTOR); /* -* It is possible that the first call to ExitBootServices may change -* the map key. Fetch a new map key and retry ExitBootServices in that -* case. +* Allocate enough pages to hold the bootinfo block and the +* memory map EFI will return to us. The memory map has an +* unknown size, so we have to determine that first. Note that +* the AllocatePages call can itself modify the memory map, so +* we have to take that into account as well. The changes to +* the memory map are caused by splitting a range of free +* memory into two, so that one is marked as being loader +* data. */ + + sz = 0; + + /* +* Matthew Garrett has observed at least one system changing the +* memory map when calling ExitBootServices, causing it to return an +* error, probably because callbacks are allocating memory. +* So we need to retry calling it at least once. +*/ for (retry = 2; retry > 0; retry--) { - /* -* Allocate enough pages to hold the bootinfo block and the -* memory map EFI will return to us. The memory map has an -* unknown size, so we have to determine that first. Note that -* the AllocatePages call can itself modify the memory map, so -* we have to take that into account as well. The changes to -* the memory map are caused by splitting a range of free -* memory into two (AFAICT), so that one is marked as being -* loader data. -*/ - sz = 0; - BS->GetMemoryMap(&sz, NULL, &efi_mapkey, &mmsz, &mmver); - sz += mmsz; - sz = (sz + 0xf) & ~0xf; - pages = EFI_SIZE_TO_PAGES(sz + efisz); - status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, -pages, &addr); - if (EFI_ERROR(status)) { - printf("%s: AllocatePages error %lu\n", __func__, - EFI_ERROR_CODE(status)); - return (ENOMEM); - } + for (;;) { + status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &dsz, &mmver); + if (!EFI_ERROR(status)) + break; - /* -* Read the memory map and stash it after bootinfo. Align the -* memory map on a 16-byte boundary (the bootinfo block is page -* aligned). -*/ - efihdr = (struct efi_map_header *)(uintptr_t)addr; - mm = (void *)((uint8_t *)efihdr + efisz); - sz = (EFI_PAGE_SIZE * pages) - efisz; + if (status != EFI_BUFFER_TOO_SMALL) { + printf("%s: GetMemoryMap error %lu\n", __func__, + EFI_ERROR_CODE(status)); + return (EINVAL); +
Re: svn commit: r352707 - in head/sys: conf kern net sys
On 27/09/2019 12:48 am, Charlie Li via svn-src-head wrote: Gleb Smirnoff wrote: Modified: head/sys/conf/options == --- head/sys/conf/options Wed Sep 25 18:09:19 2019(r352706) +++ head/sys/conf/options Wed Sep 25 18:26:31 2019(r352707) @@ -712,6 +712,8 @@ WITNESS_SKIPSPINopt_witness.h WITNESS_COUNT opt_witness.h OPENSOLARIS_WITNESS opt_global.h +EPOCH_TRACE opt_epoch.h + # options for ACPI support ACPI_DEBUGopt_acpi.h ACPI_MAX_TASKSopt_acpi.h Modified: head/sys/sys/epoch.h == --- head/sys/sys/epoch.hWed Sep 25 18:09:19 2019(r352706) +++ head/sys/sys/epoch.hWed Sep 25 18:26:31 2019(r352707) @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; #include #include +#include "opt_epoch.h" + struct epoch; typedef struct epoch *epoch_t; This breaks building the drm-kmod ports, as the build cannot find opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the exact same way): I started to get pkg-fallout emails in net/aquantia-atlantic-kmod with the same build failure https://github.com/Aquantia/aqtion-freebsd/issues/4 --- linux_anon_inodes.o --- cc -O2 -pipe -fno-strict-aliasing -include /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith -mno-aes -mno-avx -std=iso9899:1999 -c /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c -o linux_anon_inodes.o In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found #include "opt_epoch.h" ^ --- linux_anon_inodefs.o --- In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found #include "opt_epoch.h" ^ --- linux_anon_inodes.o --- 1 error generated. *** [linux_anon_inodes.o] Error code 1 make[2]: stopped in /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi --- linux_anon_inodefs.o --- 1 error generated. *** [linux_anon_inodefs.o] Error code 1 Interestingly enough, does not happen when drm-current-kmod is built as part of buildkernel (using an existing installed package with SOURCE on). ___ svn-s
svn commit: r352787 - head/sys/dev/ioat
Author: mav Date: Fri Sep 27 02:09:20 2019 New Revision: 352787 URL: https://svnweb.freebsd.org/changeset/base/352787 Log: Replace argument checks with assertions. Those functions are used by kernel, and we can't check all possible argument errors in production kernel. Plus according to docs many of those errors are checked by hardware. Assertions should just help with code debugging. MFC after:2 weeks Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c == --- head/sys/dev/ioat/ioat.cFri Sep 27 00:29:12 2019(r352786) +++ head/sys/dev/ioat/ioat.cFri Sep 27 02:09:20 2019(r352787) @@ -1136,17 +1136,14 @@ ioat_op_generic(struct ioat_softc *ioat, uint8_t op, KASSERT((flags & ~_DMA_GENERIC_FLAGS) == 0, ("Unrecognized flag(s): %#x", flags & ~_DMA_GENERIC_FLAGS)); + KASSERT(size <= ioat->max_xfer_size, ("%s: size too big (%u > %u)", + __func__, (unsigned)size, ioat->max_xfer_size)); + if ((flags & DMA_NO_WAIT) != 0) mflags = M_NOWAIT; else mflags = M_WAITOK; - if (size > ioat->max_xfer_size) { - ioat_log_message(0, "%s: max_xfer_size = %d, requested = %u\n", - __func__, ioat->max_xfer_size, (unsigned)size); - return (NULL); - } - if (ioat_reserve_space(ioat, 1, mflags) != 0) return (NULL); @@ -1226,11 +1223,8 @@ ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, ioat = to_ioat_softc(dmaengine); - if (((src | dst) & (0xull << 48)) != 0) { - ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", - __func__); - return (NULL); - } + KASSERT(((src | dst) & (0xull << 48)) == 0, + ("%s: high 16 bits of src/dst are not zero", __func__)); desc = ioat_op_generic(ioat, IOAT_OP_COPY, len, src, dst, callback_fn, callback_arg, flags); @@ -1262,16 +1256,10 @@ ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_ad ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - if (((src1 | src2 | dst1 | dst2) & (0xull << 48)) != 0) { - ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", - __func__); - return (NULL); - } - if (((src1 | src2 | dst1 | dst2) & PAGE_MASK) != 0) { - ioat_log_message(0, "%s: Addresses must be page-aligned\n", - __func__); - return (NULL); - } + KASSERT(((src1 | src2 | dst1 | dst2) & (0xull << 48)) == 0, + ("%s: high 16 bits of src/dst are not zero", __func__)); + KASSERT(((src1 | src2 | dst1 | dst2) & PAGE_MASK) == 0, + ("%s: addresses are not page-aligned", __func__)); desc = ioat_op_generic(ioat, IOAT_OP_COPY, 2 * PAGE_SIZE, 0, 0, callback_fn, callback_arg, flags); @@ -1349,26 +1337,15 @@ ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t ds ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - if ((ioat->capabilities & IOAT_DMACAP_MOVECRC) == 0) { - ioat_log_message(0, "%s: Device lacks MOVECRC capability\n", - __func__); - return (NULL); - } - if (((src | dst) & (0xffull << 40)) != 0) { - ioat_log_message(0, "%s: High 24 bits of src/dst invalid\n", - __func__); - return (NULL); - } + KASSERT((ioat->capabilities & IOAT_DMACAP_MOVECRC) != 0, + ("%s: device lacks MOVECRC capability", __func__)); + KASSERT(((src | dst) & (0xffull << 40)) == 0, + ("%s: high 24 bits of src/dst are not zero", __func__)); teststore = (flags & _DMA_CRC_TESTSTORE); - if (teststore == _DMA_CRC_TESTSTORE) { - ioat_log_message(0, "%s: TEST and STORE invalid\n", __func__); - return (NULL); - } - if (teststore == 0 && (flags & DMA_CRC_INLINE) != 0) { - ioat_log_message(0, "%s: INLINE invalid without TEST or STORE\n", - __func__); - return (NULL); - } + KASSERT(teststore != _DMA_CRC_TESTSTORE, + ("%s: TEST and STORE invalid", __func__)); + KASSERT(teststore != 0 || (flags & DMA_CRC_INLINE) == 0, + ("%s: INLINE invalid without TEST or STORE", __func__)); switch (teststore) { case DMA_CRC_STORE: @@ -1383,12 +1360,9 @@ ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t ds break; } - if ((flags & DMA_CRC_INLINE) == 0 && - (crcptr & (0xffull << 40)) != 0) { - ioat_log_message(0, - "%s: High 24 bits of crcptr invalid\n", __func__);
Re: svn commit: r352778 - in head/sys: conf sys
This is a developer only option. Out-of-tree consumers would need to be compiled with the kernel directory, much like they would need to be for other things. You wouldn't run a system with this normally: it's only to debug specific instances of bad behavior. I think, like other debugging options, that it's fine. Warner On Thu, Sep 26, 2019 at 6:18 PM Ryan Stone wrote: > Is this enough? Won't out-of-tree modules get compiled without > EPOCH_TRACE set? If such a module is loaded on a kernel with > EPOCH_TRACE set then the module will call epoch_enter_preempt() with a > epoch_tracker that is too small and have its stack corrupted, won't > it? > > On Thu, Sep 26, 2019 at 5:12 PM Gleb Smirnoff wrote: > > > > Author: glebius > > Date: Thu Sep 26 21:12:47 2019 > > New Revision: 352778 > > URL: https://svnweb.freebsd.org/changeset/base/352778 > > > > Log: > > Move EPOCH_TRACE to opt_global.h, so that any external modules that > > use epoch don't need Makefile tweaks. > > > > The downside is that any developer who wants EPOCH_TRACE needs to > > rebuild kernel in full, but that's fine. > > > > Reviewed by: imp > > > > Modified: > > head/sys/conf/options > > head/sys/sys/epoch.h > > > > Modified: head/sys/conf/options > > > == > > --- head/sys/conf/options Thu Sep 26 21:06:55 2019(r352777) > > +++ head/sys/conf/options Thu Sep 26 21:12:47 2019(r352778) > > @@ -712,7 +712,7 @@ WITNESS_SKIPSPINopt_witness.h > > WITNESS_COUNT opt_witness.h > > OPENSOLARIS_WITNESSopt_global.h > > > > -EPOCH_TRACEopt_epoch.h > > +EPOCH_TRACEopt_global.h > > > > # options for ACPI support > > ACPI_DEBUG opt_acpi.h > > > > Modified: head/sys/sys/epoch.h > > > == > > --- head/sys/sys/epoch.hThu Sep 26 21:06:55 2019(r352777) > > +++ head/sys/sys/epoch.hThu Sep 26 21:12:47 2019(r352778) > > @@ -41,8 +41,6 @@ typedef struct epoch_context *epoch_context_t; > > #include > > #include > > > > -#include "opt_epoch.h" > > - > > struct epoch; > > typedef struct epoch *epoch_t; > > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352786 - in head/contrib/ipfilter: man tools
Author: cy Date: Fri Sep 27 00:29:12 2019 New Revision: 352786 URL: https://svnweb.freebsd.org/changeset/base/352786 Log: Implement the dynamic add (-A) and removal (-R) of ippool pools from the command line. Prior to this the functionality was mostly there however since the pool type (-t) was not recognized by the -A and -R command options -- not recognized by getopt(). Additionally the code to implement the dynamic add and removal of pools didn't work. When dynamically adding (-A) a pool a type (-t) to specify if the pool is a tree or hash pool must be specified. When dynamically removing (-R) a pool, omitting -t will cause a search-and-destroy which will remove both types of pools matching the name given (-m). PR: 218433 MFC after:1 week Modified: head/contrib/ipfilter/man/ippool.8 head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/man/ippool.8 == --- head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:09 2019 (r352785) +++ head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:12 2019 (r352786) @@ -9,7 +9,7 @@ ippool \- user interface to the IPFilter pools -a [-dnv] [-m ] [-o ] [-t ] [-T ttl] -i [/] .br .B ippool --A [-dnv] [-m ] [-o ] [-S ] [-t ] +-A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool -f [-dnuv] Modified: head/contrib/ipfilter/tools/ippool.c == --- head/contrib/ipfilter/tools/ippool.cFri Sep 27 00:29:09 2019 (r352785) +++ head/contrib/ipfilter/tools/ippool.cFri Sep 27 00:29:12 2019 (r352786) @@ -257,7 +257,7 @@ poolcommand(remove, argc, argv) char *argv[]; { int type, role, c, err; - char *poolname; + char *poolname, *typearg = NULL; iphtable_t iph; ip_pool_t pool; @@ -269,7 +269,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:vt:")) != -1) switch (c) { case 'd' : @@ -295,6 +295,10 @@ poolcommand(remove, argc, argv) else usage(argv[0]); break; + case 't' : + type = gettype(optarg, &iph.iph_type); + typearg = optarg; + break; case 'v' : opts |= OPT_VERBOSE; break; @@ -314,17 +318,22 @@ poolcommand(remove, argc, argv) return -1; } - type = gettype(argv[optind], &iph.iph_type); - if (type == IPLT_NONE) { - fprintf(stderr, "unknown type '%s'\n", argv[optind]); + if (type == IPLT_NONE && remove == 0) { + if (typearg == NULL) { + fprintf(stderr, "type must be specified\n"); + usage(argv[0]); + } else { + fprintf(stderr, "unknown type '%s'\n", typearg); + } return -1; } - if (type == IPLT_HASH) { + if (type == IPLT_HASH || (type == IPLT_NONE && remove == 1)) { strncpy(iph.iph_name, poolname, sizeof(iph.iph_name)); iph.iph_name[sizeof(iph.iph_name) - 1] = '\0'; iph.iph_unit = role; - } else if (type == IPLT_POOL) { + } + if (type == IPLT_POOL || (type == IPLT_NONE && remove == 1)) { strncpy(pool.ipo_name, poolname, sizeof(pool.ipo_name)); pool.ipo_name[sizeof(pool.ipo_name) - 1] = '\0'; pool.ipo_unit = role; @@ -348,6 +357,16 @@ poolcommand(remove, argc, argv) break; case IPLT_POOL : err = remove_pool(&pool, ioctl); + break; + case IPLT_NONE : + err = 1; + { + int err_h, err_p; + err_h = remove_hash(&iph, ioctl); + err_p = remove_pool(&pool, ioctl); + if (err_h == 0 || err_p == 0) + err = 0; + } break; } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352783 - head/contrib/ipfilter/man
Author: cy Date: Fri Sep 27 00:29:03 2019 New Revision: 352783 URL: https://svnweb.freebsd.org/changeset/base/352783 Log: Fix a typo. MFC after:3 days Modified: head/contrib/ipfilter/man/ippool.8 Modified: head/contrib/ipfilter/man/ippool.8 == --- head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:11:09 2019 (r352782) +++ head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:03 2019 (r352783) @@ -108,7 +108,7 @@ Sets the hashing seed to the number specified. Only f type pools. .TP .B -t -Sets the type of pool being defined. Myst be one of +Sets the type of pool being defined. Must be one of .B tree, .B hash, .B group-map. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352784 - head/contrib/ipfilter/man
Author: cy Date: Fri Sep 27 00:29:06 2019 New Revision: 352784 URL: https://svnweb.freebsd.org/changeset/base/352784 Log: Sync with source: Only a role of "ipf" is currentlysupported as the other documented (and undocumented) roles are #ifdef'd out. The plan is to complete ippool(8) as it is even in its current state a powerful feature/tool. PR: 218433 MFC after:1 month Modified: head/contrib/ipfilter/man/ippool.8 Modified: head/contrib/ipfilter/man/ippool.8 == --- head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:03 2019 (r352783) +++ head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:06 2019 (r352784) @@ -96,11 +96,8 @@ retrieving statistical information. .TP .B -o Sets the role with which this pool is to be used. Currently only -.B ipf, -.B auth -and -.B count -are accepted as arguments to this option. +.B ipf +(the default) is accepted as arguments to this option. .TP .B -S Sets the hashing seed to the number specified. Only for use with ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352785 - head/contrib/ipfilter/tools
Author: cy Date: Fri Sep 27 00:29:09 2019 New Revision: 352785 URL: https://svnweb.freebsd.org/changeset/base/352785 Log: The no resolve (OPT_NORESOLVE) does nothing. Additionally, it (-R) conflicts with the command option of the same name (also -R). Remove the superfluous and confusing non-global non-command -R option. PR: 218433 MFC after:1 week Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c == --- head/contrib/ipfilter/tools/ippool.cFri Sep 27 00:29:06 2019 (r352784) +++ head/contrib/ipfilter/tools/ippool.cFri Sep 27 00:29:09 2019 (r352785) @@ -145,7 +145,7 @@ poolnodecommand(remove, argc, argv) bzero((char *)&pnode, sizeof(pnode)); bzero((char *)&hnode, sizeof(hnode)); - while ((c = getopt(argc, argv, "di:m:no:Rt:T:v")) != -1) + while ((c = getopt(argc, argv, "di:m:no:t:T:v")) != -1) switch (c) { case 'd' : @@ -172,9 +172,6 @@ poolnodecommand(remove, argc, argv) if (role == IPL_LOGNONE) return -1; break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 't' : if (ipset == 1) { fprintf(stderr, @@ -272,7 +269,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:RS:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) switch (c) { case 'd' : @@ -292,9 +289,6 @@ poolcommand(remove, argc, argv) return -1; } break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 'S' : if (remove == 0) iph.iph_seed = atoi(optarg); @@ -368,7 +362,7 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnRuv")) != -1) + while ((c = getopt(argc, argv, "dnuv")) != -1) switch (c) { case 'd' : @@ -377,9 +371,6 @@ loadpoolfile(argc, argv, infile) break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; - break; - case 'R' : - opts |= OPT_NORESOLVE; break; case 'u' : opts |= OPT_REMOVE; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r352778 - in head/sys: conf sys
Is this enough? Won't out-of-tree modules get compiled without EPOCH_TRACE set? If such a module is loaded on a kernel with EPOCH_TRACE set then the module will call epoch_enter_preempt() with a epoch_tracker that is too small and have its stack corrupted, won't it? On Thu, Sep 26, 2019 at 5:12 PM Gleb Smirnoff wrote: > > Author: glebius > Date: Thu Sep 26 21:12:47 2019 > New Revision: 352778 > URL: https://svnweb.freebsd.org/changeset/base/352778 > > Log: > Move EPOCH_TRACE to opt_global.h, so that any external modules that > use epoch don't need Makefile tweaks. > > The downside is that any developer who wants EPOCH_TRACE needs to > rebuild kernel in full, but that's fine. > > Reviewed by: imp > > Modified: > head/sys/conf/options > head/sys/sys/epoch.h > > Modified: head/sys/conf/options > == > --- head/sys/conf/options Thu Sep 26 21:06:55 2019(r352777) > +++ head/sys/conf/options Thu Sep 26 21:12:47 2019(r352778) > @@ -712,7 +712,7 @@ WITNESS_SKIPSPINopt_witness.h > WITNESS_COUNT opt_witness.h > OPENSOLARIS_WITNESSopt_global.h > > -EPOCH_TRACEopt_epoch.h > +EPOCH_TRACEopt_global.h > > # options for ACPI support > ACPI_DEBUG opt_acpi.h > > Modified: head/sys/sys/epoch.h > == > --- head/sys/sys/epoch.hThu Sep 26 21:06:55 2019(r352777) > +++ head/sys/sys/epoch.hThu Sep 26 21:12:47 2019(r352778) > @@ -41,8 +41,6 @@ typedef struct epoch_context *epoch_context_t; > #include > #include > > -#include "opt_epoch.h" > - > struct epoch; > typedef struct epoch *epoch_t; > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352782 - stable/12/share/mk
Author: sjg Date: Fri Sep 27 00:11:09 2019 New Revision: 352782 URL: https://svnweb.freebsd.org/changeset/base/352782 Log: Document logic for __DEFAULT_DEPENDENT_OPTIONS MFC of r352370 Reviewed by: stevek Differential Revision:https://reviews.freebsd.org/D21640 Modified: stable/12/share/mk/bsd.mkopt.mk Modified: stable/12/share/mk/bsd.mkopt.mk == --- stable/12/share/mk/bsd.mkopt.mk Fri Sep 27 00:08:40 2019 (r352781) +++ stable/12/share/mk/bsd.mkopt.mk Fri Sep 27 00:11:09 2019 (r352782) @@ -11,12 +11,16 @@ # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no", # unless WITH_FOO is defined, in which case it is set to "yes". # +# For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS, +# MK_FOO is set to "no" if WITHOUT_FOO is defined, +# "yes" if WITH_FOO is defined, otherwise the value of MK_BAR. +# # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and # MK_FOO is set to "no" regardless of which list it was in. # -# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd -# after all this processing, allowing this file to be included -# multiple times with different lists. +# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and +# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing, +# allowing this file to be included multiple times with different lists. # # Other parts of the build system will set BROKEN_OPTIONS to a list # of options that are broken on this platform. This will not be unset ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352781 - stable/12/share/mk
Author: sjg Date: Fri Sep 27 00:08:40 2019 New Revision: 352781 URL: https://svnweb.freebsd.org/changeset/base/352781 Log: Use .undef per variable Attempting to expand a variable to a list of vars to .undef does not actually work. MFC of r343066 Reviewed by: bdrewery Differential Revision:D17251 Modified: stable/12/share/mk/dirdeps-options.mk Modified: stable/12/share/mk/dirdeps-options.mk == --- stable/12/share/mk/dirdeps-options.mk Fri Sep 27 00:00:21 2019 (r352780) +++ stable/12/share/mk/dirdeps-options.mk Fri Sep 27 00:08:40 2019 (r352781) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: dirdeps-options.mk,v 1.8 2018/05/29 22:31:21 sjg Exp $ +# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $ # # @(#) Copyright (c) 2018, Simon J. Gerraty # @@ -54,7 +54,8 @@ DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U} DIRDEPS := ${DIRDEPS:O:u} # avoid cross contamination .for o in ${DIRDEPS_OPTIONS:tu} -.undef DIRDEPS.$o.yes DIRDEPS.$o.no +.undef DIRDEPS.$o.yes +.undef DIRDEPS.$o.no .endfor .else # whether options are enabled or not, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352780 - releng/12.1/sys/conf
Author: gjb Date: Fri Sep 27 00:00:21 2019 New Revision: 352780 URL: https://svnweb.freebsd.org/changeset/base/352780 Log: Update releng/12.1 to BETA2 as part of the 12.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/12.1/sys/conf/newvers.sh Modified: releng/12.1/sys/conf/newvers.sh == --- releng/12.1/sys/conf/newvers.sh Thu Sep 26 23:27:24 2019 (r352779) +++ releng/12.1/sys/conf/newvers.sh Fri Sep 27 00:00:21 2019 (r352780) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.1" -BRANCH="BETA1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352779 - releng/12.1/sys/cam/scsi
Author: mav Date: Thu Sep 26 23:27:24 2019 New Revision: 352779 URL: https://svnweb.freebsd.org/changeset/base/352779 Log: MFS r352772: MFC r349342 (by imp): Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Reviewed by: imp Approved by: re (gjb) Modified: releng/12.1/sys/cam/scsi/scsi_da.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/cam/scsi/scsi_da.c == --- releng/12.1/sys/cam/scsi/scsi_da.c Thu Sep 26 21:12:47 2019 (r352778) +++ releng/12.1/sys/cam/scsi/scsi_da.c Thu Sep 26 23:27:24 2019 (r352779) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3598,16 +3601,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5276,7 +5271,6 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352778 - in head/sys: conf sys
Author: glebius Date: Thu Sep 26 21:12:47 2019 New Revision: 352778 URL: https://svnweb.freebsd.org/changeset/base/352778 Log: Move EPOCH_TRACE to opt_global.h, so that any external modules that use epoch don't need Makefile tweaks. The downside is that any developer who wants EPOCH_TRACE needs to rebuild kernel in full, but that's fine. Reviewed by: imp Modified: head/sys/conf/options head/sys/sys/epoch.h Modified: head/sys/conf/options == --- head/sys/conf/options Thu Sep 26 21:06:55 2019(r352777) +++ head/sys/conf/options Thu Sep 26 21:12:47 2019(r352778) @@ -712,7 +712,7 @@ WITNESS_SKIPSPINopt_witness.h WITNESS_COUNT opt_witness.h OPENSOLARIS_WITNESSopt_global.h -EPOCH_TRACEopt_epoch.h +EPOCH_TRACEopt_global.h # options for ACPI support ACPI_DEBUG opt_acpi.h Modified: head/sys/sys/epoch.h == --- head/sys/sys/epoch.hThu Sep 26 21:06:55 2019(r352777) +++ head/sys/sys/epoch.hThu Sep 26 21:12:47 2019(r352778) @@ -41,8 +41,6 @@ typedef struct epoch_context *epoch_context_t; #include #include -#include "opt_epoch.h" - struct epoch; typedef struct epoch *epoch_t; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352777 - releng/12.1/share/man/man5
Author: emaste Date: Thu Sep 26 21:06:55 2019 New Revision: 352777 URL: https://svnweb.freebsd.org/changeset/base/352777 Log: Regen src.conf.5 after r352768, r352769 Approved by: re (gjb) Modified: releng/12.1/share/man/man5/src.conf.5 Modified: releng/12.1/share/man/man5/src.conf.5 == --- releng/12.1/share/man/man5/src.conf.5 Thu Sep 26 21:04:36 2019 (r352776) +++ releng/12.1/share/man/man5/src.conf.5 Thu Sep 26 21:06:55 2019 (r352777) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd July 24, 2019 +.Dd September 26, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -170,6 +170,11 @@ Set to not build or install associated utilities, and examples. .Pp This option only affects amd64/amd64. +.It Va WITH_BIND_NOW +Build all binaries with the +.Dv DF_BIND_NOW +flag set to indicate that the run-time loader should perform all relocation +processing at process startup rather than on demand. .It Va WITHOUT_BINUTILS Set to not build or install GNU .Xr as 1 , @@ -234,8 +239,6 @@ Set to build some programs without support, like .Xr fingerd 8 , .Xr ftpd 8 , -.Xr rlogind 8 , -.Xr rshd 8 , and .Xr sshd 8 . .It Va WITHOUT_BLUETOOTH @@ -256,6 +259,11 @@ and related programs. .It Va WITHOUT_BSD_CPIO Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . +.It Va WITH_BSD_CRTBEGIN +Enable the BSD licensed +.Pa crtbegin.o +and +.Pa crtend.o . .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP @@ -1565,6 +1573,9 @@ When set, it enforces these options: .It .Va WITHOUT_AUTHPF .El +.It Va WITH_PIE +Build dynamically linked binaries as +Position-Independent Executable (PIE). .It Va WITHOUT_PKGBOOTSTRAP Set to not build .Xr pkg 7 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352776 - head/sys/dev/sound/pci/hda
Author: gonzo Date: Thu Sep 26 21:04:36 2019 New Revision: 352776 URL: https://svnweb.freebsd.org/changeset/base/352776 Log: snd_hda: Add Intel Cannon Lake support Add missing header change ommitted in r352775 MFC after:2 weeks X-MFC-with: 352775 Modified: head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.h == --- head/sys/dev/sound/pci/hda/hdac.h Thu Sep 26 21:02:21 2019 (r352775) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Sep 26 21:04:36 2019 (r352776) @@ -77,6 +77,7 @@ #define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171) #define HDA_INTEL_KBLKHHDA_MODEL_CONSTRUCT(INTEL, 0xa2f0) #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348) +#define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0x) /* Nvidia */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352775 - head/sys/dev/sound/pci/hda
Author: gonzo Date: Thu Sep 26 21:02:21 2019 New Revision: 352775 URL: https://svnweb.freebsd.org/changeset/base/352775 Log: snd_hda: Add Intel Cannon Lake support Add PCI ids for Intel Cannon Lake PCH Tested on:HP Spectre x360 13-p0043dx PR: 240574 Submitted by: Neel Chauhan Reviewed by: imp, mizhka, ray MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D21789 Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c == --- head/sys/dev/sound/pci/hda/hdac.c Thu Sep 26 20:56:07 2019 (r352774) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Sep 26 21:02:21 2019 (r352775) @@ -102,6 +102,7 @@ static const struct { { HDA_INTEL_KBLK,"Intel Kaby Lake", 0, 0 }, { HDA_INTEL_KBLKH, "Intel Kaby Lake-H", 0, 0 }, { HDA_INTEL_CFLK,"Intel Coffee Lake", 0, 0 }, + { HDA_INTEL_CNLK,"Intel Cannon Lake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F",0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G",0, 0 }, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352774 - releng/12.1/usr.sbin/freebsd-update
Author: grembo (ports committer) Date: Thu Sep 26 20:56:07 2019 New Revision: 352774 URL: https://svnweb.freebsd.org/changeset/base/352774 Log: MF stable/12 r352759,r352771 Approved by: re (gjb) r352759: freebsd-update.8: Style fixes, document new features. freebsd-update: Make usage output consistent. freebsd-update: Add `updatesready' and `showconfig' commands freebsd-update: Change exit code of `freebsd-update install' to 2 in case there are no pending updates and there wasn't a fetch phase in the same invocation. r352771: Add mergeinfo missing in r352759 PR: 240757, 240177, 229346 Reviewed by: manpages (bcr), secteam (emaste), yuripv Differential Revision:https://reviews.freebsd.org/D21473 Modified: releng/12.1/usr.sbin/freebsd-update/freebsd-update.8 releng/12.1/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/usr.sbin/freebsd-update/freebsd-update.8 == --- releng/12.1/usr.sbin/freebsd-update/freebsd-update.8Thu Sep 26 19:48:36 2019(r352773) +++ releng/12.1/usr.sbin/freebsd-update/freebsd-update.8Thu Sep 26 20:56:07 2019(r352774) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2017 +.Dd September 24, 2019 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -95,7 +95,7 @@ Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release (e.g. 11.2-RELEASE) to which +Specify the new release (e.g., 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server @@ -155,13 +155,24 @@ Note that this command may require up to 500 MB of spa depending on which components of the .Fx base system are installed. +.It Cm updatesready +Check if there are fetched updates ready to install. +Returns exit code 2 if there are no updates to install. .It Cm install Install the most recently fetched updates or upgrade. +Returns exit code 2 if there are no updates to install +and the +.Cm fetch +command wasn't passed as an earlier argument in the same +invocation. .It Cm rollback Uninstall the most recently installed updates. .It Cm IDS Compare the system against a "known good" index of the installed release. +.It Cm showconfig +Show configuration options after parsing conffile and command +line options. .El .Sh TIPS .Bl -bullet Modified: releng/12.1/usr.sbin/freebsd-update/freebsd-update.sh == --- releng/12.1/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 26 19:48:36 2019(r352773) +++ releng/12.1/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 26 20:56:07 2019(r352774) @@ -62,9 +62,11 @@ Commands: cron -- Sleep rand(3600) seconds, fetch updates, and send an email if updates were found upgrade -- Fetch upgrades to FreeBSD version specified via -r option + updatesready -- Check if there are fetched updates ready to install install -- Install downloaded updates or upgrades rollback -- Uninstall most recently installed updates - IDS -- Compare the system against an index of "known good" files. + IDS -- Compare the system against an index of "known good" files + showconfig -- Show configuration EOF exit 0 } @@ -503,7 +505,8 @@ parse_cmdline () { ;; # Commands - cron | fetch | upgrade | install | rollback | IDS) + cron | fetch | upgrade | updatesready | install | rollback |\ + IDS | showconfig) COMMANDS="${COMMANDS} $1" ;; @@ -827,7 +830,7 @@ install_check_params () { echo "No updates are available to install." if [ $ISFETCHED -eq 0 ]; then echo "Run '$0 fetch' first." - exit 1 + exit 2 fi exit 0 fi @@ -,6 +3336,21 @@ cmd_upgrade () { upgrade_run || exit 1 } +# Check if there are fetched updates ready to install +cmd_updatesready () { + # Construct a unique name from ${BASEDIR} + BDHASH=`echo ${BASEDIR} | sha256 -q` + + # Check that we have updates ready to install + if ! [ -L ${BDHASH}-install ]; then + echo "No updates are available to install." + exit 2 + fi + + echo "There are updates available to install." + echo "Run '$0 install' to proceed." +} + # Install downloaded updates. cmd_install () { install_check_params @@ -3349,6 +3367,13 @@ cmd_rollback () { cmd_IDS () { IDS_check_params IDS_run || exit 1 +} + +# Output configuration. +cmd_showconfig () { +
svn commit: r352773 - stable/11/sys/cam/scsi
Author: mav Date: Thu Sep 26 19:48:36 2019 New Revision: 352773 URL: https://svnweb.freebsd.org/changeset/base/352773 Log: MFC r349342 (by imp): Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Modified: stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_da.c == --- stable/11/sys/cam/scsi/scsi_da.cThu Sep 26 19:47:54 2019 (r352772) +++ stable/11/sys/cam/scsi/scsi_da.cThu Sep 26 19:48:36 2019 (r352773) @@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3373,16 +3376,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone, @@ -4961,7 +4956,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352772 - stable/12/sys/cam/scsi
Author: mav Date: Thu Sep 26 19:47:54 2019 New Revision: 352772 URL: https://svnweb.freebsd.org/changeset/base/352772 Log: MFC r349342 (by imp): Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Modified: stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_da.c == --- stable/12/sys/cam/scsi/scsi_da.cThu Sep 26 19:10:22 2019 (r352771) +++ stable/12/sys/cam/scsi/scsi_da.cThu Sep 26 19:47:54 2019 (r352772) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3598,16 +3601,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5276,7 +5271,6 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352771 - stable/12
Author: grembo (ports committer) Date: Thu Sep 26 19:10:22 2019 New Revision: 352771 URL: https://svnweb.freebsd.org/changeset/base/352771 Log: Add mergeinfo missing in r352759 Modified: Directory Properties: stable/12/ (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352770 - stable/11
Author: grembo (ports committer) Date: Thu Sep 26 19:08:53 2019 New Revision: 352770 URL: https://svnweb.freebsd.org/changeset/base/352770 Log: Add mergeinfo missing in r352758 Modified: Directory Properties: stable/11/ (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352769 - in releng/12.1: share/mk tools/build/options
Author: emaste Date: Thu Sep 26 18:56:41 2019 New Revision: 352769 URL: https://svnweb.freebsd.org/changeset/base/352769 Log: MFS r352752: Add a WITH_BIND_NOW build knob MFC r340186: Add a WITH_BIND_NOW build knob The linker's -z now flag sets the DF_BIND_NOW flag, which signals to the runtime loader that all relocation processing should be performed at process startup rather than on demand. In combination with lld's default of enabling relro this causes the GOT to be made read-only when the process starts, preventing straightforward GOT overwrite attacks. MFC r341429: disable BIND_NOW in libc, libthr, and rtld An issue remains with BIND_NOW and processes using threads. For now, restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and libthr. MFC r345625: revert r341429 "disable BIND_NOW in libc, libthr, and rtld" r345620 by kib@ fixed the rtld issue that caused a crash at startup during resolution of libc's ifuncs with BIND_NOW. MFC r345638: Revert change accidentally committed along with r345625 MFC r345640: Revert other accidentally committed part of r345625 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Added: releng/12.1/tools/build/options/WITHOUT_BIND_NOW - copied unchanged from r352752, stable/12/tools/build/options/WITHOUT_BIND_NOW releng/12.1/tools/build/options/WITH_BIND_NOW - copied unchanged from r352752, stable/12/tools/build/options/WITH_BIND_NOW Modified: releng/12.1/share/mk/bsd.lib.mk releng/12.1/share/mk/bsd.opts.mk releng/12.1/share/mk/bsd.prog.mk Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/share/mk/bsd.lib.mk == --- releng/12.1/share/mk/bsd.lib.mk Thu Sep 26 18:37:58 2019 (r352768) +++ releng/12.1/share/mk/bsd.lib.mk Thu Sep 26 18:56:41 2019 (r352769) @@ -69,6 +69,10 @@ TAGS+= package=${PACKAGE:Uruntime} TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif +# ELF hardening knobs +.if ${MK_BIND_NOW} != "no" +LDFLAGS+= -Wl,-znow +.endif .if ${MK_RETPOLINE} != "no" CFLAGS+= -mretpoline CXXFLAGS+= -mretpoline Modified: releng/12.1/share/mk/bsd.opts.mk == --- releng/12.1/share/mk/bsd.opts.mkThu Sep 26 18:37:58 2019 (r352768) +++ releng/12.1/share/mk/bsd.opts.mkThu Sep 26 18:56:41 2019 (r352769) @@ -69,6 +69,7 @@ __DEFAULT_YES_OPTIONS = \ WARNS __DEFAULT_NO_OPTIONS = \ +BIND_NOW \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ Modified: releng/12.1/share/mk/bsd.prog.mk == --- releng/12.1/share/mk/bsd.prog.mkThu Sep 26 18:37:58 2019 (r352768) +++ releng/12.1/share/mk/bsd.prog.mkThu Sep 26 18:56:41 2019 (r352769) @@ -34,6 +34,10 @@ PROG=${PROG_CXX} MK_DEBUG_FILES=no .endif +# ELF hardening knobs +.if ${MK_BIND_NOW} != "no" +LDFLAGS+= -Wl,-znow +.endif .if ${MK_PIE} != "no" && (!defined(NO_SHARED) || ${NO_SHARED:tl} == "no") CFLAGS+= -fPIE CXXFLAGS+= -fPIE Copied: releng/12.1/tools/build/options/WITHOUT_BIND_NOW (from r352752, stable/12/tools/build/options/WITHOUT_BIND_NOW) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.1/tools/build/options/WITHOUT_BIND_NOWThu Sep 26 18:56:41 2019(r352769, copy of r352752, stable/12/tools/build/options/WITHOUT_BIND_NOW) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Do not build all binaries with the +.Dv DF_BIND_NOW +flag set. +Run-time relocation processing will be performed on demand. Copied: releng/12.1/tools/build/options/WITH_BIND_NOW (from r352752, stable/12/tools/build/options/WITH_BIND_NOW) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.1/tools/build/options/WITH_BIND_NOW Thu Sep 26 18:56:41 2019(r352769, copy of r352752, stable/12/tools/build/options/WITH_BIND_NOW) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Build all binaries with the +.Dv DF_BIND_NOW +flag set to indicate that the run-time loader should perform all relocation +processing at process startup rather than on demand. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352768 - in releng/12.1: gnu/usr.bin/binutils/as gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/kgdb kerberos5/to...
Author: emaste Date: Thu Sep 26 18:37:58 2019 New Revision: 352768 URL: https://svnweb.freebsd.org/changeset/base/352768 Log: MFS r352754: Add WITH_PIE knob to build Position Independent Executables MFC r344179: Add WITH_PIE knob to build Position Independent Executables Building binaries as PIE allows the executable itself to be loaded at a random address when ASLR is enabled (not just its shared libraries). With this change PIE objects have a .pieo extension and INTERNALLIB libraries libXXX_pie.a. MK_PIE is disabled for some kerberos5 tools, Clang, and Subversion, as they explicitly reference .a libraries in their Makefiles. These can be addressed on an individual basis later. MK_PIE is also disabled for rtld-elf because it is already position-independent using bespoke Makefile rules. Currently only dynamically linked binaries will be built as PIE. MFC r344181: Fix Makefile conditional after r344179 MFC r344182: Use make's :tl instead of checking "no" and "NO" MFC r344189: Fixup bsd.prog.mk after r344182 MFC r344211: wlandebug: disable PIE to fix build failure libifconfig is built as a static-only PRIVATELIB (and there is no _pie.a version) so disable PIE in libifconfig's consumer. r345489: Fix GNU objdump build under WITH_PIE Explicitly specified bare .a libraries need ${PIE_SUFFIX}. r345490: Apply WITH_PIE changes to other binutils components Followon to r345489, explicitly specified bare .a libraries need ${PIE_SUFFIX} (although these still built). r345778: Fix gdb/kgdb build under WITH_PIE Explicitly specified bare .a libraries need ${PIE_SUFFIX}. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Added: releng/12.1/tools/build/options/WITHOUT_PIE - copied unchanged from r352754, stable/12/tools/build/options/WITHOUT_PIE releng/12.1/tools/build/options/WITH_PIE - copied unchanged from r352754, stable/12/tools/build/options/WITH_PIE Modified: releng/12.1/gnu/usr.bin/binutils/as/Makefile releng/12.1/gnu/usr.bin/binutils/ld/Makefile releng/12.1/gnu/usr.bin/binutils/objcopy/Makefile releng/12.1/gnu/usr.bin/binutils/objdump/Makefile releng/12.1/gnu/usr.bin/gdb/gdb/Makefile releng/12.1/gnu/usr.bin/gdb/kgdb/Makefile releng/12.1/kerberos5/tools/asn1_compile/Makefile releng/12.1/kerberos5/tools/slc/Makefile releng/12.1/lib/clang/Makefile.inc releng/12.1/libexec/rtld-elf/Makefile releng/12.1/share/mk/bsd.lib.mk releng/12.1/share/mk/bsd.opts.mk releng/12.1/share/mk/bsd.prog.mk releng/12.1/share/mk/src.libnames.mk releng/12.1/stand/i386/Makefile.inc releng/12.1/usr.bin/clang/Makefile.inc releng/12.1/usr.bin/svn/Makefile.inc releng/12.1/usr.sbin/wlandebug/Makefile Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/gnu/usr.bin/binutils/as/Makefile == --- releng/12.1/gnu/usr.bin/binutils/as/MakefileThu Sep 26 18:36:52 2019(r352767) +++ releng/12.1/gnu/usr.bin/binutils/as/MakefileThu Sep 26 18:37:58 2019(r352768) @@ -95,9 +95,9 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-f NO_SHARED?=yes .endif -DPADD= ${GNURELTOP}/libbfd/libbfd.a -DPADD+=${GNURELTOP}/libiberty/libiberty.a -DPADD+=${GNURELTOP}/libopcodes/libopcodes.a +DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a LDADD= ${DPADD} .include Modified: releng/12.1/gnu/usr.bin/binutils/ld/Makefile == --- releng/12.1/gnu/usr.bin/binutils/ld/MakefileThu Sep 26 18:36:52 2019(r352767) +++ releng/12.1/gnu/usr.bin/binutils/ld/MakefileThu Sep 26 18:37:58 2019(r352768) @@ -51,8 +51,8 @@ CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd .if ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?= yes .endif -DPADD= ${GNURELTOP}/libbfd/libbfd.a -DPADD+=${GNURELTOP}/libiberty/libiberty.a +DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a LDADD= ${DPADD} CLEANDIRS+=ldscripts CLEANFILES+= ldemul-list.h stringify.sed Modified: releng/12.1/gnu/usr.bin/binutils/objcopy/Makefile == --- releng/12.1/gnu/usr.bin/binutils/objcopy/Makefile Thu Sep 26 18:36:52 2019(r352767) +++ releng/12.1/gnu/usr.bin/binutils/objcopy/Makefile Thu Sep 26 18:37:58 2019(r352768) @@ -9,9 +9,9 @@ SRCS= objcopy.c not-strip.c CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd -DPADD= ${GNURELTOP}/libbinutils/libbinutils.a -DPADD+=${GNURELTOP}/libbfd/libbfd.a -DPADD+=${GNURELTOP}/libiberty/libiberty.
svn commit: r352767 - releng/12.1/usr.sbin/bhyve
Author: markj Date: Thu Sep 26 18:36:52 2019 New Revision: 352767 URL: https://svnweb.freebsd.org/changeset/base/352767 Log: MFS r352720: Use separate descriptors in bhyve's stdio uart backend. Approved by: re (gjb) Modified: releng/12.1/usr.sbin/bhyve/uart_emul.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/usr.sbin/bhyve/uart_emul.c == --- releng/12.1/usr.sbin/bhyve/uart_emul.c Thu Sep 26 18:36:15 2019 (r352766) +++ releng/12.1/usr.sbin/bhyve/uart_emul.c Thu Sep 26 18:36:52 2019 (r352767) @@ -100,8 +100,8 @@ struct fifo { struct ttyfd { boolopened; - int fd; /* tty device file descriptor */ - struct termios tio_orig, tio_new;/* I/O Terminals */ + int rfd;/* fd for reading */ + int wfd;/* fd for writing, may be == rfd */ }; struct uart_softc { @@ -141,16 +141,15 @@ ttyclose(void) static void ttyopen(struct ttyfd *tf) { + struct termios orig, new; - tcgetattr(tf->fd, &tf->tio_orig); - - tf->tio_new = tf->tio_orig; - cfmakeraw(&tf->tio_new); - tf->tio_new.c_cflag |= CLOCAL; - tcsetattr(tf->fd, TCSANOW, &tf->tio_new); - - if (tf->fd == STDIN_FILENO) { - tio_stdio_orig = tf->tio_orig; + tcgetattr(tf->rfd, &orig); + new = orig; + cfmakeraw(&new); + new.c_cflag |= CLOCAL; + tcsetattr(tf->rfd, TCSANOW, &new); + if (uart_stdio) { + tio_stdio_orig = orig; atexit(ttyclose); } } @@ -160,7 +159,7 @@ ttyread(struct ttyfd *tf) { unsigned char rb; - if (read(tf->fd, &rb, 1) == 1) + if (read(tf->rfd, &rb, 1) == 1) return (rb); else return (-1); @@ -170,7 +169,7 @@ static void ttywrite(struct ttyfd *tf, unsigned char wb) { - (void)write(tf->fd, &wb, 1); + (void)write(tf->wfd, &wb, 1); } static void @@ -190,7 +189,7 @@ rxfifo_reset(struct uart_softc *sc, int size) * Flush any unread input from the tty buffer. */ while (1) { - nread = read(sc->tty.fd, flushbuf, sizeof(flushbuf)); + nread = read(sc->tty.rfd, flushbuf, sizeof(flushbuf)); if (nread != sizeof(flushbuf)) break; } @@ -277,7 +276,7 @@ uart_opentty(struct uart_softc *sc) { ttyopen(&sc->tty); - sc->mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); + sc->mev = mevent_add(sc->tty.rfd, EVF_READ, uart_drain, sc); assert(sc->mev != NULL); } @@ -374,7 +373,7 @@ uart_drain(int fd, enum ev_type ev, void *arg) sc = arg; - assert(fd == sc->tty.fd); + assert(fd == sc->tty.rfd); assert(ev == EVF_READ); /* @@ -634,68 +633,79 @@ uart_init(uart_intr_func_t intr_assert, uart_intr_func } static int -uart_tty_backend(struct uart_softc *sc, const char *opts) +uart_stdio_backend(struct uart_softc *sc) { - int fd; - int retval; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif - retval = -1; + if (uart_stdio) + return (-1); - fd = open(opts, O_RDWR | O_NONBLOCK); - if (fd > 0 && isatty(fd)) { - sc->tty.fd = fd; - sc->tty.opened = true; - retval = 0; - } + sc->tty.rfd = STDIN_FILENO; + sc->tty.wfd = STDOUT_FILENO; + sc->tty.opened = true; - return (retval); + if (fcntl(sc->tty.rfd, F_SETFL, O_NONBLOCK) != 0) + return (-1); + if (fcntl(sc->tty.wfd, F_SETFL, O_NONBLOCK) != 0) + return (-1); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ); + if (caph_rights_limit(sc->tty.rfd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (caph_ioctls_limit(sc->tty.rfd, cmds, nitems(cmds)) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + uart_stdio = true; + + return (0); } -int -uart_set_backend(struct uart_softc *sc, const char *opts) +static int +uart_tty_backend(struct uart_softc *sc, const char *opts) { - int retval; #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; #endif + int fd; - retval = -1; + fd = open(opts, O_RDWR | O_NONBLOCK); + if (fd < 0 || !isatty(fd)) + return (-1); + sc->tty.rfd = sc->tty.wfd = fd; + sc->tty.opened = true; + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (caph_right
svn commit: r352766 - releng/12.1/sys/dev/jme
Author: markj Date: Thu Sep 26 18:36:15 2019 New Revision: 352766 URL: https://svnweb.freebsd.org/changeset/base/352766 Log: MFS r352749: Revert r316820. PR: 233952 Approved by: re (gjb) Modified: releng/12.1/sys/dev/jme/if_jme.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/dev/jme/if_jme.c == --- releng/12.1/sys/dev/jme/if_jme.cThu Sep 26 18:35:26 2019 (r352765) +++ releng/12.1/sys/dev/jme/if_jme.cThu Sep 26 18:36:15 2019 (r352766) @@ -559,7 +559,7 @@ jme_map_intr_vector(struct jme_softc *sc) bzero(map, sizeof(map)); /* Map Tx interrupts source to MSI/MSIX vector 2. */ - map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] = MSINUM_INTR_SOURCE(2, N_INTR_TXQ0_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ1_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ1_COMP); @@ -581,37 +581,37 @@ jme_map_intr_vector(struct jme_softc *sc) MSINUM_INTR_SOURCE(2, N_INTR_TXQ_COAL_TO); /* Map Rx interrupts source to MSI/MSIX vector 1. */ - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL_TO); /* Map all other interrupts source to MSI/MSIX vector 0. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352765 - releng/12.1/sbin/ping6
Author: markj Date: Thu Sep 26 18:35:26 2019 New Revision: 352765 URL: https://svnweb.freebsd.org/changeset/base/352765 Log: MFS r352750: ping6: Use caph_rights_limit(3) for STDIN_FILENO Approved by: re (gjb) Modified: releng/12.1/sbin/ping6/ping6.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sbin/ping6/ping6.c == --- releng/12.1/sbin/ping6/ping6.c Thu Sep 26 18:25:54 2019 (r352764) +++ releng/12.1/sbin/ping6/ping6.c Thu Sep 26 18:35:26 2019 (r352765) @@ -1028,8 +1028,8 @@ main(int argc, char *argv[]) err(1, "caph_enter_casper"); cap_rights_init(&rights_stdin); - if (cap_rights_limit(STDIN_FILENO, &rights_stdin) < 0) - err(1, "cap_rights_limit stdin"); + if (caph_rights_limit(STDIN_FILENO, &rights_stdin) < 0) + err(1, "caph_rights_limit stdin"); if (caph_limit_stdout() < 0) err(1, "caph_limit_stdout"); if (caph_limit_stderr() < 0) @@ -1037,10 +1037,10 @@ main(int argc, char *argv[]) cap_rights_init(&rights_srecv, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights_srecv) < 0) - err(1, "cap_rights_limit srecv"); + err(1, "caph_rights_limit srecv"); cap_rights_init(&rights_ssend, CAP_SEND, CAP_SETSOCKOPT); if (caph_rights_limit(ssend, &rights_ssend) < 0) - err(1, "cap_rights_limit ssend"); + err(1, "caph_rights_limit ssend"); #if defined(SO_SNDBUF) && defined(SO_RCVBUF) if (sockbufsize) { @@ -1092,10 +1092,10 @@ main(int argc, char *argv[]) cap_rights_clear(&rights_srecv, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights_srecv) < 0) - err(1, "cap_rights_limit srecv setsockopt"); + err(1, "caph_rights_limit srecv setsockopt"); cap_rights_clear(&rights_ssend, CAP_SETSOCKOPT); if (caph_rights_limit(ssend, &rights_ssend) < 0) - err(1, "cap_rights_limit ssend setsockopt"); + err(1, "caph_rights_limit ssend setsockopt"); printf("PING6(%lu=40+8+%lu bytes) ", (unsigned long)(40 + pingerlen()), (unsigned long)(pingerlen() - 8)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss
On Thu, Sep 26, 2019 at 03:32:28PM +, David Bright wrote: > Author: dab > Date: Thu Sep 26 15:32:28 2019 > New Revision: 352747 > URL: https://svnweb.freebsd.org/changeset/base/352747 > > Log: > Add an shm_rename syscall > Modified: head/sys/kern/uipc_shm.c > == > --- head/sys/kern/uipc_shm.c Thu Sep 26 15:18:57 2019(r352746) > +++ head/sys/kern/uipc_shm.c Thu Sep 26 15:32:28 2019(r352747) > @@ -33,8 +33,9 @@ > > /* > * Support for shared swap-backed anonymous memory objects via > - * shm_open(2) and shm_unlink(2). While most of the implementation is > - * here, vm_mmap.c contains mapping logic changes. > + * shm_open(2), shm_rename(2), and shm_unlink(2). > + * While most of the implementation is here, vm_mmap.c contains > + * mapping logic changes. > * > * posixshmcontrol(1) allows users to inspect the state of the memory > * objects. Per-uid swap resource limit controls total amount of > @@ -945,6 +946,158 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_ar > free(path, M_TEMP); > > return (error); > +} > + > +int > +sys_shm_rename(struct thread *td, struct shm_rename_args *uap) > +{ > + char *path_from = NULL, *path_to = NULL; > + Fnv32_t fnv_from, fnv_to; > + struct shmfd *fd_from; > + struct shmfd *fd_to; > + int error; > + int flags; > + > + flags = uap->flags; > + > + /* > + * Make sure the user passed only valid flags. > + * If you add a new flag, please add a new term here. > + */ > + if ((flags & ~( > + SHM_RENAME_NOREPLACE | > + SHM_RENAME_EXCHANGE > + )) != 0) { > + error = EINVAL; > + goto out; > + } > + > + /* > + * EXCHANGE and NOREPLACE don't quite make sense together. Let's > + * force the user to choose one or the other. > + */ > + if ((flags & SHM_RENAME_NOREPLACE) != 0 && > + (flags & SHM_RENAME_EXCHANGE) != 0) { > + error = EINVAL; > + goto out; > + } > + > + /* > + * Malloc zone M_SHMFD, since this path may end up freed later from > + * M_SHMFD if we end up doing an insert. > + */ I do not quite get the comment. > + path_from = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); > + error = copyinstr(uap->path_from, path_from, MAXPATHLEN, NULL); > + if (error) > + goto out; > + > + path_to = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); > + error = copyinstr(uap->path_to, path_to, MAXPATHLEN, NULL); > + if (error) > + goto out; > + > + /* Rename with from/to equal is a no-op */ > + if (strncmp(path_from, path_to, MAXPATHLEN) == 0) > + goto out; Is this needed for correctness, or just a micro-optimization ? We require that all shm names started with '/'. I do not see a check for that in your code, so it seems that you allow to create such entries. Also look at the special handling for jailed callers in kern_shm_open(). > + > + fnv_from = fnv_32_str(path_from, FNV1_32_INIT); > + fnv_to = fnv_32_str(path_to, FNV1_32_INIT); > + > + sx_xlock(&shm_dict_lock); > + > + fd_from = shm_lookup(path_from, fnv_from); > + if (fd_from == NULL) { > + sx_xunlock(&shm_dict_lock); > + error = ENOENT; > + goto out; I think you can put an out_locked label just before final unlock and jump to it instead of repeating sx_xunlock(). > + } > + > + fd_to = shm_lookup(path_to, fnv_to); You added truss support, but not ktrace. I think it would be useful to report looked up names, see the use of KTR_NAMEI tracepoints in kern_shm_open(). > + if ((flags & SHM_RENAME_NOREPLACE) != 0 && fd_to != NULL) { > + sx_xunlock(&shm_dict_lock); > + error = EEXIST; > + goto out; > + } > + > + /* > + * Unconditionally prevents shm_remove from invalidating the 'from' > + * shm's state. > + */ > + shm_hold(fd_from); > + error = shm_remove(path_from, fnv_from, td->td_ucred); > + > + /* > + * One of my assumptions failed if ENOENT (e.g. locking didn't > + * protect us) > + */ > + KASSERT(error != ENOENT, ("Our shm disappeared during shm_rename: %s", > + path_from)); > + if (error) { > + shm_drop(fd_from); > + sx_xunlock(&shm_dict_lock); > + goto out; > + } > + > + /* > + * If we are exchanging, we need to ensure the shm_remove below > + * doesn't invalidate the dest shm's state. > + */ > + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) > + shm_hold(fd_to); > + > + /* > + * NOTE: if path_to is not already in the hash, c'est la vie; > + * it simply means we have nothing already at path_to to unlink. > + * That is the ENOENT case. > + * > + * If we somehow don't have access to unlink this guy,
Re: svn commit: r352707 - in head/sys: conf kern net sys
Kinda my point exactly... Warner On Thu, Sep 26, 2019 at 11:25 AM Ryan Stone wrote: > We also shouldn't have ifdef's that change the size of a kernel > structure that's part of the KBI. Isn't struct epoch_tracker part of > the KBI? > > On Thu, Sep 26, 2019 at 12:46 PM Warner Losh wrote: > > > > But we shouldn't be including opt_foo.h files in sys/*.h files. That's > the root cause of trouble here. > > > > Warner > > > > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising > wrote: > >> > >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: > >> > Kyle Evans wrote: > >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: > >> >>> This breaks building the drm-kmod ports, as the build cannot find > >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > >> >>> exact same way): > >> >>> > >> >>> --- linux_anon_inodes.o --- > >> >>> cc -O2 -pipe -fno-strict-aliasing -include > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > >> >>> -nostdinc > >> >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > >> >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > >> >>> -I/usr/src/sys/contrib/ck/include -fno-common > -fno-omit-frame-pointer > >> >>> -mno-omit-leaf-frame-pointer > >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o > -mcmodel=kernel > >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float > >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv > -fstack-protector > >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > >> >>> -Wmissing-include-dirs -fdiagnostics-show-option > -Wno-unknown-pragmas > >> >>> -Wno-error-tautological-compare -Wno-error-empty-body > >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function > >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value > >> >>> -Wno-address-of-packed-member -Wno-format-zero-length > -Wno-pointer-arith > >> >>>-mno-aes -mno-avx -std=iso9899:1999 -c > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > >> >>> -o linux_anon_inodes.o > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >> >>> In file included from > >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >> >>> In file included from /usr/src/sys/net/if_var.h:83: > >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >> >>> #include "opt_epoch.h" > >> >>> ^ > >> >>> --- linux_anon_inodefs.o --- > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >> >>> In file included from > >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >> >>> In file included from /usr/src/sys/net/if_var.h:83: > >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >> >>> #include "opt_epoch.h" > >> >>> ^ > >> >>> --- linux_anon_inodes.o --- > >> >>> 1 error generated. > >> >>> *** [linux_anon_inodes.o] Error code 1 > >> >>> > >> >>> make[2]: stopped in > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > >> >>> --- linux_anon_inodefs.o --- > >> >>> 1 error generated. > >> >>> *** [linux_anon_inodefs.o] Error code 1 > >> >>> > >> >>> Interestingly enough, does not happen when drm-current-kmod is > built as > >> >>> part of bui
Re: svn commit: r352707 - in head/sys: conf kern net sys
We also shouldn't have ifdef's that change the size of a kernel structure that's part of the KBI. Isn't struct epoch_tracker part of the KBI? On Thu, Sep 26, 2019 at 12:46 PM Warner Losh wrote: > > But we shouldn't be including opt_foo.h files in sys/*.h files. That's the > root cause of trouble here. > > Warner > > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising wrote: >> >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: >> > Kyle Evans wrote: >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: >> >>> This breaks building the drm-kmod ports, as the build cannot find >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the >> >>> exact same way): >> >>> >> >>> --- linux_anon_inodes.o --- >> >>> cc -O2 -pipe -fno-strict-aliasing -include >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE >> >>> -nostdinc >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include >> >>> >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys >> >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer >> >>> -mno-omit-leaf-frame-pointer >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ >> >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas >> >>> -Wno-error-tautological-compare -Wno-error-empty-body >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value >> >>> -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith >> >>>-mno-aes -mno-avx -std=iso9899:1999 -c >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c >> >>> -o linux_anon_inodes.o >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >> >>> In file included from >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> >>> In file included from /usr/src/sys/net/if_var.h:83: >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >> >>> #include "opt_epoch.h" >> >>> ^ >> >>> --- linux_anon_inodefs.o --- >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >> >>> In file included from >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> >>> In file included from /usr/src/sys/net/if_var.h:83: >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >> >>> #include "opt_epoch.h" >> >>> ^ >> >>> --- linux_anon_inodes.o --- >> >>> 1 error generated. >> >>> *** [linux_anon_inodes.o] Error code 1 >> >>> >> >>> make[2]: stopped in >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi >> >>> --- linux_anon_inodefs.o --- >> >>> 1 error generated. >> >>> *** [linux_anon_inodefs.o] Error code 1 >> >>> >> >>> Interestingly enough, does not happen when drm-current-kmod is built as >> >>> part of buildkernel (using an existing installed package with SOURCE on). >> >>> >> >> >> >> FWIW, johalun noticed this yesterday and addressed it here: >> >> https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d >> >> >> > Ah, of course I would miss these commi
Re: svn commit: r338888 - head/sbin/devd
On 22/09/18 12:32, Warner Losh wrote: > Author: imp > Date: Sat Sep 22 15:32:53 2018 > New Revision: 33 > URL: https://svnweb.freebsd.org/changeset/base/33 > > Log: > We don't need shell protection for when we're expanding matches. > Don't add it. This should fix when we do regepx matches against > variables we've set and fix wifi bring up. > > PR: 231441 > Approved by: re@ (kib) > Differential Revision: https://reviews.freebsd.org/D17267 Warner, We are seeing unexpected $ on /var/log/messages when matches are replaced inside shell commands between single quotes. With action set as follow: action "logger -t kern.notice 'device-name=$device-name start'"; We see a log entry like this: Sep 26 13:56:06 x230 kern.notice[27604]: device-name=$rtwn0 start Reverting this change made it to log properly: Sep 26 13:56:06 x230 kern.notice[27604]: device-name=rtwn0 start There is an open bug already: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240411 -- Renato Botelho ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352762 - stable/12/sys/arm/freescale/imx
Author: ian Date: Thu Sep 26 17:07:30 2019 New Revision: 352762 URL: https://svnweb.freebsd.org/changeset/base/352762 Log: MFC r352363: Apply a runtime patch to the FDT data for imx6 to fix iomuxc problems. The latest imported FDT data defines a node for an iomuxc-gpr device, which we don't support (or need, right now) in addition to the usual iomuxc device. Unfortunately, the dts improperly assigns overlapping ranges of mmio space to both devices. The -gpr device is also a syscon and simple_mfd device. At runtime the simple_mfd driver attaches for the iomuxc-gpr node, then when the real iomuxc driver comes along later, it fails to attach because it tries to allocate its register space, and it's already partially in use by the bogus instance of simple_mfd. This change works around the problem by simply disabling the node for the iomuxc-gpr device, since we don't need it for anything. Modified: stable/12/sys/arm/freescale/imx/imx6_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/freescale/imx/imx6_machdep.c == --- stable/12/sys/arm/freescale/imx/imx6_machdep.c Thu Sep 26 16:51:51 2019(r352761) +++ stable/12/sys/arm/freescale/imx/imx6_machdep.c Thu Sep 26 17:07:30 2019(r352762) @@ -148,12 +148,43 @@ fix_fdt_interrupt_data(void) OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref)); } +static void +fix_fdt_iomuxc_data(void) +{ + phandle_t node; + + /* +* The linux dts defines two nodes with the same mmio address range, +* iomuxc-gpr and the regular iomuxc. The -grp node is a simple_mfd and +* a syscon, but it only has access to a small subset of the iomuxc +* registers, so it can't serve as the accessor for the iomuxc driver's +* register IO. But right now, the simple_mfd driver attaches first, +* preventing the real iomuxc driver from allocating its mmio register +* range because it partially overlaps with the -gpr range. +* +* For now, by far the easiest thing to do to keep imx6 working is to +* just disable the iomuxc-gpr node because we don't have a driver for +* it anyway, we just need to prevent attachment of simple_mfd. +* +* If we ever write a -gpr driver, this code should probably switch to +* modifying the reg property so that the range covers all the iomuxc +* regs, then the -gpr driver can be a regular syscon driver that iomuxc +* uses for register access. +*/ + node = OF_finddevice("/soc/aips-bus@200/iomuxc-gpr@20e"); + if (node != -1) + OF_setprop(node, "status", "disabled", sizeof("disabled")); +} + static int imx6_attach(platform_t plat) { /* Fix soc interrupt-parent property. */ fix_fdt_interrupt_data(); + + /* Fix iomuxc-gpr and iomuxc nodes both using the same mmio range. */ + fix_fdt_iomuxc_data(); /* Inform the MPCore timer driver that its clock is variable. */ arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352761 - in releng/12.1/sys: dev/mpr dev/mpr/mpi dev/mps modules powerpc/conf
Author: imp Date: Thu Sep 26 16:51:51 2019 New Revision: 352761 URL: https://svnweb.freebsd.org/changeset/base/352761 Log: Merge from stable/12 r352735 and r352741 Merge all the stability fixes for the mpr and mps drivers. This fixes a number of different panics. Unfortunately, mps now requires atomic_swap_64 to work properly, so it has been disabled on 32-bit powerpc and mips. The impact should be negligible, however, since this device is difficult to attach to those platforms. Approved by: re@ (glen) Relnotes: YES (for ppc32 removal) Modified: releng/12.1/sys/dev/mpr/mpi/mpi2.h releng/12.1/sys/dev/mpr/mpi/mpi2_cnfg.h releng/12.1/sys/dev/mpr/mpi/mpi2_hbd.h releng/12.1/sys/dev/mpr/mpi/mpi2_history.txt releng/12.1/sys/dev/mpr/mpi/mpi2_init.h releng/12.1/sys/dev/mpr/mpi/mpi2_ioc.h releng/12.1/sys/dev/mpr/mpi/mpi2_pci.h releng/12.1/sys/dev/mpr/mpi/mpi2_ra.h releng/12.1/sys/dev/mpr/mpi/mpi2_raid.h releng/12.1/sys/dev/mpr/mpi/mpi2_sas.h releng/12.1/sys/dev/mpr/mpi/mpi2_targ.h releng/12.1/sys/dev/mpr/mpi/mpi2_tool.h releng/12.1/sys/dev/mpr/mpi/mpi2_type.h releng/12.1/sys/dev/mpr/mpr.c releng/12.1/sys/dev/mpr/mpr_config.c releng/12.1/sys/dev/mpr/mpr_ioctl.h releng/12.1/sys/dev/mpr/mpr_mapping.c releng/12.1/sys/dev/mpr/mpr_mapping.h releng/12.1/sys/dev/mpr/mpr_pci.c releng/12.1/sys/dev/mpr/mpr_sas.c releng/12.1/sys/dev/mpr/mpr_sas.h releng/12.1/sys/dev/mpr/mpr_sas_lsi.c releng/12.1/sys/dev/mpr/mpr_table.c releng/12.1/sys/dev/mpr/mpr_user.c releng/12.1/sys/dev/mpr/mprvar.h releng/12.1/sys/dev/mps/mps.c releng/12.1/sys/dev/mps/mps_sas.c releng/12.1/sys/dev/mps/mps_sas_lsi.c releng/12.1/sys/dev/mps/mps_table.c releng/12.1/sys/dev/mps/mps_user.c releng/12.1/sys/dev/mps/mpsvar.h releng/12.1/sys/modules/Makefile releng/12.1/sys/powerpc/conf/GENERIC Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/dev/mpr/mpi/mpi2.h == --- releng/12.1/sys/dev/mpr/mpi/mpi2.h Thu Sep 26 16:39:33 2019 (r352760) +++ releng/12.1/sys/dev/mpr/mpi/mpi2.h Thu Sep 26 16:51:51 2019 (r352761) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,15 +25,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * * Name: mpi2.h @@ -44,7 +40,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.48 + * mpi2.h Version: 02.00.52 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 *prefix are for use only on MPI v2.5 products, and must not be used @@ -153,6 +149,11 @@ * 09-02-16 02.00.46 Bumped MPI2_HEADER_VERSION_UNIT. * 11-23-16 02.00.47 Bumped MPI2_HEADER_VERSION_UNIT. * 02-03-17 02.00.48 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-17 02.00.49 Bumped MPI2_HEADER_VERSION_UNIT. + * 09-29-17 02.00.50 Bumped MPI2_HEADER_VERSION_UNIT. + * 07-22-18 02.00.51 Added SECURE_BOOT define. + * Bumped MPI2_HEADER_VERSION_UNIT + * 08-15-18 02.00.52 Bumped MPI2_HEADER_VERSION_UNIT. * -- */ @@ -196,7 +197,7 @@ /* Unit and Dev versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT(0x30) +#define MPI2_HEADER_VERSION_UNIT(0x34) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -297,6 +298,8 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS * Defines for the HostDiagnostic register */ #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x0008) + +#define MPI26_DIAG_SECURE_BOOT (0x8000) #define MPI2_DIAG_SBR_RELOAD(0x2000) Modified: releng/12.1/sys/dev/mpr/mpi/mpi2_cnfg.h == --- releng/12.1/sys/dev/mpr/mpi/mpi2_cnfg.h Thu Sep 26 16:39:33 2019 (r352760) +++ releng/12.1/sys/dev/mpr/mpi/mpi2_cnfg.h Thu Sep 26 16:51:51 2019 (r352761) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved
Re: svn commit: r352707 - in head/sys: conf kern net sys
But we shouldn't be including opt_foo.h files in sys/*.h files. That's the root cause of trouble here. Warner On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising wrote: > On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: > > Kyle Evans wrote: > >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: > >>> This breaks building the drm-kmod ports, as the build cannot find > >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > >>> exact same way): > >>> > >>> --- linux_anon_inodes.o --- > >>> cc -O2 -pipe -fno-strict-aliasing -include > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > >>> -nostdinc > >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer > >>> -mno-omit-leaf-frame-pointer > >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel > >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float > >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv > -fstack-protector > >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > >>> -Wno-error-tautological-compare -Wno-error-empty-body > >>> -Wno-error-parentheses-equality -Wno-error-unused-function > >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value > >>> -Wno-address-of-packed-member -Wno-format-zero-length > -Wno-pointer-arith > >>>-mno-aes -mno-avx -std=iso9899:1999 -c > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > >>> -o linux_anon_inodes.o > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >>> In file included from > >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >>> In file included from /usr/src/sys/net/if_var.h:83: > >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >>> #include "opt_epoch.h" > >>> ^ > >>> --- linux_anon_inodefs.o --- > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >>> In file included from > >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >>> In file included from /usr/src/sys/net/if_var.h:83: > >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >>> #include "opt_epoch.h" > >>> ^ > >>> --- linux_anon_inodes.o --- > >>> 1 error generated. > >>> *** [linux_anon_inodes.o] Error code 1 > >>> > >>> make[2]: stopped in > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > >>> --- linux_anon_inodefs.o --- > >>> 1 error generated. > >>> *** [linux_anon_inodefs.o] Error code 1 > >>> > >>> Interestingly enough, does not happen when drm-current-kmod is built as > >>> part of buildkernel (using an existing installed package with SOURCE > on). > >>> > >> > >> FWIW, johalun noticed this yesterday and addressed it here: > >> > https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d > >> > > Ah, of course I would miss these commits in the kms-drm repo, > > considering that I watch them roll in. Will wait for the updated > > snapshots in ports. > > > > I'll get to updating the ports as soon as I can. > Regards > -- > Niclas Zeising > ___ > freebsd-..
svn commit: r352760 - stable/12/sys/sys
Author: emaste Date: Thu Sep 26 16:39:33 2019 New Revision: 352760 URL: https://svnweb.freebsd.org/changeset/base/352760 Log: MFC r352551: elf_common: add ELF note names r348628 added a definition of NT_GNU_BUILD_ID. Some software (Valgrind) also expects a #define for the note name (ELF_NOTE_GNU) in the case that NT_GNU_BUILD_ID is defined. PR: 239669 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/sys/elf_common.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/elf_common.h == --- stable/12/sys/sys/elf_common.h Thu Sep 26 16:34:43 2019 (r352759) +++ stable/12/sys/sys/elf_common.h Thu Sep 26 16:39:33 2019 (r352760) @@ -764,6 +764,12 @@ typedef struct { #defineLL_DELAY_LOAD 0x10 #defineLL_DELTA0x20 +/* Note section names */ +#defineELF_NOTE_FREEBSD"FreeBSD" +#defineELF_NOTE_NETBSD "NetBSD" +#defineELF_NOTE_SOLARIS"SUNW Solaris" +#defineELF_NOTE_GNU"GNU" + /* Values for n_type used in executables. */ #defineNT_FREEBSD_ABI_TAG 1 #defineNT_FREEBSD_NOINIT_TAG 2 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352759 - stable/12/usr.sbin/freebsd-update
Author: grembo (ports committer) Date: Thu Sep 26 16:34:43 2019 New Revision: 352759 URL: https://svnweb.freebsd.org/changeset/base/352759 Log: MFC r352513, r352514, r352662: As suggested by koobs, MFC recent freebsd-update changes to have a consistent user experience on all supported versions. r352513: freebsd-update.8: appease igor igor follows American style guides in the belief that abbreviations i.e. and e.g. are always followed by a comma. Make that change now so that future updates to freebsd-update.8 do not complain about this. r352514: freebsd-update: make usage output consistent Drop trailing . which appeared only on description of IDS. r352662: freebsd-update: Add `updatesready' and `showconfig' commands `freebsd-update updatesready' can be used to check if there are any pending fetched updates that can be installed. `freebsd-update showconfig' writes freebsd-update's configuration to stdout. This also changes the exit code of `freebsd-update install' to 2 in case there are no updates pending to be installed and there wasn't a fetch phase in the same invocation. This allows scripts to tell apart these error conditions without breaking existing jail managers. PR: 240757, 240177, 229346 Reviewed by: manpages (bcr), secteam (emaste), yuripv Differential Revision:https://reviews.freebsd.org/D21473 Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8 stable/12/usr.sbin/freebsd-update/freebsd-update.sh Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8 == --- stable/12/usr.sbin/freebsd-update/freebsd-update.8 Thu Sep 26 16:33:20 2019(r352758) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.8 Thu Sep 26 16:34:43 2019(r352759) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2017 +.Dd September 24, 2019 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -95,7 +95,7 @@ Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release (e.g. 11.2-RELEASE) to which +Specify the new release (e.g., 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server @@ -155,13 +155,24 @@ Note that this command may require up to 500 MB of spa depending on which components of the .Fx base system are installed. +.It Cm updatesready +Check if there are fetched updates ready to install. +Returns exit code 2 if there are no updates to install. .It Cm install Install the most recently fetched updates or upgrade. +Returns exit code 2 if there are no updates to install +and the +.Cm fetch +command wasn't passed as an earlier argument in the same +invocation. .It Cm rollback Uninstall the most recently installed updates. .It Cm IDS Compare the system against a "known good" index of the installed release. +.It Cm showconfig +Show configuration options after parsing conffile and command +line options. .El .Sh TIPS .Bl -bullet Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.sh == --- stable/12/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 26 16:33:20 2019(r352758) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 26 16:34:43 2019(r352759) @@ -62,9 +62,11 @@ Commands: cron -- Sleep rand(3600) seconds, fetch updates, and send an email if updates were found upgrade -- Fetch upgrades to FreeBSD version specified via -r option + updatesready -- Check if there are fetched updates ready to install install -- Install downloaded updates or upgrades rollback -- Uninstall most recently installed updates - IDS -- Compare the system against an index of "known good" files. + IDS -- Compare the system against an index of "known good" files + showconfig -- Show configuration EOF exit 0 } @@ -503,7 +505,8 @@ parse_cmdline () { ;; # Commands - cron | fetch | upgrade | install | rollback | IDS) + cron | fetch | upgrade | updatesready | install | rollback |\ + IDS | showconfig) COMMANDS="${COMMANDS} $1" ;; @@ -827,7 +830,7 @@ install_check_params () { echo "No updates are available to install." if [ $ISFETCHED -eq 0 ]; then echo "Run '$0 fetch' first." - exit 1 + exit 2 fi exit 0 fi @@ -,6 +3336,21 @@ cmd_upgrade () { upgrade_run || exit 1 } +# Check if there are fetched updates ready to install +cmd_updatesready () { + # Construct a unique name from ${BASEDIR} + BDHASH=`echo ${BASEDIR} | sha256 -q` + + # Check
svn commit: r352758 - stable/11/usr.sbin/freebsd-update
Author: grembo (ports committer) Date: Thu Sep 26 16:33:20 2019 New Revision: 352758 URL: https://svnweb.freebsd.org/changeset/base/352758 Log: MFC r352513, r352514, r352662: As suggested by koobs, MFC recent freebsd-update changes to have a consistent user experience on all supported versions. r352513: freebsd-update.8: appease igor igor follows American style guides in the belief that abbreviations i.e. and e.g. are always followed by a comma. Make that change now so that future updates to freebsd-update.8 do not complain about this. r352514: freebsd-update: make usage output consistent Drop trailing . which appeared only on description of IDS. r352662: freebsd-update: Add `updatesready' and `showconfig' commands `freebsd-update updatesready' can be used to check if there are any pending fetched updates that can be installed. `freebsd-update showconfig' writes freebsd-update's configuration to stdout. This also changes the exit code of `freebsd-update install' to 2 in case there are no updates pending to be installed and there wasn't a fetch phase in the same invocation. This allows scripts to tell apart these error conditions without breaking existing jail managers. PR: 240757, 240177, 229346 Reviewed by: manpages (bcr), secteam (emaste), yuripv Differential Revision:https://reviews.freebsd.org/D21473 Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8 stable/11/usr.sbin/freebsd-update/freebsd-update.sh Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8 == --- stable/11/usr.sbin/freebsd-update/freebsd-update.8 Thu Sep 26 16:19:22 2019(r352757) +++ stable/11/usr.sbin/freebsd-update/freebsd-update.8 Thu Sep 26 16:33:20 2019(r352758) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2017 +.Dd September 24, 2019 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -95,7 +95,7 @@ Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release (e.g. 11.2-RELEASE) to which +Specify the new release (e.g., 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server @@ -155,13 +155,24 @@ Note that this command may require up to 500 MB of spa depending on which components of the .Fx base system are installed. +.It Cm updatesready +Check if there are fetched updates ready to install. +Returns exit code 2 if there are no updates to install. .It Cm install Install the most recently fetched updates or upgrade. +Returns exit code 2 if there are no updates to install +and the +.Cm fetch +command wasn't passed as an earlier argument in the same +invocation. .It Cm rollback Uninstall the most recently installed updates. .It Cm IDS Compare the system against a "known good" index of the installed release. +.It Cm showconfig +Show configuration options after parsing conffile and command +line options. .El .Sh TIPS .Bl -bullet Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.sh == --- stable/11/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 26 16:19:22 2019(r352757) +++ stable/11/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 26 16:33:20 2019(r352758) @@ -62,9 +62,11 @@ Commands: cron -- Sleep rand(3600) seconds, fetch updates, and send an email if updates were found upgrade -- Fetch upgrades to FreeBSD version specified via -r option + updatesready -- Check if there are fetched updates ready to install install -- Install downloaded updates or upgrades rollback -- Uninstall most recently installed updates - IDS -- Compare the system against an index of "known good" files. + IDS -- Compare the system against an index of "known good" files + showconfig -- Show configuration EOF exit 0 } @@ -503,7 +505,8 @@ parse_cmdline () { ;; # Commands - cron | fetch | upgrade | install | rollback | IDS) + cron | fetch | upgrade | updatesready | install | rollback |\ + IDS | showconfig) COMMANDS="${COMMANDS} $1" ;; @@ -827,7 +830,7 @@ install_check_params () { echo "No updates are available to install." if [ $ISFETCHED -eq 0 ]; then echo "Run '$0 fetch' first." - exit 1 + exit 2 fi exit 0 fi @@ -,6 +3336,21 @@ cmd_upgrade () { upgrade_run || exit 1 } +# Check if there are fetched updates ready to install +cmd_updatesready () { + # Construct a unique name from ${BASEDIR} + BDHASH=`echo ${BASEDIR} | sha256 -q` + + # Check
svn commit: r352757 - in head: lib/libc/sys lib/libregex/tests stand/lua tests/sys/kern
Author: kevans Date: Thu Sep 26 16:19:22 2019 New Revision: 352757 URL: https://svnweb.freebsd.org/changeset/base/352757 Log: Further normalize copyright notices - s/C/c/ where I've been inconsistent about it - +SPDX tags - Remove "All rights reserved" where possible Requested by: rgrimes (all rights reserved) Modified: head/lib/libc/sys/shm_open.c head/lib/libregex/tests/libregex_test.sh head/stand/lua/config.lua head/stand/lua/menu.lua head/stand/lua/password.lua head/tests/sys/kern/memfd_test.c Modified: head/lib/libc/sys/shm_open.c == --- head/lib/libc/sys/shm_open.cThu Sep 26 16:13:17 2019 (r352756) +++ head/lib/libc/sys/shm_open.cThu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libregex/tests/libregex_test.sh == --- head/lib/libregex/tests/libregex_test.shThu Sep 26 16:13:17 2019 (r352756) +++ head/lib/libregex/tests/libregex_test.shThu Sep 26 16:19:22 2019 (r352757) @@ -1,6 +1,7 @@ # +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# # Copyright (c) 2017 Kyle Evans -# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/stand/lua/config.lua == --- head/stand/lua/config.lua Thu Sep 26 16:13:17 2019(r352756) +++ head/stand/lua/config.lua Thu Sep 26 16:19:22 2019(r352757) @@ -2,7 +2,7 @@ -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright (c) 2015 Pedro Souza --- Copyright (C) 2018 Kyle Evans +-- Copyright (c) 2018 Kyle Evans -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without Modified: head/stand/lua/menu.lua == --- head/stand/lua/menu.lua Thu Sep 26 16:13:17 2019(r352756) +++ head/stand/lua/menu.lua Thu Sep 26 16:19:22 2019(r352757) @@ -2,7 +2,7 @@ -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright (c) 2015 Pedro Souza --- Copyright (C) 2018 Kyle Evans +-- Copyright (c) 2018 Kyle Evans -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without Modified: head/stand/lua/password.lua == --- head/stand/lua/password.lua Thu Sep 26 16:13:17 2019(r352756) +++ head/stand/lua/password.lua Thu Sep 26 16:19:22 2019(r352757) @@ -2,7 +2,7 @@ -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright (c) 2015 Pedro Souza --- Copyright (C) 2018 Kyle Evans +-- Copyright (c) 2018 Kyle Evans -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without Modified: head/tests/sys/kern/memfd_test.c == --- head/tests/sys/kern/memfd_test.cThu Sep 26 16:13:17 2019 (r352756) +++ head/tests/sys/kern/memfd_test.cThu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352756 - head/lib/libc/sys
Author: dab Date: Thu Sep 26 16:13:17 2019 New Revision: 352756 URL: https://svnweb.freebsd.org/changeset/base/352756 Log: Correct mistake in MLINKS introduced in r352747 Messed up a merge conflict resolution and didn't catch that before commit. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc == --- head/lib/libc/sys/Makefile.inc Thu Sep 26 16:09:28 2019 (r352755) +++ head/lib/libc/sys/Makefile.inc Thu Sep 26 16:13:17 2019 (r352756) @@ -478,7 +478,7 @@ MLINKS+=setuid.2 setegid.2 \ MLINKS+=shmat.2 shmdt.2 MLINKS+=shm_open.2 memfd_create.3 \ shm_open.2 shm_unlink.2 \ - shm_rename.2 + shm_open.2 shm_rename.2 MLINKS+=sigwaitinfo.2 sigtimedwait.2 MLINKS+=stat.2 fstat.2 \ stat.2 fstatat.2 \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352755 - stable/12/share/man/man5
Author: emaste Date: Thu Sep 26 16:09:28 2019 New Revision: 352755 URL: https://svnweb.freebsd.org/changeset/base/352755 Log: src.conf.5: regen after r352754, WITH_PIE Sponsored by: The FreeBSD Foundation Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 == --- stable/12/share/man/man5/src.conf.5 Thu Sep 26 16:05:57 2019 (r352754) +++ stable/12/share/man/man5/src.conf.5 Thu Sep 26 16:09:28 2019 (r352755) @@ -1573,6 +1573,9 @@ When set, it enforces these options: .It .Va WITHOUT_AUTHPF .El +.It Va WITH_PIE +Build dynamically linked binaries as +Position-Independent Executable (PIE). .It Va WITHOUT_PKGBOOTSTRAP Set to not build .Xr pkg 7 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352754 - in stable/12: gnu/usr.bin/binutils/as gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/kgdb kerberos5/tool...
Author: emaste Date: Thu Sep 26 16:05:57 2019 New Revision: 352754 URL: https://svnweb.freebsd.org/changeset/base/352754 Log: Add WITH_PIE knob to build Position Independent Executables MFC r344179: Add WITH_PIE knob to build Position Independent Executables Building binaries as PIE allows the executable itself to be loaded at a random address when ASLR is enabled (not just its shared libraries). With this change PIE objects have a .pieo extension and INTERNALLIB libraries libXXX_pie.a. MK_PIE is disabled for some kerberos5 tools, Clang, and Subversion, as they explicitly reference .a libraries in their Makefiles. These can be addressed on an individual basis later. MK_PIE is also disabled for rtld-elf because it is already position-independent using bespoke Makefile rules. Currently only dynamically linked binaries will be built as PIE. MFC r344181: Fix Makefile conditional after r344179 MFC r344182: Use make's :tl instead of checking "no" and "NO" MFC r344189: Fixup bsd.prog.mk after r344182 MFC r344211: wlandebug: disable PIE to fix build failure libifconfig is built as a static-only PRIVATELIB (and there is no _pie.a version) so disable PIE in libifconfig's consumer. r345489: Fix GNU objdump build under WITH_PIE Explicitly specified bare .a libraries need ${PIE_SUFFIX}. r345490: Apply WITH_PIE changes to other binutils components Followon to r345489, explicitly specified bare .a libraries need ${PIE_SUFFIX} (although these still built). r345778: Fix gdb/kgdb build under WITH_PIE Explicitly specified bare .a libraries need ${PIE_SUFFIX}. Sponsored by: The FreeBSD Foundation Added: stable/12/tools/build/options/WITHOUT_PIE - copied unchanged from r344179, head/tools/build/options/WITHOUT_PIE stable/12/tools/build/options/WITH_PIE - copied unchanged from r344179, head/tools/build/options/WITH_PIE Modified: stable/12/gnu/usr.bin/binutils/as/Makefile stable/12/gnu/usr.bin/binutils/ld/Makefile stable/12/gnu/usr.bin/binutils/objcopy/Makefile stable/12/gnu/usr.bin/binutils/objdump/Makefile stable/12/gnu/usr.bin/gdb/gdb/Makefile stable/12/gnu/usr.bin/gdb/kgdb/Makefile stable/12/kerberos5/tools/asn1_compile/Makefile stable/12/kerberos5/tools/slc/Makefile stable/12/lib/clang/Makefile.inc stable/12/libexec/rtld-elf/Makefile stable/12/share/mk/bsd.lib.mk stable/12/share/mk/bsd.opts.mk stable/12/share/mk/bsd.prog.mk stable/12/share/mk/src.libnames.mk stable/12/stand/i386/Makefile.inc stable/12/usr.bin/clang/Makefile.inc stable/12/usr.bin/svn/Makefile.inc stable/12/usr.sbin/wlandebug/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/gnu/usr.bin/binutils/as/Makefile == --- stable/12/gnu/usr.bin/binutils/as/Makefile Thu Sep 26 15:52:42 2019 (r352753) +++ stable/12/gnu/usr.bin/binutils/as/Makefile Thu Sep 26 16:05:57 2019 (r352754) @@ -95,9 +95,9 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-f NO_SHARED?=yes .endif -DPADD= ${GNURELTOP}/libbfd/libbfd.a -DPADD+=${GNURELTOP}/libiberty/libiberty.a -DPADD+=${GNURELTOP}/libopcodes/libopcodes.a +DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a LDADD= ${DPADD} .include Modified: stable/12/gnu/usr.bin/binutils/ld/Makefile == --- stable/12/gnu/usr.bin/binutils/ld/Makefile Thu Sep 26 15:52:42 2019 (r352753) +++ stable/12/gnu/usr.bin/binutils/ld/Makefile Thu Sep 26 16:05:57 2019 (r352754) @@ -51,8 +51,8 @@ CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd .if ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?= yes .endif -DPADD= ${GNURELTOP}/libbfd/libbfd.a -DPADD+=${GNURELTOP}/libiberty/libiberty.a +DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a LDADD= ${DPADD} CLEANDIRS+=ldscripts CLEANFILES+= ldemul-list.h stringify.sed Modified: stable/12/gnu/usr.bin/binutils/objcopy/Makefile == --- stable/12/gnu/usr.bin/binutils/objcopy/Makefile Thu Sep 26 15:52:42 2019(r352753) +++ stable/12/gnu/usr.bin/binutils/objcopy/Makefile Thu Sep 26 16:05:57 2019(r352754) @@ -9,9 +9,9 @@ SRCS= objcopy.c not-strip.c CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd -DPADD= ${GNURELTOP}/libbinutils/libbinutils.a -DPADD+=${GNURELTOP}/libbfd/libbfd.a -DPADD+=${GNURELTOP}/libiberty/libiberty.a +DPADD= ${GNURELTOP}/libbinutils/libbinutils${PIE_SUFFIX}.a +DPADD+=${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a +DPADD+=
Re: svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss
On Thu, Sep 26, 2019 at 10:32 AM David Bright wrote: > > Author: dab > Date: Thu Sep 26 15:32:28 2019 > New Revision: 352747 > URL: https://svnweb.freebsd.org/changeset/base/352747 > > Log: > Add an shm_rename syscall > > Add an atomic shm rename operation, similar in spirit to a file > rename. Atomically unlink an shm from a source path and link it to a > destination path. If an existing shm is linked at the destination > path, unlink it as part of the same atomic operation. The caller needs > the same permissions as shm_unlink to the shm being renamed, and the > same permissions for the shm at the destination which is being > unlinked, if it exists. If those fail, EACCES is returned, as with the > other shm_* syscalls. > > truss support is included; audit support will come later. > > This commit includes only the implementation; the sysent-generated > bits will come in a follow-on commit. > > Submitted by: Matthew Bryan > Reviewed by: jilles (earlier revision) > Reviewed by: brueffer (manpages, earlier revision) > Relnotes: yes > Sponsored by: Dell EMC Isilon > Differential Revision:https://reviews.freebsd.org/D21423 > > Modified: > head/lib/libc/sys/Makefile.inc > head/lib/libc/sys/Symbol.map > head/lib/libc/sys/shm_open.2 > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > head/sys/kern/uipc_shm.c > head/sys/sys/mman.h > head/tests/sys/posixshm/posixshm_test.c > head/usr.bin/truss/syscalls.c > > Modified: head/lib/libc/sys/Makefile.inc > == > --- head/lib/libc/sys/Makefile.inc Thu Sep 26 15:18:57 2019 > (r352746) > +++ head/lib/libc/sys/Makefile.inc Thu Sep 26 15:32:28 2019 > (r352747) > @@ -477,7 +477,8 @@ MLINKS+=setuid.2 setegid.2 \ > setuid.2 setgid.2 > MLINKS+=shmat.2 shmdt.2 > MLINKS+=shm_open.2 memfd_create.3 \ > - shm_open.2 shm_unlink.2 > + shm_open.2 shm_unlink.2 \ > + shm_rename.2 > MLINKS+=sigwaitinfo.2 sigtimedwait.2 > MLINKS+=stat.2 fstat.2 \ > stat.2 fstatat.2 \ > > Modified: head/lib/libc/sys/Symbol.map > == > --- head/lib/libc/sys/Symbol.mapThu Sep 26 15:18:57 2019 > (r352746) > +++ head/lib/libc/sys/Symbol.mapThu Sep 26 15:32:28 2019 > (r352747) > @@ -410,6 +410,7 @@ FBSD_1.6 { > getfhat; > funlinkat; > memfd_create; > + shm_rename; > }; > > FBSDprivate_1.0 { > > Modified: head/lib/libc/sys/shm_open.2 > == > --- head/lib/libc/sys/shm_open.2Thu Sep 26 15:18:57 2019 > (r352746) > +++ head/lib/libc/sys/shm_open.2Thu Sep 26 15:32:28 2019 > (r352747) > @@ -28,11 +28,11 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 24, 2019 > +.Dd September 26, 2019 > .Dt SHM_OPEN 2 > .Os > .Sh NAME > -.Nm memfd_create , shm_open , shm_unlink > +.Nm memfd_create , shm_open , shm_rename, shm_unlink > .Nd "shared memory object operations" > .Sh LIBRARY > .Lb libc > @@ -45,6 +45,8 @@ > .Ft int > .Fn shm_open "const char *path" "int flags" "mode_t mode" > .Ft int > +.Fn shm_rename "const char *path_from" "const char *path_to" "int flags" > +.Ft int > .Fn shm_unlink "const char *path" > .Sh DESCRIPTION > The > @@ -112,8 +114,9 @@ see > and > .Xr fcntl 2 . > .Pp > -As a FreeBSD extension, > -the constant > +As a > +.Fx > +extension, the constant > .Dv SHM_ANON > may be used for the > .Fa path > @@ -122,7 +125,9 @@ argument to > In this case, an anonymous, unnamed shared memory object is created. > Since the object has no name, > it cannot be removed via a subsequent call to > -.Fn shm_unlink . > +.Fn shm_unlink , > +or moved with a call to > +.Fn shm_rename . > Instead, > the shared memory object will be garbage collected when the last reference to > the shared memory object is removed. > @@ -138,6 +143,31 @@ will fail with > All other flags are ignored. > .Pp > The > +.Fn shm_rename > +system call atomically removes a shared memory object named > +.Fa path_from > +and relinks it at > +.Fa path_to . > +If another object is already linked at > +.Fa path_to , > +that object will be unlinked, unless one of the following flags are provided: > +.Bl -tag -offset indent -width Er > +.It Er SHM_RENAME_EXCHANGE > +Atomically exchange the shms at > +.Fa path_from > +and > +.Fa path_to . > +.It Er SHM_RENAME_NOREPLACE > +Return an error if an shm exists at > +.Fa path_to , > +rather than unlinking it. > +.El > +.Fn shm_rename > +is also a > +.Fx > +extension. > +.Pp > +The > .Fn shm_unlink > system call removes a shared memory object named > .Fa path . > @@ -196,15 +226,20 @@ and > .Fn shm_open > both return a non-negative integer, > and > +.Fn shm_rename > +and > .Fn shm_unlink > -returns zero. > -All three fu
svn commit: r352753 - stable/12/share/man/man5
Author: emaste Date: Thu Sep 26 15:52:42 2019 New Revision: 352753 URL: https://svnweb.freebsd.org/changeset/base/352753 Log: src.conf.5: regen after r352752, WITH_BIND_NOW Sponsored by: The FreeBSD Foundation Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 == --- stable/12/share/man/man5/src.conf.5 Thu Sep 26 15:50:18 2019 (r352752) +++ stable/12/share/man/man5/src.conf.5 Thu Sep 26 15:52:42 2019 (r352753) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd July 24, 2019 +.Dd September 26, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -170,6 +170,11 @@ Set to not build or install associated utilities, and examples. .Pp This option only affects amd64/amd64. +.It Va WITH_BIND_NOW +Build all binaries with the +.Dv DF_BIND_NOW +flag set to indicate that the run-time loader should perform all relocation +processing at process startup rather than on demand. .It Va WITHOUT_BINUTILS Set to not build or install GNU .Xr as 1 , @@ -234,8 +239,6 @@ Set to build some programs without support, like .Xr fingerd 8 , .Xr ftpd 8 , -.Xr rlogind 8 , -.Xr rshd 8 , and .Xr sshd 8 . .It Va WITHOUT_BLUETOOTH @@ -256,6 +259,11 @@ and related programs. .It Va WITHOUT_BSD_CPIO Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . +.It Va WITH_BSD_CRTBEGIN +Enable the BSD licensed +.Pa crtbegin.o +and +.Pa crtend.o . .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352752 - in stable/12: share/mk tools/build/options
Author: emaste Date: Thu Sep 26 15:50:18 2019 New Revision: 352752 URL: https://svnweb.freebsd.org/changeset/base/352752 Log: Add a WITH_BIND_NOW build knob MFC r340186: Add a WITH_BIND_NOW build knob The linker's -z now flag sets the DF_BIND_NOW flag, which signals to the runtime loader that all relocation processing should be performed at process startup rather than on demand. In combination with lld's default of enabling relro this causes the GOT to be made read-only when the process starts, preventing straightforward GOT overwrite attacks. MFC r341429: disable BIND_NOW in libc, libthr, and rtld An issue remains with BIND_NOW and processes using threads. For now, restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and libthr. MFC r345625: revert r341429 "disable BIND_NOW in libc, libthr, and rtld" r345620 by kib@ fixed the rtld issue that caused a crash at startup during resolution of libc's ifuncs with BIND_NOW. MFC r345638: Revert change accidentally committed along with r345625 MFC r345640: Revert other accidentally committed part of r345625 Sponsored by: The FreeBSD Foundation Added: stable/12/tools/build/options/WITHOUT_BIND_NOW - copied unchanged from r340186, head/tools/build/options/WITHOUT_BIND_NOW stable/12/tools/build/options/WITH_BIND_NOW - copied unchanged from r340186, head/tools/build/options/WITH_BIND_NOW Modified: stable/12/share/mk/bsd.lib.mk stable/12/share/mk/bsd.opts.mk stable/12/share/mk/bsd.prog.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/bsd.lib.mk == --- stable/12/share/mk/bsd.lib.mk Thu Sep 26 15:41:10 2019 (r352751) +++ stable/12/share/mk/bsd.lib.mk Thu Sep 26 15:50:18 2019 (r352752) @@ -69,6 +69,10 @@ TAGS+= package=${PACKAGE:Uruntime} TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif +# ELF hardening knobs +.if ${MK_BIND_NOW} != "no" +LDFLAGS+= -Wl,-znow +.endif .if ${MK_RETPOLINE} != "no" CFLAGS+= -mretpoline CXXFLAGS+= -mretpoline Modified: stable/12/share/mk/bsd.opts.mk == --- stable/12/share/mk/bsd.opts.mk Thu Sep 26 15:41:10 2019 (r352751) +++ stable/12/share/mk/bsd.opts.mk Thu Sep 26 15:50:18 2019 (r352752) @@ -69,6 +69,7 @@ __DEFAULT_YES_OPTIONS = \ WARNS __DEFAULT_NO_OPTIONS = \ +BIND_NOW \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ Modified: stable/12/share/mk/bsd.prog.mk == --- stable/12/share/mk/bsd.prog.mk Thu Sep 26 15:41:10 2019 (r352751) +++ stable/12/share/mk/bsd.prog.mk Thu Sep 26 15:50:18 2019 (r352752) @@ -34,6 +34,10 @@ PROG=${PROG_CXX} MK_DEBUG_FILES=no .endif +# ELF hardening knobs +.if ${MK_BIND_NOW} != "no" +LDFLAGS+= -Wl,-znow +.endif .if ${MK_RETPOLINE} != "no" CFLAGS+= -mretpoline CXXFLAGS+= -mretpoline Copied: stable/12/tools/build/options/WITHOUT_BIND_NOW (from r340186, head/tools/build/options/WITHOUT_BIND_NOW) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_BIND_NOW Thu Sep 26 15:50:18 2019(r352752, copy of r340186, head/tools/build/options/WITHOUT_BIND_NOW) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Do not build all binaries with the +.Dv DF_BIND_NOW +flag set. +Run-time relocation processing will be performed on demand. Copied: stable/12/tools/build/options/WITH_BIND_NOW (from r340186, head/tools/build/options/WITH_BIND_NOW) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITH_BIND_NOW Thu Sep 26 15:50:18 2019 (r352752, copy of r340186, head/tools/build/options/WITH_BIND_NOW) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Build all binaries with the +.Dv DF_BIND_NOW +flag set to indicate that the run-time loader should perform all relocation +processing at process startup rather than on demand. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352751 - in head/sys: compat/freebsd32 kern sys
Author: dab Date: Thu Sep 26 15:41:10 2019 New Revision: 352751 URL: https://svnweb.freebsd.org/changeset/base/352751 Log: sysent: regenerate after r352747. Sponsored by: Dell EMC Isilon Modified: head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_syscall.h == --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Sep 26 15:38:06 2019(r352750) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Sep 26 15:41:10 2019(r352751) @@ -498,4 +498,5 @@ #defineFREEBSD32_SYS_copy_file_range 569 #defineFREEBSD32_SYS_freebsd32___sysctlbyname 570 #defineFREEBSD32_SYS_shm_open2 571 -#defineFREEBSD32_SYS_MAXSYSCALL572 +#defineFREEBSD32_SYS_shm_rename572 +#defineFREEBSD32_SYS_MAXSYSCALL573 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c == --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Sep 26 15:38:06 2019(r352750) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Sep 26 15:41:10 2019(r352751) @@ -608,4 +608,5 @@ const char *freebsd32_syscallnames[] = { "copy_file_range", /* 569 = copy_file_range */ "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ "shm_open2",/* 571 = shm_open2 */ + "shm_rename", /* 572 = shm_rename */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c == --- head/sys/compat/freebsd32/freebsd32_sysent.cThu Sep 26 15:38:06 2019(r352750) +++ head/sys/compat/freebsd32/freebsd32_sysent.cThu Sep 26 15:41:10 2019(r352751) @@ -661,4 +661,5 @@ struct sysent freebsd32_sysent[] = { { AS(copy_file_range_args), (sy_call_t *)sys_copy_file_range, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 569 = copy_file_range */ { AS(freebsd32___sysctlbyname_args), (sy_call_t *)freebsd32___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 570 = freebsd32___sysctlbyname */ { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ + { AS(shm_rename_args), (sy_call_t *)sys_shm_rename, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 572 = shm_rename */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c == --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Sep 26 15:38:06 2019(r352750) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Sep 26 15:41:10 2019(r352751) @@ -3346,6 +3346,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 5; break; } + /* shm_rename */ + case 572: { + struct shm_rename_args *p = params; + uarg[0] = (intptr_t) p->path_from; /* const char * */ + uarg[1] = (intptr_t) p->path_to; /* const char * */ + iarg[2] = p->flags; /* int */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -9016,6 +9025,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* shm_rename */ + case 572: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "userland const char *"; + break; + case 2: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10897,6 +10922,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* shm_open2 */ case 571: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* shm_rename */ + case 572: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/init_sysent.c =
svn commit: r352750 - stable/12/sbin/ping6
Author: markj Date: Thu Sep 26 15:38:06 2019 New Revision: 352750 URL: https://svnweb.freebsd.org/changeset/base/352750 Log: MFC r352634: ping6: Use caph_rights_limit(3) for STDIN_FILENO Modified: stable/12/sbin/ping6/ping6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ping6/ping6.c == --- stable/12/sbin/ping6/ping6.cThu Sep 26 15:37:40 2019 (r352749) +++ stable/12/sbin/ping6/ping6.cThu Sep 26 15:38:06 2019 (r352750) @@ -1028,8 +1028,8 @@ main(int argc, char *argv[]) err(1, "caph_enter_casper"); cap_rights_init(&rights_stdin); - if (cap_rights_limit(STDIN_FILENO, &rights_stdin) < 0) - err(1, "cap_rights_limit stdin"); + if (caph_rights_limit(STDIN_FILENO, &rights_stdin) < 0) + err(1, "caph_rights_limit stdin"); if (caph_limit_stdout() < 0) err(1, "caph_limit_stdout"); if (caph_limit_stderr() < 0) @@ -1037,10 +1037,10 @@ main(int argc, char *argv[]) cap_rights_init(&rights_srecv, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights_srecv) < 0) - err(1, "cap_rights_limit srecv"); + err(1, "caph_rights_limit srecv"); cap_rights_init(&rights_ssend, CAP_SEND, CAP_SETSOCKOPT); if (caph_rights_limit(ssend, &rights_ssend) < 0) - err(1, "cap_rights_limit ssend"); + err(1, "caph_rights_limit ssend"); #if defined(SO_SNDBUF) && defined(SO_RCVBUF) if (sockbufsize) { @@ -1092,10 +1092,10 @@ main(int argc, char *argv[]) cap_rights_clear(&rights_srecv, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights_srecv) < 0) - err(1, "cap_rights_limit srecv setsockopt"); + err(1, "caph_rights_limit srecv setsockopt"); cap_rights_clear(&rights_ssend, CAP_SETSOCKOPT); if (caph_rights_limit(ssend, &rights_ssend) < 0) - err(1, "cap_rights_limit ssend setsockopt"); + err(1, "caph_rights_limit ssend setsockopt"); printf("PING6(%lu=40+8+%lu bytes) ", (unsigned long)(40 + pingerlen()), (unsigned long)(pingerlen() - 8)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352749 - stable/12/sys/dev/jme
Author: markj Date: Thu Sep 26 15:37:40 2019 New Revision: 352749 URL: https://svnweb.freebsd.org/changeset/base/352749 Log: MFC r352625: Revert r316820. PR: 233952 Modified: stable/12/sys/dev/jme/if_jme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/jme/if_jme.c == --- stable/12/sys/dev/jme/if_jme.c Thu Sep 26 15:35:35 2019 (r352748) +++ stable/12/sys/dev/jme/if_jme.c Thu Sep 26 15:37:40 2019 (r352749) @@ -559,7 +559,7 @@ jme_map_intr_vector(struct jme_softc *sc) bzero(map, sizeof(map)); /* Map Tx interrupts source to MSI/MSIX vector 2. */ - map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] = MSINUM_INTR_SOURCE(2, N_INTR_TXQ0_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ1_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ1_COMP); @@ -581,37 +581,37 @@ jme_map_intr_vector(struct jme_softc *sc) MSINUM_INTR_SOURCE(2, N_INTR_TXQ_COAL_TO); /* Map Rx interrupts source to MSI/MSIX vector 1. */ - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL_TO); /* Map all other interrupts source to MSI/MSIX vector 0. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352748 - head/sys/kern
Author: markj Date: Thu Sep 26 15:35:35 2019 New Revision: 352748 URL: https://svnweb.freebsd.org/changeset/base/352748 Log: Fix handling of invalid pages in exec_map_first_page(). exec_map_first_page() would unconditionally free an unbacked, invalid page from the executable image. However, it is possible that the page is wired, in which case it is incorrect to free the page, so check for additional wirings first. Reported by: syzkaller Tested by:pho Reviewed by: kib MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D21767 Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c == --- head/sys/kern/kern_exec.c Thu Sep 26 15:32:28 2019(r352747) +++ head/sys/kern/kern_exec.c Thu Sep 26 15:35:35 2019(r352748) @@ -981,8 +981,10 @@ exec_map_first_page(struct image_params *imgp) if (ma[0]->valid != VM_PAGE_BITS_ALL) { vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { - vm_page_unwire_noq(ma[0]); - vm_page_free(ma[0]); + if (vm_page_unwire_noq(ma[0])) + vm_page_free(ma[0]); + else + vm_page_xunbusy(ma[0]); VM_OBJECT_WUNLOCK(object); return (EIO); } @@ -1006,9 +1008,16 @@ exec_map_first_page(struct image_params *imgp) initial_pagein = i; rv = vm_pager_get_pages(object, ma, initial_pagein, NULL, NULL); if (rv != VM_PAGER_OK) { - vm_page_unwire_noq(ma[0]); - for (i = 0; i < initial_pagein; i++) - vm_page_free(ma[i]); + if (vm_page_unwire_noq(ma[0])) + vm_page_free(ma[0]); + else + vm_page_xunbusy(ma[0]); + for (i = 1; i < initial_pagein; i++) { + if (!vm_page_wired(ma[i])) + vm_page_free(ma[i]); + else + vm_page_xunbusy(ma[i]); + } VM_OBJECT_WUNLOCK(object); return (EIO); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss
Author: dab Date: Thu Sep 26 15:32:28 2019 New Revision: 352747 URL: https://svnweb.freebsd.org/changeset/base/352747 Log: Add an shm_rename syscall Add an atomic shm rename operation, similar in spirit to a file rename. Atomically unlink an shm from a source path and link it to a destination path. If an existing shm is linked at the destination path, unlink it as part of the same atomic operation. The caller needs the same permissions as shm_unlink to the shm being renamed, and the same permissions for the shm at the destination which is being unlinked, if it exists. If those fail, EACCES is returned, as with the other shm_* syscalls. truss support is included; audit support will come later. This commit includes only the implementation; the sysent-generated bits will come in a follow-on commit. Submitted by: Matthew Bryan Reviewed by: jilles (earlier revision) Reviewed by: brueffer (manpages, earlier revision) Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D21423 Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/shm_open.2 head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master head/sys/kern/uipc_shm.c head/sys/sys/mman.h head/tests/sys/posixshm/posixshm_test.c head/usr.bin/truss/syscalls.c Modified: head/lib/libc/sys/Makefile.inc == --- head/lib/libc/sys/Makefile.inc Thu Sep 26 15:18:57 2019 (r352746) +++ head/lib/libc/sys/Makefile.inc Thu Sep 26 15:32:28 2019 (r352747) @@ -477,7 +477,8 @@ MLINKS+=setuid.2 setegid.2 \ setuid.2 setgid.2 MLINKS+=shmat.2 shmdt.2 MLINKS+=shm_open.2 memfd_create.3 \ - shm_open.2 shm_unlink.2 + shm_open.2 shm_unlink.2 \ + shm_rename.2 MLINKS+=sigwaitinfo.2 sigtimedwait.2 MLINKS+=stat.2 fstat.2 \ stat.2 fstatat.2 \ Modified: head/lib/libc/sys/Symbol.map == --- head/lib/libc/sys/Symbol.mapThu Sep 26 15:18:57 2019 (r352746) +++ head/lib/libc/sys/Symbol.mapThu Sep 26 15:32:28 2019 (r352747) @@ -410,6 +410,7 @@ FBSD_1.6 { getfhat; funlinkat; memfd_create; + shm_rename; }; FBSDprivate_1.0 { Modified: head/lib/libc/sys/shm_open.2 == --- head/lib/libc/sys/shm_open.2Thu Sep 26 15:18:57 2019 (r352746) +++ head/lib/libc/sys/shm_open.2Thu Sep 26 15:32:28 2019 (r352747) @@ -28,11 +28,11 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2019 +.Dd September 26, 2019 .Dt SHM_OPEN 2 .Os .Sh NAME -.Nm memfd_create , shm_open , shm_unlink +.Nm memfd_create , shm_open , shm_rename, shm_unlink .Nd "shared memory object operations" .Sh LIBRARY .Lb libc @@ -45,6 +45,8 @@ .Ft int .Fn shm_open "const char *path" "int flags" "mode_t mode" .Ft int +.Fn shm_rename "const char *path_from" "const char *path_to" "int flags" +.Ft int .Fn shm_unlink "const char *path" .Sh DESCRIPTION The @@ -112,8 +114,9 @@ see and .Xr fcntl 2 . .Pp -As a FreeBSD extension, -the constant +As a +.Fx +extension, the constant .Dv SHM_ANON may be used for the .Fa path @@ -122,7 +125,9 @@ argument to In this case, an anonymous, unnamed shared memory object is created. Since the object has no name, it cannot be removed via a subsequent call to -.Fn shm_unlink . +.Fn shm_unlink , +or moved with a call to +.Fn shm_rename . Instead, the shared memory object will be garbage collected when the last reference to the shared memory object is removed. @@ -138,6 +143,31 @@ will fail with All other flags are ignored. .Pp The +.Fn shm_rename +system call atomically removes a shared memory object named +.Fa path_from +and relinks it at +.Fa path_to . +If another object is already linked at +.Fa path_to , +that object will be unlinked, unless one of the following flags are provided: +.Bl -tag -offset indent -width Er +.It Er SHM_RENAME_EXCHANGE +Atomically exchange the shms at +.Fa path_from +and +.Fa path_to . +.It Er SHM_RENAME_NOREPLACE +Return an error if an shm exists at +.Fa path_to , +rather than unlinking it. +.El +.Fn shm_rename +is also a +.Fx +extension. +.Pp +The .Fn shm_unlink system call removes a shared memory object named .Fa path . @@ -196,15 +226,20 @@ and .Fn shm_open both return a non-negative integer, and +.Fn shm_rename +and .Fn shm_unlink -returns zero. -All three functions return -1 on failure, and set +return zero. +All functions return -1 on failure, and set .Va errno to indicate the error. .Sh COMPATIBILITY The -.Fa path -argument does not necessarily represent a pathname (although it does in +.Fa path , +.Fa path_from , +and +.Fa path_to +arguments do not necessarily represent a pathname (although they do in most oth
svn commit: r352746 - head/sys/netinet
Author: jtl Date: Thu Sep 26 15:18:57 2019 New Revision: 352746 URL: https://svnweb.freebsd.org/changeset/base/352746 Log: Add new functionality to switch to using cookies exclusively when we the syn cache overflows. Whether this is due to an attack or due to the system having more legitimate connections than the syn cache can hold, this situation can quickly impact performance. To make the system perform better during these periods, the code will now switch to exclusively using cookies until the syn cache stops overflowing. In order for this to occur, the system must be configured to use the syn cache with syn cookie fallback. If syn cookies are completely disabled, this change should have no functional impact. When the system is exclusively using syn cookies (either due to configuration or the overflow detection enabled by this change), the code will now skip acquiring a lock on the syn cache bucket. Additionally, the code will now skip lookups in several places (such as when the system receives a RST in response to a SYN|ACK frame). Reviewed by: rrs, gallatin (previous version) Discussed with: tuexen Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.c == --- head/sys/netinet/tcp_syncache.c Thu Sep 26 15:06:46 2019 (r352745) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:18:57 2019 (r352746) @@ -144,6 +144,8 @@ static struct syncache *syncookie_lookup(struct in_conninfo *, struct syncache_head *, struct syncache *, struct tcphdr *, struct tcpopt *, struct socket *); +static voidsyncache_pause(struct in_conninfo *); +static voidsyncache_unpause(void *); static void syncookie_reseed(void *); #ifdef INVARIANTS static int syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch, @@ -300,6 +302,14 @@ syncache_init(void) arc4rand(V_tcp_syncache.secret.key[1], SYNCOOKIE_SECRET_SIZE, 0); callout_reset(&V_tcp_syncache.secret.reseed, SYNCOOKIE_LIFETIME * hz, syncookie_reseed, &V_tcp_syncache); + + /* Initialize the pause machinery. */ + mtx_init(&V_tcp_syncache.pause_mtx, "tcp_sc_pause", NULL, MTX_DEF); + callout_init_mtx(&V_tcp_syncache.pause_co, &V_tcp_syncache.pause_mtx, + 0); + V_tcp_syncache.pause_until = time_uptime - TCP_SYNCACHE_PAUSE_TIME; + V_tcp_syncache.pause_backoff = 0; + V_tcp_syncache.paused = false; } #ifdef VIMAGE @@ -316,6 +326,14 @@ syncache_destroy(void) */ callout_drain(&V_tcp_syncache.secret.reseed); + /* Stop the SYN cache pause callout. */ + mtx_lock(&V_tcp_syncache.pause_mtx); + if (callout_stop(&V_tcp_syncache.pause_co) == 0) { + mtx_unlock(&V_tcp_syncache.pause_mtx); + callout_drain(&V_tcp_syncache.pause_co); + } else + mtx_unlock(&V_tcp_syncache.pause_mtx); + /* Cleanup hash buckets: stop timers, free entries, destroy locks. */ for (i = 0; i < V_tcp_syncache.hashsize; i++) { @@ -339,6 +357,7 @@ syncache_destroy(void) /* Free the allocated global resources. */ uma_zdestroy(V_tcp_syncache.zone); free(V_tcp_syncache.hashbase, M_SYNCACHE); + mtx_destroy(&V_tcp_syncache.pause_mtx); } #endif @@ -360,10 +379,10 @@ syncache_insert(struct syncache *sc, struct syncache_h if (sch->sch_length >= V_tcp_syncache.bucket_limit) { KASSERT(!TAILQ_EMPTY(&sch->sch_bucket), ("sch->sch_length incorrect")); + syncache_pause(&sc->sc_inc); sc2 = TAILQ_LAST(&sch->sch_bucket, sch_head); sch->sch_last_overflow = time_uptime; syncache_drop(sc2, sch); - TCPSTAT_INC(tcps_sc_bucketoverflow); } /* Put it into the bucket. */ @@ -450,6 +469,7 @@ syncache_timer(void *xsch) struct syncache *sc, *nsc; int tick = ticks; char *s; + bool paused; CURVNET_SET(sch->sch_sc->vnet); @@ -462,7 +482,19 @@ syncache_timer(void *xsch) */ sch->sch_nextc = tick + INT_MAX; + /* +* If we have paused processing, unconditionally remove +* all syncache entries. +*/ + mtx_lock(&V_tcp_syncache.pause_mtx); + paused = V_tcp_syncache.paused; + mtx_unlock(&V_tcp_syncache.pause_mtx); + TAILQ_FOREACH_SAFE(sc, &sch->sch_bucket, sc_hash, nsc) { + if (paused) { + syncache_drop(sc, sch); + continue; + } /* * We do not check if the listen socket still exists * and accept the
Re: svn commit: r352707 - in head/sys: conf kern net sys
On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: Kyle Evans wrote: On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: This breaks building the drm-kmod ports, as the build cannot find opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the exact same way): --- linux_anon_inodes.o --- cc -O2 -pipe -fno-strict-aliasing -include /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith -mno-aes -mno-avx -std=iso9899:1999 -c /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c -o linux_anon_inodes.o In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found #include "opt_epoch.h" ^ --- linux_anon_inodefs.o --- In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found #include "opt_epoch.h" ^ --- linux_anon_inodes.o --- 1 error generated. *** [linux_anon_inodes.o] Error code 1 make[2]: stopped in /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi --- linux_anon_inodefs.o --- 1 error generated. *** [linux_anon_inodefs.o] Error code 1 Interestingly enough, does not happen when drm-current-kmod is built as part of buildkernel (using an existing installed package with SOURCE on). FWIW, johalun noticed this yesterday and addressed it here: https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d Ah, of course I would miss these commits in the kms-drm repo, considering that I watch them roll in. Will wait for the updated snapshots in ports. I'll get to updating the ports as soon as I can. Regards -- Niclas Zeising ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352745 - head/sys/netinet
Author: jtl Date: Thu Sep 26 15:06:46 2019 New Revision: 352745 URL: https://svnweb.freebsd.org/changeset/base/352745 Log: Access the syncache secret directly from the V_tcp_syncache variable, rather than indirectly through the backpointer to the tcp_syncache structure stored in the hashtable bucket. This also allows us to remove the requirement in syncookie_generate() and syncookie_lookup() that the syncache hashtable bucket must be locked. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c == --- head/sys/netinet/tcp_syncache.c Thu Sep 26 15:02:34 2019 (r352744) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:06:46 2019 (r352745) @@ -2061,8 +2061,6 @@ syncookie_generate(struct syncache_head *sch, struct s uint8_t *secbits; union syncookie cookie; - SCH_LOCK_ASSERT(sch); - cookie.cookie = 0; /* Map our computed MSS into the 3-bit index. */ @@ -2090,10 +2088,10 @@ syncookie_generate(struct syncache_head *sch, struct s cookie.flags.sack_ok = 1; /* Which of the two secrets to use. */ - secbit = sch->sch_sc->secret.oddeven & 0x1; + secbit = V_tcp_syncache.secret.oddeven & 0x1; cookie.flags.odd_even = secbit; - secbits = sch->sch_sc->secret.key[secbit]; + secbits = V_tcp_syncache.secret.key[secbit]; hash = syncookie_mac(&sc->sc_inc, sc->sc_irs, cookie.cookie, secbits, (uintptr_t)sch); @@ -2121,8 +2119,6 @@ syncookie_lookup(struct in_conninfo *inc, struct synca int wnd, wscale = 0; union syncookie cookie; - SCH_LOCK_ASSERT(sch); - /* * Pull information out of SYN-ACK/ACK and revert sequence number * advances. @@ -2137,7 +2133,7 @@ syncookie_lookup(struct in_conninfo *inc, struct synca cookie.cookie = (ack & 0xff) ^ (ack >> 24); /* Which of the two secrets to use. */ - secbits = sch->sch_sc->secret.key[cookie.flags.odd_even]; + secbits = V_tcp_syncache.secret.key[cookie.flags.odd_even]; hash = syncookie_mac(inc, seq, cookie.cookie, secbits, (uintptr_t)sch); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352744 - head/sys/netinet
Author: jtl Date: Thu Sep 26 15:02:34 2019 New Revision: 352744 URL: https://svnweb.freebsd.org/changeset/base/352744 Log: Remove the unused sch parameter to the syncache_respond() function. The use of this parameter was removed in r313330. This commit now removes passing this now-unused parameter. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c == --- head/sys/netinet/tcp_syncache.c Thu Sep 26 14:48:39 2019 (r352743) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:02:34 2019 (r352744) @@ -130,8 +130,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, functions_inherit_ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *, struct syncache_head *, - const struct mbuf *, int); +static int syncache_respond(struct syncache *, const struct mbuf *, int); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -495,7 +494,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - syncache_respond(sc, sch, NULL, TH_SYN|TH_ACK); + syncache_respond(sc, NULL, TH_SYN|TH_ACK); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -632,7 +631,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - syncache_respond(sc, sch, m, TH_ACK); + syncache_respond(sc, m, TH_ACK); } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -1475,7 +1474,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc, sch, m, TH_SYN|TH_ACK) == 0) { + if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1640,7 +1639,7 @@ skip_alloc: /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc, sch, m, TH_SYN|TH_ACK) == 0) { + if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1685,8 +1684,7 @@ tfo_expanded: * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. */ static int -syncache_respond(struct syncache *sc, struct syncache_head *sch, -const struct mbuf *m0, int flags) +syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) { struct ip *ip = NULL; struct mbuf *m; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r352707 - in head/sys: conf kern net sys
Kyle Evans wrote: > On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: >> This breaks building the drm-kmod ports, as the build cannot find >> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the >> exact same way): >> >> --- linux_anon_inodes.o --- >> cc -O2 -pipe -fno-strict-aliasing -include >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h >> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE >> -nostdinc >> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include >> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include >> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include >> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys >> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer >> -mno-omit-leaf-frame-pointer >> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include >> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD >> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel >> -mno-red-zone -mno-mmx -mno-sse -msoft-float >> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector >> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes >> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef >> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ >> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas >> -Wno-error-tautological-compare -Wno-error-empty-body >> -Wno-error-parentheses-equality -Wno-error-unused-function >> -Wno-error-pointer-sign -Wno-error-shift-negative-value >> -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith >> -mno-aes -mno-avx -std=iso9899:1999 -c >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c >> -o linux_anon_inodes.o >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >> In file included from >> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> In file included from /usr/src/sys/net/if_var.h:83: >> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >> #include "opt_epoch.h" >> ^ >> --- linux_anon_inodefs.o --- >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >> In file included from >> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> In file included from /usr/src/sys/net/if_var.h:83: >> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >> #include "opt_epoch.h" >> ^ >> --- linux_anon_inodes.o --- >> 1 error generated. >> *** [linux_anon_inodes.o] Error code 1 >> >> make[2]: stopped in >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi >> --- linux_anon_inodefs.o --- >> 1 error generated. >> *** [linux_anon_inodefs.o] Error code 1 >> >> Interestingly enough, does not happen when drm-current-kmod is built as >> part of buildkernel (using an existing installed package with SOURCE on). >> > > FWIW, johalun noticed this yesterday and addressed it here: > https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d > Ah, of course I would miss these commits in the kms-drm repo, considering that I watch them roll in. Will wait for the updated snapshots in ports. -- Charlie Li …nope, still don't have an exit line. (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) signature.asc Description: OpenPGP digital signature
Re: svn commit: r352707 - in head/sys: conf kern net sys
On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: > > Gleb Smirnoff wrote: > > Modified: head/sys/conf/options > > == > > --- head/sys/conf/options Wed Sep 25 18:09:19 2019(r352706) > > +++ head/sys/conf/options Wed Sep 25 18:26:31 2019(r352707) > > @@ -712,6 +712,8 @@ WITNESS_SKIPSPIN opt_witness.h > > WITNESS_COUNTopt_witness.h > > OPENSOLARIS_WITNESS opt_global.h > > > > +EPOCH_TRACE opt_epoch.h > > + > > # options for ACPI support > > ACPI_DEBUG opt_acpi.h > > ACPI_MAX_TASKS opt_acpi.h > > > > Modified: head/sys/sys/epoch.h > > == > > --- head/sys/sys/epoch.h Wed Sep 25 18:09:19 2019(r352706) > > +++ head/sys/sys/epoch.h Wed Sep 25 18:26:31 2019(r352707) > > @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; > > #include > > #include > > > > +#include "opt_epoch.h" > > + > > struct epoch; > > typedef struct epoch *epoch_t; > > > This breaks building the drm-kmod ports, as the build cannot find > opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > exact same way): > > --- linux_anon_inodes.o --- > cc -O2 -pipe -fno-strict-aliasing -include > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > -nostdinc > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer > -mno-omit-leaf-frame-pointer > -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel > -mno-red-zone -mno-mmx -mno-sse -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value > -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith > -mno-aes -mno-avx -std=iso9899:1999 -c > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > -o linux_anon_inodes.o > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > In file included from > /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > In file included from /usr/src/sys/net/if_var.h:83: > /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found > #include "opt_epoch.h" > ^ > --- linux_anon_inodefs.o --- > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > In file included from > /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > In file included from /usr/src/sys/net/if_var.h:83: > /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found > #include "opt_epoch.h" > ^ > --- linux_anon_inodes.o --- > 1 error generated. > *** [linux_anon_inodes.o] Error code 1 > > make[2]: stopped in > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > --- linux_anon_inodefs.o --- > 1 error generated. > *** [linux_anon_inodefs.o] Error code 1 > > Interestingly enough, does not happen when drm-current-kmod is built as > part of buildkernel (using an existing installed package with SO
svn commit: r352743 - head/sys/cam/scsi
Author: mav Date: Thu Sep 26 14:48:39 2019 New Revision: 352743 URL: https://svnweb.freebsd.org/changeset/base/352743 Log: Add kern.cam.da.X.quirks tunable, similar existing for ada. Submitted by: Michael Lass MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D20677 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c == --- head/sys/cam/scsi/scsi_da.c Thu Sep 26 13:27:25 2019(r352742) +++ head/sys/cam/scsi/scsi_da.c Thu Sep 26 14:48:39 2019(r352743) @@ -2694,6 +2694,7 @@ daregister(struct cam_periph *periph, void *arg) struct ccb_getdev *cgd; char tmpstr[80]; caddr_t match; + int quirks; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -2749,6 +2750,13 @@ daregister(struct cam_periph *periph, void *arg) xpt_path_inq(&cpi, periph->path); if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE)) softc->quirks |= DA_Q_NO_6_BYTE; + + /* Override quirks if tunable is set */ + snprintf(tmpstr, sizeof(tmpstr), "kern.cam.da.%d.quirks", +periph->unit_number); + quirks = softc->quirks; + TUNABLE_INT_FETCH(tmpstr, &quirks); + softc->quirks = quirks; if (SID_TYPE(&cgd->inq_data) == T_ZBC_HM) softc->zone_mode = DA_ZONE_HOST_MANAGED; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r352707 - in head/sys: conf kern net sys
Gleb Smirnoff wrote: > Modified: head/sys/conf/options > == > --- head/sys/conf/options Wed Sep 25 18:09:19 2019(r352706) > +++ head/sys/conf/options Wed Sep 25 18:26:31 2019(r352707) > @@ -712,6 +712,8 @@ WITNESS_SKIPSPIN opt_witness.h > WITNESS_COUNTopt_witness.h > OPENSOLARIS_WITNESS opt_global.h > > +EPOCH_TRACE opt_epoch.h > + > # options for ACPI support > ACPI_DEBUG opt_acpi.h > ACPI_MAX_TASKS opt_acpi.h > > Modified: head/sys/sys/epoch.h > == > --- head/sys/sys/epoch.h Wed Sep 25 18:09:19 2019(r352706) > +++ head/sys/sys/epoch.h Wed Sep 25 18:26:31 2019(r352707) > @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; > #include > #include > > +#include "opt_epoch.h" > + > struct epoch; > typedef struct epoch *epoch_t; > This breaks building the drm-kmod ports, as the build cannot find opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the exact same way): --- linux_anon_inodes.o --- cc -O2 -pipe -fno-strict-aliasing -include /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith -mno-aes -mno-avx -std=iso9899:1999 -c /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c -o linux_anon_inodes.o In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found #include "opt_epoch.h" ^ --- linux_anon_inodefs.o --- In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found #include "opt_epoch.h" ^ --- linux_anon_inodes.o --- 1 error generated. *** [linux_anon_inodes.o] Error code 1 make[2]: stopped in /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi --- linux_anon_inodefs.o --- 1 error generated. *** [linux_anon_inodefs.o] Error code 1 Interestingly enough, does not happen when drm-current-kmod is built as part of buildkernel (using an existing installed package with SOURCE on). -- Charlie Li …nope, still don't have an exit line. (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) signature.asc Description: OpenPGP digital signature
svn commit: r352742 - head/usr.bin/bsdiff/bspatch
Author: emaste Date: Thu Sep 26 13:27:25 2019 New Revision: 352742 URL: https://svnweb.freebsd.org/changeset/base/352742 Log: bspatch: add integer overflow checks Introduce a new add_off_t static function that exits with an error message if there's an overflow, otherwise returns their sum. Use this when adding values obtained from the input patch. Reviewed by: delphij, allanjude (earlier) MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D7897 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c == --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 26 12:54:52 2019 (r352741) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 26 13:27:25 2019 (r352742) @@ -61,6 +61,23 @@ exit_cleanup(void) warn("unlinkat"); } +static inline off_t +add_off_t(off_t a, off_t b) +{ + off_t result; + +#if __GNUC__ >= 5 || \ +(defined(__has_builtin) && __has_builtin(__builtin_add_overflow)) + if (__builtin_add_overflow(a, b, &result)) + errx(1, "Corrupt patch"); +#else + if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b)) + errx(1, "Corrupt patch"); + result = a + b; +#endif + return result; +} + static off_t offtin(u_char *buf) { off_t y; @@ -199,12 +216,12 @@ int main(int argc, char *argv[]) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - offset += bzctrllen; + offset = add_off_t(offset, bzctrllen); if (fseeko(dpf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - offset += bzdatalen; + offset = add_off_t(offset, bzdatalen); if (fseeko(epf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) @@ -238,7 +255,7 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Sanity-check */ - if (newpos + ctrl[0] > newsize) + if (add_off_t(newpos, ctrl[0]) > newsize) errx(1, "Corrupt patch"); /* Read diff string */ @@ -249,15 +266,15 @@ int main(int argc, char *argv[]) /* Add old data to diff string */ for (i = 0; i < ctrl[0]; i++) - if ((oldpos + i >= 0) && (oldpos + i < oldsize)) + if (add_off_t(oldpos, i) < oldsize) new[newpos + i] += old[oldpos + i]; /* Adjust pointers */ - newpos += ctrl[0]; - oldpos += ctrl[0]; + newpos = add_off_t(newpos, ctrl[0]); + oldpos = add_off_t(oldpos, ctrl[0]); /* Sanity-check */ - if (newpos + ctrl[1] > newsize) + if (add_off_t(newpos, ctrl[1]) > newsize) errx(1, "Corrupt patch"); /* Read extra string */ @@ -267,8 +284,8 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Adjust pointers */ - newpos+=ctrl[1]; - oldpos+=ctrl[2]; + newpos = add_off_t(newpos, ctrl[1]); + oldpos = add_off_t(oldpos, ctrl[2]); } /* Clean up the bzip2 reads */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r352695 - in head/sys: kern sys
On Wed, Sep 25, 2019 at 12:32 PM Kyle Evans wrote: > > Author: kevans > Date: Wed Sep 25 17:32:43 2019 > New Revision: 352695 > URL: https://svnweb.freebsd.org/changeset/base/352695 > > Log: > [1/3] Add mostly Linux-compatible file sealing support > > File sealing applies protections against certain actions > (currently: write, growth, shrink) at the inode level. New fileops are added > to accommodate seals - EINVAL is returned by fcntl(2) if they are not > implemented. > > Reviewed by: markj, kib > Differential Revision:https://reviews.freebsd.org/D21391 > Small nit, pointed out by koobs... the above should be Linux-compatible, not just mostly Linux-compatible. The initial version of this tried to implement file sealing at the completely wrong layer, which was caught in review and promptly fixed. Thanks, Kyle Evans ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352741 - in stable/12/sys: modules powerpc/conf
Author: imp Date: Thu Sep 26 12:54:52 2019 New Revision: 352741 URL: https://svnweb.freebsd.org/changeset/base/352741 Log: mpr/mps crash badly. Part of the stability added use of atomic64 functions not present on 32-bit powerpc. Merge the part that removes mps from the build on this tier 2 platform. Working mpr/mps in 12 and 12.1 on our tier 1 platforms is more important. MFC r341754: Remove the mps driver from powerpc 32bit GENERIC, and don't build it and mpr as a module for powerpc or mips. An upcoming commit will cause these drivers to rely on the presence of 64bit atomic operations. Discussed with jhibbits. Relnotes: YES Modified: stable/12/sys/modules/Makefile stable/12/sys/powerpc/conf/GENERIC Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/modules/Makefile == --- stable/12/sys/modules/Makefile Thu Sep 26 07:19:26 2019 (r352740) +++ stable/12/sys/modules/Makefile Thu Sep 26 12:54:52 2019 (r352741) @@ -256,8 +256,8 @@ SUBDIR= \ ${_mly} \ mmc \ mmcsd \ - mpr \ - mps \ + ${_mpr} \ + ${_mps} \ mpt \ mqueue \ mrsas \ @@ -557,6 +557,12 @@ _rtwnfw= rtwnfw ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \ ${MACHINE_CPUARCH} != "riscv" _cxgbe=cxgbe +.endif + +# These rely on 64bit atomics +.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "mips" +_mps= mps +_mpr= mpr .endif .if ${MK_TESTS} != "no" || defined(ALL_MODULES) Modified: stable/12/sys/powerpc/conf/GENERIC == --- stable/12/sys/powerpc/conf/GENERIC Thu Sep 26 07:19:26 2019 (r352740) +++ stable/12/sys/powerpc/conf/GENERIC Thu Sep 26 12:54:52 2019 (r352741) @@ -120,7 +120,6 @@ options AHC_ALLOW_MEMIO # Attempt to use memory mappe device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mpt # LSI-Logic MPT-Fusion -device mps # LSI-Logic MPT-Fusion 2 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352740 - head/sys/kern
Author: tsoome Date: Thu Sep 26 07:19:26 2019 New Revision: 352740 URL: https://svnweb.freebsd.org/changeset/base/352740 Log: kernel terminal should initialize fg and bg variables before calling TUNABLE_INT_FETCH We have two ways to check if kenv variable exists - either we check return value from TUNABLE_INT_FETCH, or we pre-initialize the variable and check if this value did change. In terminal_init() it is more convinient to use pre-initialized variables. Problem was revealed by older loader.efi, which did not set teken.* variables. Reported by: tuexen Modified: head/sys/kern/subr_terminal.c Modified: head/sys/kern/subr_terminal.c == --- head/sys/kern/subr_terminal.c Thu Sep 26 07:14:54 2019 (r352739) +++ head/sys/kern/subr_terminal.c Thu Sep 26 07:19:26 2019 (r352740) @@ -175,6 +175,7 @@ terminal_init(struct terminal *tm) teken_init(&tm->tm_emulator, &terminal_drawmethods, tm); + fg = bg = -1; TUNABLE_INT_FETCH("teken.fg_color", &fg); TUNABLE_INT_FETCH("teken.bg_color", &bg); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r352739 - head/sys/dev/vt/hw/fb
Author: tsoome Date: Thu Sep 26 07:14:54 2019 New Revision: 352739 URL: https://svnweb.freebsd.org/changeset/base/352739 Log: vt: use proper return value check with TUNABLE_INT_FETCH The TUNABLE_INT_FETCH is macro around getenv_int() and we will get return value 0 or 1 for failure or success, we can use it to decide which background color to use. Modified: head/sys/dev/vt/hw/fb/vt_fb.c Modified: head/sys/dev/vt/hw/fb/vt_fb.c == --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 26 03:09:45 2019 (r352738) +++ head/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 26 07:14:54 2019 (r352739) @@ -480,8 +480,7 @@ vt_fb_init(struct vt_device *vd) } c = TC_BLACK; - TUNABLE_INT_FETCH("teken.bg_color", &bg); - if (bg != -1) { + if (TUNABLE_INT_FETCH("teken.bg_color", &bg) != 0) { if (bg == TC_WHITE) bg |= TC_LIGHT; c = bg; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"