svn commit: r343254 - stable/12/sys/kern

2019-01-21 Thread Jason A. Harmening
Author: jah
Date: Mon Jan 21 08:24:49 2019
New Revision: 343254
URL: https://svnweb.freebsd.org/changeset/base/343254

Log:
  MFC r343005: Handle SIGIO for listening sockets
  
  r319722 separated struct socket and parts of the socket I/O path into
  listening-socket-specific and dataflow-socket-specific pieces.  Listening
  socket connection notifications are now handled by solisten_wakeup() instead
  of sowakeup(), but solisten_wakeup() does not currently post SIGIO to the
  owning process.
  
  PR:   234258

Modified:
  stable/12/sys/kern/uipc_socket.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/uipc_socket.c
==
--- stable/12/sys/kern/uipc_socket.cMon Jan 21 07:44:46 2019
(r343253)
+++ stable/12/sys/kern/uipc_socket.cMon Jan 21 08:24:49 2019
(r343254)
@@ -886,6 +886,8 @@ solisten_wakeup(struct socket *sol)
}
SOLISTEN_UNLOCK(sol);
wakeup_one(&sol->sol_comp);
+   if ((sol->so_state & SS_ASYNC) && sol->so_sigio != NULL)
+   pgsigio(&sol->so_sigio, SIGIO, 0);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343255 - head/sys/arm/allwinner

2019-01-21 Thread Kyle Evans
Author: kevans
Date: Mon Jan 21 14:35:36 2019
New Revision: 343255
URL: https://svnweb.freebsd.org/changeset/base/343255

