Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Kubilay Kocak

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 commit: r352787 - head/sys/dev/ioat

2019-09-26 Thread Alexander Motin
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

2019-09-26 Thread Warner Losh
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352786 - in head/contrib/ipfilter: man tools

2019-09-26 Thread Cy Schubert
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 *), sizeof(iph));
bzero((char *), 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, _type);
+   typearg = optarg;
+   break;
case 'v' :
opts |= OPT_VERBOSE;
break;
@@ -314,17 +318,22 @@ poolcommand(remove, argc, argv)
return -1;
}
 
-   type = gettype(argv[optind], _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(, ioctl);
+   break;
+   case IPLT_NONE :
+   err = 1;
+   {
+   int err_h, err_p;
+   err_h = remove_hash(, ioctl);
+   err_p = remove_pool(, ioctl);
+   if (err_h == 0 || err_p == 0)
+   err = 0;
+   }
break;
}
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352784 - head/contrib/ipfilter/man

2019-09-26 Thread Cy Schubert
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352785 - head/contrib/ipfilter/tools

2019-09-26 Thread Cy Schubert
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 *), sizeof(pnode));
bzero((char *), 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 *), sizeof(iph));
bzero((char *), 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352783 - head/contrib/ipfilter/man

2019-09-26 Thread Cy Schubert
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r352778 - in head/sys: conf sys

2019-09-26 Thread Ryan Stone
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352778 - in head/sys: conf sys

2019-09-26 Thread Gleb Smirnoff
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352776 - head/sys/dev/sound/pci/hda

2019-09-26 Thread Oleksandr Tymoshenko
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352775 - head/sys/dev/sound/pci/hda

2019-09-26 Thread Oleksandr Tymoshenko
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-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

2019-09-26 Thread Konstantin Belousov
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(_dict_lock);
> +
> + fd_from = shm_lookup(path_from, fnv_from);
> + if (fd_from == NULL) {
> + sx_xunlock(_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(_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(_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, but
> +  * 

Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Warner Losh
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 

Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Ryan Stone
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 

Re: svn commit: r338888 - head/sbin/devd

2019-09-26 Thread Renato Botelho
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Warner Losh
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
> ___
> 

svn commit: r352757 - in head: lib/libc/sys lib/libregex/tests stand/lua tests/sys/kern

2019-09-26 Thread Kyle Evans
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352756 - head/lib/libc/sys

2019-09-26 Thread David Bright
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-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

2019-09-26 Thread Kyle Evans
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 

svn commit: r352751 - in head/sys: compat/freebsd32 kern sys

2019-09-26 Thread David Bright
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: r352748 - head/sys/kern

2019-09-26 Thread Mark Johnston
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, )) {
-   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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss

2019-09-26 Thread David Bright
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 

svn commit: r352746 - head/sys/netinet

2019-09-26 Thread Jonathan T. Looney
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(_tcp_syncache.secret.reseed, SYNCOOKIE_LIFETIME * hz,
syncookie_reseed, _tcp_syncache);
+
+   /* Initialize the pause machinery. */
+   mtx_init(_tcp_syncache.pause_mtx, "tcp_sc_pause", NULL, MTX_DEF);
+   callout_init_mtx(_tcp_syncache.pause_co, _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(_tcp_syncache.secret.reseed);
 
+   /* Stop the SYN cache pause callout. */
+   mtx_lock(_tcp_syncache.pause_mtx);
+   if (callout_stop(_tcp_syncache.pause_co) == 0) {
+   mtx_unlock(_tcp_syncache.pause_mtx);
+   callout_drain(_tcp_syncache.pause_co);
+   } else
+   mtx_unlock(_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(_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_bucket),
("sch->sch_length incorrect"));
+   syncache_pause(>sc_inc);
sc2 = TAILQ_LAST(>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(_tcp_syncache.pause_mtx);
+   paused = V_tcp_syncache.paused;
+   mtx_unlock(_tcp_syncache.pause_mtx);
+
TAILQ_FOREACH_SAFE(sc, >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 case where the listen socket may be
@@ -505,14 

Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Niclas Zeising

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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352745 - head/sys/netinet

2019-09-26 Thread Jonathan T. Looney
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_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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Charlie Li via svn-src-head
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

2019-09-26 Thread Kyle Evans
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 

svn commit: r352743 - head/sys/cam/scsi

2019-09-26 Thread Alexander Motin
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(, 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, );
+   softc->quirks = quirks;
 
if (SID_TYPE(>inq_data) == T_ZBC_HM)
softc->zone_mode = DA_ZONE_HOST_MANAGED;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-09-26 Thread Charlie Li via svn-src-head
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

2019-09-26 Thread Ed Maste
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, ))
+   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(, 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(, 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(, 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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r352695 - in head/sys: kern sys

2019-09-26 Thread Kyle Evans
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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352740 - head/sys/kern

2019-09-26 Thread Toomas Soome
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_emulator, _drawmethods, tm);
 
+   fg = bg = -1;
TUNABLE_INT_FETCH("teken.fg_color", );
TUNABLE_INT_FETCH("teken.bg_color", );
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r352739 - head/sys/dev/vt/hw/fb

2019-09-26 Thread Toomas Soome
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", );
-   if (bg != -1) {
+   if (TUNABLE_INT_FETCH("teken.bg_color", ) != 0) {
if (bg == TC_WHITE)
bg |= TC_LIGHT;
c = bg;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"