Log:
  awg: fix soft reset failure with no link
  
  U-Boot will leave the ephy reset de-asserted and the MAC soft reset will
  fail on these boards with internal PHY and no link established. Toggle reset
  again before proceeding to attach/init.
  
  MFC after:1 week

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Mon Jan 21 08:24:49 2019
(r343254)
+++ head/sys/arm/allwinner/if_awg.c Mon Jan 21 14:35:36 2019
(r343255)
@@ -1466,6 +1466,12 @@ awg_setup_extres(device_t dev)
goto fail;
}
if (rst_ephy != NULL) {
+   /*
+* The ephy reset is left de-asserted by U-Boot.  Assert it
+* here to make sure that we're in a known good state going
+* into the PHY reset.
+*/
+   hwreset_assert(rst_ephy);
error = hwreset_deassert(rst_ephy);
if (error != 0) {
device_printf(dev, "cannot de-assert ephy reset\n");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343256 - stable/12/lib/msun/src

2019-01-21 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 21 14:52:48 2019
New Revision: 343256
URL: https://svnweb.freebsd.org/changeset/base/343256

Log:
  MFC r343023:
  msun: reduce diff between src/e_j0.c and src/e_j0f.c
  
  PR:   229501

Modified:
  stable/12/lib/msun/src/e_j0.c
  stable/12/lib/msun/src/e_j0f.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/msun/src/e_j0.c
==
--- stable/12/lib/msun/src/e_j0.c   Mon Jan 21 14:35:36 2019
(r343255)
+++ stable/12/lib/msun/src/e_j0.c   Mon Jan 21 14:52:48 2019
(r343256)
@@ -80,7 +80,7 @@ S02  =  1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD
 S03  =  5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
 S04  =  1.166140079205e-09; /* 0x3E1408BC, 0xF4745D8F */
 
-static const double zero = 0.0;
+static const double zero = 0, qrtr = 0.25;
 
 double
 __ieee754_j0(double x)
@@ -97,7 +97,7 @@ __ieee754_j0(double x)
c = cos(x);
ss = s-c;
cc = s+c;
-   if(ix<0x7fe0) {  /* make sure x+x not overflow */
+   if(ix<0x7fe0) {  /* Make sure x+x does not overflow. */
z = -cos(x+x);
if ((s*c)https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343257 - stable/11/lib/msun/src

2019-01-21 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 21 14:54:01 2019
New Revision: 343257
URL: https://svnweb.freebsd.org/changeset/base/343257

Log:
  MFC r343023:
  msun: reduce diff between src/e_j0.c and src/e_j0f.c
  
  PR:   229501

Modified:
  stable/11/lib/msun/src/e_j0.c
  stable/11/lib/msun/src/e_j0f.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/msun/src/e_j0.c
==
--- stable/11/lib/msun/src/e_j0.c   Mon Jan 21 14:52:48 2019
(r343256)
+++ stable/11/lib/msun/src/e_j0.c   Mon Jan 21 14:54:01 2019
(r343257)
@@ -80,7 +80,7 @@ S02  =  1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD
 S03  =  5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
 S04  =  1.166140079205e-09; /* 0x3E1408BC, 0xF4745D8F */
 
-static const double zero = 0.0;
+static const double zero = 0, qrtr = 0.25;
 
 double
 __ieee754_j0(double x)
@@ -97,7 +97,7 @@ __ieee754_j0(double x)
c = cos(x);
ss = s-c;
cc = s+c;
-   if(ix<0x7fe0) {  /* make sure x+x not overflow */
+   if(ix<0x7fe0) {  /* Make sure x+x does not overflow. */
z = -cos(x+x);
if ((s*c)https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343258 - stable/10/lib/msun/src

2019-01-21 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 21 14:55:10 2019
New Revision: 343258
URL: https://svnweb.freebsd.org/changeset/base/343258

Log:
  MFC r343023:
  msun: reduce diff between src/e_j0.c and src/e_j0f.c
  
  PR:   229501

Modified:
  stable/10/lib/msun/src/e_j0.c
  stable/10/lib/msun/src/e_j0f.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/msun/src/e_j0.c
==
--- stable/10/lib/msun/src/e_j0.c   Mon Jan 21 14:54:01 2019
(r343257)
+++ stable/10/lib/msun/src/e_j0.c   Mon Jan 21 14:55:10 2019
(r343258)
@@ -81,7 +81,7 @@ S02  =  1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD
 S03  =  5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
 S04  =  1.166140079205e-09; /* 0x3E1408BC, 0xF4745D8F */
 
-static const double zero = 0.0;
+static const double zero = 0, qrtr = 0.25;
 
 double
 __ieee754_j0(double x)
@@ -98,7 +98,7 @@ __ieee754_j0(double x)
c = cos(x);
ss = s-c;
cc = s+c;
-   if(ix<0x7fe0) {  /* make sure x+x not overflow */
+   if(ix<0x7fe0) {  /* Make sure x+x does not overflow. */
z = -cos(x+x);
if ((s*c)https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343259 - head/usr.bin/units

2019-01-21 Thread Glen Barber
Author: gjb
Date: Mon Jan 21 15:27:58 2019
New Revision: 343259
URL: https://svnweb.freebsd.org/changeset/base/343259

Log:
  Correct a typo: was -> way.
  
  Submitted by: Larry Hynes
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/units/units.1

Modified: head/usr.bin/units/units.1
==
--- head/usr.bin/units/units.1  Mon Jan 21 14:55:10 2019(r343258)
+++ head/usr.bin/units/units.1  Mon Jan 21 15:27:58 2019(r343259)
@@ -158,7 +158,7 @@ by careless unit definitions.
 Comments in the unit definition file
 begin with a '#' or '/' character at the beginning of a line.
 .Pp
-Prefixes are defined in the same was as standard units, but with
+Prefixes are defined in the same way as standard units, but with
 a trailing dash at the end of the prefix name.
 If a unit is not found
 even after removing trailing 's' or 'es', then it will be checked
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343260 - head/sys/compat/linux

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 16:19:02 2019
New Revision: 343260
URL: https://svnweb.freebsd.org/changeset/base/343260

Log:
  linuxulator: fix stack memory disclosure in linux_ioctl_v4l
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich 
  Reviewed by:  andrew
  MFC after:1 day
  Security: Kernel stack memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_ioctl.c

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Mon Jan 21 15:27:58 2019
(r343259)
+++ head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:19:02 2019
(r343260)
@@ -2843,6 +2843,8 @@ linux_to_bsd_v4l_window(struct l_video_window *lvw, st
 static int
 bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw)
 {
+   memset(lvw, 0, sizeof(*lvw));
+
lvw->x = vw->x;
lvw->y = vw->y;
lvw->width = vw->width;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343261 - head/sys/compat/linux

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 16:21:03 2019
New Revision: 343261
URL: https://svnweb.freebsd.org/changeset/base/343261

Log:
  linuxulator: fix stack memory disclosure in linux_ioctl_termio
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich 
  Reviewed by:  andrew
  MFC after:1 day
  Security: Kernel stack memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_ioctl.c

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:19:02 2019
(r343260)
+++ head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:21:03 2019
(r343261)
@@ -686,6 +686,7 @@ bsd_to_linux_termio(struct termios *bios, struct linux
 {
struct linux_termios lios;
 
+   memset(lio, 0, sizeof(*lio));
bsd_to_linux_termios(bios, &lios);
lio->c_iflag = lios.c_iflag;
lio->c_oflag = lios.c_oflag;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343262 - head/sys/amd64/linux

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 16:25:40 2019
New Revision: 343262
URL: https://svnweb.freebsd.org/changeset/base/343262

Log:
  linuxulator: fix stack memory disclosure in linux_sigaltstack
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich 
  Reviewed by:  andrew
  MFC after:1 day
  Security: Kernel memory disclosure
  Sponsored by:   The FreeBSD Foundation

Modified:
  head/sys/amd64/linux/linux_machdep.c

Modified: head/sys/amd64/linux/linux_machdep.c
==
--- head/sys/amd64/linux/linux_machdep.cMon Jan 21 16:21:03 2019
(r343261)
+++ head/sys/amd64/linux/linux_machdep.cMon Jan 21 16:25:40 2019
(r343262)
@@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct linux_siga
l_stack_t lss;
int error;
 
+   memset(&lss, 0, sizeof(lss));
LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss);
 
if (uap->uss != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343263 - head/sys/compat/linux

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 17:12:16 2019
New Revision: 343263
URL: https://svnweb.freebsd.org/changeset/base/343263

Log:
  linuxulator: fix stack memory disclosure in linux_sigaltstack
  
  Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before
  callit it, but linux_waitid did not.  Instead of zeroing in the called
  function to address linux_waitid (as in commit 2e6ebe70), just do it in
  linux_waitid.
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich 
  Reviewed by:  Andrew
  MFC after:1 day
  Security: Kernel stack memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_misc.c

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Mon Jan 21 16:25:40 2019
(r343262)
+++ head/sys/compat/linux/linux_misc.c  Mon Jan 21 17:12:16 2019
(r343263)
@@ -1089,9 +1089,8 @@ linux_waitid(struct thread *td, struct linux_waitid_ar
}
if (args->info != NULL) {
p = td->td_proc;
-   if (td->td_retval[0] == 0)
-   bzero(&lsi, sizeof(lsi));
-   else {
+   bzero(&lsi, sizeof(lsi));
+   if (td->td_retval[0] != 0) {
sig = bsd_to_linux_signal(siginfo.si_signo);
siginfo_to_lsiginfo(&siginfo, &lsi, sig);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343263 - head/sys/compat/linux

2019-01-21 Thread Ed Maste
On Mon, 21 Jan 2019 at 12:12, Ed Maste  wrote:
>
> Author: emaste
> Date: Mon Jan 21 17:12:16 2019
> New Revision: 343263
> URL: https://svnweb.freebsd.org/changeset/base/343263
>
> Log:
>   linuxulator: fix stack memory disclosure in linux_sigaltstack
>
>   Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before
>   callit it, but linux_waitid did not.  Instead of zeroing in the called
>   function to address linux_waitid (as in commit 2e6ebe70), just do it in
>   linux_waitid.

Oops, I meant to edit the commit message to remove the git hash (from
my WIP tree). My original change for this issue zeroed the struct in
siginfo_to_lsiginfo.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343264 - head/sys/dev/cxgbe

2019-01-21 Thread Navdeep Parhar
Author: np
Date: Mon Jan 21 17:58:06 2019
New Revision: 343264
URL: https://svnweb.freebsd.org/changeset/base/343264

Log:
  cxgbe(4): Use a truncated firmware header for version checks.  All the
  version numbers are towards the begining of the header.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Jan 21 17:12:16 2019
(r343263)
+++ head/sys/dev/cxgbe/t4_main.cMon Jan 21 17:58:06 2019
(r343264)
@@ -3324,17 +3324,38 @@ restart:
 V_FW_HDR_FW_VER_BUILD(chip##FW_VERSION_BUILD))
 #define FW_INTFVER(chip, intf) (chip##FW_HDR_INTFVER_##intf)
 
+/* Just enough of fw_hdr to cover all version info. */
+struct fw_h {
+   __u8ver;
+   __u8chip;
+   __be16  len512;
+   __be32  fw_ver;
+   __be32  tp_microcode_ver;
+   __u8intfver_nic;
+   __u8intfver_vnic;
+   __u8intfver_ofld;
+   __u8intfver_ri;
+   __u8intfver_iscsipdu;
+   __u8intfver_iscsi;
+   __u8intfver_fcoepdu;
+   __u8intfver_fcoe;
+};
+/* Spot check a couple of fields. */
+CTASSERT(offsetof(struct fw_h, fw_ver) == offsetof(struct fw_hdr, fw_ver));
+CTASSERT(offsetof(struct fw_h, intfver_nic) == offsetof(struct fw_hdr, 
intfver_nic));
+CTASSERT(offsetof(struct fw_h, intfver_fcoe) == offsetof(struct fw_hdr, 
intfver_fcoe));
+
 struct fw_info {
uint8_t chip;
char *kld_name;
char *fw_mod_name;
-   struct fw_hdr fw_hdr;   /* XXX: waste of space, need a sparse struct */
+   struct fw_h fw_h;
 } fw_info[] = {
{
.chip = CHELSIO_T4,
.kld_name = "t4fw_cfg",
.fw_mod_name = "t4fw",
-   .fw_hdr = {
+   .fw_h = {
.chip = FW_HDR_CHIP_T4,
.fw_ver = htobe32(FW_VERSION(T4)),
.intfver_nic = FW_INTFVER(T4, NIC),
@@ -3350,7 +3371,7 @@ struct fw_info {
.chip = CHELSIO_T5,
.kld_name = "t5fw_cfg",
.fw_mod_name = "t5fw",
-   .fw_hdr = {
+   .fw_h = {
.chip = FW_HDR_CHIP_T5,
.fw_ver = htobe32(FW_VERSION(T5)),
.intfver_nic = FW_INTFVER(T5, NIC),
@@ -3366,7 +3387,7 @@ struct fw_info {
.chip = CHELSIO_T6,
.kld_name = "t6fw_cfg",
.fw_mod_name = "t6fw",
-   .fw_hdr = {
+   .fw_h = {
.chip = FW_HDR_CHIP_T6,
.fw_ver = htobe32(FW_VERSION(T6)),
.intfver_nic = FW_INTFVER(T6, NIC),
@@ -3398,7 +3419,7 @@ find_fw_info(int chip)
  * with?
  */
 static int
-fw_compatible(const struct fw_hdr *hdr1, const struct fw_hdr *hdr2)
+fw_compatible(const struct fw_h *hdr1, const struct fw_h *hdr2)
 {
 
/* short circuit if it's the exact same firmware version */
@@ -3465,8 +3486,8 @@ unload_fw_module(struct adapter *sc, const struct firm
  * +ve errno means a firmware install was attempted but failed.
  */
 static int
-install_kld_firmware(struct adapter *sc, struct fw_hdr *card_fw,
-const struct fw_hdr *drv_fw, const char *reason, int *already)
+install_kld_firmware(struct adapter *sc, struct fw_h *card_fw,
+const struct fw_h *drv_fw, const char *reason, int *already)
 {
const struct firmware *cfg, *fw;
const uint32_t c = be32toh(card_fw->fw_ver);
@@ -3571,7 +3592,7 @@ contact_firmware(struct adapter *sc)
enum dev_state state;
struct fw_info *fw_info;
struct fw_hdr *card_fw; /* fw on the card */
-   const struct fw_hdr *drv_fw;/* fw bundled with the driver */
+   const struct fw_h *drv_fw;
 
fw_info = find_fw_info(chip_id(sc));
if (fw_info == NULL) {
@@ -3580,7 +3601,7 @@ contact_firmware(struct adapter *sc)
chip_id(sc));
return (EINVAL);
}
-   drv_fw = &fw_info->fw_hdr;
+   drv_fw = &fw_info->fw_h;
 
/* Read the header of the firmware on the card */
card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK);
@@ -3593,7 +3614,8 @@ restart:
goto done;
}
 
-   rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already);
+   rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, NULL,
+   &already);
if (rc == ERESTART)
goto restart;
if (rc != 0)
@@ -3606,7 +3628,7 @@ restart:
"failed to connect to the firmware: %d, %d.  "
"PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW));
 #if 0
-   if (install_kld_firmware(sc, card_fw, drv_fw,
+   if (install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw,
  

svn commit: r343265 - head/sys/dev/hwpmc

2019-01-21 Thread Mark Johnston
Author: markj
Date: Mon Jan 21 18:07:02 2019
New Revision: 343265
URL: https://svnweb.freebsd.org/changeset/base/343265

Log:
  hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}.
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich 
  MFC after:1 day
  Security: Kernel memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Mon Jan 21 17:58:06 2019
(r343264)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Mon Jan 21 18:07:02 2019
(r343265)
@@ -3512,6 +3512,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a
struct pmc_classdep *pcd;
int cl;
 
+   memset(&gci, 0, sizeof(gci));
gci.pm_cputype = md->pmd_cputype;
gci.pm_ncpu= pmc_cpu_max();
gci.pm_npmc= md->pmd_npmc;
@@ -3661,7 +3662,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a
npmc = md->pmd_npmc;
 
pmcinfo_size = npmc * sizeof(struct pmc_info);
-   pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK);
+   pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK | M_ZERO);
 
p = pmcinfo;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343266 - stable/12/usr.sbin/freebsd-update

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 18:34:33 2019
New Revision: 343266
URL: https://svnweb.freebsd.org/changeset/base/343266

Log:
  MFC r343153: freebsd-update.8: mandoc -Tlint fixes
  
  PR:   185389

Modified:
  stable/12/usr.sbin/freebsd-update/freebsd-update.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8
==
--- stable/12/usr.sbin/freebsd-update/freebsd-update.8  Mon Jan 21 18:07:02 
2019(r343265)
+++ stable/12/usr.sbin/freebsd-update/freebsd-update.8  Mon Jan 21 18:34:33 
2019(r343266)
@@ -27,7 +27,7 @@
 .\"
 .Dd June 14, 2017
 .Dt FREEBSD-UPDATE 8
-.Os FreeBSD
+.Os
 .Sh NAME
 .Nm freebsd-update
 .Nd fetch and install binary updates to FreeBSD
@@ -47,9 +47,12 @@
 The
 .Nm
 tool is used to fetch, install, and rollback binary
-updates to the FreeBSD base system.
+updates to the
+.Fx
+base system.
 Note that updates are only available if they are being built for the
-FreeBSD release and architecture being used; in particular, the
+.Fx
+release and architecture being used; in particular, the
 .Fx
 Security Team only builds updates for releases shipped in binary form
 by the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343267 - stable/11/usr.sbin/freebsd-update

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 18:35:39 2019
New Revision: 343267
URL: https://svnweb.freebsd.org/changeset/base/343267

Log:
  MFC r343153: freebsd-update.8: mandoc -Tlint fixes
  
  PR:   185389

Modified:
  stable/11/usr.sbin/freebsd-update/freebsd-update.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8
==
--- stable/11/usr.sbin/freebsd-update/freebsd-update.8  Mon Jan 21 18:34:33 
2019(r343266)
+++ stable/11/usr.sbin/freebsd-update/freebsd-update.8  Mon Jan 21 18:35:39 
2019(r343267)
@@ -27,7 +27,7 @@
 .\"
 .Dd June 14, 2017
 .Dt FREEBSD-UPDATE 8
-.Os FreeBSD
+.Os
 .Sh NAME
 .Nm freebsd-update
 .Nd fetch and install binary updates to FreeBSD
@@ -47,9 +47,12 @@
 The
 .Nm
 tool is used to fetch, install, and rollback binary
-updates to the FreeBSD base system.
+updates to the
+.Fx
+base system.
 Note that updates are only available if they are being built for the
-FreeBSD release and architecture being used; in particular, the
+.Fx
+release and architecture being used; in particular, the
 .Fx
 Security Team only builds updates for releases shipped in binary form
 by the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343269 - head/sys/dev/cxgbe

2019-01-21 Thread Navdeep Parhar
Author: np
Date: Mon Jan 21 18:42:16 2019
New Revision: 343269
URL: https://svnweb.freebsd.org/changeset/base/343269

Log:
  cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to
  mean that the driver should taste the firmware in the KLD and use that
  firmware's version for all its fw_install checks.
  
  The driver gets firmware version information from compiled-in values by
  default and this change allows custom (or older/newer) firmware modules
  to be used with the stock driver.
  
  There is no change in default behavior.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Jan 21 18:41:57 2019
(r343268)
+++ head/sys/dev/cxgbe/t4_main.cMon Jan 21 18:42:16 2019
(r343269)
@@ -480,9 +480,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, autoneg, CTLFLAG_RDTUN
 
 /*
  * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, 
allowed,
- * encouraged respectively).
+ * encouraged respectively).  '-n' is the same as 'n' except the firmware
+ * version used in the checks is read from the firmware bundled with the 
driver.
  */
-static unsigned int t4_fw_install = 1;
+static int t4_fw_install = 1;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, fw_install, CTLFLAG_RDTUN, &t4_fw_install, 0,
 "Firmware auto-install (0 = prohibited, 1 = allowed, 2 = encouraged)");
 
@@ -3491,10 +3492,15 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
 {
const struct firmware *cfg, *fw;
const uint32_t c = be32toh(card_fw->fw_ver);
-   const uint32_t d = be32toh(drv_fw->fw_ver);
-   uint32_t k;
-   int rc;
+   uint32_t d, k;
+   int rc, fw_install;
+   struct fw_h bundled_fw;
+   bool load_attempted;
 
+   cfg = fw = NULL;
+   load_attempted = false;
+   fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install;
+
if (reason != NULL)
goto install;
 
@@ -3508,7 +3514,23 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
return (0);
}
 
-   if (!fw_compatible(card_fw, drv_fw)) {
+   memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw));
+   if (t4_fw_install < 0) {
+   rc = load_fw_module(sc, &cfg, &fw);
+   if (rc != 0 || fw == NULL) {
+   device_printf(sc->dev,
+   "failed to load firmware module: %d. cfg %p, fw %p;"
+   " will use compiled-in firmware version for"
+   "hw.cxgbe.fw_install checks.\n",
+   rc, cfg, fw);
+   } else {
+   memcpy(&bundled_fw, fw->data, sizeof(bundled_fw));
+   }
+   load_attempted = true;
+   }
+   d = be32toh(bundled_fw.fw_ver);
+
+   if (!fw_compatible(card_fw, &bundled_fw)) {
reason = "incompatible or unusable";
goto install;
}
@@ -3518,52 +3540,72 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
goto install;
}
 
-   if (t4_fw_install == 2 && d != c) {
+   if (fw_install == 2 && d != c) {
reason = "different than the version bundled with this driver";
goto install;
}
 
-   return (0);
+   /* No reason to do anything to the firmware already on the card. */
+   rc = 0;
+   goto done;
 
 install:
+   rc = 0;
if ((*already)++)
-   return (0);
+   goto done;
 
-   if (t4_fw_install == 0) {
+   if (fw_install == 0) {
device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
"but the driver is prohibited from installing a firmware "
"on the card.\n",
G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason);
 
-   return (0);
+   goto done;
}
 
-   device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
-   "installing firmware %u.%u.%u.%u on card.\n",
-   G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
-   G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason,
-   G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d),
-   G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d));
-
-   rc = load_fw_module(sc, &cfg, &fw);
-   if (rc != 0 || fw == NULL) {
-   device_printf(sc->dev,
-   "failed to load firmware module: %d. cfg %p, fw %p\n", rc,
-   cfg, fw);
+   /*
+* We'll attempt to install a firmware.  Load the module first (if it
+* hasn't been loaded already).
+*/
+   if (!load_attempted) {
+   rc = load_fw_modul

svn commit: r343268 - head/usr.sbin/freebsd-update

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 18:41:57 2019
New Revision: 343268
URL: https://svnweb.freebsd.org/changeset/base/343268

Log:
  frebsd-update: fix --currently-running after r343122
  
  PR:   234771
  Submitted by: Gerald Aryeetey 
  Reported by:  Brandon Schneider
  MFC with: r343122
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18896

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Jan 21 18:35:39 
2019(r343267)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Jan 21 18:41:57 
2019(r343268)
@@ -310,6 +310,7 @@ config_SourceRelease () {
if echo ${UNAME_r} | grep -qE '^[0-9.]+$'; then
UNAME_r="${UNAME_r}-RELEASE"
fi
+   export UNAME_r
 }
 
 # Define what happens to output of utilities
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343262 - head/sys/amd64/linux

2019-01-21 Thread Cy Schubert
On January 21, 2019 8:25:41 AM PST, Ed Maste  wrote:
>Author: emaste
>Date: Mon Jan 21 16:25:40 2019
>New Revision: 343262
>URL: https://svnweb.freebsd.org/changeset/base/343262
>
>Log:
>  linuxulator: fix stack memory disclosure in linux_sigaltstack
>  
>  admbugs: 765
>  Reported by: Vlad Tsyrklevich 
>  Reviewed by: andrew
>  MFC after:   1 day
>  Security:Kernel memory disclosure
>  Sponsored by:   The FreeBSD Foundation
>
>Modified:
>  head/sys/amd64/linux/linux_machdep.c
>
>Modified: head/sys/amd64/linux/linux_machdep.c
>==
>--- head/sys/amd64/linux/linux_machdep.c   Mon Jan 21 16:21:03
>2019   (r343261)
>+++ head/sys/amd64/linux/linux_machdep.c   Mon Jan 21 16:25:40
>2019   (r343262)
>@@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct
>linux_siga
>   l_stack_t lss;
>   int error;
> 
>+  memset(&lss, 0, sizeof(lss));
>   LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss);
> 
>   if (uap->uss != NULL) {

Do we have a CVE for this?
-- 
Pardon the typos and autocorrect, small keyboard in use.
Cheers,
Cy Schubert 
FreeBSD UNIX:  Web: http://www.FreeBSD.org

The need of the many outweighs the greed of the few.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343270 - head/usr.sbin/freebsd-update

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 19:04:37 2019
New Revision: 343270
URL: https://svnweb.freebsd.org/changeset/base/343270

Log:
  freebsd-update: Update /etc/passwd after password db changes
  
  Add -p to pwd_mkdb in order to ensure password db changes are also
  included in /etc/passwd.
  
  PR:   165954, 232921, 229487
  Submitted by: Gerald Aryeetey 
  Reviewed by:  jilles
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18827

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Jan 21 18:42:16 
2019(r343269)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Jan 21 19:04:37 
2019(r343270)
@@ -2918,10 +2918,11 @@ Kernel updates have been installed.  Please reboot and
install_from_index INDEX-NEW || return 1
install_delete INDEX-OLD INDEX-NEW || return 1
 
-   # Rebuild /etc/spwd.db and /etc/pwd.db if necessary.
+   # Rebuild generated pwd files.
if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] 
||
-   [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ]; 
then
-   pwd_mkdb -d ${BASEDIR}/etc ${BASEDIR}/etc/master.passwd
+   [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ] 
||
+   [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/passwd ]; 
then
+   pwd_mkdb -d ${BASEDIR}/etc -p 
${BASEDIR}/etc/master.passwd
fi
 
# Rebuild /etc/login.conf.db if necessary.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343271 - head/usr.sbin/freebsd-update

2019-01-21 Thread Ed Maste
Author: emaste
Date: Mon Jan 21 19:21:11 2019
New Revision: 343271
URL: https://svnweb.freebsd.org/changeset/base/343271

Log:
  freebsd-update: Allow upgrade from pre-release builds
  
  Update r343122 to include -ALPHA, -BETA and -RC releases as
  upgrade-able via freebsd-update.
  
  PR:   234771
  Submitted by: Gerald Aryeetey 
  Reported by:  delphij, des
  Reviewed by:  delphij
  MFC with: r343122
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D18881

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Jan 21 19:04:37 
2019(r343270)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Mon Jan 21 19:21:11 
2019(r343271)
@@ -668,17 +668,23 @@ fetchupgrade_check_params () {
FETCHDIR=${RELNUM}/${ARCH}
PATCHDIR=${RELNUM}/${ARCH}/bp
 
-   # Disallow upgrade from a version that is not `-RELEASE`
-   if ! echo "${RELNUM}" | grep -qE -- "-RELEASE$"; then
-   echo -n "`basename $0`: "
-   cat  <<- EOF
-   Cannot upgrade from a version that is not a '-RELEASE' 
using `basename $0`. 
-   Instead, FreeBSD can be directly upgraded by source or 
upgraded to a 
-   RELEASE/RELENG version prior to running `basename $0`.
-   EOF
-   echo "System version: ${RELNUM}"
-   exit 1
-   fi
+   # Disallow upgrade from a version that is not a release
+   case ${RELNUM} in
+   *-RELEASE | *-ALPHA*  | *-BETA* | *-RC*)
+   ;;
+   *)
+   echo -n "`basename $0`: "
+   cat <<- EOF
+   Cannot upgrade from a version that is not a 
release
+   (including alpha, beta and release candidates)
+   using `basename $0`. Instead, FreeBSD can be 
directly
+   upgraded by source or upgraded to a 
RELEASE/RELENG version
+   prior to running `basename $0`.
+   Currently running: ${RELNUM}
+   EOF
+   exit 1
+   ;;
+   esac
 
# Figure out what directory contains the running kernel
BOOTFILE=`sysctl -n kern.bootfile`
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343272 - stable/12/sys/netinet

2019-01-21 Thread Brooks Davis
Author: brooks
Date: Mon Jan 21 19:22:02 2019
New Revision: 343272
URL: https://svnweb.freebsd.org/changeset/base/343272

Log:
  MFC r343162:
  
  Make SIFTR work again after r342125 (D18443).
  
  Correct a logic error.
  
  Only disable when already enabled or enable when disabled.
  
  Submitted by: Richard Scheffenegger
  Reviewed by:  Cheng Cui
  Obtained from:Cheng Cui
  Differential Revision:https://reviews.freebsd.org/D18885

Modified:
  stable/12/sys/netinet/siftr.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/siftr.c
==
--- stable/12/sys/netinet/siftr.c   Mon Jan 21 19:21:11 2019
(r343271)
+++ stable/12/sys/netinet/siftr.c   Mon Jan 21 19:22:02 2019
(r343272)
@@ -1219,7 +1219,7 @@ siftr_manage_ops(uint8_t action)
if ((s = sbuf_new(NULL, NULL, 200, SBUF_AUTOEXTEND)) == NULL)
return (-1);
 
-   if (action == SIFTR_ENABLE) {
+   if (action == SIFTR_ENABLE && siftr_pkt_manager_thr == NULL) {
/*
 * Create our alq
 * XXX: We should abort if alq_open fails!
@@ -1424,7 +1424,8 @@ siftr_manage_ops(uint8_t action)
 
alq_close(siftr_alq);
siftr_alq = NULL;
-   }
+   } else
+   error = EINVAL;
 
sbuf_delete(s);
 
@@ -1445,13 +1446,15 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS)
 
new = siftr_enabled;
error = sysctl_handle_int(oidp, &new, 0, req);
-   if (error != 0 && req->newptr != NULL) {
+   if (error == 0 && req->newptr != NULL) {
if (new > 1)
return (EINVAL);
else if (new != siftr_enabled) {
-   error = siftr_manage_ops(new);
-   if (error != 0)
+   if ((error = siftr_manage_ops(new)) == 0) {
+   siftr_enabled = new;
+   } else {
siftr_manage_ops(SIFTR_DISABLE);
+   }
}
}
 
@@ -1462,7 +1465,9 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS)
 static void
 siftr_shutdown_handler(void *arg)
 {
-   siftr_manage_ops(SIFTR_DISABLE);
+   if (siftr_enabled == 1) {
+   siftr_manage_ops(SIFTR_DISABLE);
+   }
 }
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343273 - stable/11/sys/netinet

2019-01-21 Thread Brooks Davis
Author: brooks
Date: Mon Jan 21 19:33:05 2019
New Revision: 343273
URL: https://svnweb.freebsd.org/changeset/base/343273

Log:
  MFC r343162:
  
  Make SIFTR work again after r342125 (D18443).
  
  Correct a logic error.
  
  Only disable when already enabled or enable when disabled.
  
  Submitted by: Richard Scheffenegger
  Reviewed by:  Cheng Cui
  Obtained from:Cheng Cui
  Differential Revision:https://reviews.freebsd.org/D18885

Modified:
  stable/11/sys/netinet/siftr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/siftr.c
==
--- stable/11/sys/netinet/siftr.c   Mon Jan 21 19:22:02 2019
(r343272)
+++ stable/11/sys/netinet/siftr.c   Mon Jan 21 19:33:05 2019
(r343273)
@@ -1217,7 +1217,7 @@ siftr_manage_ops(uint8_t action)
if ((s = sbuf_new(NULL, NULL, 200, SBUF_AUTOEXTEND)) == NULL)
return (-1);
 
-   if (action == SIFTR_ENABLE) {
+   if (action == SIFTR_ENABLE && siftr_pkt_manager_thr == NULL) {
/*
 * Create our alq
 * XXX: We should abort if alq_open fails!
@@ -1422,7 +1422,8 @@ siftr_manage_ops(uint8_t action)
 
alq_close(siftr_alq);
siftr_alq = NULL;
-   }
+   } else
+   error = EINVAL;
 
sbuf_delete(s);
 
@@ -1443,13 +1444,15 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS)
 
new = siftr_enabled;
error = sysctl_handle_int(oidp, &new, 0, req);
-   if (error != 0 && req->newptr != NULL) {
+   if (error == 0 && req->newptr != NULL) {
if (new > 1)
return (EINVAL);
else if (new != siftr_enabled) {
-   error = siftr_manage_ops(new);
-   if (error != 0)
+   if ((error = siftr_manage_ops(new)) == 0) {
+   siftr_enabled = new;
+   } else {
siftr_manage_ops(SIFTR_DISABLE);
+   }
}
}
 
@@ -1460,7 +1463,9 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS)
 static void
 siftr_shutdown_handler(void *arg)
 {
-   siftr_manage_ops(SIFTR_DISABLE);
+   if (siftr_enabled == 1) {
+   siftr_manage_ops(SIFTR_DISABLE);
+   }
 }
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343274 - head/sys/riscv/riscv

2019-01-21 Thread Mark Johnston
Author: markj
Date: Mon Jan 21 19:37:12 2019
New Revision: 343274
URL: https://svnweb.freebsd.org/changeset/base/343274

Log:
  Deduplicate common code in copyin()/copyout() with a macro.
  
  No functional change intended.
  
  Submitted by: Mitchell Horne 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18850

Modified:
  head/sys/riscv/riscv/copyinout.S

Modified: head/sys/riscv/riscv/copyinout.S
==
--- head/sys/riscv/riscv/copyinout.SMon Jan 21 19:33:05 2019
(r343273)
+++ head/sys/riscv/riscv/copyinout.SMon Jan 21 19:37:12 2019
(r343274)
@@ -52,60 +52,61 @@ copyio_fault_nopcb:
 END(copyio_fault)
 
 /*
- * Copies from a kernel to user address
+ * copycommon - common copy routine
  *
- * int copyout(const void *kaddr, void *udaddr, size_t len)
+ * a0 - Source address
+ * a1 - Destination address
+ * a2 - Size of copy
  */
-ENTRY(copyout)
-   beqza2, 2f  /* If len == 0 then skip loop */
-   add a3, a1, a2
-   li  a4, VM_MAXUSER_ADDRESS
-   bgt a3, a4, copyio_fault_nopcb
-
+   .macro copycommon
la  a6, copyio_fault /* Get the handler address */
SET_FAULT_HANDLER(a6, a7) /* Set the handler */
ENTER_USER_ACCESS(a7)
 
-1: lb  a4, 0(a0)   /* Load from kaddr */
+1: lb  a4, 0(a0)   /* Load from src */
addia0, a0, 1
-   sb  a4, 0(a1)   /* Store in uaddr */
+   sb  a4, 0(a1)   /* Store in dest */
addia1, a1, 1
addia2, a2, -1  /* len-- */
bneza2, 1b
 
EXIT_USER_ACCESS(a7)
SET_FAULT_HANDLER(x0, a7) /* Clear the handler */
+   .endm
 
-2: li  a0, 0   /* return 0 */
+/*
+ * Copies from a kernel to user address
+ *
+ * int copyout(const void *kaddr, void *udaddr, size_t len)
+ */
+ENTRY(copyout)
+   beqza2, copyout_end /* If len == 0 then skip loop */
+   add a3, a1, a2
+   li  a4, VM_MAXUSER_ADDRESS
+   bgt a3, a4, copyio_fault_nopcb
+
+   copycommon
+
+copyout_end:
+   li  a0, 0   /* return 0 */
ret
 END(copyout)
 
 /*
  * Copies from a user to kernel address
  *
- * int copyin(const void *uaddr, void *kdaddr, size_t len)
+ * int copyin(const void *uaddr, void *kaddr, size_t len)
  */
 ENTRY(copyin)
-   beqza2, 2f  /* If len == 0 then skip loop */
+   beqza2, copyin_end  /* If len == 0 then skip loop */
add a3, a0, a2
li  a4, VM_MAXUSER_ADDRESS
bgt a3, a4, copyio_fault_nopcb
 
-   la  a6, copyio_fault /* Get the handler address */
-   SET_FAULT_HANDLER(a6, a7) /* Set the handler */
-   ENTER_USER_ACCESS(a7)
+   copycommon
 
-1: lb  a4, 0(a0)   /* Load from uaddr */
-   addia0, a0, 1
-   sb  a4, 0(a1)   /* Store in kaddr */
-   addia1, a1, 1
-   addia2, a2, -1  /* len-- */
-   bneza2, 1b
-
-   EXIT_USER_ACCESS(a7)
-   SET_FAULT_HANDLER(x0, a7) /* Clear the handler */
-
-2: li  a0, 0   /* return 0 */
+copyin_end:
+   li  a0, 0   /* return 0 */
ret
 END(copyin)
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343275 - in head/sys/riscv: include riscv

2019-01-21 Thread Mark Johnston
Author: markj
Date: Mon Jan 21 19:38:53 2019
New Revision: 343275
URL: https://svnweb.freebsd.org/changeset/base/343275

Log:
  Optimize RISC-V copyin(9)/copyout(9) routines.
  
  The existing copyin(9) and copyout(9) routines on RISC-V perform only a
  simple byte-by-byte copy.  Improve their performance by performing
  word-sized copies where possible.
  
  Submitted by: Mitchell Horne 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D18851

Modified:
  head/sys/riscv/include/riscvreg.h
  head/sys/riscv/riscv/copyinout.S

Modified: head/sys/riscv/include/riscvreg.h
==
--- head/sys/riscv/include/riscvreg.h   Mon Jan 21 19:37:12 2019
(r343274)
+++ head/sys/riscv/include/riscvreg.h   Mon Jan 21 19:38:53 2019
(r343275)
@@ -155,7 +155,8 @@
 #defineSATP_MODE_SV39  (8ULL << SATP_MODE_S)
 #defineSATP_MODE_SV48  (9ULL << SATP_MODE_S)
 
-#defineXLEN8
+#defineXLEN__riscv_xlen
+#defineXLEN_BYTES  (XLEN / 8)
 #defineINSN_SIZE   4
 #defineINSN_C_SIZE 2
 

Modified: head/sys/riscv/riscv/copyinout.S
==
--- head/sys/riscv/riscv/copyinout.SMon Jan 21 19:37:12 2019
(r343274)
+++ head/sys/riscv/riscv/copyinout.SMon Jan 21 19:38:53 2019
(r343275)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2015-2018 Ruslan Bukin 
+ * Copyright (c) 2019 Mitchell Horne
  * All rights reserved.
  *
  * Portions of this software were developed by SRI International and the
@@ -59,19 +60,52 @@ END(copyio_fault)
  * a2 - Size of copy
  */
.macro copycommon
-   la  a6, copyio_fault /* Get the handler address */
-   SET_FAULT_HANDLER(a6, a7) /* Set the handler */
+   la  a6, copyio_fault/* Get the handler address */
+   SET_FAULT_HANDLER(a6, a7)   /* Set the handler */
ENTER_USER_ACCESS(a7)
 
-1: lb  a4, 0(a0)   /* Load from src */
+   li  t2, XLEN_BYTES
+   blt a2, t2, 3f  /* Byte-copy if len < XLEN_BYTES */
+
+   /*
+* Compare lower bits of src and dest.
+* If they are aligned with each other, we can do word copy.
+*/
+   andit0, a0, (XLEN_BYTES-1)  /* Low bits of src */
+   andit1, a1, (XLEN_BYTES-1)  /* Low bits of dest */
+   bne t0, t1, 3f  /* Misaligned. Go to byte copy */
+   beqzt0, 2f  /* Already word-aligned, skip ahead */
+
+   /* Byte copy until the first word-aligned address */
+1: lb  a4, 0(a0)   /* Load byte from src */
addia0, a0, 1
-   sb  a4, 0(a1)   /* Store in dest */
+   sb  a4, 0(a1)   /* Store byte in dest */
addia1, a1, 1
-   addia2, a2, -1  /* len-- */
-   bneza2, 1b
+   addia2, a2, -1  /* len-- */
+   andit0, a0, (XLEN_BYTES-1)
+   bnezt0, 1b
 
-   EXIT_USER_ACCESS(a7)
-   SET_FAULT_HANDLER(x0, a7) /* Clear the handler */
+   /* Copy words */
+2: ld  a4, 0(a0)   /* Load word from src */
+   addia0, a0, XLEN_BYTES
+   sd  a4, 0(a1)   /* Store word in dest */
+   addia1, a1, XLEN_BYTES
+   addia2, a2, -XLEN_BYTES /* len -= XLEN_BYTES */
+   bgeua2, t2, 2b  /* Again if len >= XLEN_BYTES */
+
+   /* Check if we're finished */
+   beqza2, 4f
+
+   /* Copy any remaining bytes */
+3: lb  a4, 0(a0)   /* Load byte from src */
+   addia0, a0, 1
+   sb  a4, 0(a1)   /* Store byte in dest */
+   addia1, a1, 1
+   addia2, a2, -1  /* len-- */
+   bneza2, 3b
+
+4: EXIT_USER_ACCESS(a7)
+   SET_FAULT_HANDLER(x0, a7)   /* Clear the handler */
.endm
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343277 - vendor/bearssl

2019-01-21 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jan 21 20:01:42 2019
New Revision: 343277
URL: https://svnweb.freebsd.org/changeset/base/343277

Log:
  bearssl for importing BearSSL
  
  BearSSL is a tiny SSL lib for embedded systems.
  
  Reviewed by:  emaste

Added:
  vendor/bearssl/
  vendor/bearssl/import.sh   (contents, props changed)

Added: vendor/bearssl/import.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/bearssl/import.shMon Jan 21 20:01:42 2019(r343277)
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+# Set SVN variables
+#  select the local subversion site
+SVN=${SVN:-/usr/local/bin/svn}
+GIT=${GIT:-/usr/local/bin/git}
+
+# For consistency...
+Error() {
+   echo ERROR: ${1+"$@"} >&2
+   exit 1
+}
+
+Cd() {
+   [ $# -eq 1 ] || Error "Cd() takes a single parameter."
+   cd $1 || Error "cannot \"cd $1\" from $PWD"
+}
+
+SKIP_PULL=
+
+# Call this function and then follow it by any specific import script additions
+option_parsing() {
+   local _shift=$#
+   # Parse command line options
+   while :
+   do
+   case "$1" in
+   *=*) eval "$1"; shift;;
+   --) shift; break;;
+   --skip-pull) SKIP_PULL=:; shift;;
+   --help|-h) cat  $TF.old
+# use * rather than . to skip .git
+('cd' BearSSL && find * -type f ) | sort > $TF.new
+comm -23 $TF.old $TF.new > $TF.rmlist
+comm -13 $TF.old $TF.new > $TF.addlist
+[ -s $TF.rmlist ] && { echo rm:; cat $TF.rmlist; }
+[ -s $TF.addlist ] && { echo add:; cat $TF.addlist; }
+('cd' BearSSL && tar cf - * | tar xf - -C ../dist)
+('cd' dist
+test -s $TF.rmlist && xargs $SVN rm < $TF.rmlist
+test -s $TF.addlist && xargs $SVN --parents add < $TF.addlist
+)
+
+url=`$SVN info | sed -n '/^URL:/s,URL: ,,p'`
+echo "After committing dist... run; sh ./tag.sh"
+echo "$SVN cp -m 'tag $thing-$VERSION' $url/dist $url/$VERSION" > tag.sh
+
+rm -f $TF.*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343279 - svnadmin/conf

2019-01-21 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jan 21 20:23:03 2019
New Revision: 343279
URL: https://svnweb.freebsd.org/changeset/base/343279

Log:
  For initial BearSSL import

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confMon Jan 21 20:22:11 2019
(r343278)
+++ svnadmin/conf/sizelimit.confMon Jan 21 20:23:03 2019
(r343279)
@@ -27,3 +27,4 @@ np
 obrien
 peter
 rwatson
+sjg
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343281 - in vendor/bearssl/dist: . T0 build conf inc mk samples src src/aead src/codec src/ec src/hash src/int src/kdf src/mac src/rand src/rsa src/ssl src/symcipher src/x509 test test...

2019-01-21 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jan 21 20:23:49 2019
New Revision: 343281
URL: https://svnweb.freebsd.org/changeset/base/343281

Log:
  Import bearssl-6433cc2

Added:
  vendor/bearssl/dist/
  vendor/bearssl/dist/Doxyfile
  vendor/bearssl/dist/LICENSE.txt   (contents, props changed)
  vendor/bearssl/dist/Makefile   (contents, props changed)
  vendor/bearssl/dist/README.txt   (contents, props changed)
  vendor/bearssl/dist/T0/
  vendor/bearssl/dist/T0/BlobWriter.cs
  vendor/bearssl/dist/T0/CPU.cs
  vendor/bearssl/dist/T0/CodeElement.cs
  vendor/bearssl/dist/T0/CodeElementJump.cs
  vendor/bearssl/dist/T0/CodeElementUInt.cs
  vendor/bearssl/dist/T0/CodeElementUIntExpr.cs
  vendor/bearssl/dist/T0/CodeElementUIntInt.cs
  vendor/bearssl/dist/T0/CodeElementUIntUInt.cs
  vendor/bearssl/dist/T0/ConstData.cs
  vendor/bearssl/dist/T0/Opcode.cs
  vendor/bearssl/dist/T0/OpcodeCall.cs
  vendor/bearssl/dist/T0/OpcodeConst.cs
  vendor/bearssl/dist/T0/OpcodeGetLocal.cs
  vendor/bearssl/dist/T0/OpcodeJump.cs
  vendor/bearssl/dist/T0/OpcodeJumpIf.cs
  vendor/bearssl/dist/T0/OpcodeJumpIfNot.cs
  vendor/bearssl/dist/T0/OpcodeJumpUncond.cs
  vendor/bearssl/dist/T0/OpcodePutLocal.cs
  vendor/bearssl/dist/T0/OpcodeRet.cs
  vendor/bearssl/dist/T0/SType.cs
  vendor/bearssl/dist/T0/T0Comp.cs
  vendor/bearssl/dist/T0/TPointerBase.cs
  vendor/bearssl/dist/T0/TPointerBlob.cs
  vendor/bearssl/dist/T0/TPointerExpr.cs
  vendor/bearssl/dist/T0/TPointerNull.cs
  vendor/bearssl/dist/T0/TPointerXT.cs
  vendor/bearssl/dist/T0/TValue.cs
  vendor/bearssl/dist/T0/Word.cs
  vendor/bearssl/dist/T0/WordBuilder.cs
  vendor/bearssl/dist/T0/WordData.cs
  vendor/bearssl/dist/T0/WordInterpreted.cs
  vendor/bearssl/dist/T0/WordNative.cs
  vendor/bearssl/dist/T0/kern.t0
  vendor/bearssl/dist/T0Comp.exe   (contents, props changed)
  vendor/bearssl/dist/build/
  vendor/bearssl/dist/build/.do_not_remove
  vendor/bearssl/dist/conf/
  vendor/bearssl/dist/conf/Unix.mk   (contents, props changed)
  vendor/bearssl/dist/conf/Unix32.mk   (contents, props changed)
  vendor/bearssl/dist/conf/UnixClang.mk   (contents, props changed)
  vendor/bearssl/dist/conf/Win.mk   (contents, props changed)
  vendor/bearssl/dist/conf/samd20.mk   (contents, props changed)
  vendor/bearssl/dist/inc/
  vendor/bearssl/dist/inc/bearssl.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_aead.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_block.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_ec.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_hash.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_hmac.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_kdf.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_pem.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_prf.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_rand.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_rsa.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_ssl.h   (contents, props changed)
  vendor/bearssl/dist/inc/bearssl_x509.h   (contents, props changed)
  vendor/bearssl/dist/mk/
  vendor/bearssl/dist/mk/Defaults.mk   (contents, props changed)
  vendor/bearssl/dist/mk/NMake.mk   (contents, props changed)
  vendor/bearssl/dist/mk/Rules.mk   (contents, props changed)
  vendor/bearssl/dist/mk/SingleUnix.mk   (contents, props changed)
  vendor/bearssl/dist/mk/mkT0.cmd
  vendor/bearssl/dist/mk/mkT0.sh   (contents, props changed)
  vendor/bearssl/dist/mk/mkrules.sh   (contents, props changed)
  vendor/bearssl/dist/samples/
  vendor/bearssl/dist/samples/README.txt   (contents, props changed)
  vendor/bearssl/dist/samples/cert-ee-ec+rsa.pem
  vendor/bearssl/dist/samples/cert-ee-ec.pem
  vendor/bearssl/dist/samples/cert-ee-rsa.pem
  vendor/bearssl/dist/samples/cert-ica-ec.pem
  vendor/bearssl/dist/samples/cert-ica-rsa.pem
  vendor/bearssl/dist/samples/cert-root-ec.pem
  vendor/bearssl/dist/samples/cert-root-rsa.pem
  vendor/bearssl/dist/samples/chain-ec+rsa.h   (contents, props changed)
  vendor/bearssl/dist/samples/chain-ec.h   (contents, props changed)
  vendor/bearssl/dist/samples/chain-rsa.h   (contents, props changed)
  vendor/bearssl/dist/samples/client_basic.c   (contents, props changed)
  vendor/bearssl/dist/samples/custom_profile.c   (contents, props changed)
  vendor/bearssl/dist/samples/key-ec.h   (contents, props changed)
  vendor/bearssl/dist/samples/key-ee-ec.pem
  vendor/bearssl/dist/samples/key-ee-rsa.pem
  vendor/bearssl/dist/samples/key-ica-ec.pem
  vendor/bearssl/dist/samples/key-ica-rsa.pem
  vendor/bearssl/dist/samples/key-root-ec.pem
  vendor/bearssl/dist/samples/key-root-rsa.pem
  vendor/bearssl/dist/samples/key-rsa.h   (contents, props changed)
  vendor/bearssl/dist/samples/server_basic.c   (contents, props changed)
  vendor/bearssl/dist/src/
  vendor/bearssl/dist/src/aead/
  vendor/bearssl/dist/src/aead/ccm.c   (contents, props changed)
  vendor/bearssl/dist/src/aea

svn commit: r343282 - vendor/bearssl/6433cc2

2019-01-21 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jan 21 20:24:00 2019
New Revision: 343282
URL: https://svnweb.freebsd.org/changeset/base/343282

Log:
  tag bearssl-6433cc2

Added:
  vendor/bearssl/6433cc2/
 - copied from r343281, vendor/bearssl/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343283 - svnadmin/conf

2019-01-21 Thread Simon J. Gerraty
Author: sjg
Date: Mon Jan 21 20:25:08 2019
New Revision: 343283
URL: https://svnweb.freebsd.org/changeset/base/343283

Log:
  Done with initial BearSSL import

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confMon Jan 21 20:24:00 2019
(r343282)
+++ svnadmin/conf/sizelimit.confMon Jan 21 20:25:08 2019
(r343283)
@@ -27,4 +27,3 @@ np
 obrien
 peter
 rwatson
-sjg
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r343269 - head/sys/dev/cxgbe

2019-01-21 Thread Andrew Gallatin

On 1/21/19 1:42 PM, Navdeep Parhar wrote:


Log:
   cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to


Thank you!

Drew
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343284 - head/lib/libcapsicum

2019-01-21 Thread Mark Johnston
Author: markj
Date: Mon Jan 21 20:56:29 2019
New Revision: 343284
URL: https://svnweb.freebsd.org/changeset/base/343284

Log:
  List caph_limit_stream() in the synopsis.
  
  Fix typos while here.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libcapsicum/capsicum_helpers.3

Modified: head/lib/libcapsicum/capsicum_helpers.3
==
--- head/lib/libcapsicum/capsicum_helpers.3 Mon Jan 21 20:25:08 2019
(r343283)
+++ head/lib/libcapsicum/capsicum_helpers.3 Mon Jan 21 20:56:29 2019
(r343284)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 4, 2018
+.Dd January 21, 2019
 .Dt CAPSICUM_HELPERS 3
 .Os
 .Sh NAME
@@ -50,11 +50,13 @@
 .Ft int
 .Fn caph_enter_casper "void"
 .Ft int
-.Fn caph_rights_limit "inf fd" "const cap_righst_t *rights"
+.Fn caph_rights_limit "int fd" "const cap_righst_t *rights"
 .Ft int
-.Fn caph_ioctls_limit "inf fd" "const unsigned long *cmds" "size_t ncmds"
+.Fn caph_ioctls_limit "int fd" "const unsigned long *cmds" "size_t ncmds"
 .Ft int
-.Fn caph_fcntls_limit "inf fd" "uint32_t fcntlrights"
+.Fn caph_fcntls_limit "int fd" "uint32_t fcntlrights"
+.Ft int
+.Fn caph_limit_stream "int fd" "int flags"
 .Ft int
 .Fn caph_limit_stdin "void"
 .Ft int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343286 - head/sys/fs/nfsserver

2019-01-21 Thread Mark Johnston
Author: markj
Date: Mon Jan 21 23:54:33 2019
New Revision: 343286
URL: https://svnweb.freebsd.org/changeset/base/343286

Log:
  nfs: Zero the buffers exported by NFSSVC_DUMPCLIENTS and DUMPLOCKS.
  
  Note that these interfaces are available only to root.
  
  admbugs:  765
  Reported by:  Vlad Tsyrklevich 
  Reviewed by:  rmacklem
  MFC after:1 day
  Security: Kernel memory disclosure
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon Jan 21 20:58:33 2019
(r343285)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cMon Jan 21 23:54:33 2019
(r343286)
@@ -3614,8 +3614,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u
error = EPERM;
if (!error) {
len = sizeof (struct nfsd_dumpclients) * dumplist.ndl_size;
-   dumpclients = (struct nfsd_dumpclients *)malloc(len,
-   M_TEMP, M_WAITOK);
+   dumpclients = malloc(len, M_TEMP, M_WAITOK | M_ZERO);
nfsrv_dumpclients(dumpclients, dumplist.ndl_size);
error = copyout(dumpclients,
CAST_USER_ADDR_T(dumplist.ndl_list), len);
@@ -3633,8 +3632,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u
if (!error) {
len = sizeof (struct nfsd_dumplocks) *
dumplocklist.ndllck_size;
-   dumplocks = (struct nfsd_dumplocks *)malloc(len,
-   M_TEMP, M_WAITOK);
+   dumplocks = malloc(len, M_TEMP, M_WAITOK | M_ZERO);
nfsrv_dumplocks(nd.ni_vp, dumplocks,
dumplocklist.ndllck_size, p);
vput(nd.ni_vp);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343287 - head/sbin/pfctl

2019-01-21 Thread Patrick Kelsey
Author: pkelsey
Date: Tue Jan 22 00:50:24 2019
New Revision: 343287
URL: https://svnweb.freebsd.org/changeset/base/343287

Log:
  Reduce pf.conf parsing cost for configs that define N queues from O(N^2) to 
O(N)
  
  The number of syscalls made during parsing of any config that
  defines tables is also reduced, and incorrect warnings that HFSC
  parent queue bandwidths were smaller than the sum of their child
  bandwidths have been fixed.
  
  Reviewed by:  kp
  MFC after:1 week
  Sponsored by: RG Nets
  Differential Revision:https://reviews.freebsd.org/D18759

Modified:
  head/sbin/pfctl/pfctl.h
  head/sbin/pfctl/pfctl_altq.c
  head/sbin/pfctl/pfctl_parser.c
  head/sbin/pfctl/pfctl_parser.h

Modified: head/sbin/pfctl/pfctl.h
==
--- head/sbin/pfctl/pfctl.h Mon Jan 21 23:54:33 2019(r343286)
+++ head/sbin/pfctl/pfctl.h Tue Jan 22 00:50:24 2019(r343287)
@@ -114,7 +114,6 @@ extern  int loadopt;
 
 int check_commit_altq(int, int);
 voidpfaltq_store(struct pf_altq *);
-struct pf_altq *pfaltq_lookup(const char *);
 char   *rate2str(double);
 
 voidprint_addr(struct pf_addr_wrap *, sa_family_t, int);

Modified: head/sbin/pfctl/pfctl_altq.c
==
--- head/sbin/pfctl/pfctl_altq.cMon Jan 21 23:54:33 2019
(r343286)
+++ head/sbin/pfctl/pfctl_altq.cTue Jan 22 00:50:24 2019
(r343287)
@@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$");
 #define PFIOC_USE_LATEST
 
 #include 
+#include 
 #include 
 #include 
 
@@ -36,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -53,33 +55,40 @@ __FBSDID("$FreeBSD$");
 
 #define is_sc_null(sc) (((sc) == NULL) || ((sc)->m1 == 0 && (sc)->m2 == 0))
 
-static TAILQ_HEAD(altqs, pf_altq) altqs = TAILQ_HEAD_INITIALIZER(altqs);
-static LIST_HEAD(gen_sc, segment) rtsc, lssc;
+static STAILQ_HEAD(interfaces, pfctl_altq) interfaces = 
STAILQ_HEAD_INITIALIZER(interfaces);
+static struct hsearch_data queue_map;
+static struct hsearch_data if_map;
+static struct hsearch_data qid_map;
 
-struct pf_altq *qname_to_pfaltq(const char *, const char *);
-u_int32_t   qname_to_qid(const char *);
+static struct pfctl_altq *pfaltq_lookup(char *ifname);
+static struct pfctl_altq *qname_to_pfaltq(const char *, const char *);
+static u_int32_tqname_to_qid(char *);
 
-static int eval_pfqueue_cbq(struct pfctl *, struct pf_altq *);
+static int eval_pfqueue_cbq(struct pfctl *, struct pf_altq *,
+   struct pfctl_altq *);
 static int cbq_compute_idletime(struct pfctl *, struct pf_altq *);
-static int check_commit_cbq(int, int, struct pf_altq *);
+static int check_commit_cbq(int, int, struct pfctl_altq *);
 static int print_cbq_opts(const struct pf_altq *);
 
 static int print_codel_opts(const struct pf_altq *,
const struct node_queue_opt *);
 
-static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *);
-static int check_commit_priq(int, int, struct pf_altq *);
+static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *,
+   struct pfctl_altq *);
+static int check_commit_priq(int, int, struct pfctl_altq *);
 static int print_priq_opts(const struct pf_altq *);
 
-static int eval_pfqueue_hfsc(struct pfctl *, struct pf_altq *);
-static int check_commit_hfsc(int, int, struct pf_altq *);
+static int eval_pfqueue_hfsc(struct pfctl *, struct pf_altq *,
+   struct pfctl_altq *, struct pfctl_altq *);
+static int check_commit_hfsc(int, int, struct pfctl_altq *);
 static int print_hfsc_opts(const struct pf_altq *,
const struct node_queue_opt *);
 
-static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *);
+static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *,
+   struct pfctl_altq *, struct pfctl_altq *);
 static int print_fairq_opts(const struct pf_altq *,
const struct node_queue_opt *);
-static int check_commit_fairq(int, int, struct pf_altq *);
+static int check_commit_fairq(int, int, struct pfctl_altq *);
 
 static void gsc_add_sc(struct gen_sc *, struct service_curve *);
 static int  is_gsc_under_sc(struct gen_sc *,
@@ -104,59 +113,101 @@ void  print_hfsc_sc(const char *, u_int, 
u_int, u_int
 voidprint_fairq_sc(const char *, u_int, u_int, u_int,
 const struct node_fairq_sc *);
 
+static __attribute__((constructor)) void
+pfctl_altq_init(void)
+{
+   /*
+* As hdestroy() will never be called on these tables, it will be
+* safe to use references into the stored data as keys.
+*/
+   if (hcreate_r(0, &queue_map) == 0)
+   err(1, "Failed to create altq queue map");
+   

svn commit: r343288 - head/sys/net

2019-01-21 Thread Patrick Kelsey
Author: pkelsey
Date: Tue Jan 22 00:56:44 2019
New Revision: 343288
URL: https://svnweb.freebsd.org/changeset/base/343288

Log:
  Fix various resource leaks that can occur in the error paths of
  iflib_device_register() and iflib_pseudo_register().
  
  Reviewed by:  shurd
  MFC after:1 week
  Sponsored by: RG Nets
  Differential Revision:https://reviews.freebsd.org/D18760

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Jan 22 00:50:24 2019(r343287)
+++ head/sys/net/iflib.cTue Jan 22 00:56:44 2019(r343288)
@@ -4368,11 +4368,8 @@ iflib_device_register(device_t dev, void *sc, if_share
ctx->ifc_softc = sc;
 
if ((err = iflib_register(ctx)) != 0) {
-   if (ctx->ifc_flags & IFC_SC_ALLOCATED)
-   free(sc, M_IFLIB);
-   free(ctx, M_IFLIB);
device_printf(dev, "iflib_register failed %d\n", err);
-   return (err);
+   goto fail_ctx_free;
}
iflib_add_device_sysctl_pre(ctx);
 
@@ -4382,9 +4379,8 @@ iflib_device_register(device_t dev, void *sc, if_share
iflib_reset_qvalues(ctx);
CTX_LOCK(ctx);
if ((err = IFDI_ATTACH_PRE(ctx)) != 0) {
-   CTX_UNLOCK(ctx);
device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err);
-   return (err);
+   goto fail_unlock;
}
_iflib_pre_assert(scctx);
ctx->ifc_txrx = *scctx->isc_txrx;
@@ -4414,7 +4410,7 @@ iflib_device_register(device_t dev, void *sc, if_share
/* round down instead? */
device_printf(dev, "# rx descriptors must be a power of 
2\n");
err = EINVAL;
-   goto fail;
+   goto fail_iflib_detach;
}
}
for (i = 0; i < sctx->isc_ntxqs; i++) {
@@ -4422,7 +4418,7 @@ iflib_device_register(device_t dev, void *sc, if_share
device_printf(dev,
"# tx descriptors must be a power of 2");
err = EINVAL;
-   goto fail;
+   goto fail_iflib_detach;
}
}
 
@@ -4492,7 +4488,7 @@ iflib_device_register(device_t dev, void *sc, if_share
/* Get memory for the station queues */
if ((err = iflib_queues_alloc(ctx))) {
device_printf(dev, "Unable to allocate queue memory\n");
-   goto fail;
+   goto fail_intr_free;
}
 
if ((err = iflib_qset_structures_setup(ctx)))
@@ -4511,7 +4507,7 @@ iflib_device_register(device_t dev, void *sc, if_share
IFDI_INTR_DISABLE(ctx);
if (msix > 1 && (err = IFDI_MSIX_INTR_ASSIGN(ctx, msix)) != 0) {
device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", err);
-   goto fail_intr_free;
+   goto fail_queues;
}
if (msix <= 1) {
rid = 0;
@@ -4521,7 +4517,7 @@ iflib_device_register(device_t dev, void *sc, if_share
}
if ((err = iflib_legacy_setup(ctx, ctx->isc_legacy_intr, 
ctx->ifc_softc, &rid, "irq0")) != 0) {
device_printf(dev, "iflib_legacy_setup failed %d\n", 
err);
-   goto fail_intr_free;
+   goto fail_queues;
}
}
 
@@ -4557,14 +4553,18 @@ iflib_device_register(device_t dev, void *sc, if_share
 fail_detach:
ether_ifdetach(ctx->ifc_ifp);
 fail_intr_free:
+   iflib_free_intr_mem(ctx);
 fail_queues:
iflib_tx_structures_free(ctx);
iflib_rx_structures_free(ctx);
-fail:
-   iflib_free_intr_mem(ctx);
+fail_iflib_detach:
IFDI_DETACH(ctx);
+fail_unlock:
CTX_UNLOCK(ctx);
-
+fail_ctx_free:
+if (ctx->ifc_flags & IFC_SC_ALLOCATED)
+free(ctx->ifc_softc, M_IFLIB);
+free(ctx, M_IFLIB);
return (err);
 }
 
@@ -4593,9 +4593,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc
 
if ((err = iflib_register(ctx)) != 0) {
device_printf(dev, "%s: iflib_register failed %d\n", __func__, 
err);
-   free(sc, M_IFLIB);
-   free(ctx, M_IFLIB);
-   return (err);
+   goto fail_ctx_free;
}
iflib_add_device_sysctl_pre(ctx);
 
@@ -4609,14 +4607,14 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc
 
if ((err = IFDI_ATTACH_PRE(ctx)) != 0) {
device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err);
-   return (err);
+   goto fail_ctx_free;
}
if (sctx->isc_flags & IFLIB_GEN_MAC)
iflib_gen_mac(ctx);
if ((err = IFDI_CLONEATTACH(ctx, clctx->cc_ifc, clctx->cc_name,


svn commit: r343290 - stable/11/sys/netpfil/pf

2019-01-21 Thread Kristof Provost
Author: kp
Date: Tue Jan 22 01:07:20 2019
New Revision: 343290
URL: https://svnweb.freebsd.org/changeset/base/343290

Log:
  MFC r343041
  
  pf: silence a runtime warning
  
  Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion 
failed'.
  This warning does not clarify anything for users, so silence it, just as
  OpenBSD has.
  
  PR:   234874

Modified:
  stable/11/sys/netpfil/pf/pf_table.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/pf/pf_table.c
==
--- stable/11/sys/netpfil/pf/pf_table.c Tue Jan 22 01:07:18 2019
(r343289)
+++ stable/11/sys/netpfil/pf/pf_table.c Tue Jan 22 01:07:20 2019
(r343290)
@@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
+
 #defineACCEPT_FLAGS(flags, oklist) \
do {\
if ((flags & ~(oklist)) &   \
@@ -1985,7 +1987,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr
}
if ((ke == NULL || ke->pfrke_not) != notrule) {
if (op_pass != PFR_OP_PASS)
-   printf("pfr_update_stats: assertion failed.\n");
+   DPFPRINTF(PF_DEBUG_URGENT,
+   ("pfr_update_stats: assertion failed.\n"));
op_pass = PFR_OP_XPASS;
}
kt->pfrkt_packets[dir_out][op_pass]++;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343289 - stable/12/sys/netpfil/pf

2019-01-21 Thread Kristof Provost
Author: kp
Date: Tue Jan 22 01:07:18 2019
New Revision: 343289
URL: https://svnweb.freebsd.org/changeset/base/343289

Log:
  MFC r343041
  
  pf: silence a runtime warning
  
  Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion 
failed'.
  This warning does not clarify anything for users, so silence it, just as
  OpenBSD has.
  
  PR:   234874

Modified:
  stable/12/sys/netpfil/pf/pf_table.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netpfil/pf/pf_table.c
==
--- stable/12/sys/netpfil/pf/pf_table.c Tue Jan 22 00:56:44 2019
(r343288)
+++ stable/12/sys/netpfil/pf/pf_table.c Tue Jan 22 01:07:18 2019
(r343289)
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
+
 #defineACCEPT_FLAGS(flags, oklist) \
do {\
if ((flags & ~(oklist)) &   \
@@ -1992,7 +1994,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr
}
if ((ke == NULL || ke->pfrke_not) != notrule) {
if (op_pass != PFR_OP_PASS)
-   printf("pfr_update_stats: assertion failed.\n");
+   DPFPRINTF(PF_DEBUG_URGENT,
+   ("pfr_update_stats: assertion failed.\n"));
op_pass = PFR_OP_XPASS;
}
kt->pfrkt_packets[dir_out][op_pass]++;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net

2019-01-21 Thread Patrick Kelsey
Author: pkelsey
Date: Tue Jan 22 01:11:17 2019
New Revision: 343291
URL: https://svnweb.freebsd.org/changeset/base/343291

Log:
  onvert vmx(4) to being an iflib driver.
  
  Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add
  iflib_dma_alloc_align() to the iflib API.
  
  Performance is generally better with the tunable/sysctl
  dev.vmx..iflib.tx_abdicate=1.
  
  Reviewed by:  shurd
  MFC after:1 week
  Relnotes: yes
  Sponsored by: RG Nets
  Differential Revision:https://reviews.freebsd.org/D18761

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c
  head/sys/dev/vmware/vmxnet3/if_vmxvar.h
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- head/sys/dev/vmware/vmxnet3/if_vmx.cTue Jan 22 01:07:20 2019
(r343290)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.cTue Jan 22 01:11:17 2019
(r343291)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2013 Tsubai Masanari
  * Copyright (c) 2013 Bryan Venteicher 
+ * Copyright (c) 2018 Patrick Kelsey
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -24,7 +25,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -46,9 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -57,8 +55,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -67,139 +63,95 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "ifdi_if.h"
+
 #include "if_vmxreg.h"
 #include "if_vmxvar.h"
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
-#ifdef VMXNET3_FAILPOINTS
-#include 
-static SYSCTL_NODE(DEBUG_FP, OID_AUTO, vmxnet3, CTLFLAG_RW, 0,
-"vmxnet3 fail points");
-#define VMXNET3_FP _debug_fail_point_vmxnet3
-#endif
 
-static int vmxnet3_probe(device_t);
-static int vmxnet3_attach(device_t);
-static int vmxnet3_detach(device_t);
-static int vmxnet3_shutdown(device_t);
+#define VMXNET3_VMWARE_VENDOR_ID   0x15AD
+#define VMXNET3_VMWARE_DEVICE_ID   0x07B0
 
+static pci_vendor_info_t vmxnet3_vendor_info_array[] =
+{
+   PVID(VMXNET3_VMWARE_VENDOR_ID, VMXNET3_VMWARE_DEVICE_ID, "VMware 
VMXNET3 Ethernet Adapter"),
+   /* required last entry */
+   PVID_END
+};
+
+static void*vmxnet3_register(device_t);
+static int vmxnet3_attach_pre(if_ctx_t);
+static int vmxnet3_msix_intr_assign(if_ctx_t, int);
+static voidvmxnet3_free_irqs(struct vmxnet3_softc *);
+static int vmxnet3_attach_post(if_ctx_t);
+static int vmxnet3_detach(if_ctx_t);
+static int vmxnet3_shutdown(if_ctx_t);
+static int vmxnet3_suspend(if_ctx_t);
+static int vmxnet3_resume(if_ctx_t);
+
 static int vmxnet3_alloc_resources(struct vmxnet3_softc *);
 static voidvmxnet3_free_resources(struct vmxnet3_softc *);
 static int vmxnet3_check_version(struct vmxnet3_softc *);
-static voidvmxnet3_initial_config(struct vmxnet3_softc *);
-static voidvmxnet3_check_multiqueue(struct vmxnet3_softc *);
+static voidvmxnet3_set_interrupt_idx(struct vmxnet3_softc *);
 
-static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *);
-static int vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *);
-static int vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *);
-static int vmxnet3_alloc_interrupt(struct vmxnet3_softc *, int, int,
-   struct vmxnet3_interrupt *);
-static int vmxnet3_alloc_intr_resources(struct vmxnet3_softc *);
-static int vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *);
-static int vmxnet3_setup_legacy_interrupt(struct vmxnet3_softc *);
-static int vmxnet3_setup_interrupts(struct vmxnet3_softc *);
-static int vmxnet3_alloc_interrupts(struct vmxnet3_softc *);
+static int vmxnet3_queues_shared_alloc(struct vmxnet3_softc *);
+static voidvmxnet3_init_txq(struct vmxnet3_softc *, int);
+static int vmxnet3_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, 
int);
+static voidvmxnet3_init_rxq(struct vmxnet3_softc *, int, int);
+static int vmxnet3_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, 
int);
+static voidvmxnet3_queues_free(if_ctx_t);
 
-static voidvmxnet3_free_interrupt(struct vmxnet3_softc *,
-   struct vmxnet3_interrupt *);
-static voidvmxnet3_free_interrupts(struct vmxnet3_softc *);
-
-#ifndef VMXNET3_LEGACY_TX
-static int vmxnet3_alloc_taskqueue(struct vmxnet3_softc *);
-static voidvmxnet3_start_taskqueue(struct vmxnet3_softc *);
-static voidvmxnet3_drain_taskqueue(struct vmxnet3_softc *);
-static voidvmxnet3_free_taskqueue(struct vmxnet3_softc *);
-#endif
-
-static int 

svn commit: r343292 - head/sys/dev/iwn

2019-01-21 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Jan 22 01:44:47 2019
New Revision: 343292
URL: https://svnweb.freebsd.org/changeset/base/343292

Log:
  iwn(4): drop i_seq field initialization for A-MPDU frames.
  
  It is done by net80211 since r319460.
  
  MFC after:24 days
  X-MFC-With:   343094

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Tue Jan 22 01:11:17 2019(r343291)
+++ head/sys/dev/iwn/if_iwn.c   Tue Jan 22 01:44:47 2019(r343292)
@@ -4587,10 +4587,6 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, stru
if (!IEEE80211_AMPDU_RUNNING(tap))
return (EINVAL);
 
-   /* NB: clear Fragment Number field. */
-   /* XXX move this to net80211 */
-   *(uint16_t *)wh->i_seq = 0;
-
ac = *(int *)tap->txa_private;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343293 - stable/12/sys/compat/linux

2019-01-21 Thread Mark Johnston
Author: markj
Date: Tue Jan 22 02:02:12 2019
New Revision: 343293
URL: https://svnweb.freebsd.org/changeset/base/343293

Log:
  MFC r342864:
  Specify the correct option level when emulating SO_PEERCRED.
  
  PR:   234722

Modified:
  stable/12/sys/compat/linux/linux_socket.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_socket.c
==
--- stable/12/sys/compat/linux/linux_socket.c   Tue Jan 22 01:44:47 2019
(r343292)
+++ stable/12/sys/compat/linux/linux_socket.c   Tue Jan 22 02:02:12 2019
(r343293)
@@ -1632,6 +1632,11 @@ linux_getsockopt(struct thread *td, struct linux_getso
case LOCAL_PEERCRED:
if (args->optlen < sizeof(lxu))
return (EINVAL);
+   /*
+* LOCAL_PEERCRED is not served at the SOL_SOCKET level,
+* but by the Unix socket's level 0.
+*/
+   bsd_args.level = 0;
xulen = sizeof(xu);
error = kern_getsockopt(td, args->s, bsd_args.level,
name, &xu, UIO_SYSSPACE, &xulen);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343295 - head/sys/netpfil/pf

2019-01-21 Thread Kristof Provost
Author: kp
Date: Tue Jan 22 02:13:33 2019
New Revision: 343295
URL: https://svnweb.freebsd.org/changeset/base/343295

Log:
  pf: Validate psn_len in DIOCGETSRCNODES
  
  psn_len is controlled by user space, but we allocated memory based on it.
  Check how much memory we might need at most (i.e. how many source nodes we
  have) and limit the allocation to that.
  
  Reported by:  markj
  MFC after:1 week

Modified:
  head/sys/netpfil/pf/pf_ioctl.c

Modified: head/sys/netpfil/pf/pf_ioctl.c
==
--- head/sys/netpfil/pf/pf_ioctl.c  Tue Jan 22 02:04:37 2019
(r343294)
+++ head/sys/netpfil/pf/pf_ioctl.c  Tue Jan 22 02:13:33 2019
(r343295)
@@ -3577,14 +3577,18 @@ DIOCCHANGEADDR_error:
struct pf_src_node  *n, *p, *pstore;
uint32_t i, nr = 0;
 
+   for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask;
+   i++, sh++) {
+   PF_HASHROW_LOCK(sh);
+   LIST_FOREACH(n, &sh->nodes, entry)
+   nr++;
+   PF_HASHROW_UNLOCK(sh);
+   }
+
+   psn->psn_len = min(psn->psn_len,
+   sizeof(struct pf_src_node) * nr);
+
if (psn->psn_len == 0) {
-   for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask;
-   i++, sh++) {
-   PF_HASHROW_LOCK(sh);
-   LIST_FOREACH(n, &sh->nodes, entry)
-   nr++;
-   PF_HASHROW_UNLOCK(sh);
-   }
psn->psn_len = sizeof(struct pf_src_node) * nr;
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343294 - stable/11/sys/compat/linux

2019-01-21 Thread Mark Johnston
Author: markj
Date: Tue Jan 22 02:04:37 2019
New Revision: 343294
URL: https://svnweb.freebsd.org/changeset/base/343294

Log:
  MFC r342864:
  Specify the correct option level when emulating SO_PEERCRED.
  
  PR:   234722

Modified:
  stable/11/sys/compat/linux/linux_socket.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_socket.c
==
--- stable/11/sys/compat/linux/linux_socket.c   Tue Jan 22 02:02:12 2019
(r343293)
+++ stable/11/sys/compat/linux/linux_socket.c   Tue Jan 22 02:04:37 2019
(r343294)
@@ -1635,6 +1635,11 @@ linux_getsockopt(struct thread *td, struct linux_getso
case LOCAL_PEERCRED:
if (args->optlen < sizeof(lxu))
return (EINVAL);
+   /*
+* LOCAL_PEERCRED is not served at the SOL_SOCKET level,
+* but by the Unix socket's level 0.
+*/
+   bsd_args.level = 0;
xulen = sizeof(xu);
error = kern_getsockopt(td, args->s, bsd_args.level,
name, &xu, UIO_SYSSPACE, &xulen);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343296 - head/sbin/pfctl

2019-01-21 Thread Patrick Kelsey
Author: pkelsey
Date: Tue Jan 22 02:53:59 2019
New Revision: 343296
URL: https://svnweb.freebsd.org/changeset/base/343296

Log:
  Remove unused function gsc_destroy()
  
  gsc_destroy() is no longer needed as of r343287.
  
  MFC after:1 week

Modified:
  head/sbin/pfctl/pfctl_altq.c

Modified: head/sbin/pfctl/pfctl_altq.c
==
--- head/sbin/pfctl/pfctl_altq.cTue Jan 22 02:13:33 2019
(r343295)
+++ head/sbin/pfctl/pfctl_altq.cTue Jan 22 02:53:59 2019
(r343296)
@@ -93,7 +93,6 @@ static intcheck_commit_fairq(int, int, struct pfctl_a
 static void gsc_add_sc(struct gen_sc *, struct service_curve *);
 static int  is_gsc_under_sc(struct gen_sc *,
 struct service_curve *);
-static void gsc_destroy(struct gen_sc *);
 static struct segment  *gsc_getentry(struct gen_sc *, double);
 static int  gsc_add_seg(struct gen_sc *, double, double, double,
 double);
@@ -1127,17 +1126,6 @@ is_gsc_under_sc(struct gen_sc *gsc, struct service_cur
return (0);
}
return (1);
-}
-
-static void
-gsc_destroy(struct gen_sc *gsc)
-{
-   struct segment  *s;
-
-   while ((s = LIST_FIRST(gsc)) != NULL) {
-   LIST_REMOVE(s, _next);
-   free(s);
-   }
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343297 - head/tests/sys/netpfil/pf/ioctl

2019-01-21 Thread Kristof Provost
Author: kp
Date: Tue Jan 22 02:56:36 2019
New Revision: 343297
URL: https://svnweb.freebsd.org/changeset/base/343297

Log:
  pf tests: Check size validation in DIOCGETSRCNODES
  
  Ensure that invalid sizes for DIOCGETSRCNODES do not cause panics.
  
  MFC after: 1 week

Modified:
  head/tests/sys/netpfil/pf/ioctl/validation.c

Modified: head/tests/sys/netpfil/pf/ioctl/validation.c
==
--- head/tests/sys/netpfil/pf/ioctl/validation.cTue Jan 22 02:53:59 
2019(r343296)
+++ head/tests/sys/netpfil/pf/ioctl/validation.cTue Jan 22 02:56:36 
2019(r343297)
@@ -753,6 +753,38 @@ ATF_TC_CLEANUP(commit, tc)
COMMON_CLEANUP();
 }
 
+ATF_TC_WITH_CLEANUP(getsrcnodes);
+ATF_TC_HEAD(getsrcnodes, tc)
+{
+   atf_tc_set_md_var(tc, "require.user", "root");
+}
+
+ATF_TC_BODY(getsrcnodes, tc)
+{
+   struct pfioc_src_nodes psn;
+
+   COMMON_HEAD();
+
+   bzero(&psn, sizeof(psn));
+
+   psn.psn_len = -1;
+   if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0)
+   atf_tc_fail("request with size -1 failed");
+
+   psn.psn_len = 1 << 30;
+   if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0)
+   atf_tc_fail("request with size << 30 failed");
+
+   psn.psn_len = 1 << 31;
+   if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0)
+   atf_tc_fail("request with size << 30 failed");
+}
+
+ATF_TC_CLEANUP(getsrcnodes, tc)
+{
+   COMMON_CLEANUP();
+}
+
 ATF_TP_ADD_TCS(tp)
 {
ATF_TP_ADD_TC(tp, addtables);
@@ -772,6 +804,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, cxbegin);
ATF_TP_ADD_TC(tp, cxrollback);
ATF_TP_ADD_TC(tp, commit);
+   ATF_TP_ADD_TC(tp, getsrcnodes);
 
return (atf_no_error());
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343298 - head/sys/compat/ndis

2019-01-21 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Jan 22 03:53:42 2019
New Revision: 343298
URL: https://svnweb.freebsd.org/changeset/base/343298

Log:
  [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64
  
  amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use
  of FPU in kernel" panic.
  
  Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave.  To reduce
  amount of allocations/deallocations done via
  fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements.
  
  Based on the patch by Paul B Mahol
  
  PR:   165622
  Submitted by: Vlad Movchan 
  MFC after:1 month

Modified:
  head/sys/compat/ndis/kern_windrv.c
  head/sys/compat/ndis/pe_var.h

Modified: head/sys/compat/ndis/kern_windrv.c
==
--- head/sys/compat/ndis/kern_windrv.c  Tue Jan 22 02:56:36 2019
(r343297)
+++ head/sys/compat/ndis/kern_windrv.c  Tue Jan 22 03:53:42 2019
(r343298)
@@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
+#ifdef __amd64__
+#include 
+#endif
+
 #include 
 
 #include 
@@ -68,6 +72,19 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef __amd64__
+struct fpu_cc_ent {
+   struct fpu_kern_ctx *ctx;
+   LIST_ENTRY(fpu_cc_ent)  entries;
+};
+static LIST_HEAD(fpu_ctx_free, fpu_cc_ent) fpu_free_head =
+LIST_HEAD_INITIALIZER(fpu_free_head);
+static LIST_HEAD(fpu_ctx_busy, fpu_cc_ent) fpu_busy_head =
+LIST_HEAD_INITIALIZER(fpu_busy_head);
+static struct mtx fpu_free_mtx;
+static struct mtx fpu_busy_mtx;
+#endif
+
 static struct mtx drvdb_mtx;
 static STAILQ_HEAD(drvdb, drvdb_ent) drvdb_head;
 
@@ -98,6 +115,13 @@ windrv_libinit(void)
mtx_init(&drvdb_mtx, "Windows driver DB lock",
"Windows internal lock", MTX_DEF);
 
+#ifdef __amd64__
+   LIST_INIT(&fpu_free_head);
+   LIST_INIT(&fpu_busy_head);
+   mtx_init(&fpu_free_mtx, "free fpu context list lock", NULL, MTX_DEF);
+   mtx_init(&fpu_busy_mtx, "busy fpu context list lock", NULL, MTX_DEF);
+#endif
+
/*
 * PCI and pccard devices don't need to use IRPs to
 * interact with their bus drivers (usually), so our
@@ -132,6 +156,9 @@ int
 windrv_libfini(void)
 {
struct drvdb_ent*d;
+#ifdef __amd64__
+   struct fpu_cc_ent   *ent;
+#endif
 
mtx_lock(&drvdb_mtx); 
while(STAILQ_FIRST(&drvdb_head) != NULL) {
@@ -150,6 +177,18 @@ windrv_libfini(void)
smp_rendezvous(NULL, x86_oldldt, NULL, NULL);
ExFreePool(my_tids);
 #endif
+#ifdef __amd64__
+   while ((ent = LIST_FIRST(&fpu_free_head)) != NULL) {
+   LIST_REMOVE(ent, entries);
+   fpu_kern_free_ctx(ent->ctx);
+   free(ent, M_DEVBUF);
+   }
+   mtx_destroy(&fpu_free_mtx);
+
+   ent = LIST_FIRST(&fpu_busy_head);
+   KASSERT(ent == NULL, ("busy fpu context list is not empty"));
+   mtx_destroy(&fpu_busy_mtx);
+#endif
return (0);
 }
 
@@ -614,6 +653,148 @@ windrv_wrap(func, wrap, argcnt, ftype)
*wrap = p;
 
return (0);
+}
+
+static struct fpu_cc_ent *
+request_fpu_cc_ent(void)
+{
+   struct fpu_cc_ent *ent;
+
+   mtx_lock(&fpu_free_mtx);
+   if ((ent = LIST_FIRST(&fpu_free_head)) != NULL) {
+   LIST_REMOVE(ent, entries);
+   mtx_unlock(&fpu_free_mtx);
+   mtx_lock(&fpu_busy_mtx);
+   LIST_INSERT_HEAD(&fpu_busy_head, ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   return (ent);
+   }
+   mtx_unlock(&fpu_free_mtx);
+
+   if ((ent = malloc(sizeof(struct fpu_cc_ent), M_DEVBUF, M_NOWAIT |
+   M_ZERO)) != NULL) {
+   ent->ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL |
+   FPU_KERN_NOWAIT);
+   if (ent->ctx != NULL) {
+   mtx_lock(&fpu_busy_mtx);
+   LIST_INSERT_HEAD(&fpu_busy_head, ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   } else {
+   free(ent, M_DEVBUF);
+   ent = NULL;
+   }
+   }
+
+   return (ent);
+}
+
+static void
+release_fpu_cc_ent(struct fpu_cc_ent *ent)
+{
+   mtx_lock(&fpu_busy_mtx);
+   LIST_REMOVE(ent, entries);
+   mtx_unlock(&fpu_busy_mtx);
+   mtx_lock(&fpu_free_mtx);
+   LIST_INSERT_HEAD(&fpu_free_head, ent, entries);
+   mtx_unlock(&fpu_free_mtx);
+}
+
+uint64_t
+_x86_64_call1(void *fn, uint64_t a)
+{
+   struct fpu_cc_ent *ent;
+   uint64_t ret;
+
+   if ((ent = request_fpu_cc_ent()) == NULL)
+   return (ENOMEM);
+   fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL);
+   ret = x86_64_call1(fn, a);
+   fpu_kern_leave(curthread, ent->ctx);
+   release_fpu_cc_ent(ent);
+
+   return (ret);
+}
+
+uint64_t
+_x86_64_call2(void *fn, uint64_t a, uint64_t b)
+{
+   struct fpu_cc_ent *ent;
+   uint64_t ret;
+
+ 

svn commit: r343299 - stable/12/sys/dev/oce

2019-01-21 Thread Xin LI
Author: delphij
Date: Tue Jan 22 04:20:00 2019
New Revision: 343299
URL: https://svnweb.freebsd.org/changeset/base/343299

Log:
  MFC r342856: Added support for the SIOCGI2C ioctl.
  
  Submitted by: Ram Kishore Vegesna 
  Obtained from:Broadcom

Modified:
  stable/12/sys/dev/oce/oce_if.c
  stable/12/sys/dev/oce/oce_if.h
  stable/12/sys/dev/oce/oce_mbox.c
  stable/12/sys/dev/oce/oce_sysctl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/oce/oce_if.c
==
--- stable/12/sys/dev/oce/oce_if.c  Tue Jan 22 03:53:42 2019
(r343298)
+++ stable/12/sys/dev/oce/oce_if.c  Tue Jan 22 04:20:00 2019
(r343299)
@@ -475,6 +475,8 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d
 {
struct ifreq *ifr = (struct ifreq *)data;
POCE_SOFTC sc = ifp->if_softc;
+   struct ifi2creq i2c;
+   uint8_t offset = 0;
int rc = 0;
uint32_t u;
 
@@ -584,6 +586,38 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d
}
 #endif
 
+   break;
+
+   case SIOCGI2C:
+   rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
+   if (rc)
+   break;
+
+   if (i2c.dev_addr != PAGE_NUM_A0 &&
+   i2c.dev_addr != PAGE_NUM_A2) {
+   rc = EINVAL;
+   break;
+   }
+
+   if (i2c.len > sizeof(i2c.data)) {
+   rc = EINVAL;
+   break;
+   }
+
+   rc = oce_mbox_read_transrecv_data(sc, i2c.dev_addr);
+   if(rc) {
+   rc = -rc;
+   break;
+   }
+
+   if (i2c.dev_addr == PAGE_NUM_A0)
+   offset = i2c.offset;
+   else
+   offset = TRANSCEIVER_A0_SIZE + i2c.offset;
+
+   memcpy(&i2c.data[0], &sfp_vpd_dump_buffer[offset], i2c.len);
+
+   rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
break;
 
case SIOCGPRIVATE_0:

Modified: stable/12/sys/dev/oce/oce_if.h
==
--- stable/12/sys/dev/oce/oce_if.h  Tue Jan 22 03:53:42 2019
(r343298)
+++ stable/12/sys/dev/oce/oce_if.h  Tue Jan 22 04:20:00 2019
(r343299)
@@ -1188,6 +1188,7 @@ static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc)
 #define PAGE_NUM_A2 0xa2
 #define IS_QNQ_OR_UMC(sc) ((sc->pvid && (sc->function_mode & FNM_UMC_MODE ))\
 || (sc->qnqid && (sc->function_mode & FNM_FLEX10_MODE)))
+extern uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE];
 
 struct oce_rdma_info;
 extern struct oce_rdma_if *oce_rdma_if;

Modified: stable/12/sys/dev/oce/oce_mbox.c
==
--- stable/12/sys/dev/oce/oce_mbox.cTue Jan 22 03:53:42 2019
(r343298)
+++ stable/12/sys/dev/oce/oce_mbox.cTue Jan 22 04:20:00 2019
(r343299)
@@ -41,7 +41,6 @@
 /* $FreeBSD$ */
 
 #include "oce_if.h"
-extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE];
 
 int
 oce_wait_ready(POCE_SOFTC sc)
@@ -1966,15 +1965,15 @@ oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t p
if(fwcmd->params.rsp.page_num == PAGE_NUM_A0)
{
bcopy((char *)fwcmd->params.rsp.page_data, 
-   (char *)&sfp_vpd_dump_buffer[0], 
-   TRANSCEIVER_A0_SIZE);
+ &sfp_vpd_dump_buffer[0], 
+ TRANSCEIVER_A0_SIZE);
}
 
if(fwcmd->params.rsp.page_num == PAGE_NUM_A2)
{
bcopy((char *)fwcmd->params.rsp.page_data, 
-   (char *)&sfp_vpd_dump_buffer[32], 
-   TRANSCEIVER_A2_SIZE);
+ &sfp_vpd_dump_buffer[TRANSCEIVER_A0_SIZE],
+ TRANSCEIVER_A2_SIZE);
}
 error:
oce_dma_free(sc, &dma);

Modified: stable/12/sys/dev/oce/oce_sysctl.c
==
--- stable/12/sys/dev/oce/oce_sysctl.c  Tue Jan 22 03:53:42 2019
(r343298)
+++ stable/12/sys/dev/oce/oce_sysctl.c  Tue Jan 22 04:20:00 2019
(r343299)
@@ -66,7 +66,7 @@ static void oce_add_stats_sysctls_xe201(POCE_SOFTC sc,
 
 
 extern char component_revision[32];
-uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE];
+uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE];
 
 struct flash_img_attri {
int img_offset;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343300 - stable/11/sys/dev/oce

2019-01-21 Thread Xin LI
Author: delphij
Date: Tue Jan 22 04:20:52 2019
New Revision: 343300
URL: https://svnweb.freebsd.org/changeset/base/343300

Log:
  MFC r342856: Added support for the SIOCGI2C ioctl.
  
  Submitted by: Ram Kishore Vegesna 
  Obtained from:Broadcom

Modified:
  stable/11/sys/dev/oce/oce_if.c
  stable/11/sys/dev/oce/oce_if.h
  stable/11/sys/dev/oce/oce_mbox.c
  stable/11/sys/dev/oce/oce_sysctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/oce/oce_if.c
==
--- stable/11/sys/dev/oce/oce_if.c  Tue Jan 22 04:20:00 2019
(r343299)
+++ stable/11/sys/dev/oce/oce_if.c  Tue Jan 22 04:20:52 2019
(r343300)
@@ -470,6 +470,8 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d
 {
struct ifreq *ifr = (struct ifreq *)data;
POCE_SOFTC sc = ifp->if_softc;
+   struct ifi2creq i2c;
+   uint8_t offset = 0;
int rc = 0;
uint32_t u;
 
@@ -579,6 +581,38 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d
}
 #endif
 
+   break;
+
+   case SIOCGI2C:
+   rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
+   if (rc)
+   break;
+
+   if (i2c.dev_addr != PAGE_NUM_A0 &&
+   i2c.dev_addr != PAGE_NUM_A2) {
+   rc = EINVAL;
+   break;
+   }
+
+   if (i2c.len > sizeof(i2c.data)) {
+   rc = EINVAL;
+   break;
+   }
+
+   rc = oce_mbox_read_transrecv_data(sc, i2c.dev_addr);
+   if(rc) {
+   rc = -rc;
+   break;
+   }
+
+   if (i2c.dev_addr == PAGE_NUM_A0)
+   offset = i2c.offset;
+   else
+   offset = TRANSCEIVER_A0_SIZE + i2c.offset;
+
+   memcpy(&i2c.data[0], &sfp_vpd_dump_buffer[offset], i2c.len);
+
+   rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
break;
 
case SIOCGPRIVATE_0:

Modified: stable/11/sys/dev/oce/oce_if.h
==
--- stable/11/sys/dev/oce/oce_if.h  Tue Jan 22 04:20:00 2019
(r343299)
+++ stable/11/sys/dev/oce/oce_if.h  Tue Jan 22 04:20:52 2019
(r343300)
@@ -1186,6 +1186,7 @@ static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc)
 #define PAGE_NUM_A2 0xa2
 #define IS_QNQ_OR_UMC(sc) ((sc->pvid && (sc->function_mode & FNM_UMC_MODE ))\
 || (sc->qnqid && (sc->function_mode & FNM_FLEX10_MODE)))
+extern uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE];
 
 struct oce_rdma_info;
 extern struct oce_rdma_if *oce_rdma_if;

Modified: stable/11/sys/dev/oce/oce_mbox.c
==
--- stable/11/sys/dev/oce/oce_mbox.cTue Jan 22 04:20:00 2019
(r343299)
+++ stable/11/sys/dev/oce/oce_mbox.cTue Jan 22 04:20:52 2019
(r343300)
@@ -39,7 +39,6 @@
 /* $FreeBSD$ */
 
 #include "oce_if.h"
-extern uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE];
 
 int
 oce_wait_ready(POCE_SOFTC sc)
@@ -1964,15 +1963,15 @@ oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t p
if(fwcmd->params.rsp.page_num == PAGE_NUM_A0)
{
bcopy((char *)fwcmd->params.rsp.page_data, 
-   (char *)&sfp_vpd_dump_buffer[0], 
-   TRANSCEIVER_A0_SIZE);
+ &sfp_vpd_dump_buffer[0], 
+ TRANSCEIVER_A0_SIZE);
}
 
if(fwcmd->params.rsp.page_num == PAGE_NUM_A2)
{
bcopy((char *)fwcmd->params.rsp.page_data, 
-   (char *)&sfp_vpd_dump_buffer[32], 
-   TRANSCEIVER_A2_SIZE);
+ &sfp_vpd_dump_buffer[TRANSCEIVER_A0_SIZE],
+ TRANSCEIVER_A2_SIZE);
}
 error:
oce_dma_free(sc, &dma);

Modified: stable/11/sys/dev/oce/oce_sysctl.c
==
--- stable/11/sys/dev/oce/oce_sysctl.c  Tue Jan 22 04:20:00 2019
(r343299)
+++ stable/11/sys/dev/oce/oce_sysctl.c  Tue Jan 22 04:20:52 2019
(r343300)
@@ -64,7 +64,7 @@ static void oce_add_stats_sysctls_xe201(POCE_SOFTC sc,
 
 
 extern char component_revision[32];
-uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE];
+uint8_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_SIZE];
 
 struct flash_img_attri {
int img_offset;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r343301 - head/sys/modules/vmware/vmxnet3

2019-01-21 Thread Patrick Kelsey
Author: pkelsey
Date: Tue Jan 22 04:36:19 2019
New Revision: 343301
URL: https://svnweb.freebsd.org/changeset/base/343301

Log:
  Add missing dependency to vmxnet3 Makefile and clean it up a bit otherwise.
  
  MFC after:1 week

Modified:
  head/sys/modules/vmware/vmxnet3/Makefile

Modified: head/sys/modules/vmware/vmxnet3/Makefile
==
--- head/sys/modules/vmware/vmxnet3/MakefileTue Jan 22 04:20:52 2019
(r343300)
+++ head/sys/modules/vmware/vmxnet3/MakefileTue Jan 22 04:36:19 2019
(r343301)
@@ -27,10 +27,7 @@
 
 KMOD=  if_vmx
 SRCS=  if_vmx.c
-SRCS+= bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h
-
-# With VMXNET3_LEGACY_TX, the driver will use the non-multiqueue
-# capable if_start interface.
-#CFLAGS+= -DVMXNET3_LEGACY_TX
+SRCS+= bus_if.h device_if.h pci_if.h ifdi_if.h
+SRCS+= opt_inet.h opt_inet6.h
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"