Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/cocci
Thank you Conrad. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message , Conrad Meyer writes: > --a6fe4405a56be1bb > Content-Type: text/plain; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > > Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m back at a computer. > > Best, > Conrad > > On Mon, May 11, 2020 at 20:28 Cy Schubert wrote= > : > > > In message <202005112257.04bmvmx2096...@repo.freebsd.org>, Conrad Meyer > > writes: > > > Author: cem > > > Date: Mon May 11 22:57:21 2020 > > > New Revision: 360944 > > > URL: https://svnweb.freebsd.org/changeset/base/360944 > > > > > > Log: > > > copystr(9): Move to deprecate [2/2] > > > > > > Unlike the other copy*() functions, it does not serve to copy from on= > e > > > address space to another or protect against potential faults. It's > > just > > > an older incarnation of the now-more-common strlcpy(). > > > > > > Add a coccinelle script to tools/ which can be used to mechanically > > > convert existing instances where replacement with strlcpy is trivial. > > > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > > > code was further refactored manually to simplify. > > > > > > Replace the declaration of copystr() in systm.h with a small macro > > > wrapper around strlcpy. > > > > > > Remove N redundant MI implementations of copystr. For MIPS, this > > > entailed inlining the assembler copystr into the only consumer, > > > copyinstr, and making the latter a leaf function. > > > > > > Reviewed by:jhb > > > Differential Revision: https://reviews.freebsd.org/D24672 > > > > > > Added: > > > head/tools/coccinelle/ > > > head/tools/coccinelle/copystr9.cocci (contents, props changed) > > > Deleted: > > > head/sys/arm64/arm64/copystr.c > > > head/sys/powerpc/powerpc/copystr.c > > > head/sys/riscv/riscv/copystr.c > > > Modified: > > > head/sys/amd64/amd64/support.S > > > head/sys/arm/arm/copystr.S > > > head/sys/fs/fuse/fuse_vfsops.c > > > head/sys/fs/unionfs/union_vfsops.c > > > head/sys/i386/i386/support.s > > > head/sys/kern/subr_csan.c > > > head/sys/mips/mips/support.S > > > head/sys/sys/systm.h > > > > > > > Hi Conrad, > > > > This is causing a failure to boot with geom_mirror: > > > > GEOM_MIRROR: Device mirror/gm0 launched (2/2). > > GEOM_MIRROR: Device mirror/gm1 launched (2/2). > > GEOM_MIRROR: Device mirror/gm2 launched (2/2). > > GEOM_MIRROR: Device mirror/gm3 launched (2/2). > > mountroot: waiting for device /dev/mirror/gm0a... > > Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 > > more > > seconds > > exec /sbin/init: error 20 > > exec /sbin/init.bak: error 20 > > exec /rescue/init: error 20 > > init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/ini= > t > > panic: no init > > cpuid =3D 1 > > time =3D 1589225852 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfe004df51ba0 > > vpanic() at vpanic+0x182/frame 0xfe004df51bf0 > > panic() at panic+0x43/frame 0xfe004df51c50 > > start_init() at start_init+0x23c/frame 0xfe004df51cf0 > > fork_exit() at fork_exit+0x7e/frame 0xfe004df51d30 > > fork_trampoline() at fork_trampoline+0xe/frame 0xfe004df51d30 > > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > > Uptime: 9s > > acpi0: reset failed - timeout > > Automatic reboot in 15 seconds - press a key on the console to abort > > --> Press a key on the console to reboot, > > --> or switch off the system now. > > Rebooting... > > cpu_reset: Restarting BSP > > cpu_reset_proxy: Stopped CPU 1 > > > > > > Anticipating you might ask if r360941 is the problem. It is not. Revertin= > g > > this r360944 (not r360941) resolves the boot problem. System is amd64. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > The need of the many outweighs the greed of the few. > > > > > > > > --a6fe4405a56be1bb > Content-Type: text/html; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > > Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m b= > ack at a computer. >Best,Conrad=C2=A0 l_quote">On Mon, May 11, 2020 at 20:2= > 8 Cy Schubert mailto:cy.schub...@cschubert.com;>Cy.Schubert@= > cschubert.com wrote: le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In mes= > sage mailto:202005112257.04bmvmx2096...@repo.freebsd.org; ta= > rget=3D"_blank">202005112257.04bmvmx2096...@repo.freebsd.org, Conra= > d Meyer > writes: > Author: cem > Date: Mon May 11 22:57:21 2020 > New Revision: 360944 > URL: https://svnweb.freebsd.org/changeset/base/360944; rel= > =3D"noreferrer" target=3D"_blank">https://svnweb.freebsd.org/changeset/base= > /360944 > > Log: > =C2=A0 =C2=A0copystr(9): Move
svn commit: r360955 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools...
Author: cem Date: Tue May 12 04:34:26 2020 New Revision: 360955 URL: https://svnweb.freebsd.org/changeset/base/360955 Log: Revert r360944 and r360946 until reported issues can be resolved Reported by: cy Added: head/sys/arm64/arm64/copystr.c - copied unchanged from r360943, head/sys/arm64/arm64/copystr.c head/sys/powerpc/powerpc/copystr.c - copied unchanged from r360943, head/sys/powerpc/powerpc/copystr.c head/sys/riscv/riscv/copystr.c - copied unchanged from r360943, head/sys/riscv/riscv/copystr.c Deleted: head/tools/coccinelle/ Modified: head/sys/amd64/amd64/support.S head/sys/arm/arm/copystr.S head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/i386/i386/support.s head/sys/kern/subr_csan.c head/sys/mips/mips/support.S head/sys/sys/systm.h Modified: head/sys/amd64/amd64/support.S == --- head/sys/amd64/amd64/support.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/amd64/amd64/support.S Tue May 12 04:34:26 2020 (r360955) @@ -1417,6 +1417,43 @@ copyinstr_toolong: jmp cpystrflt_x /* + * copystr(from, to, maxlen, int *lencopied) + * %rdi, %rsi, %rdx, %rcx + */ +ENTRY(copystr) + PUSH_FRAME_POINTER + movq%rdx,%r8/* %r8 = maxlen */ + + incq%rdx +1: + decq%rdx + jz 4f + movb(%rdi),%al + movb%al,(%rsi) + incq%rsi + incq%rdi + testb %al,%al + jnz 1b + + /* Success -- 0 byte reached */ + decq%rdx + xorl%eax,%eax +2: + testq %rcx,%rcx + jz 3f + /* set *lencopied and return %rax */ + subq%rdx,%r8 + movq%r8,(%rcx) +3: + POP_FRAME_POINTER + ret +4: + /* rdx is zero -- return ENAMETOOLONG */ + movl$ENAMETOOLONG,%eax + jmp 2b +END(copystr) + +/* * Handling of special amd64 registers and descriptor tables etc */ /* void lgdt(struct region_descriptor *rdp); */ Modified: head/sys/arm/arm/copystr.S == --- head/sys/arm/arm/copystr.S Tue May 12 02:23:11 2020(r360954) +++ head/sys/arm/arm/copystr.S Tue May 12 04:34:26 2020(r360955) @@ -60,6 +60,39 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif +/* + * r0 - from + * r1 - to + * r2 - maxlens + * r3 - lencopied + * + * Copy string from r0 to r1 + */ +ENTRY(copystr) + stmfd sp!, {r4-r5}/* stack is 8 byte aligned */ + teq r2, #0x + mov r5, #0x + moveq r0, #ENAMETOOLONG + beq 2f + +1: ldrbr4, [r0], #0x0001 + add r5, r5, #0x0001 + teq r4, #0x + strbr4, [r1], #0x0001 + teqne r5, r2 + bne 1b + + teq r4, #0x + moveq r0, #0x + movne r0, #ENAMETOOLONG + +2: teq r3, #0x + strne r5, [r3] + + ldmfd sp!, {r4-r5}/* stack is 8 byte aligned */ + RET +END(copystr) + #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} Copied: head/sys/arm64/arm64/copystr.c (from r360943, head/sys/arm64/arm64/copystr.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/arm64/arm64/copystr.c) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + *
Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccine
Thanks Cy. I’ll revert it when I’m back at a computer. Best, Conrad On Mon, May 11, 2020 at 20:28 Cy Schubert wrote: > In message <202005112257.04bmvmx2096...@repo.freebsd.org>, Conrad Meyer > writes: > > Author: cem > > Date: Mon May 11 22:57:21 2020 > > New Revision: 360944 > > URL: https://svnweb.freebsd.org/changeset/base/360944 > > > > Log: > > copystr(9): Move to deprecate [2/2] > > > > Unlike the other copy*() functions, it does not serve to copy from one > > address space to another or protect against potential faults. It's > just > > an older incarnation of the now-more-common strlcpy(). > > > > Add a coccinelle script to tools/ which can be used to mechanically > > convert existing instances where replacement with strlcpy is trivial. > > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > > code was further refactored manually to simplify. > > > > Replace the declaration of copystr() in systm.h with a small macro > > wrapper around strlcpy. > > > > Remove N redundant MI implementations of copystr. For MIPS, this > > entailed inlining the assembler copystr into the only consumer, > > copyinstr, and making the latter a leaf function. > > > > Reviewed by:jhb > > Differential Revision: https://reviews.freebsd.org/D24672 > > > > Added: > > head/tools/coccinelle/ > > head/tools/coccinelle/copystr9.cocci (contents, props changed) > > Deleted: > > head/sys/arm64/arm64/copystr.c > > head/sys/powerpc/powerpc/copystr.c > > head/sys/riscv/riscv/copystr.c > > Modified: > > head/sys/amd64/amd64/support.S > > head/sys/arm/arm/copystr.S > > head/sys/fs/fuse/fuse_vfsops.c > > head/sys/fs/unionfs/union_vfsops.c > > head/sys/i386/i386/support.s > > head/sys/kern/subr_csan.c > > head/sys/mips/mips/support.S > > head/sys/sys/systm.h > > > > Hi Conrad, > > This is causing a failure to boot with geom_mirror: > > GEOM_MIRROR: Device mirror/gm0 launched (2/2). > GEOM_MIRROR: Device mirror/gm1 launched (2/2). > GEOM_MIRROR: Device mirror/gm2 launched (2/2). > GEOM_MIRROR: Device mirror/gm3 launched (2/2). > mountroot: waiting for device /dev/mirror/gm0a... > Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 > more > seconds > exec /sbin/init: error 20 > exec /sbin/init.bak: error 20 > exec /rescue/init: error 20 > init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init > panic: no init > cpuid = 1 > time = 1589225852 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfe004df51ba0 > vpanic() at vpanic+0x182/frame 0xfe004df51bf0 > panic() at panic+0x43/frame 0xfe004df51c50 > start_init() at start_init+0x23c/frame 0xfe004df51cf0 > fork_exit() at fork_exit+0x7e/frame 0xfe004df51d30 > fork_trampoline() at fork_trampoline+0xe/frame 0xfe004df51d30 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Uptime: 9s > acpi0: reset failed - timeout > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > Rebooting... > cpu_reset: Restarting BSP > cpu_reset_proxy: Stopped CPU 1 > > > Anticipating you might ask if r360941 is the problem. It is not. Reverting > this r360944 (not r360941) resolves the boot problem. System is amd64. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.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"
Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/cocci
In message <202005112257.04bmvmx2096...@repo.freebsd.org>, Conrad Meyer writes: > Author: cem > Date: Mon May 11 22:57:21 2020 > New Revision: 360944 > URL: https://svnweb.freebsd.org/changeset/base/360944 > > Log: > copystr(9): Move to deprecate [2/2] > > Unlike the other copy*() functions, it does not serve to copy from one > address space to another or protect against potential faults. It's just > an older incarnation of the now-more-common strlcpy(). > > Add a coccinelle script to tools/ which can be used to mechanically > convert existing instances where replacement with strlcpy is trivial. > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > code was further refactored manually to simplify. > > Replace the declaration of copystr() in systm.h with a small macro > wrapper around strlcpy. > > Remove N redundant MI implementations of copystr. For MIPS, this > entailed inlining the assembler copystr into the only consumer, > copyinstr, and making the latter a leaf function. > > Reviewed by:jhb > Differential Revision: https://reviews.freebsd.org/D24672 > > Added: > head/tools/coccinelle/ > head/tools/coccinelle/copystr9.cocci (contents, props changed) > Deleted: > head/sys/arm64/arm64/copystr.c > head/sys/powerpc/powerpc/copystr.c > head/sys/riscv/riscv/copystr.c > Modified: > head/sys/amd64/amd64/support.S > head/sys/arm/arm/copystr.S > head/sys/fs/fuse/fuse_vfsops.c > head/sys/fs/unionfs/union_vfsops.c > head/sys/i386/i386/support.s > head/sys/kern/subr_csan.c > head/sys/mips/mips/support.S > head/sys/sys/systm.h > Hi Conrad, This is causing a failure to boot with geom_mirror: GEOM_MIRROR: Device mirror/gm0 launched (2/2). GEOM_MIRROR: Device mirror/gm1 launched (2/2). GEOM_MIRROR: Device mirror/gm2 launched (2/2). GEOM_MIRROR: Device mirror/gm3 launched (2/2). mountroot: waiting for device /dev/mirror/gm0a... Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 more seconds exec /sbin/init: error 20 exec /sbin/init.bak: error 20 exec /rescue/init: error 20 init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init panic: no init cpuid = 1 time = 1589225852 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe004df51ba0 vpanic() at vpanic+0x182/frame 0xfe004df51bf0 panic() at panic+0x43/frame 0xfe004df51c50 start_init() at start_init+0x23c/frame 0xfe004df51cf0 fork_exit() at fork_exit+0x7e/frame 0xfe004df51d30 fork_trampoline() at fork_trampoline+0xe/frame 0xfe004df51d30 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 9s acpi0: reset failed - timeout Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 1 Anticipating you might ask if r360941 is the problem. It is not. Reverting this r360944 (not r360941) resolves the boot problem. System is amd64. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.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"
Re: svn commit: r360905 - in head/tests/sys/netpfil: common pf
> On May 11, 2020, at 12:07 PM, Mark Johnston wrote: > > Author: markj > Date: Mon May 11 19:07:33 2020 > New Revision: 360905 > URL: https://svnweb.freebsd.org/changeset/base/360905 > > Log: > Remove the svn:executable property from some pf test files. > > The test makefiles will handle setting mode bits during install. Also, > Phabricator gets upset when uploading an executable plain-text file > without a shebang. Awesome — thanks for doing this! Cheers, -Enji ___ 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: r360954 - head/sys/contrib/dev/ath/ath_hal/ar9300
Author: adrian Date: Tue May 12 02:23:11 2020 New Revision: 360954 URL: https://svnweb.freebsd.org/changeset/base/360954 Log: [ath_hal_ar9300] Ensure AH_BYTE_ORDER is defined before used. Same deal here - ensure endian bits are set here first! Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Tue May 12 02:20:27 2020(r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Tue May 12 02:23:11 2020(r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateAP121_h__ #define __ar9300templateAP121_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_ap121= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Tue May 12 02:20:27 2020(r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Tue May 12 02:23:11 2020(r360954) @@ -26,6 +26,11 @@ #ifndef __ar9300templateAphrodite_h__ #define __ar9300templateAphrodite_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_aphrodite= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h Tue May 12 02:20:27 2020(r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h Tue May 12 02:23:11 2020(r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300template_cus157_h__ #define __ar9300template_cus157_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t Ar9300Template_cus157= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.hTue May 12 02:20:27 2020(r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.hTue May 12 02:23:11 2020(r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateGeneric_h__ #define __ar9300templateGeneric_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_generic= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h Tue May 12 02:20:27 2020(r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h Tue May 12 02:23:11 2020(r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateHB112_h__ #define __ar9300templateHB112_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_hb112= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h Tue May 12 02:20:27 2020(r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h Tue May 12 02:23:11 2020(r360954) @@ -26,6 +26,11 @@ #ifndef __ar9300templateHB116_h__ #define __ar9300templateHB116_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_hb116= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h == ---
svn commit: r360953 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal
Author: adrian Date: Tue May 12 02:20:27 2020 New Revision: 360953 URL: https://svnweb.freebsd.org/changeset/base/360953 Log: [ath_hal] [ath_hal_ar9300] Fix endian macros to work in and out of kernel tree. Yes, people shouldn't use bitfields in C for structure parsing. If someone ever wants a cleanup task then it'd be great to remove them from this vendor code and other places in the ar9285/ar9287 HALs. Alas, here we are. AH_BYTE_ORDER wasn't defined and neither were the two values it could be. So when compiling ath_ee_print_9300 it'd default to the big endian struct layout and get a WHOLE lot of stuff wrong. So: * move AH_BYTE_ORDER into ath_hal/ah.h where it can be used by everyone. * ensure that AH_BYTE_ORDER is actually defined before using it! This should work on both big and little endian platforms. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.hTue May 12 01:47:33 2020(r360952) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.hTue May 12 02:20:27 2020(r360953) @@ -19,18 +19,14 @@ #include "ar9300_freebsd_inc.h" -#defineAH_BIG_ENDIAN 4321 -#defineAH_LITTLE_ENDIAN1234 - -#if _BYTE_ORDER == _BIG_ENDIAN -#defineAH_BYTE_ORDER AH_BIG_ENDIAN -#else -#defineAH_BYTE_ORDER AH_LITTLE_ENDIAN -#endif - /* XXX doesn't belong here */ #defineAR_EEPROM_MODAL_SPURS 5 +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* * (a) this should be N(a), * (b) FreeBSD does define nitems, @@ -43,9 +39,7 @@ #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ - #define AR9300_MAGIC0x19741014 - /* MAC register values */ Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Tue May 12 01:47:33 2020(r360952) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Tue May 12 02:20:27 2020(r360953) @@ -18,13 +18,17 @@ #define _ATH_AR9300_EEP_H_ #include "opt_ah.h" - #include "ah.h" #if defined(WIN32) || defined(WIN64) #pragma pack (push, ar9300, 1) #endif +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* FreeBSD extras - should be in ah_eeprom.h ? */ #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 #define AR_EEPROM_EEPCAP_AES_DIS0x0002 @@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr { u_int8_t flag :2, t_power :6; } __packed CAL_CTL_EDGE_PWR; -#else +#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN typedef struct CalCtlEdgePwr { u_int8_t t_power :6, flag :2; } __packed CAL_CTL_EDGE_PWR; +#else +#error AH_BYTE_ORDER undefined! #endif typedef struct ospCalCtlData_5G { Modified: head/sys/dev/ath/ath_hal/ah.h == --- head/sys/dev/ath/ath_hal/ah.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/dev/ath/ath_hal/ah.h Tue May 12 02:20:27 2020 (r360953) @@ -33,6 +33,18 @@ #include "ah_osdep.h" /* + * Endianness macros; used by various structures and code. + */ +#define AH_BIG_ENDIAN 4321 +#define AH_LITTLE_ENDIAN1234 + +#if _BYTE_ORDER == _BIG_ENDIAN +#define AH_BYTE_ORDER AH_BIG_ENDIAN +#else +#define AH_BYTE_ORDER AH_LITTLE_ENDIAN +#endif + +/* * The maximum number of TX/RX chains supported. * This is intended to be used by various statistics gathering operations * (NF, RSSI, EVM). ___ 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: r360952 - head/lib/libz
Author: delphij Date: Tue May 12 01:47:33 2020 New Revision: 360952 URL: https://svnweb.freebsd.org/changeset/base/360952 Log: Generate zlib.pc from source. Reviewed by: bapt MFC after:3 days Differential Revision:https://reviews.freebsd.org/D24806 Deleted: head/lib/libz/zlib.pc Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile == --- head/lib/libz/Makefile Tue May 12 01:40:48 2020(r360951) +++ head/lib/libz/Makefile Tue May 12 01:47:33 2020(r360952) @@ -53,6 +53,17 @@ INCS=zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz ___ 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: r360951 - head/tools/tools/ath/ath_ee_9300_print
Author: adrian Date: Tue May 12 01:40:48 2020 New Revision: 360951 URL: https://svnweb.freebsd.org/changeset/base/360951 Log: [ar9300] Fix up this tool after test compiling it with LLVM. Le oops. Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c == --- head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:36:48 2020(r360950) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:40:48 2020(r360951) @@ -61,10 +61,10 @@ eeprom_9300_ctl_idx_to_regdomain(uint8_t idx) case 0x10: return "FCC"; case 0x30: return "ETSI"; case 0x40: return "JP"; + default: return ""; } } - static void eeprom_9300_hdr_print(const uint16_t *buf) { @@ -219,7 +219,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t int i; for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { - printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -229,7 +229,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_5], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_6], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); - printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -239,7 +239,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_13], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_14], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); - printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -258,7 +258,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t int i; for (i = 0; i < OSPREY_NUM_2G_40_TARGET_POWERS; i++) { - printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -268,7 +268,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_5], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_6], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); - printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -278,7 +278,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_13], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_14], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); - printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], ___ svn-src-all@freebsd.org
svn commit: r360950 - head/tools/tools/ath/ath_ee_9300_print
Author: adrian Date: Tue May 12 01:36:48 2020 New Revision: 360950 URL: https://svnweb.freebsd.org/changeset/base/360950 Log: [ar9300] Update the ar9300 eeprom dump utility to include target power and CTL. This lets me easily see what the EEPROM target power and regulatory compliance table limits are. (Yeah, should've done this in 2013..) Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c == --- head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:23:05 2020(r360949) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:36:48 2020(r360950) @@ -37,6 +37,34 @@ struct ath_hal; #include "ar9300/ar9300eep.h" +static const char * +eeprom_9300_ctl_idx_to_mode(uint8_t idx) +{ + switch (idx & 0xf) { + /* 2G CTLs */ + case 1: return "CCK"; + case 2: return "OFDM"; + case 5: return "HT20"; + case 7: return "HT40"; + /* 5G CTLs */ + case 0: return "OFDM"; + case 6: return "HT20"; + case 8: return "HT40"; + default: return ""; + } +} + +static const char * +eeprom_9300_ctl_idx_to_regdomain(uint8_t idx) +{ + switch (idx & 0xf0) { + case 0x10: return "FCC"; + case 0x30: return "ETSI"; + case 0x40: return "JP"; + } +} + + static void eeprom_9300_hdr_print(const uint16_t *buf) { @@ -156,6 +184,246 @@ eeprom_9300_modal_print(const OSPREY_MODAL_EEP_HEADER } static void +eeprom_9300_print_2g_target_cck(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_CCK_TARGET_POWERS; i++) { + printf("| Freq %u CCK: pow2x 1/5L %u 5S %u 11L %u 11S %u\n", + FBIN2FREQ(ee->cal_target_freqbin_cck[i], 1), + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_1L_5L], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_5S], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_11L], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_11S]); + } +} + +static void +eeprom_9300_print_2g_target_ofdm(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { + printf("| Freq %u OFDM: pow2x 6/12/18/24M %u 36M %u 48M %u 54M %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g[i], 1), + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_6_24], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_36], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_48], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_54]); + } +} + +static void +eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], +
svn commit: r360948 - head/sys/powerpc/aim
Author: bdragon Date: Tue May 12 01:04:50 2020 New Revision: 360948 URL: https://svnweb.freebsd.org/changeset/base/360948 Log: [PowerPC64] Minor correctness fix in rstcode. TRAP_ENTRY(0) should be TRAP_GENTRAP(0) here. However, in practice, it doesn't matter, as the only time TRAP_ENTRY and TRAP_GENTRAP can differ is when bridge mode is active, which is impossible on the 64 bit kernel. Fix it anyway in case we ever need to add a trap preamble on PPC64. Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S == --- head/sys/powerpc/aim/trap_subr64.S Tue May 12 01:01:48 2020 (r360947) +++ head/sys/powerpc/aim/trap_subr64.S Tue May 12 01:04:50 2020 (r360948) @@ -318,7 +318,7 @@ CNAME(rstcode): * It is software reset when 46:47 = 0b00 */ /* 0x00 */ - ld %r2,TRAP_ENTRY(0) /* Real-mode */ + ld %r2,TRAP_GENTRAP(0) /* Real-mode */ mfsrr1 %r9 /* Load SRR1 into r9 */ andis. %r9,%r9,0x3 /* Logic AND with 46:47 bits */ ___ 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: r360947 - stable/12/usr.bin/elfctl
Author: emaste Date: Tue May 12 01:01:48 2020 New Revision: 360947 URL: https://svnweb.freebsd.org/changeset/base/360947 Log: MFC r360676: elfctl: update earliest FreeBSD revision to 12.2 elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2 Reported by: Dewayne Geraghty Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/elfctl/elfctl.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/elfctl/elfctl.1 == --- stable/12/usr.bin/elfctl/elfctl.1 Tue May 12 00:42:16 2020 (r360946) +++ stable/12/usr.bin/elfctl/elfctl.1 Tue May 12 01:01:48 2020 (r360947) @@ -85,7 +85,7 @@ elfctl -e +aslr file .Sh HISTORY .Nm first appeared in -.Fx 13.0 . +.Fx 12.2 . .Sh AUTHORS .Nm was written by ___ 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: r360946 - head/sys/conf
Author: cem Date: Tue May 12 00:42:16 2020 New Revision: 360946 URL: https://svnweb.freebsd.org/changeset/base/360946 Log: Remove deleted files from the build Fix build break introduced in r360944. Reported by: kevans Modified: head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/files.riscv Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Tue May 12 00:36:37 2020(r360945) +++ head/sys/conf/files.arm64 Tue May 12 00:42:16 2020(r360946) @@ -133,7 +133,6 @@ arm64/arm64/busdma_machdep.cstandard arm64/arm64/bzero.Sstandard arm64/arm64/clock.cstandard arm64/arm64/copyinout.Sstandard -arm64/arm64/copystr.c standard arm64/arm64/cpu_errata.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.coptionalddb Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Tue May 12 00:36:37 2020(r360945) +++ head/sys/conf/files.powerpc Tue May 12 00:42:16 2020(r360946) @@ -241,7 +241,6 @@ powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard powerpc/powerpc/clock.cstandard powerpc/powerpc/copyinout.cstandard -powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/cpu_subr64.S optionalpowerpc64 powerpc/powerpc/db_disasm.coptionalddb Modified: head/sys/conf/files.riscv == --- head/sys/conf/files.riscv Tue May 12 00:36:37 2020(r360945) +++ head/sys/conf/files.riscv Tue May 12 00:42:16 2020(r360946) @@ -37,7 +37,6 @@ riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.cstandard riscv/riscv/copyinout.Sstandard -riscv/riscv/copystr.c standard riscv/riscv/cpufunc_asm.S standard riscv/riscv/db_disasm.coptionalddb riscv/riscv/db_interface.c optionalddb ___ 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: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle
Author: cem Date: Mon May 11 22:57:21 2020 New Revision: 360944 URL: https://svnweb.freebsd.org/changeset/base/360944 Log: copystr(9): Move to deprecate [2/2] Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Add a coccinelle script to tools/ which can be used to mechanically convert existing instances where replacement with strlcpy is trivial. In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the code was further refactored manually to simplify. Replace the declaration of copystr() in systm.h with a small macro wrapper around strlcpy. Remove N redundant MI implementations of copystr. For MIPS, this entailed inlining the assembler copystr into the only consumer, copyinstr, and making the latter a leaf function. Reviewed by: jhb Differential Revision:https://reviews.freebsd.org/D24672 Added: head/tools/coccinelle/ head/tools/coccinelle/copystr9.cocci (contents, props changed) Deleted: head/sys/arm64/arm64/copystr.c head/sys/powerpc/powerpc/copystr.c head/sys/riscv/riscv/copystr.c Modified: head/sys/amd64/amd64/support.S head/sys/arm/arm/copystr.S head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/i386/i386/support.s head/sys/kern/subr_csan.c head/sys/mips/mips/support.S head/sys/sys/systm.h Modified: head/sys/amd64/amd64/support.S == --- head/sys/amd64/amd64/support.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/amd64/amd64/support.S Mon May 11 22:57:21 2020 (r360944) @@ -1417,43 +1417,6 @@ copyinstr_toolong: jmp cpystrflt_x /* - * copystr(from, to, maxlen, int *lencopied) - * %rdi, %rsi, %rdx, %rcx - */ -ENTRY(copystr) - PUSH_FRAME_POINTER - movq%rdx,%r8/* %r8 = maxlen */ - - incq%rdx -1: - decq%rdx - jz 4f - movb(%rdi),%al - movb%al,(%rsi) - incq%rsi - incq%rdi - testb %al,%al - jnz 1b - - /* Success -- 0 byte reached */ - decq%rdx - xorl%eax,%eax -2: - testq %rcx,%rcx - jz 3f - /* set *lencopied and return %rax */ - subq%rdx,%r8 - movq%r8,(%rcx) -3: - POP_FRAME_POINTER - ret -4: - /* rdx is zero -- return ENAMETOOLONG */ - movl$ENAMETOOLONG,%eax - jmp 2b -END(copystr) - -/* * Handling of special amd64 registers and descriptor tables etc */ /* void lgdt(struct region_descriptor *rdp); */ Modified: head/sys/arm/arm/copystr.S == --- head/sys/arm/arm/copystr.S Mon May 11 22:48:00 2020(r360943) +++ head/sys/arm/arm/copystr.S Mon May 11 22:57:21 2020(r360944) @@ -60,39 +60,6 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif -/* - * r0 - from - * r1 - to - * r2 - maxlens - * r3 - lencopied - * - * Copy string from r0 to r1 - */ -ENTRY(copystr) - stmfd sp!, {r4-r5}/* stack is 8 byte aligned */ - teq r2, #0x - mov r5, #0x - moveq r0, #ENAMETOOLONG - beq 2f - -1: ldrbr4, [r0], #0x0001 - add r5, r5, #0x0001 - teq r4, #0x - strbr4, [r1], #0x0001 - teqne r5, r2 - bne 1b - - teq r4, #0x - moveq r0, #0x - movne r0, #ENAMETOOLONG - -2: teq r3, #0x - strne r5, [r3] - - ldmfd sp!, {r4-r5}/* stack is 8 byte aligned */ - RET -END(copystr) - #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} Modified: head/sys/fs/fuse/fuse_vfsops.c == --- head/sys/fs/fuse/fuse_vfsops.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/fs/fuse/fuse_vfsops.c Mon May 11 22:57:21 2020 (r360944) @@ -303,8 +303,6 @@ fuse_vfsop_mount(struct mount *mp) int daemon_timeout; int fd; - size_t len; - struct cdev *fdev; struct fuse_data *data = NULL; struct thread *td; @@ -432,8 +430,8 @@ fuse_vfsop_mount(struct mount *mp) strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); } - copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, ); - bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); + memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); mp->mnt_iosize_max = MAXPHYS; /* Now
Re: svn commit: r360937 - head
On 5/11/20 3:19 PM, Cy Schubert wrote: > In message <202005112215.04bmfkh8071...@repo.freebsd.org>, John Baldwin > writes: >> Author: jhb >> Date: Mon May 11 22:15:46 2020 >> New Revision: 360937 >> URL: https://svnweb.freebsd.org/changeset/base/360937 >> >> Log: >> Document removal of deprecated algorithms from OCF. >> >> Sponsored by: Chelsio Communications >> >> Modified: >> head/RELNOTES >> >> Modified: head/RELNOTES >> = >> = >> --- head/RELNOTESMon May 11 22:08:08 2020(r360936) >> +++ head/RELNOTESMon May 11 22:15:46 2020(r360937) >> @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. >> >> Changes to this file should not be MFCed. >> >> +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: >> +Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, >> +MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from >> +the kernel open cryptographic framework (OCF). >> + >> r360562: >> Remove support for ARC4, Blowfish, Cast, DES, Triple DES, >> MD5-HMAC, and Skipjack algorithms from /dev/crypto. >> > > Do we need a __FreeBSD_version bump? We shouldn't. I did not remove any of the CRYPTO_* constants that list algorithms since OpenSSL assumes some of them exist unconditionally. OpenSSL's /dev/crypto engine could use some love (it doesn't support AES-GCM on FreeBSD for example), but I've also found that using the engine isn't really beneficial. Doing crypto in the kernel via KTLS seems to perform better for hardware accelerators than the /dev/crypto interface. -- John Baldwin ___ 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: r360943 - head/share/man/man9
Author: cem Date: Mon May 11 22:48:00 2020 New Revision: 360943 URL: https://svnweb.freebsd.org/changeset/base/360943 Log: copystr(9): Move to deprecate [1/2] Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Reviewed by: jhb MFC after:i² days Differential Revision:yes (see 2/2) Modified: head/share/man/man9/copy.9 Modified: head/share/man/man9/copy.9 == --- head/share/man/man9/copy.9 Mon May 11 22:47:20 2020(r360942) +++ head/share/man/man9/copy.9 Mon May 11 22:48:00 2020(r360943) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2017 +.Dd May 11, 2020 .Dt COPY 9 .Os .Sh NAME @@ -45,7 +45,7 @@ .Nm copyout_nofault , .Nm copystr , .Nm copyinstr -.Nd kernel copy functions +.Nd heterogenous address space copy functions .Sh SYNOPSIS .In sys/types.h .In sys/systm.h @@ -57,18 +57,21 @@ .Fn copyout "const void *kaddr" "void *uaddr" "size_t len" .Ft int .Fn copyout_nofault "const void *kaddr" "void *uaddr" "size_t len" -.Ft int +.Ft int __deprecated .Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done" .Ft int .Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done" .Sh DESCRIPTION The .Nm -functions are designed to copy contiguous data from one address +functions are designed to copy contiguous data from one address space to another. -All but +.Pp .Fn copystr -copy data from user-space to kernel-space or vice-versa. +is deprecated and should be replaced with +.Xr strlcpy 9 . +It will be removed from +.Fx 13 . .Pp The .Fn 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: r360942 - head/sys/netinet
Author: tuexen Date: Mon May 11 22:47:20 2020 New Revision: 360942 URL: https://svnweb.freebsd.org/changeset/base/360942 Log: Fix a copy and paste error introduced in r360878. Reported-by: syzbot+a0863e972771f2f0d...@syzkaller.appspotmail.com Reported-by: syzbot+4481757e967ba83c4...@syzkaller.appspotmail.com MFC after:3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c == --- head/sys/netinet/sctp_input.c Mon May 11 22:39:53 2020 (r360941) +++ head/sys/netinet/sctp_input.c Mon May 11 22:47:20 2020 (r360942) @@ -5225,7 +5225,7 @@ process_control_chunks: auth_skipped = 0; } /* Restart the timer if we have pending data */ - TAILQ_FOREACH(chk, >sent_queue, sctp_next) { + TAILQ_FOREACH(chk, >asoc.sent_queue, sctp_next) { if (chk->whoTo != NULL) { 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: r360941 - head/sys/geom/mirror
Author: cem Date: Mon May 11 22:39:53 2020 New Revision: 360941 URL: https://svnweb.freebsd.org/changeset/base/360941 Log: geom(4) mirror: Do not panic on gmirror(8) insert, resize Geom_mirror initialization occurs in spurts and the present of a non-destroyed g_mirror softc does not always indicate that the geom has launched (i.e., has an sc_provider). Some gmirror(8) commands (via g_mirror_ctl) depend on a g_mirror's sc_provider (insert and resize). For those commands, g_mirror_ctl is modified to sleep-poll in an interruptible way until the target geom is either launched or destroyed. Reviewed by: markj Tested by:markj Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D24780 Modified: head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror_ctl.c == --- head/sys/geom/mirror/g_mirror_ctl.c Mon May 11 22:38:32 2020 (r360940) +++ head/sys/geom/mirror/g_mirror_ctl.c Mon May 11 22:39:53 2020 (r360941) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Configure, Rebuild, Remove, Deactivate, Forget, and Stop operations do not + * seem to depend on any particular g_mirror initialization state. + */ static struct g_mirror_softc * g_mirror_find_device(struct g_class *mp, const char *name) { @@ -61,6 +65,10 @@ g_mirror_find_device(struct g_class *mp, const char *n strcmp(sc->sc_name, name) == 0) { g_topology_unlock(); sx_xlock(>sc_lock); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + sx_xunlock(>sc_lock); + return (NULL); + } return (sc); } } @@ -68,6 +76,55 @@ g_mirror_find_device(struct g_class *mp, const char *n return (NULL); } +/* Insert and Resize operations depend on a launched GEOM (sc_provider). */ +#defineGMFL_VALID_FLAGS(M_WAITOK | M_NOWAIT) +static struct g_mirror_softc * +g_mirror_find_launched_device(struct g_class *mp, const char *name, int flags) +{ + struct g_mirror_softc *sc; + int error; + + KASSERT((flags & ~GMFL_VALID_FLAGS) == 0 && + flags != GMFL_VALID_FLAGS && flags != 0, + ("%s: Invalid flags %x\n", __func__, (unsigned)flags)); +#undef GMFL_VALID_FLAGS + + while (true) { + sc = g_mirror_find_device(mp, name); + if (sc == NULL) + return (NULL); + if (sc->sc_provider != NULL) + return (sc); + if (flags & M_NOWAIT) { + sx_xunlock(>sc_lock); + return (NULL); + } + + /* +* This is a dumb hack. G_mirror does not expose any real +* wakeup API for observing state changes, and even if it did, +* its "RUNNING" state does not actually reflect all softc +* elements being initialized. +* +* Revamping g_mirror to have a 3rd, ACTUALLY_RUNNING state and +* updating all assertions and sc_state checks is a large work +* and would be easy to introduce regressions. +* +* Revamping g_mirror to have a wakeup for state changes would +* be difficult if one wanted to capture more than just +* sc_state and sc_provider. +* +* For now, just dummy sleep-poll until sc_provider shows up, +* the user cancels, or the g_mirror is destroyed. +*/ + error = sx_sleep(, >sc_lock, PRIBIO | PCATCH | PDROP, + "GM:launched", 1); + if (error != 0 && error != EWOULDBLOCK) + return (NULL); + } + __unreachable(); +} + static struct g_mirror_disk * g_mirror_find_disk(struct g_mirror_softc *sc, const char *name) { @@ -605,7 +662,7 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_cla gctl_error(req, "No 'arg%u' argument.", 0); return; } - sc = g_mirror_find_device(mp, name); + sc = g_mirror_find_launched_device(mp, name, M_WAITOK); if (sc == NULL) { gctl_error(req, "No such device: %s.", name); return; @@ -847,7 +904,7 @@ g_mirror_ctl_resize(struct gctl_req *req, struct g_cla gctl_error(req, "Invalid '%s' argument.", "size"); return; } - sc = g_mirror_find_device(mp, name); + sc = g_mirror_find_launched_device(mp, name, M_WAITOK); if (sc == NULL) { gctl_error(req, "No such device: %s.", name); return;
svn commit: r360940 - head/sys/kern
Author: kib Date: Mon May 11 22:38:32 2020 New Revision: 360940 URL: https://svnweb.freebsd.org/changeset/base/360940 Log: sigfastblock: fix delivery of the pending signals in single-threaded processes. If single-threaded process receives a signal during critical section established by sigfastblock(2) word, unblock did not caused signal delivery because sigfastblock(SIGFASTBLOCK_UNBLOCK) failed to request ast handling of the pending signals. Set TDF_ASTPENDING | TDF_NEEDSIGCHK on unblock or when kernel forces end of sigfastblock critical section, to cause syscall exit to recheck and deliver any signal pending. Reported by: corydo...@ridiculousfish.com PR: 246385 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c == --- head/sys/kern/kern_sig.cMon May 11 22:26:39 2020(r360939) +++ head/sys/kern/kern_sig.cMon May 11 22:38:32 2020(r360940) @@ -3976,6 +3976,22 @@ sigfastblock_fetch_sig(struct thread *td, bool sendsig return (true); } +static void +sigfastblock_resched(struct thread *td, bool resched) +{ + struct proc *p; + + if (resched) { + p = td->td_proc; + PROC_LOCK(p); + reschedule_signals(p, td->td_sigmask, 0); + PROC_UNLOCK(p); + } + thread_lock(td); + td->td_flags |= TDF_ASTPENDING | TDF_NEEDSIGCHK; + thread_unlock(td); +} + int sys_sigfastblock(struct thread *td, struct sigfastblock_args *uap) { @@ -4046,11 +4062,8 @@ sys_sigfastblock(struct thread *td, struct sigfastbloc * signals to current thread. But notify others about * fake unblock. */ - if (error == 0 && p->p_numthreads != 1) { - PROC_LOCK(p); - reschedule_signals(p, td->td_sigmask, 0); - PROC_UNLOCK(p); - } + sigfastblock_resched(td, error == 0 && p->p_numthreads != 1); + break; case SIGFASTBLOCK_UNSETPTR: @@ -4079,7 +4092,6 @@ sys_sigfastblock(struct thread *td, struct sigfastbloc void sigfastblock_clear(struct thread *td) { - struct proc *p; bool resched; if ((td->td_pflags & TDP_SIGFASTBLOCK) == 0) @@ -4088,12 +4100,7 @@ sigfastblock_clear(struct thread *td) resched = (td->td_pflags & TDP_SIGFASTPENDING) != 0 || SIGPENDING(td); td->td_pflags &= ~(TDP_SIGFASTBLOCK | TDP_SIGFASTPENDING); - if (resched) { - p = td->td_proc; - PROC_LOCK(p); - reschedule_signals(p, td->td_sigmask, 0); - PROC_UNLOCK(p); - } + sigfastblock_resched(td, resched); } void ___ 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: r360939 - in head: sbin/sunlabel share/man/man4/man4.sparc64 sys/arm/mv/discovery sys/arm/mv/kirkwood sys/arm/mv/orion sys/arm/ralink sys/cddl/contrib/opensolaris/common/atomic/aarch64 ...
Author: jhb Date: Mon May 11 22:26:39 2020 New Revision: 360939 URL: https://svnweb.freebsd.org/changeset/base/360939 Log: Remove various empty directories. Some of these I orphaned today, others were emptied by earlier commits to head. Deleted: head/sbin/sunlabel/ head/share/man/man4/man4.sparc64/ head/sys/arm/mv/discovery/ head/sys/arm/mv/kirkwood/ head/sys/arm/mv/orion/ head/sys/arm/ralink/ head/sys/cddl/contrib/opensolaris/common/atomic/aarch64/ head/sys/cddl/contrib/opensolaris/common/atomic/amd64/ head/sys/cddl/contrib/opensolaris/common/atomic/powerpc64/ head/sys/cddl/contrib/opensolaris/common/atomic/sparc64/ head/sys/crypto/blowfish/ head/sys/dev/auxio/ head/sys/dev/bktr/ head/sys/dev/sound/sbus/ head/sys/dev/ubsec/ head/sys/modules/auxio/ head/sys/modules/bktr/ head/sys/modules/epic/ head/sys/modules/sound/driver/audiocs/ head/sys/modules/ubsec/ head/sys/modules/vpo/ head/usr.bin/elf2aout/ head/usr.sbin/eeprom/ ___ 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: r360937 - head
In message <202005112215.04bmfkh8071...@repo.freebsd.org>, John Baldwin writes: > Author: jhb > Date: Mon May 11 22:15:46 2020 > New Revision: 360937 > URL: https://svnweb.freebsd.org/changeset/base/360937 > > Log: > Document removal of deprecated algorithms from OCF. > > Sponsored by: Chelsio Communications > > Modified: > head/RELNOTES > > Modified: head/RELNOTES > = > = > --- head/RELNOTES Mon May 11 22:08:08 2020(r360936) > +++ head/RELNOTES Mon May 11 22:15:46 2020(r360937) > @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. > > Changes to this file should not be MFCed. > > +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: > + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, > + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from > + the kernel open cryptographic framework (OCF). > + > r360562: > Remove support for ARC4, Blowfish, Cast, DES, Triple DES, > MD5-HMAC, and Skipjack algorithms from /dev/crypto. > Do we need a __FreeBSD_version bump? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.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: r360938 - stable/11/lib/msun/tests
Author: lwhsu Date: Mon May 11 22:17:24 2020 New Revision: 360938 URL: https://svnweb.freebsd.org/changeset/base/360938 Log: MFC r358887 (partially): Temporarily skip 2 failing tests after llvm10 import The DDifference of the original revision to -head is only lib.msun.ctrig_test.test_inf_inputs skipped. PR: 244732 Sponsored by: The FreeBSD Foundation Modified: stable/11/lib/msun/tests/ctrig_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/tests/ctrig_test.c == --- stable/11/lib/msun/tests/ctrig_test.c Mon May 11 22:15:46 2020 (r360937) +++ stable/11/lib/msun/tests/ctrig_test.c Mon May 11 22:17:24 2020 (r360938) @@ -248,6 +248,9 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/244732;); + /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-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: r360937 - head
Author: jhb Date: Mon May 11 22:15:46 2020 New Revision: 360937 URL: https://svnweb.freebsd.org/changeset/base/360937 Log: Document removal of deprecated algorithms from OCF. Sponsored by: Chelsio Communications Modified: head/RELNOTES Modified: head/RELNOTES == --- head/RELNOTES Mon May 11 22:08:08 2020(r360936) +++ head/RELNOTES Mon May 11 22:15:46 2020(r360937) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from + the kernel open cryptographic framework (OCF). + r360562: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5-HMAC, and Skipjack algorithms from /dev/crypto. ___ 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: r360936 - in head: share/man/man4 share/man/man9 sys/crypto/via sys/dev/cesa sys/dev/glxsb sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/ope...
Author: jhb Date: Mon May 11 22:08:08 2020 New Revision: 360936 URL: https://svnweb.freebsd.org/changeset/base/360936 Log: Remove MD5 HMAC from OCF. There are no in-kernel consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24775 Deleted: head/sys/opencrypto/xform_md5.c Modified: head/share/man/man4/hifn.4 head/share/man/man4/safe.4 head/share/man/man9/crypto.9 head/sys/crypto/via/padlock_hash.c head/sys/dev/cesa/cesa.c head/sys/dev/glxsb/glxsb.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c head/sys/dev/sec/sec.c head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/cryptocteon/cryptocteon.c head/sys/mips/cavium/cryptocteon/cryptocteonvar.h head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform.h head/sys/opencrypto/xform_auth.h Modified: head/share/man/man4/hifn.4 == --- head/share/man/man4/hifn.4 Mon May 11 21:42:19 2020(r360935) +++ head/share/man/man4/hifn.4 Mon May 11 22:08:08 2020(r360936) @@ -58,7 +58,7 @@ The .Nm driver registers itself to accelerate AES (7955 and 7956 only), -MD5-HMAC, SHA1, and SHA1-HMAC operations for +SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and .Xr crypto 4 . Modified: head/share/man/man4/safe.4 == --- head/share/man/man4/safe.4 Mon May 11 21:42:19 2020(r360935) +++ head/share/man/man4/safe.4 Mon May 11 22:08:08 2020(r360936) @@ -60,7 +60,7 @@ driver supports cards containing SafeNet crypto accele .Pp The .Nm -driver registers itself to accelerate AES, MD5-HMAC, +driver registers itself to accelerate AES, SHA1-HMAC, and NULL operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man9/crypto.9Mon May 11 22:08:08 2020 (r360936) @@ -106,7 +106,6 @@ The following authentication algorithms are supported: .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S -.It Dv CRYPTO_MD5_HMAC .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_POLY1305 .It Dv CRYPTO_RIPEMD160 Modified: head/sys/crypto/via/padlock_hash.c == --- head/sys/crypto/via/padlock_hash.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/crypto/via/padlock_hash.c Mon May 11 22:08:08 2020 (r360936) @@ -321,9 +321,6 @@ padlock_hash_lookup(int alg) case CRYPTO_NULL_HMAC: axf = _hash_null; break; - case CRYPTO_MD5_HMAC: - axf = _hash_hmac_md5; - break; case CRYPTO_SHA1_HMAC: if ((via_feature_xcrypt & VIA_HAS_SHA) != 0) axf = _hmac_sha1; Modified: head/sys/dev/cesa/cesa.c == --- head/sys/dev/cesa/cesa.cMon May 11 21:42:19 2020(r360935) +++ head/sys/dev/cesa/cesa.cMon May 11 22:08:08 2020(r360936) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -434,14 +433,6 @@ cesa_set_mkey(struct cesa_session *cs, int alg, const hout = (uint32_t *)cs->cs_hiv_out; switch (alg) { - case CRYPTO_MD5_HMAC: - hmac_init_ipad(_hash_hmac_md5, mkey, mklen, _ctx); - memcpy(hin, auth_ctx.md5ctx.state, - sizeof(auth_ctx.md5ctx.state)); - hmac_init_opad(_hash_hmac_md5, mkey, mklen, _ctx); - memcpy(hout, auth_ctx.md5ctx.state, - sizeof(auth_ctx.md5ctx.state)); - break; case CRYPTO_SHA1_HMAC: hmac_init_ipad(_hash_hmac_sha1, mkey, mklen, _ctx); memcpy(hin, auth_ctx.sha1ctx.h.b32, @@ -1599,7 +1590,6 @@ cesa_auth_supported(struct cesa_softc *sc, sc->sc_soc_id == MV_DEV_88F6810)) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: break; @@ -1668,14 +1658,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cs->cs_mblen = MD5_BLOCK_LEN; - cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : - csp->csp_auth_mlen; - cs->cs_config |= CESA_CSHD_MD5_HMAC; - if
svn commit: r360935 - head/sys/opencrypto
Author: kp Date: Mon May 11 21:42:19 2020 New Revision: 360935 URL: https://svnweb.freebsd.org/changeset/base/360935 Log: opencrypto: Add missing ioctl exit SDTs The opencrypto ioctl code has very useful probe points at the various exit points. These allow us to figure out exactly why a request failed. However, a few paths did not have these probe points. Add them here. Reviewed by: jhb Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c == --- head/sys/opencrypto/cryptodev.c Mon May 11 21:39:02 2020 (r360934) +++ head/sys/opencrypto/cryptodev.c Mon May 11 21:42:19 2020 (r360935) @@ -465,6 +465,8 @@ cryptof_ioctl( /* Should always be paired with GCM. */ if (sop->cipher != CRYPTO_AES_NIST_GCM_16) { CRYPTDEB("GMAC without GCM"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } break; @@ -539,8 +541,10 @@ cryptof_ioctl( return (EINVAL); } - if (txform == NULL && thash == NULL) + if (txform == NULL && thash == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } memset(, 0, sizeof(csp)); @@ -550,13 +554,18 @@ cryptof_ioctl( case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; @@ -564,14 +573,19 @@ cryptof_ioctl( switch (sop->mac) { #ifdef COMPAT_FREEBSD12 case CRYPTO_AES_CCM_CBC_MAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } thash = NULL; break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; ___ 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: r360934 - head/sys/conf
Author: jhb Date: Mon May 11 21:39:02 2020 New Revision: 360934 URL: https://svnweb.freebsd.org/changeset/base/360934 Log: kgssapi no longer supports RC4, so don't list it as a build dependency. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24774 Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Mon May 11 21:34:29 2020(r360933) +++ head/sys/conf/files Mon May 11 21:39:02 2020(r360934) @@ -686,7 +686,7 @@ crypto/chacha20/chacha.cstandard crypto/chacha20/chacha-sw.coptional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.coptional netsmb -crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi +crypto/rc4/rc4.c optional netgraph_mppc_encryption crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ ipsec | ipsec_support | !random_loadable | wlan_ccmp crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | !random_loadable ___ 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: r360933 - in head: share/man/man4 share/man/man9 sys/conf sys/dev/cesa sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto
Author: jhb Date: Mon May 11 21:34:29 2020 New Revision: 360933 URL: https://svnweb.freebsd.org/changeset/base/360933 Log: Remove support for DES and Triple DES from OCF. It no longer has any in-kernel consumers via OCF. smbfs still uses single DES directly, so sys/crypto/des remains for that use case. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24773 Deleted: head/sys/opencrypto/xform_des1.c head/sys/opencrypto/xform_des3.c Modified: head/share/man/man4/hifn.4 head/share/man/man4/safe.4 head/share/man/man9/crypto.9 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/dev/cesa/cesa.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c head/sys/dev/sec/sec.c head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/cryptocteon/cryptocteon.c head/sys/mips/cavium/cryptocteon/cryptocteonvar.h head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man4/hifn.4 == --- head/share/man/man4/hifn.4 Mon May 11 21:24:22 2020(r360932) +++ head/share/man/man4/hifn.4 Mon May 11 21:34:29 2020(r360933) @@ -56,7 +56,7 @@ driver supports various cards containing the Hifn 7751 .Pp The .Nm -driver registers itself to accelerate DES, Triple-DES, +driver registers itself to accelerate AES (7955 and 7956 only), MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 Modified: head/share/man/man4/safe.4 == --- head/share/man/man4/safe.4 Mon May 11 21:24:22 2020(r360932) +++ head/share/man/man4/safe.4 Mon May 11 21:34:29 2020(r360933) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 1, 2006 +.Dd May 11, 2020 .Dt SAFE 4 .Os .Sh NAME @@ -60,7 +60,7 @@ driver supports cards containing SafeNet crypto accele .Pp The .Nm -driver registers itself to accelerate DES, Triple-DES, AES, MD5-HMAC, +driver registers itself to accelerate AES, MD5-HMAC, SHA1-HMAC, and NULL operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man9/crypto.9Mon May 11 21:34:29 2020 (r360933) @@ -131,8 +131,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_XTS .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 -.It Dv CRYPTO_DES_CBC -.It Dv CRYPTO_3DES_CBC .It Dv CRYPTO_NULL_CBC .El .Pp Modified: head/sys/conf/files == --- head/sys/conf/files Mon May 11 21:24:22 2020(r360932) +++ head/sys/conf/files Mon May 11 21:34:29 2020(r360933) @@ -684,8 +684,8 @@ crypto/camellia/camellia.c optional crypto | ipsec | i crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support crypto/chacha20/chacha.c standard crypto/chacha20/chacha-sw.coptional crypto | ipsec | ipsec_support -crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb -crypto/des/des_setkey.coptional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_ecb.c optional netsmb +crypto/des/des_setkey.coptional netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ ipsec | ipsec_support | !random_loadable | wlan_ccmp Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Mon May 11 21:24:22 2020(r360932) +++ head/sys/conf/files.amd64 Mon May 11 21:34:29 2020(r360933) @@ -136,8 +136,7 @@ amd64/pci/pci_cfgreg.c optionalpci cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.coptional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni -crypto/des/des_enc.c optionalcrypto | ipsec | \ - ipsec_support | netsmb +crypto/des/des_enc.c optionalnetsmb dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.coptionalagp dev/agp/agp_i810.c optionalagp Modified: head/sys/conf/files.arm
svn commit: r360931 - in head: share/man/man9 sys/conf sys/crypto/blowfish sys/crypto/blowfish/arch/i386 sys/modules/crypto sys/opencrypto
Author: jhb Date: Mon May 11 21:24:05 2020 New Revision: 360931 URL: https://svnweb.freebsd.org/changeset/base/360931 Log: Remove support for the Blowfish algorithm from OCF. It no longer has any in-kernel consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24772 Deleted: head/sys/crypto/blowfish/arch/i386/bf_enc.S head/sys/crypto/blowfish/arch/i386/bf_enc_586.S head/sys/crypto/blowfish/arch/i386/bf_enc_686.S head/sys/crypto/blowfish/bf_ecb.c head/sys/crypto/blowfish/bf_enc.c head/sys/crypto/blowfish/bf_locl.h head/sys/crypto/blowfish/bf_pi.h head/sys/crypto/blowfish/bf_skey.c head/sys/crypto/blowfish/blowfish.h head/sys/opencrypto/xform_blf.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 21:23:22 2020 (r360930) +++ head/share/man/man9/crypto.9Mon May 11 21:24:05 2020 (r360931) @@ -129,7 +129,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_CBC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_XTS -.It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DES_CBC Modified: head/sys/conf/files == --- head/sys/conf/files Mon May 11 21:23:22 2020(r360930) +++ head/sys/conf/files Mon May 11 21:24:05 2020(r360931) @@ -680,8 +680,6 @@ contrib/libb2/blake2s-ref.c optional crypto | ipsec | compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" crypto/blake2/blake2-sw.c optional crypto | ipsec | ipsec_support \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual" -crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support -crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support crypto/chacha20/chacha.c standard Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Mon May 11 21:23:22 2020(r360930) +++ head/sys/conf/files.amd64 Mon May 11 21:24:05 2020(r360931) @@ -136,7 +136,6 @@ amd64/pci/pci_cfgreg.c optionalpci cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.coptional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni -crypto/blowfish/bf_enc.c optionalcrypto | ipsec | ipsec_support crypto/des/des_enc.c optionalcrypto | ipsec | \ ipsec_support | netsmb dev/acpi_support/acpi_wmi_if.m standard Modified: head/sys/conf/files.arm == --- head/sys/conf/files.arm Mon May 11 21:23:22 2020(r360930) +++ head/sys/conf/files.arm Mon May 11 21:24:05 2020(r360931) @@ -91,7 +91,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optionalcrypto | ipsec | ipsec_support crypto/des/des_enc.c optionalcrypto | ipsec | ipsec_support | netsmb dev/cpufreq/cpufreq_dt.c optionalcpufreq fdt dev/dwc/if_dwc.c optionaldwc Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Mon May 11 21:23:22 2020(r360930) +++ head/sys/conf/files.arm64 Mon May 11 21:24:05 2020(r360931) @@ -221,7 +221,6 @@ armv8_crypto_wrap.o optionalarmv8crypto \ compile-with"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule\
svn commit: r360932 - stable/12/lib/libc/riscv/gen
Author: jhb Date: Mon May 11 21:24:22 2020 New Revision: 360932 URL: https://svnweb.freebsd.org/changeset/base/360932 Log: MFC 357643: Tidy the _set_tp function for RISC-V. - Use a constant for the offset instead of a magic number. - Use an addi instruction that writes to tp directly instead of a mv that writes the result of a compiler-generated addi. Modified: stable/12/lib/libc/riscv/gen/_set_tp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/riscv/gen/_set_tp.c == --- stable/12/lib/libc/riscv/gen/_set_tp.c Mon May 11 21:24:05 2020 (r360931) +++ stable/12/lib/libc/riscv/gen/_set_tp.c Mon May 11 21:24:22 2020 (r360932) @@ -38,13 +38,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include +/* NB: size of 'struct tcb'. */ +#defineTP_OFFSET (sizeof(void *) * 2) + void _set_tp(void *tp) { - __asm __volatile("mv tp, %0" :: "r"((char*)tp + 0x10)); + __asm __volatile("addi tp, %0, %1" :: "r" (tp), "I" (TP_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: r360930 - head/sys/netinet6
Author: gallatin Date: Mon May 11 21:23:22 2020 New Revision: 360930 URL: https://svnweb.freebsd.org/changeset/base/360930 Log: Fix the build Back out the IPv6 portion of r360903, as the stamp_tag param is apparently not supported in upstream FreeBSD. Sponsored by: Netflix Pointy hat to: gallatin Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c == --- head/sys/netinet6/ip6_output.c Mon May 11 21:22:16 2020 (r360929) +++ head/sys/netinet6/ip6_output.c Mon May 11 21:23:22 2020 (r360930) @@ -353,10 +353,6 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } - /* -* Always stamp tags that include NIC ktls. -*/ - stamp_tag = true; } #endif #ifdef RATELIMIT ___ 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: r360929 - head/usr.bin/systat
Author: mr Date: Mon May 11 21:22:16 2020 New Revision: 360929 URL: https://svnweb.freebsd.org/changeset/base/360929 Log: Add missing sysput.c PR: 237664 Submitted by: o...@j.email.ne.jp Reported by: imb, cy Added: head/usr.bin/systat/sysput.c (contents, props changed) Added: head/usr.bin/systat/sysput.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/systat/sysput.cMon May 11 21:22:16 2020 (r360929) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2019 Yoshihiro Ota + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#include "systat.h" +#include "extern.h" + +void +sysputstrs(WINDOW *wnd, int row, int col, int width) +{ + static char str40[] = ""; + + mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); +} + +void +sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags) +{ + char unit, *ptr, *start, wrtbuf[width + width + 1]; + int len; + + unit = 0; + start = wrtbuf; + flags |= HN_NOSPACE; + + if (val > INT64_MAX) + goto error; + else + len = humanize_number([width], width + 1, val, "", + HN_AUTOSCALE, flags); + if (len < 0) + goto error; + else if (len < width) + memset(wrtbuf + len, ' ', width - len); + start += len; + + mvwaddstr(wnd, row, col, start); + return; + +error: + sysputstrs(wnd, row, col, 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: r360928 - in head: share/man/man4 share/man/man9 sys/dev/hifn sys/mips/nlm/dev/sec sys/opencrypto
Author: jhb Date: Mon May 11 21:17:08 2020 New Revision: 360928 URL: https://svnweb.freebsd.org/changeset/base/360928 Log: Remove support for the ARC4 algorithm from OCF. There are no longer any in-kernel consumers. The software implementation was also a non-functional stub. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24771 Modified: head/share/man/man4/hifn.4 head/share/man/man9/crypto.9 head/sys/dev/hifn/hifn7751.c head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man4/hifn.4 == --- head/share/man/man4/hifn.4 Mon May 11 21:04:59 2020(r360927) +++ head/share/man/man4/hifn.4 Mon May 11 21:17:08 2020(r360928) @@ -57,7 +57,7 @@ driver supports various cards containing the Hifn 7751 The .Nm driver registers itself to accelerate DES, Triple-DES, -AES (7955 and 7956 only), ARC4, +AES (7955 and 7956 only), MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 21:04:59 2020 (r360927) +++ head/share/man/man9/crypto.9Mon May 11 21:17:08 2020 (r360928) @@ -129,7 +129,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_CBC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_XTS -.It Dv CRYPTO_ARC4 .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 Modified: head/sys/dev/hifn/hifn7751.c == --- head/sys/dev/hifn/hifn7751.cMon May 11 21:04:59 2020 (r360927) +++ head/sys/dev/hifn/hifn7751.cMon May 11 21:17:08 2020 (r360928) @@ -1546,7 +1546,7 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t hifn_base_command_t *base_cmd; hifn_mac_command_t *mac_cmd; hifn_crypt_command_t *cry_cmd; - int using_mac, using_crypt, len, ivlen; + int using_mac, using_crypt, ivlen; u_int32_t dlen, slen; crp = cmd->crp; @@ -1612,19 +1612,6 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH); buf_pos += HIFN_DES_KEY_LENGTH; break; - case HIFN_CRYPT_CMD_ALG_RC4: - len = 256; - do { - int clen; - - clen = MIN(cmd->cklen, len); - bcopy(cmd->ck, buf_pos, clen); - len -= clen; - buf_pos += clen; - } while (len > 0); - bzero(buf_pos, 4); - buf_pos += 4; - break; case HIFN_CRYPT_CMD_ALG_AES: /* * AES keys are variable 128, 192 and @@ -2342,7 +2329,6 @@ hifn_cipher_supported(struct hifn_softc *sc, case HIFN_PUSTAT_ENA_2: switch (csp->csp_cipher_alg) { case CRYPTO_3DES_CBC: - case CRYPTO_ARC4: break; case CRYPTO_AES_CBC: if ((sc->sc_flags & HIFN_HAS_AES) == 0) @@ -2462,9 +2448,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_DECODE; cmd->base_masks |= HIFN_BASE_CMD_CRYPT; switch (csp->csp_cipher_alg) { - case CRYPTO_ARC4: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_RC4; - break; case CRYPTO_DES_CBC: cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES | HIFN_CRYPT_CMD_MODE_CBC | @@ -2484,8 +2467,7 @@ hifn_process(device_t dev, struct cryptop *crp, int hi err = EINVAL; goto errout; } - if (csp->csp_cipher_alg != CRYPTO_ARC4) - crypto_read_iv(crp, cmd->iv); + crypto_read_iv(crp, cmd->iv); if (crp->crp_cipher_key != NULL) cmd->ck = crp->crp_cipher_key; Modified: head/sys/mips/nlm/dev/sec/nlmsec.c == --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:17:08 2020 (r360928) @@ -400,10 +400,6 @@ xlp_sec_cipher_supported(const struct crypto_session_p
svn commit: r360927 - in head: share/man/man9 sys/opencrypto
Author: jhb Date: Mon May 11 21:04:59 2020 New Revision: 360927 URL: https://svnweb.freebsd.org/changeset/base/360927 Log: Remove support for keyed MD5 and SHA1 authentication hashes. They no longer have any in-tree consumers. Note that these are a different from MD5-HMAC and SHA1-HMAC and were only used with IPsec. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24770 Modified: head/share/man/man9/crypto.9 head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_auth.h head/sys/opencrypto/xform_md5.c head/sys/opencrypto/xform_sha1.c Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 20:58:27 2020 (r360926) +++ head/share/man/man9/crypto.9Mon May 11 21:04:59 2020 (r360927) @@ -107,14 +107,12 @@ The following authentication algorithms are supported: .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S .It Dv CRYPTO_MD5_HMAC -.It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_POLY1305 .It Dv CRYPTO_RIPEMD160 .It Dv CRYPTO_RIPEMD160_HMAC .It Dv CRYPTO_SHA1 .It Dv CRYPTO_SHA1_HMAC -.It Dv CRYPTO_SHA1_KPDK .It Dv CRYPTO_SHA2_224 .It Dv CRYPTO_SHA2_224_HMAC .It Dv CRYPTO_SHA2_256 Modified: head/sys/opencrypto/crypto.c == --- head/sys/opencrypto/crypto.cMon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/crypto.cMon May 11 21:04:59 2020 (r360927) @@ -546,10 +546,6 @@ crypto_auth_hash(const struct crypto_session_params *c return (_hash_null); case CRYPTO_RIPEMD160_HMAC: return (_hash_hmac_ripemd_160); - case CRYPTO_MD5_KPDK: - return (_hash_key_md5); - case CRYPTO_SHA1_KPDK: - return (_hash_key_sha1); case CRYPTO_SHA1: return (_hash_sha1); case CRYPTO_SHA2_224: @@ -690,8 +686,6 @@ static enum alg_type { [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, - [CRYPTO_MD5_KPDK] = ALG_KEYED_DIGEST, - [CRYPTO_SHA1_KPDK] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, [CRYPTO_ARC4] = ALG_CIPHER, [CRYPTO_SHA1] = ALG_DIGEST, Modified: head/sys/opencrypto/cryptodev.h == --- head/sys/opencrypto/cryptodev.h Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:04:59 2020 (r360927) @@ -81,8 +81,6 @@ #defineSHA2_256_HASH_LEN 32 #defineSHA2_384_HASH_LEN 48 #defineSHA2_512_HASH_LEN 64 -#defineMD5_KPDK_HASH_LEN 16 -#defineSHA1_KPDK_HASH_LEN 20 #defineAES_GMAC_HASH_LEN 16 #definePOLY1305_HASH_LEN 16 #defineAES_CBC_MAC_HASH_LEN16 Modified: head/sys/opencrypto/cryptosoft.c == --- head/sys/opencrypto/cryptosoft.cMon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/cryptosoft.cMon May 11 21:04:59 2020 (r360927) @@ -64,7 +64,6 @@ struct swcr_auth { void*sw_octx; struct auth_hash *sw_axf; uint16_tsw_mlen; - uint16_tsw_octx_len; }; struct swcr_encdec { @@ -349,27 +348,6 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_au hmac_init_ipad(axf, key, klen, sw->sw_ictx); hmac_init_opad(axf, key, klen, sw->sw_octx); break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - { - /* -* We need a buffer that can hold an md5 and a sha1 result -* just to throw it away. -* What we do here is the initial part of: -* ALGO( key, keyfill, .. ) -* adding the key to sw_ictx and abusing Final() to get the -* "keyfill" padding. -* In addition we abuse the sw_octx to save the key to have -* it to be able to append it at the end in swcr_authcompute(). -*/ - u_char buf[SHA1_RESULTLEN]; - - bcopy(key, sw->sw_octx, klen); - axf->Init(sw->sw_ictx); - axf->Update(sw->sw_ictx, key, klen); - axf->Final(buf, sw->sw_ictx); - break; - } case CRYPTO_POLY1305: case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: @@ -442,23 +420,6 @@ swcr_authcompute(struct swcr_session *ses, struct cryp axf->Final(aalg, ); break; -
svn commit: r360926 - stable/12/sys/riscv/riscv
Author: jhb Date: Mon May 11 20:58:27 2020 New Revision: 360926 URL: https://svnweb.freebsd.org/changeset/base/360926 Log: MFC 357632: Use the context created in makectx() for stack traces. Always use the kdb_thr_ctx() for db_trace_thread() as on other architectures. Initialize pcb_ra to be the sepc from the saved trapframe rather than the saved ra to avoid skipping a frame. Modified: stable/12/sys/riscv/riscv/db_trace.c stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/db_trace.c == --- stable/12/sys/riscv/riscv/db_trace.cMon May 11 20:55:04 2020 (r360925) +++ stable/12/sys/riscv/riscv/db_trace.cMon May 11 20:58:27 2020 (r360926) @@ -130,15 +130,12 @@ db_trace_thread(struct thread *thr, int count) struct unwind_state frame; struct pcb *ctx; - if (thr != curthread) { - ctx = kdb_thr_ctx(thr); + ctx = kdb_thr_ctx(thr); - frame.sp = (uint64_t)ctx->pcb_sp; - frame.fp = (uint64_t)ctx->pcb_s[0]; - frame.pc = (uint64_t)ctx->pcb_ra; - db_stack_trace_cmd(); - } else - db_trace_self(); + frame.sp = (uint64_t)ctx->pcb_sp; + frame.fp = (uint64_t)ctx->pcb_s[0]; + frame.pc = (uint64_t)ctx->pcb_ra; + db_stack_trace_cmd(); return (0); } Modified: stable/12/sys/riscv/riscv/machdep.c == --- stable/12/sys/riscv/riscv/machdep.c Mon May 11 20:55:04 2020 (r360925) +++ stable/12/sys/riscv/riscv/machdep.c Mon May 11 20:58:27 2020 (r360926) @@ -568,7 +568,7 @@ makectx(struct trapframe *tf, struct pcb *pcb) memcpy(pcb->pcb_s, tf->tf_s, sizeof(tf->tf_s)); - pcb->pcb_ra = tf->tf_ra; + pcb->pcb_ra = tf->tf_sepc; pcb->pcb_sp = tf->tf_sp; pcb->pcb_gp = tf->tf_gp; pcb->pcb_tp = tf->tf_tp; ___ 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: r360919 - head/usr.bin/systat
In message <202005112034.04bkyq1j009...@repo.freebsd.org>, Michael Reifenberger writes: > Author: mr > Date: Mon May 11 20:34:52 2020 > New Revision: 360919 > URL: https://svnweb.freebsd.org/changeset/base/360919 > > Log: > Patch systat -zarc to display cumulative rate and round down large numbers > by SI units > > PR: 237664 > Submitted by: o...@j.email.ne.jp > MFC after: 2 weeks > > Modified: > head/usr.bin/systat/Makefile > head/usr.bin/systat/extern.h > head/usr.bin/systat/main.c > head/usr.bin/systat/zarc.c > > Modified: head/usr.bin/systat/Makefile > = > = > --- head/usr.bin/systat/Makefile Mon May 11 20:30:28 2020(r36091 > 8) > +++ head/usr.bin/systat/Makefile Mon May 11 20:34:52 2020(r36091 > 9) > @@ -4,7 +4,7 @@ > .include > > PROG=systat > -SRCS=cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ > +SRCS=cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c syspu > t.c \ The build fails here because it cannot fine sysput.c. > netcmds.c netstat.c pigs.c swap.c icmp.c \ > mode.c ip.c sctp.c tcp.c zarc.c \ > vmstat.c convtbl.c ifcmds.c ifstat.c > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.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-src-all@freebsd.org) Unread voicemail received on 5/11/2020 9:55:44 p.m.
___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r360925 - head/sys/dev/usb
Author: hselasky Date: Mon May 11 20:55:04 2020 New Revision: 360925 URL: https://svnweb.freebsd.org/changeset/base/360925 Log: Refresh the USB device strings when a USB device is re-enumerated. Submitted by: Horse Ma MFC after:1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_device.c == --- head/sys/dev/usb/usb_device.c Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_device.c Mon May 11 20:55:04 2020 (r360925) @@ -103,7 +103,6 @@ static void usb_suspend_resume_sub(struct usb_device * uint8_t); static usb_proc_callback_t usbd_clear_stall_proc; static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); -static voidusbd_set_device_strings(struct usb_device *); #if USB_HAVE_DEVCTL static voidusb_notify_addq(const char *type, struct usb_device *); #endif @@ -1652,6 +1651,85 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) } /** + * usb_get_langid + * + * This function tries to figure out the USB string language to use. + **/ +void +usb_get_langid(struct usb_device *udev) +{ + uint8_t *scratch_ptr; + uint8_t do_unlock; + int err; + + /* +* Workaround for buggy USB devices. +* +* It appears that some string-less USB chips will crash and +* disappear if any attempts are made to read any string +* descriptors. +* +* Try to detect such chips by checking the strings in the USB +* device descriptor. If no strings are present there we +* simply disable all USB strings. +*/ + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(udev); + + scratch_ptr = udev->scratch.data; + + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { + /* read out the language ID string */ + err = usbd_req_get_string_desc(udev, NULL, + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USB_ERR_INVAL; + } + + if (err || (scratch_ptr[0] < 4)) { + udev->flags.no_strings = 1; + } else { + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1U; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; x < scratch_ptr[0]; x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; + } + + if (do_unlock) + usbd_ctrl_unlock(udev); +} + +/** * usb_alloc_device * * This function allocates a new USB device. This function is called @@ -1672,13 +1750,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * struct usb_device *udev; struct usb_device *adev; struct usb_device *hub; - uint8_t *scratch_ptr; usb_error_t err; uint8_t device_index; uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; - uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1888,76 +1964,13 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * if (usb_test_quirk(, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } - /* -* Workaround for buggy USB devices. -* -* It appears that some string-less USB chips will crash and -* disappear if any attempts are made to read any string -* descriptors. -* -* Try to detect such chips by checking the strings in the USB -* device descriptor. If no strings are present
svn commit: r360924 - in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto
Author: jhb Date: Mon May 11 20:54:59 2020 New Revision: 360924 URL: https://svnweb.freebsd.org/changeset/base/360924 Log: Remove support for the skipjack encryption algorithm. This was removed from IPsec in r286100 and no longer has any in-tree consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24769 Deleted: head/sys/opencrypto/skipjack.c head/sys/opencrypto/skipjack.h head/sys/opencrypto/xform_skipjack.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 20:52:18 2020 (r360923) +++ head/share/man/man9/crypto.9Mon May 11 20:54:59 2020 (r360924) @@ -138,7 +138,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC .It Dv CRYPTO_NULL_CBC -.It Dv CRYPTO_SKIPJACK_CBC .El .Pp The following authenticated encryption with additional data (AEAD) Modified: head/sys/conf/files == --- head/sys/conf/files Mon May 11 20:52:18 2020(r360923) +++ head/sys/conf/files Mon May 11 20:54:59 2020(r360924) @@ -4806,7 +4806,6 @@ opencrypto/cryptodeflate.coptional crypto | ipsec | i opencrypto/gmac.c optional crypto | ipsec | ipsec_support opencrypto/gfmult.coptional crypto | ipsec | ipsec_support opencrypto/rmd160.coptional crypto | ipsec | ipsec_support -opencrypto/skipjack.c optional crypto | ipsec | ipsec_support opencrypto/xform.c optional crypto | ipsec | ipsec_support opencrypto/xform_poly1305.coptional crypto \ compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" Modified: head/sys/modules/crypto/Makefile == --- head/sys/modules/crypto/MakefileMon May 11 20:52:18 2020 (r360923) +++ head/sys/modules/crypto/MakefileMon May 11 20:54:59 2020 (r360924) @@ -23,7 +23,7 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c -SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c +SRCS += bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha256c.c sha512c.c Modified: head/sys/opencrypto/crypto.c == --- head/sys/opencrypto/crypto.cMon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/crypto.cMon May 11 20:54:59 2020 (r360924) @@ -604,8 +604,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (_xform_3des); case CRYPTO_BLF_CBC: return (_xform_blf); - case CRYPTO_SKIPJACK_CBC: - return (_xform_skipjack); case CRYPTO_RIJNDAEL128_CBC: return (_xform_rijndael128); case CRYPTO_AES_XTS: @@ -689,7 +687,6 @@ static enum alg_type { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, [CRYPTO_BLF_CBC] = ALG_CIPHER, - [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h == --- head/sys/opencrypto/cryptodev.h Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/cryptodev.h Mon May 11 20:54:59 2020 (r360924) @@ -118,7 +118,6 @@ #defineDES_BLOCK_LEN 8 #defineDES3_BLOCK_LEN 8 #defineBLOWFISH_BLOCK_LEN 8 -#defineSKIPJACK_BLOCK_LEN 8 #defineRIJNDAEL128_BLOCK_LEN 16 #defineAES_BLOCK_LEN 16 #defineAES_ICM_BLOCK_LEN 1 @@ -144,8 +143,6 @@ #defineTRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY #defineBLOWFISH_MIN_KEY5 #defineBLOWFISH_MAX_KEY56 /* 448 bits, max key */ -#defineSKIPJACK_MIN_KEY10 -#defineSKIPJACK_MAX_KEYSKIPJACK_MIN_KEY #defineRIJNDAEL_MIN_KEY16 #defineRIJNDAEL_MAX_KEY32 #defineAES_MIN_KEY RIJNDAEL_MIN_KEY Modified: head/sys/opencrypto/cryptosoft.c
Re: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm
On Mon, 11 May 2020 13:43:58 -0700 Kevin Bowling wrote: > Were there any major changes you can summarize from the P9BSD > integration, and any TODO list (perhaps wiki for this question)? The committed version lacks minidumps, which luporl@ had implemented in OEA64 a few months ago, so I still have to pull that in. Also, Radix pmap is currently disabled by default, enabled with 'radix_mmu=1' boot arg, because it's extremely unstable in anything but the most mundane cases (can pass buildworld, but a lot of ports trigger machine checks), so that all needs fixed. The rest of the TODO list from POWER9BSD consists of: * IFUNCify pmap and its ancillary functions (copy*()) * Bring in the soft-interrupt-disable feature Someone (Alfredo?) is working on IFUNCifying pmap, but nobody's yet done the soft interrupt disabling. I have a patch to implement it, but last time I tested it, it fell over quite quickly, so I must've missed something. I think that's it. - Justin > > On Sun, May 10, 2020 at 7:33 PM Justin Hibbits > wrote: > > > > Author: jhibbits > > Date: Mon May 11 02:33:37 2020 > > New Revision: 360887 > > URL: https://svnweb.freebsd.org/changeset/base/360887 > > > > Log: > > powerpc64: Implement Radix MMU for POWER9 CPUs > > > > Summary: > > POWER9 supports two MMU formats: traditional hashed page tables, > > and Radix page tables, similar to what's presesnt on most other > > architectures. The PowerISA also specifies a process table -- a > > table of page table pointers-- which on the POWER9 is only > > available with the Radix MMU, so we can take advantage of it with > > the Radix MMU driver. > > > > Written by Matt Macy. > > > > Differential Revision: https://reviews.freebsd.org/D19516 > > > > Added: > > head/sys/powerpc/aim/mmu_radix.c (contents, props changed) > > Modified: > > head/sys/conf/files.powerpc > > head/sys/powerpc/aim/aim_machdep.c > > head/sys/powerpc/aim/mmu_oea.c > > head/sys/powerpc/aim/mmu_oea64.c > > head/sys/powerpc/booke/pmap.c > > head/sys/powerpc/include/cpufunc.h > > head/sys/powerpc/include/mmuvar.h > > head/sys/powerpc/include/param.h > > head/sys/powerpc/include/pmap.h > > head/sys/powerpc/include/proc.h > > head/sys/powerpc/include/pte.h > > head/sys/powerpc/include/spr.h > > head/sys/powerpc/include/sr.h > > head/sys/powerpc/include/vmparam.h > > head/sys/powerpc/powerpc/machdep.c > > head/sys/powerpc/powerpc/mmu_if.m > > head/sys/powerpc/powerpc/pmap_dispatch.c > > head/sys/powerpc/powerpc/trap.c > > head/sys/vm/vm_fault.c > > > > Modified: head/sys/conf/files.powerpc > > == > > --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 > > (r360887) @@ -135,6 +135,7 @@ powerpc/aim/locore.S > > optionalaim no-obj powerpc/aim/aim_machdep.c > > optionalaim powerpc/aim/mmu_oea.c optional > > aim powerpc powerpc/aim/mmu_oea64.coptional > > aim +powerpc/aim/mmu_radix.coptionalaim > > powerpc64 powerpc/aim/moea64_if.moptionalaim > > powerpc/aim/moea64_native.coptionalaim > > powerpc/aim/mp_cpudep.coptionalaim > > > > Modified: head/sys/powerpc/aim/aim_machdep.c > > == > > --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 > > 02:33:37 2020(r360887) @@ -136,6 +136,8 @@ > > __FBSDID("$FreeBSD$"); struct bat battable[16]; > > #endif > > > > +int radix_mmu = 0; > > + > > #ifndef __powerpc64__ > > /* Bits for running on 64-bit systems in 32-bit mode. */ > > extern void*testppc64, *testppc64size; > > @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) > > * in case the platform module had a better idea of what we > > * should do. > > */ > > - if (cpu_features & PPC_FEATURE_64) > > + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { > > + radix_mmu = 0; > > + TUNABLE_INT_FETCH("radix_mmu", _mmu); > > + if (radix_mmu) > > + pmap_mmu_install(MMU_TYPE_RADIX, > > BUS_PROBE_GENERIC); > > + else > > + pmap_mmu_install(MMU_TYPE_G5, > > BUS_PROBE_GENERIC); > > + } else if (cpu_features & PPC_FEATURE_64) > > pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > > else > > pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); > > > > Modified: head/sys/powerpc/aim/mmu_oea.c > > == > > --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 > > 02:33:37 2020
svn commit: r360923 - in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto
Author: jhb Date: Mon May 11 20:52:18 2020 New Revision: 360923 URL: https://svnweb.freebsd.org/changeset/base/360923 Log: Remove support for the cast128 encryption algorithm. It no longer has any in-tree consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24768 Deleted: head/sys/opencrypto/cast.c head/sys/opencrypto/cast.h head/sys/opencrypto/castsb.h head/sys/opencrypto/xform_cast5.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 20:41:27 2020 (r360922) +++ head/share/man/man9/crypto.9Mon May 11 20:52:18 2020 (r360923) @@ -134,7 +134,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_ARC4 .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC -.It Dv CRYPTO_CAST_CBC .It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC Modified: head/sys/conf/files == --- head/sys/conf/files Mon May 11 20:41:27 2020(r360922) +++ head/sys/conf/files Mon May 11 20:52:18 2020(r360923) @@ -4797,7 +4797,6 @@ dev/mlx5/mlx5_en/mlx5_en_port_buffer.c optional mlx5e compile-with "${OFED_C}" # crypto support -opencrypto/cast.c optional crypto | ipsec | ipsec_support opencrypto/criov.c optional crypto | ipsec | ipsec_support opencrypto/crypto.coptional crypto | ipsec | ipsec_support opencrypto/cryptodev.c optional cryptodev Modified: head/sys/modules/crypto/Makefile == --- head/sys/modules/crypto/MakefileMon May 11 20:41:27 2020 (r360922) +++ head/sys/modules/crypto/MakefileMon May 11 20:52:18 2020 (r360923) @@ -22,7 +22,7 @@ LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodiu KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c -SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c +SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c Modified: head/sys/opencrypto/crypto.c == --- head/sys/opencrypto/crypto.cMon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/crypto.cMon May 11 20:52:18 2020 (r360923) @@ -604,8 +604,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (_xform_3des); case CRYPTO_BLF_CBC: return (_xform_blf); - case CRYPTO_CAST_CBC: - return (_xform_cast5); case CRYPTO_SKIPJACK_CBC: return (_xform_skipjack); case CRYPTO_RIJNDAEL128_CBC: @@ -691,7 +689,6 @@ static enum alg_type { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, [CRYPTO_BLF_CBC] = ALG_CIPHER, - [CRYPTO_CAST_CBC] = ALG_CIPHER, [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h == --- head/sys/opencrypto/cryptodev.h Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/cryptodev.h Mon May 11 20:52:18 2020 (r360923) @@ -119,7 +119,6 @@ #defineDES3_BLOCK_LEN 8 #defineBLOWFISH_BLOCK_LEN 8 #defineSKIPJACK_BLOCK_LEN 8 -#defineCAST128_BLOCK_LEN 8 #defineRIJNDAEL128_BLOCK_LEN 16 #defineAES_BLOCK_LEN 16 #defineAES_ICM_BLOCK_LEN 1 @@ -145,8 +144,6 @@ #defineTRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY #defineBLOWFISH_MIN_KEY5 #defineBLOWFISH_MAX_KEY56 /* 448 bits, max key */ -#defineCAST_MIN_KEY5 -#defineCAST_MAX_KEY16 #defineSKIPJACK_MIN_KEY10 #defineSKIPJACK_MAX_KEYSKIPJACK_MIN_KEY #defineRIJNDAEL_MIN_KEY16 Modified: head/sys/opencrypto/cryptosoft.c == --- head/sys/opencrypto/cryptosoft.cMon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/cryptosoft.cMon May 11 20:52:18 2020
Re: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm
Were there any major changes you can summarize from the P9BSD integration, and any TODO list (perhaps wiki for this question)? On Sun, May 10, 2020 at 7:33 PM Justin Hibbits wrote: > > Author: jhibbits > Date: Mon May 11 02:33:37 2020 > New Revision: 360887 > URL: https://svnweb.freebsd.org/changeset/base/360887 > > Log: > powerpc64: Implement Radix MMU for POWER9 CPUs > > Summary: > POWER9 supports two MMU formats: traditional hashed page tables, and Radix > page tables, similar to what's presesnt on most other architectures. The > PowerISA also specifies a process table -- a table of page table pointers-- > which on the POWER9 is only available with the Radix MMU, so we can take > advantage of it with the Radix MMU driver. > > Written by Matt Macy. > > Differential Revision: https://reviews.freebsd.org/D19516 > > Added: > head/sys/powerpc/aim/mmu_radix.c (contents, props changed) > Modified: > head/sys/conf/files.powerpc > head/sys/powerpc/aim/aim_machdep.c > head/sys/powerpc/aim/mmu_oea.c > head/sys/powerpc/aim/mmu_oea64.c > head/sys/powerpc/booke/pmap.c > head/sys/powerpc/include/cpufunc.h > head/sys/powerpc/include/mmuvar.h > head/sys/powerpc/include/param.h > head/sys/powerpc/include/pmap.h > head/sys/powerpc/include/proc.h > head/sys/powerpc/include/pte.h > head/sys/powerpc/include/spr.h > head/sys/powerpc/include/sr.h > head/sys/powerpc/include/vmparam.h > head/sys/powerpc/powerpc/machdep.c > head/sys/powerpc/powerpc/mmu_if.m > head/sys/powerpc/powerpc/pmap_dispatch.c > head/sys/powerpc/powerpc/trap.c > head/sys/vm/vm_fault.c > > Modified: head/sys/conf/files.powerpc > == > --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020(r360886) > +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020(r360887) > @@ -135,6 +135,7 @@ powerpc/aim/locore.Soptionalaim > no-obj > powerpc/aim/aim_machdep.c optionalaim > powerpc/aim/mmu_oea.c optionalaim powerpc > powerpc/aim/mmu_oea64.coptionalaim > +powerpc/aim/mmu_radix.coptionalaim powerpc64 > powerpc/aim/moea64_if.moptionalaim > powerpc/aim/moea64_native.coptionalaim > powerpc/aim/mp_cpudep.coptionalaim > > Modified: head/sys/powerpc/aim/aim_machdep.c > == > --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 > (r360886) > +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 02:33:37 2020 > (r360887) > @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); > struct bat battable[16]; > #endif > > +int radix_mmu = 0; > + > #ifndef __powerpc64__ > /* Bits for running on 64-bit systems in 32-bit mode. */ > extern void*testppc64, *testppc64size; > @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) > * in case the platform module had a better idea of what we > * should do. > */ > - if (cpu_features & PPC_FEATURE_64) > + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { > + radix_mmu = 0; > + TUNABLE_INT_FETCH("radix_mmu", _mmu); > + if (radix_mmu) > + pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); > + else > + pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > + } else if (cpu_features & PPC_FEATURE_64) > pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > else > pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); > > Modified: head/sys/powerpc/aim/mmu_oea.c > == > --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 > (r360886) > +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 02:33:37 2020 > (r360887) > @@ -322,6 +322,7 @@ void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t > void moea_scan_init(mmu_t mmu); > vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); > void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); > +boolean_t moea_page_is_mapped(mmu_t mmu, vm_page_t m); > static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, > volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, > @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { > MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), > MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), > MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), > + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), > > /* Internal interfaces */ > MMUMETHOD(mmu_bootstrap,moea_bootstrap), > @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t
svn commit: r360921 - head/sys/netinet
Author: melifaro Date: Mon May 11 20:41:03 2020 New Revision: 360921 URL: https://svnweb.freebsd.org/changeset/base/360921 Log: Fix NOINET[6] build by using af-independent route lookup function. Reported by: rpokala Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h == --- head/sys/netinet/sctp_os_bsd.h Mon May 11 20:40:30 2020 (r360920) +++ head/sys/netinet/sctp_os_bsd.h Mon May 11 20:41:03 2020 (r360921) @@ -402,10 +402,7 @@ typedef struct route sctp_route_t; #define SCTP_RTALLOC(ro, vrf_id, fibnum) \ { \ if ((ro)->ro_nh == NULL) { \ - if ((ro)->ro_dst.sa_family == AF_INET) \ - (ro)->ro_nh = fib4_lookup(fibnum, ((struct sockaddr_in *)&(ro)->ro_dst)->sin_addr, 0, NHR_REF, 0); \ - if ((ro)->ro_dst.sa_family == AF_INET6) \ - (ro)->ro_nh = fib6_lookup(fibnum, &((struct sockaddr_in6 *)&(ro)->ro_dst)->sin6_addr, 0, NHR_REF, 0); \ + (ro)->ro_nh = rib_lookup(fibnum, &(ro)->ro_dst, NHR_REF, 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: r360922 - stable/12/sys/riscv/riscv
Author: jhb Date: Mon May 11 20:41:27 2020 New Revision: 360922 URL: https://svnweb.freebsd.org/changeset/base/360922 Log: MFC 357630: Fix DDB to unwind across exception frames. While here, add an extra line of information for exceptions and interrupts and compress the per-frame line down to one line to match other architectures. Modified: stable/12/sys/riscv/riscv/db_trace.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/db_trace.c == --- stable/12/sys/riscv/riscv/db_trace.cMon May 11 20:41:03 2020 (r360921) +++ stable/12/sys/riscv/riscv/db_trace.cMon May 11 20:41:27 2020 (r360922) @@ -2,6 +2,7 @@ * Copyright (c) 2015 The FreeBSD Foundation * Copyright (c) 2016 Ruslan Bukin * All rights reserved. + * Copyright (c) 2020 John Baldwin * * Portions of this software were developed by Semihalf under * the sponsorship of the FreeBSD Foundation. @@ -38,15 +39,18 @@ #include __FBSDID("$FreeBSD$"); + #include -#include #include -#include +#include + #include #include +#include #include #include +#include void db_md_list_watchpoints() @@ -80,9 +84,6 @@ db_stack_trace_cmd(struct unwind_state *frame) while (1) { pc = frame->pc; - if (unwind_frame(frame) < 0) - break; - sym = db_search_symbol(pc, DB_STGY_ANY, ); if (sym == C_DB_SYM_NULL) { value = 0; @@ -94,11 +95,32 @@ db_stack_trace_cmd(struct unwind_state *frame) db_printsym(frame->pc, DB_STGY_PROC); db_printf("\n"); - db_printf("\t pc = 0x%016lx ra = 0x%016lx\n", - pc, frame->pc); - db_printf("\t sp = 0x%016lx fp = 0x%016lx\n", - frame->sp, frame->fp); - db_printf("\n"); + if (strcmp(name, "cpu_exception_handler_supervisor") == 0 || + strcmp(name, "cpu_exception_handler_user") == 0) { + struct trapframe *tf; + + tf = (struct trapframe *)(uintptr_t)frame->sp; + + if (tf->tf_scause & EXCP_INTR) + db_printf("--- interrupt %ld\n", + tf->tf_scause & EXCP_MASK); + else + db_printf("--- exception %ld, tval = %#lx\n", + tf->tf_scause & EXCP_MASK, + tf->tf_stval); + frame->sp = (uint64_t)tf->tf_sp; + frame->fp = (uint64_t)tf->tf_s[0]; + frame->pc = (uint64_t)tf->tf_sepc; + if (!INKERNEL(frame->fp)) + break; + continue; + } + + if (strcmp(name, "fork_trampoline") == 0) + break; + + if (unwind_frame(frame) < 0) + break; } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r360920 - in head: share/man/man4 share/man/man9 sys/dev/cesa sys/dev/hifn sys/dev/sec sys/mips/nlm/dev/sec sys/opencrypto
Author: jhb Date: Mon May 11 20:40:30 2020 New Revision: 360920 URL: https://svnweb.freebsd.org/changeset/base/360920 Log: Remove incomplete support for plain MD5 from OCF. Although a few drivers supported this algorithm, there were never any in-kernel consumers. cryptosoft and cryptodev never supported it, and there was not a software xform auth_hash for it. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24767 Modified: head/share/man/man4/hifn.4 head/share/man/man9/crypto.9 head/sys/dev/cesa/cesa.c head/sys/dev/hifn/hifn7751.c head/sys/dev/sec/sec.c head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c Modified: head/share/man/man4/hifn.4 == --- head/share/man/man4/hifn.4 Mon May 11 20:34:52 2020(r360919) +++ head/share/man/man4/hifn.4 Mon May 11 20:40:30 2020(r360920) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2009 +.Dd May 11, 2020 .Dt HIFN 4 .Os .Sh NAME @@ -57,7 +57,7 @@ driver supports various cards containing the Hifn 7751 The .Nm driver registers itself to accelerate DES, Triple-DES, -AES (7955 and 7956 only), ARC4, MD5, +AES (7955 and 7956 only), ARC4, MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 == --- head/share/man/man9/crypto.9Mon May 11 20:34:52 2020 (r360919) +++ head/share/man/man9/crypto.9Mon May 11 20:40:30 2020 (r360920) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 11, 2020 .Dt CRYPTO 9 .Os .Sh NAME @@ -106,7 +106,6 @@ The following authentication algorithms are supported: .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S -.It Dv CRYPTO_MD5 .It Dv CRYPTO_MD5_HMAC .It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC Modified: head/sys/dev/cesa/cesa.c == --- head/sys/dev/cesa/cesa.cMon May 11 20:34:52 2020(r360919) +++ head/sys/dev/cesa/cesa.cMon May 11 20:40:30 2020(r360920) @@ -1607,7 +1607,6 @@ cesa_auth_supported(struct cesa_softc *sc, sc->sc_soc_id == MV_DEV_88F6810)) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: @@ -1686,12 +1685,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5: - cs->cs_mblen = 1; - cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : - csp->csp_auth_mlen; - cs->cs_config |= CESA_CSHD_MD5; - break; case CRYPTO_MD5_HMAC: cs->cs_mblen = MD5_BLOCK_LEN; cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : Modified: head/sys/dev/hifn/hifn7751.c == --- head/sys/dev/hifn/hifn7751.cMon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/hifn/hifn7751.cMon May 11 20:40:30 2020 (r360920) @@ -2315,7 +2315,6 @@ hifn_auth_supported(struct hifn_softc *sc, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: break; case CRYPTO_MD5_HMAC: @@ -2524,11 +2523,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_MAC; switch (csp->csp_auth_alg) { - case CRYPTO_MD5: - cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | - HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH | - HIFN_MAC_CMD_POS_IPSEC; - break; case CRYPTO_MD5_HMAC: cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC | Modified: head/sys/dev/sec/sec.c == --- head/sys/dev/sec/sec.c Mon May 11 20:34:52 2020(r360919) +++ head/sys/dev/sec/sec.c Mon May 11 20:40:30 2020(r360920) @@ -1180,7 +1180,6 @@ sec_auth_supported(struct sec_softc *sc, if (csp->csp_auth_klen > SEC_MAX_KEY_LEN) return (false); break; - case CRYPTO_MD5: case CRYPTO_SHA1: break; default: @@ -1530,7 +1529,6 @@ static bool sec_mdeu_can_handle(u_int alg) { switch (alg) { - case
svn commit: r360919 - head/usr.bin/systat
Author: mr Date: Mon May 11 20:34:52 2020 New Revision: 360919 URL: https://svnweb.freebsd.org/changeset/base/360919 Log: Patch systat -zarc to display cumulative rate and round down large numbers by SI units PR: 237664 Submitted by: o...@j.email.ne.jp MFC after:2 weeks Modified: head/usr.bin/systat/Makefile head/usr.bin/systat/extern.h head/usr.bin/systat/main.c head/usr.bin/systat/zarc.c Modified: head/usr.bin/systat/Makefile == --- head/usr.bin/systat/MakefileMon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/MakefileMon May 11 20:34:52 2020 (r360919) @@ -4,7 +4,7 @@ .include PROG= systat -SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ +SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c sysput.c \ netcmds.c netstat.c pigs.c swap.c icmp.c \ mode.c ip.c sctp.c tcp.c zarc.c \ vmstat.c convtbl.c ifcmds.c ifstat.c Modified: head/usr.bin/systat/extern.h == --- head/usr.bin/systat/extern.hMon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/extern.hMon May 11 20:34:52 2020 (r360919) @@ -165,6 +165,8 @@ void showtcp(void); voidstatus(void); voidsuspend(int); char *sysctl_dynread(const char *, size_t *); +voidsysputstrs(WINDOW* , int, int, int); +voidsysputuint64(WINDOW* , int, int, int, uint64_t, int); #define SYSTAT_CMD(name) \ void close ## name(WINDOW *); \ @@ -176,4 +178,4 @@ char*sysctl_dynread(const char *, size_t *); void show ## name(void) SYSTAT_CMD( zarc ); -SYSTAT_CMD ( sctp ); +SYSTAT_CMD( sctp ); Modified: head/usr.bin/systat/main.c == --- head/usr.bin/systat/main.c Mon May 11 20:30:28 2020(r360918) +++ head/usr.bin/systat/main.c Mon May 11 20:34:52 2020(r360919) @@ -300,17 +300,8 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.dbuf_size", arc_stat); arc[6] += arc_stat; wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < nitems(arc); i++) { - if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { - wprintw(wload, "%7lluG", arc[i] >> 30); - } - else if (arc[i] > 10 * 1024 * 1024 ) { - wprintw(wload, "%7lluM", arc[i] >> 20); - } - else { - wprintw(wload, "%7lluK", arc[i] >> 10); - } - } + for (i = 0 ; i < nitems(arc); i++) + sysputuint64(wload, 0, i*8+2, 6, arc[i], 0); } } (*curcmd->c_refresh)(); Modified: head/usr.bin/systat/zarc.c == --- head/usr.bin/systat/zarc.c Mon May 11 20:30:28 2020(r360918) +++ head/usr.bin/systat/zarc.c Mon May 11 20:34:52 2020(r360919) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 - 2017 Yoshihiro Ota + * Copyright (c) 2014 - 2017, 2019 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,16 +32,16 @@ __FBSDID("$FreeBSD$"); #include #include -/* #include */ #include #include #include +#include #include "systat.h" #include "extern.h" #include "devs.h" -struct zfield{ +struct zfield { uint64_t arcstats; uint64_t arcstats_demand_data; uint64_t arcstats_demand_metadata; @@ -57,18 +57,25 @@ static struct zarcstats { struct zfield misses; } curstat, initstat, oldstat; +struct zarcrates { + struct zfield current; + struct zfield total; +}; + static void getinfo(struct zarcstats *ls); WINDOW * openzarc(void) { - return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); + + return (subwin(stdscr, LINES - 3 - 1, 0, MAINWIN_ROW, 0)); } void closezarc(WINDOW *w) { + if (w == NULL) return; wclear(w); @@ -80,12 +87,12 @@ void labelzarc(void) { int row = 1; + wmove(wnd, 0, 0); wclrtoeol(wnd); - mvwprintw(wnd, 0, 31+1, "%4.4s %7.7s %7.7s %12.12s %12.12s", - "rate", "hits", "misses", "total hits", "total misses"); -#define L(str) mvwprintw(wnd, row, 5, #str); \ - mvwprintw(wnd, row, 31, ":"); \ - mvwprintw(wnd, row, 31+4, "%%"); ++row + mvwprintw(wnd, 0, 31+1, "%4.4s %6.6s %6.6s | Total %4.4s %6.6s %6.6s", + "Rate", "Hits", "Misses", "Rate", "Hits", "Misses"); +#define L(str) mvwprintw(wnd, row++, 5, \ + "%-26.26s:
svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys
Author: jhb Date: Mon May 11 20:30:28 2020 New Revision: 360918 URL: https://svnweb.freebsd.org/changeset/base/360918 Log: Remove ubsec(4). This driver was previously marked for deprecation in r360710. Approved by: csprng (cem, gordon, delphij) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D24766 Deleted: head/share/man/man4/ubsec.4 head/sys/dev/ubsec/ubsec.c head/sys/dev/ubsec/ubsecreg.h head/sys/dev/ubsec/ubsecvar.h head/sys/modules/ubsec/Makefile Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/share/man/man4/crypto.4 head/share/man/man4/rndtest.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/dev/random/random_harvestq.c head/sys/modules/Makefile head/sys/sys/random.h Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Mon May 11 20:10:01 2020(r360917) +++ head/ObsoleteFiles.inc Mon May 11 20:30:28 2020(r360918) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 2020: Remove ubsec(4) +OLD_FILES+=usr/share/man/man4/ubsec.4.gz + # 20200506: GNU objdump 2.17.50 retired OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/share/man/man1/objdump.1.gz Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileMon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/MakefileMon May 11 20:30:28 2020 (r360918) @@ -966,7 +966,6 @@ MAN+= \ uart.4 \ uath.4 \ ubsa.4 \ - ubsec.4 \ ubser.4 \ ubtbcmfw.4 \ uchcom.4 \ Modified: head/share/man/man4/crypto.4 == --- head/share/man/man4/crypto.4Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/crypto.4Mon May 11 20:30:28 2020 (r360918) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 11, 2020 .Dt CRYPTO 4 .Os .Sh NAME @@ -424,7 +424,6 @@ The semantics of these arguments are currently undocum .Xr ipsec 4 , .Xr padlock 4 , .Xr safe 4 , -.Xr ubsec 4 , .Xr crypto 7 , .Xr geli 8 , .Xr crypto 9 Modified: head/share/man/man4/rndtest.4 == --- head/share/man/man4/rndtest.4 Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/rndtest.4 Mon May 11 20:30:28 2020 (r360918) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2003 +.Dd May 11, 2020 .Dt RNDTEST 4 .Os .Sh NAME @@ -54,7 +54,6 @@ Failures are optionally reported on the console. .Xr hifn 4 , .Xr random 4 , .Xr safe 4 , -.Xr ubsec 4 , .Xr crypto 9 .Sh HISTORY The idea for this and the original code came from Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Mon May 11 20:10:01 2020(r360917) +++ head/sys/conf/NOTES Mon May 11 20:30:28 2020(r360918) @@ -2630,10 +2630,6 @@ device hifn# Hifn 7951, 7781, etc. optionsHIFN_DEBUG # enable debugging support: hw.hifn.debug optionsHIFN_RNDTEST# enable rndtest support -device ubsec # Broadcom 5501, 5601, 58xx -optionsUBSEC_DEBUG # enable debugging support: hw.ubsec.debug -optionsUBSEC_RNDTEST # enable rndtest support - # Modified: head/sys/conf/files == --- head/sys/conf/files Mon May 11 20:10:01 2020(r360917) +++ head/sys/conf/files Mon May 11 20:30:28 2020(r360918) @@ -3182,7 +3182,6 @@ dev/uart/uart_dev_z8530.c optional uart uart_z8530 | u dev/uart/uart_if.m optional uart dev/uart/uart_subr.c optional uart dev/uart/uart_tty.coptional uart -dev/ubsec/ubsec.c optional ubsec # # USB controller drivers # Modified: head/sys/conf/options == --- head/sys/conf/options Mon May 11 20:10:01 2020(r360917) +++ head/sys/conf/options Mon May 11 20:30:28 2020(r360918) @@ -734,11 +734,6 @@ BCE_NVRAM_WRITE_SUPPORTopt_bce.h SOCKBUF_DEBUG opt_global.h -# options for ubsec driver -UBSEC_DEBUGopt_ubsec.h -UBSEC_RNDTEST opt_ubsec.h -UBSEC_NO_RNG opt_ubsec.h - # options for hifn driver HIFN_DEBUG opt_hifn.h HIFN_RNDTEST opt_hifn.h Modified: head/sys/dev/random/random_harvestq.c == --- head/sys/dev/random/random_harvestq.c
svn commit: r360917 - stable/12/sys/dev/pci
Author: jhibbits Date: Mon May 11 20:10:01 2020 New Revision: 360917 URL: https://svnweb.freebsd.org/changeset/base/360917 Log: MFC r350571: Fix the build after r350570. Signed char cannot compare to values above 0x7f. Use unsigned instead. Modified: stable/12/sys/dev/pci/vga_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/vga_pci.c == --- stable/12/sys/dev/pci/vga_pci.c Mon May 11 19:57:45 2020 (r360916) +++ stable/12/sys/dev/pci/vga_pci.c Mon May 11 20:10:01 2020 (r360917) @@ -170,7 +170,7 @@ vga_pci_map_bios(device_t dev, size_t *size) device_t pcib; uint32_t rom_addr; uint16_t config; - volatile char *bios; + volatile unsigned char *bios; int i, rid, found; #if defined(__amd64__) || defined(__i386__) ___ 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: r360916 - stable/12/sys/riscv/riscv
Author: jhb Date: Mon May 11 19:57:45 2020 New Revision: 360916 URL: https://svnweb.freebsd.org/changeset/base/360916 Log: MFC 357594: Use csr_read() to read sstatus instead of inline assembly. While here, remove a local variable to avoid the CSR read in non-debug kernels. Modified: stable/12/sys/riscv/riscv/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/trap.c == --- stable/12/sys/riscv/riscv/trap.cMon May 11 19:36:38 2020 (r360915) +++ stable/12/sys/riscv/riscv/trap.cMon May 11 19:57:45 2020 (r360916) @@ -246,12 +246,10 @@ void do_trap_supervisor(struct trapframe *frame) { uint64_t exception; - uint64_t sstatus; /* Ensure we came from supervisor mode, interrupts disabled */ - __asm __volatile("csrr %0, sstatus" : "=" (sstatus)); - KASSERT((sstatus & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, - ("We must came from S mode with interrupts disabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == + SSTATUS_SPP, ("Came from S mode with interrupts enabled")); exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { @@ -306,7 +304,6 @@ do_trap_user(struct trapframe *frame) { uint64_t exception; struct thread *td; - uint64_t sstatus; struct pcb *pcb; td = curthread; @@ -314,9 +311,8 @@ do_trap_user(struct trapframe *frame) pcb = td->td_pcb; /* Ensure we came from usermode, interrupts disabled */ - __asm __volatile("csrr %0, sstatus" : "=" (sstatus)); - KASSERT((sstatus & (SSTATUS_SPP | SSTATUS_SIE)) == 0, - ("We must came from U mode with interrupts disabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, + ("Came from U mode with interrupts enabled")); exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { ___ 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: r360915 - head/lib/csu
Author: dim Date: Mon May 11 19:36:38 2020 New Revision: 360915 URL: https://svnweb.freebsd.org/changeset/base/360915 Log: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 MFC after:3 days Differential Revision: https://reviews.freebsd.org/D24797 Modified: head/lib/csu/Makefile.inc Modified: head/lib/csu/Makefile.inc == --- head/lib/csu/Makefile.inc Mon May 11 19:17:33 2020(r360914) +++ head/lib/csu/Makefile.inc Mon May 11 19:36:38 2020(r360915) @@ -13,6 +13,9 @@ NO_WMISSING_VARIABLE_DECLARATIONS= OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + CFLAGS_CRTS= -DSHARED ${PICFLAG} crtbegin.o: crtbegin.c ___ 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: r360914 - in head/sys: netinet netinet6
Author: gallatin Date: Mon May 11 19:17:33 2020 New Revision: 360914 URL: https://svnweb.freebsd.org/changeset/base/360914 Log: Ktls: never skip stamping tags for NIC TLS The newer RACK and BBR TCP stacks have added a mechanism to disable hardware packet pacing for TCP retransmits. This mechanism works by skipping the send-tag stamp on rate-limited connections when the TCP stack calls ip_output() with the IP_NO_SND_TAG_RL flag set. When doing NIC TLS, we must ignore this flag, as NIC TLS packets must always be stamped. Failure to stamp a NIC TLS packet will result in crypto issues. Reviewed by: hselasky, rrs Sponsored by: Netflix, Mellanox Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c == --- head/sys/netinet/ip_output.cMon May 11 19:16:49 2020 (r360913) +++ head/sys/netinet/ip_output.cMon May 11 19:17:33 2020 (r360914) @@ -242,6 +242,10 @@ ip_output_send(struct inpcb *inp, struct ifnet *ifp, s error = EAGAIN; goto done; } + /* +* Always stamp tags that include NIC ktls. +*/ + stamp_tag = true; } #endif #ifdef RATELIMIT Modified: head/sys/netinet6/ip6_output.c == --- head/sys/netinet6/ip6_output.c Mon May 11 19:16:49 2020 (r360913) +++ head/sys/netinet6/ip6_output.c Mon May 11 19:17:33 2020 (r360914) @@ -353,6 +353,10 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } + /* +* Always stamp tags that include NIC ktls. +*/ + stamp_tag = true; } #endif #ifdef RATELIMIT ___ 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: r360913 - releng/11.4/release/doc/en_US.ISO8859-1
Author: gjb Date: Mon May 11 19:16:49 2020 New Revision: 360913 URL: https://svnweb.freebsd.org/changeset/base/360913 Log: Uncomment the installation SUBDIR entry. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile == --- releng/11.4/release/doc/en_US.ISO8859-1/MakefileMon May 11 19:10:29 2020(r360912) +++ releng/11.4/release/doc/en_US.ISO8859-1/MakefileMon May 11 19:16:49 2020(r360913) @@ -4,7 +4,7 @@ RELN_ROOT?= ${.CURDIR}/.. SUBDIR = relnotes SUBDIR+= hardware -#SUBDIR+= installation +SUBDIR+= installation SUBDIR+= readme SUBDIR+= errata ___ 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: r360912 - releng/11.4/release/doc/en_US.ISO8859-1/readme
Author: gjb Date: Mon May 11 19:10:29 2020 New Revision: 360912 URL: https://svnweb.freebsd.org/changeset/base/360912 Log: Fix a mailing list reference. Bump copyright year while here. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml == --- releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml Mon May 11 19:10:28 2020(r360911) +++ releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml Mon May 11 19:10:29 2020(r360912) @@ -44,6 +44,8 @@ 2016 2017 2018 + 2019 + 2020 mailto:d...@freebsd.org;>The Documentation Project @@ -231,7 +233,7 @@ please send mail to the . If you are tracking the development - efforts, you must join the , + efforts, you must join the , in order to keep abreast of recent developments and changes that may affect the way you use and maintain the system. ___ 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: r360910 - releng/11.4/release/doc/en_US.ISO8859-1/relnotes
Author: gjb Date: Mon May 11 19:10:26 2020 New Revision: 360910 URL: https://svnweb.freebsd.org/changeset/base/360910 Log: Prune entries from 11.3-RELEASE. Bump copyright year while here. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml == --- releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xmlMon May 11 19:10:25 2020(r360909) +++ releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xmlMon May 11 19:10:26 2020(r360910) @@ -24,10 +24,8 @@ $FreeBSD$ - - - 2019 + 2020 mailto:d...@freebsd.org;>The Documentation Project @@ -161,151 +159,19 @@ Userland Configuration Changes - The utility has been - updated to include a new parameter, - allow.read_msgbuf, which prevents jailed - processes and users from accessing the buffer. - This parameter is set to false by - default. - - The system , - /etc/crontab, has been updated to set - PATH for consistency with the - daemon. - - The default has been - updated to prevent duplicated and -startup via . + Userland Application Changes - The , , - , and utilities have been updated - to support names. - - The utililty has - been updated to include a new flag, -T, - which is used to specify the timestamp for build - reproducibility. - - The utility has been updated - to add a new statusoperand, - progress, which reports the current status - on a single line every second. - - The utility has been - updated to include support. - - The utility has been - updated to include support. - - The utility has been - updated to include support. - - The utility has been - updated to implement -B and - --ignore-blank-lines support. - - The utility has been - updated to prevent operating within read-only - directories. - - The utility has been - updated to add a new flag, -e, which takes - a parameter as an argument and prints a list - of non-wildcard jails with the specified parameter. - - The utility has been - updated to include the -l flag which - enables live mode when specified. - - The utility has been added, - which deletes content for blocks on flash-based storage - devices that use wear-leveling algorithms. - - The utility has been - updated to add -l support for - files. - - The and - utilities have been updated to allow underscores in label - names. - - The utility has been - updated to provide clearer output and reference the - net.pf.request_maxcount - if a defined table is too large. - - The and - utilities have been updated to allow dashes in label - names. - - The utility has been - updated to support sectors larger than 2048 bytes. - - The utility has been updated - to add the pipefail option which simplifies - checking the exit status of all commands in a pipeline. - - The utility has been - updated to exit successfully if the input patch file is - zero-length. + Contributed Software - The utility has been updated - to version 5.2.4. - - The utility has been - updated to version 5.34. - - The - ELF Tool Chain has been updated to - version r3614. - - The - lld utility has been updated to add - -z interpose, marking the object file as - an interposer. - - The utility has been - updated to fix incorrect date reporting for - files. - - The LUA -has been merged. - - The utilities have been - updated to version 4.2.8p13. - - Timezone data files have been updated to - version 2019a. - - The clang, - llvm, - lld, - lldb, and - compiler-rt utilities as well as - libc++ have been updated to - upstream version 8.0.0. - - The WPA - utilities have been updated to version 2.8. - - OpenSSL has - been updated to version 1.0.2s. - - The library has been - updated to version 3.3.3, with additional fixes from - upstream. - - OpenPAM has - been updated to the latest upstream version. + @@ -318,56 +184,20 @@ /etc/rc.d Scripts - Support for auxiliary - RAM has been added to - /etc/rc.initdiskless. - - The utility has been - updated to add support for - /etc/rc.resume. - -
svn commit: r360909 - releng/11.4/release/doc/en_US.ISO8859-1/installation
Author: gjb Date: Mon May 11 19:10:25 2020 New Revision: 360909 URL: https://svnweb.freebsd.org/changeset/base/360909 Log: Update version information in the installation page. Bump the copyright year while here. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xml == --- releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xmlMon May 11 19:10:24 2020(r360908) +++ releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xmlMon May 11 19:10:25 2020(r360909) @@ -4,7 +4,7 @@ http://www.FreeBSD.org/release/XML/share/xml/release.ent;> %release; - + ]> http://docbook.org/ns/docbook; @@ -22,7 +22,7 @@ $FreeBSD$ - 2018 + 2020 mailto:d...@freebsd.org;>The Documentation Project @@ -82,8 +82,7 @@ The utility supports binary upgrades of and systems running earlier FreeBSD releases. Systems running - 10.3-RELEASE, - 11.0-RELEASE can upgrade as follows: + 11.3-RELEASE can upgrade as follows: freebsd-update fetch freebsd-update install ___ 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: r360911 - releng/11.4/release/doc/en_US.ISO8859-1/errata
Author: gjb Date: Mon May 11 19:10:28 2020 New Revision: 360911 URL: https://svnweb.freebsd.org/changeset/base/360911 Log: Prune open issues and late-breaking news sections from the errata page. Note that the errata page will be maintained until 11.4 reaches EoL. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml == --- releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml Mon May 11 19:10:26 2020(r360910) +++ releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml Mon May 11 19:10:28 2020(r360911) @@ -49,8 +49,7 @@ . This errata document for will be maintained - until the release of (if - applicable). + until reaches end-of-life. @@ -97,38 +96,8 @@ - [2019-07-04] An issue which can cause a crash when - connecting to a instance with - a VNC client under certain circumstances - had been reported. An errata notice is planned - post-release. + No open issues. - - - [2019-07-04] An issue booting virtual - machines compiled with version 8.0.0 or later - had been reported late in the release cycle. An errata - notice is planned post-release. - - This issue is believed to only affect OpenBSD virtual - machines compiled with . - - - - [2019-07-04] An issue when upgrading from 11.3 - to 12.0 (which occurred earlier in time, - comparatively), had been reported where the - com.delphix:spacemap_v2 - feature does not exist on 12.0, will fail to - import the ZFS pool. - - At this time, it is advised to defer migrating from - 11.3 to 12.x until 12.1 is - available. - - Upgrading from earlier 11.x releases to - 12.0 are believed to be unaffected. - @@ -137,27 +106,7 @@ - [2019-12-06] An issue has been reported with the - 11.3-RELEASE images on the Google Compute Engine - platform which causes virtual machines to fail to start - properly. - - While we intend to investigate how to handle similar - situations should they arise in the future, updated images - will not be provided as of this time. - - Users wanting to use in Google Compute Engine are - advised to use 12.0-RELEASE or 12.1-RELEASE, or for those - who wish to track 11.X, the - freebsd-11-3-stable-amd64-v20190801 - snapshot from stable/11 has been - https://github.com/cirruslabs/cirrus-ci-docs/issues/359#issuecomment-519314652;> - reported to work correctly. - - More details can be found in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242303;>PR - 242303. + No late-breaking news. ___ 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: r360907 - releng/11.4/release/doc/en_US.ISO8859-1
Author: gjb Date: Mon May 11 19:10:23 2020 New Revision: 360907 URL: https://svnweb.freebsd.org/changeset/base/360907 Log: Add the installation SUBDIR (commented for now). Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile == --- releng/11.4/release/doc/en_US.ISO8859-1/MakefileMon May 11 19:08:03 2020(r360906) +++ releng/11.4/release/doc/en_US.ISO8859-1/MakefileMon May 11 19:10:23 2020(r360907) @@ -4,6 +4,7 @@ RELN_ROOT?= ${.CURDIR}/.. SUBDIR = relnotes SUBDIR+= hardware +#SUBDIR+= installation SUBDIR+= readme SUBDIR+= errata ___ 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: r360908 - releng/11.4/release/doc/share/xml
Author: gjb Date: Mon May 11 19:10:24 2020 New Revision: 360908 URL: https://svnweb.freebsd.org/changeset/base/360908 Log: Update version number information in release.ent. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/share/xml/release.ent Modified: releng/11.4/release/doc/share/xml/release.ent == --- releng/11.4/release/doc/share/xml/release.ent Mon May 11 19:10:23 2020(r360907) +++ releng/11.4/release/doc/share/xml/release.ent Mon May 11 19:10:24 2020(r360908) @@ -6,7 +6,7 @@ - + - + - + https://www.FreeBSD.org/snapshots/"> @@ -37,10 +37,10 @@ or "release" --> - + - - + + ___ 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: r360906 - head/tests/sys/netpfil/pf
Author: markj Date: Mon May 11 19:08:03 2020 New Revision: 360906 URL: https://svnweb.freebsd.org/changeset/base/360906 Log: Add a basic table entry counter regression test. Reviewed by: kp MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D24809 Added: head/tests/sys/netpfil/pf/table.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile == --- head/tests/sys/netpfil/pf/Makefile Mon May 11 19:07:33 2020 (r360905) +++ head/tests/sys/netpfil/pf/Makefile Mon May 11 19:08:03 2020 (r360906) @@ -16,6 +16,7 @@ ATF_TESTS_SH+=anchor \ route_to \ synproxy \ set_skip \ + table \ pfsync \ icmp Added: head/tests/sys/netpfil/pf/table.sh == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/table.sh Mon May 11 19:08:03 2020 (r360906) @@ -0,0 +1,115 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Mark Johnston +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +TABLE_STATS_ZERO_REGEXP='Packets: 0[[:space:]]*Bytes: 0[[:space:]]' +TABLE_STATS_NONZERO_REGEXP='Packets: [1-9][0-9]*[[:space:]]*Bytes: [1-9][0-9]*[[:space:]]' + +atf_test_case "v4_counters" "cleanup" +v4_counters_head() +{ + atf_set descr 'Verify per-address counters for v4' + atf_set require.user root +} + +v4_counters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table counters { 192.0.2.1 }" \ + "block all" \ + "pass in from to any" \ + "pass out from any to " + + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + + atf_check -s exit:0 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + jexec alcatraz pfctl -t foo -T show -vv +} + +v4_counters_cleanup() +{ + pft_cleanup +} + +atf_test_case "v6_counters" "cleanup" +v6_counters_head() +{ + atf_set descr 'Verify per-address counters for v6' + atf_set require.user root +} + +v6_counters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b inet6 2001:db8:42::2/64 up no_dad + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table counters { 2001:db8:42::1 }" \ + "block all" \ + "pass in from to any" \ + "pass out from any to " + + atf_check -s exit:0 -o ignore ping6 -c 3 2001:db8:42::2 + + atf_check -s exit:0 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + jexec alcatraz pfctl -t foo6 -T show -vv +} + +v6_counters_cleanup() +{ + pft_cleanup +} +
svn commit: r360905 - in head/tests/sys/netpfil: common pf
Author: markj Date: Mon May 11 19:07:33 2020 New Revision: 360905 URL: https://svnweb.freebsd.org/changeset/base/360905 Log: Remove the svn:executable property from some pf test files. The test makefiles will handle setting mode bits during install. Also, Phabricator gets upset when uploading an executable plain-text file without a shebang. MFC after:1 week Modified: Directory Properties: head/tests/sys/netpfil/common/forward.sh (props changed) head/tests/sys/netpfil/pf/anchor.sh (props changed) head/tests/sys/netpfil/pf/forward.sh (props changed) head/tests/sys/netpfil/pf/fragmentation.sh (props changed) head/tests/sys/netpfil/pf/icmp.sh (props changed) head/tests/sys/netpfil/pf/names.sh (props changed) head/tests/sys/netpfil/pf/nat.sh (props changed) head/tests/sys/netpfil/pf/pass_block.sh (props changed) head/tests/sys/netpfil/pf/pfsync.sh (props changed) head/tests/sys/netpfil/pf/rdr.sh (props changed) head/tests/sys/netpfil/pf/route_to.sh (props changed) head/tests/sys/netpfil/pf/set_skip.sh (props changed) head/tests/sys/netpfil/pf/set_tos.sh (props changed) head/tests/sys/netpfil/pf/synproxy.sh (props changed) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r360904 - stable/12/sys/riscv/include
Author: jhb Date: Mon May 11 18:47:51 2020 New Revision: 360904 URL: https://svnweb.freebsd.org/changeset/base/360904 Log: MFC 357595: Fix EXCP_MASK to include all relevant bits from scause. While cause codes higher than 16 are reserved, the exception code field of the register is defined to be all bits but the upper-most bit. Modified: stable/12/sys/riscv/include/riscvreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/riscvreg.h == --- stable/12/sys/riscv/include/riscvreg.h Mon May 11 18:47:38 2020 (r360903) +++ stable/12/sys/riscv/include/riscvreg.h Mon May 11 18:47:51 2020 (r360904) @@ -37,8 +37,7 @@ #ifndef _MACHINE_RISCVREG_H_ #define_MACHINE_RISCVREG_H_ -#defineEXCP_SHIFT 0 -#defineEXCP_MASK (0xf << EXCP_SHIFT) +#defineEXCP_MASK (~EXCP_INTR) #defineEXCP_MISALIGNED_FETCH 0 #defineEXCP_FAULT_FETCH1 #defineEXCP_ILLEGAL_INSTRUCTION2 ___ 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: r360903 - in head: share/man/man5 sys/netpfil/pf
Author: markj Date: Mon May 11 18:47:38 2020 New Revision: 360903 URL: https://svnweb.freebsd.org/changeset/base/360903 Log: pf: Don't allocate per-table entry counters unless required. pf by default does not do per-table address accounting unless the "counters" keyword is specified in the corresponding pf.conf table definition. Yet, we always allocate 12 per-CPU counters per table. For large tables this carries a lot of overhead, so only allocate counters when they will actually be used. A further enhancement might be to use a dedicated UMA zone to allocate counter arrays for table entries, since close to half of the structure size comes from counter pointers. A related issue is the cost of zeroing counters, since counter_u64_zero() calls smp_rendezvous() on some architectures. Reported by: loos, Jim Pingle Reviewed by: kp MFC after:2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision:https://reviews.freebsd.org/D24803 Modified: head/share/man/man5/pf.conf.5 head/sys/netpfil/pf/pf_table.c Modified: head/share/man/man5/pf.conf.5 == --- head/share/man/man5/pf.conf.5 Mon May 11 17:42:04 2020 (r360902) +++ head/share/man/man5/pf.conf.5 Mon May 11 18:47:38 2020 (r360903) @@ -189,6 +189,7 @@ The .Ar counters flag enables per-address packet and byte counters which can be displayed with .Xr pfctl 8 . +Note that this feature carries significant memory overhead for large tables. .El .Pp For example, Modified: head/sys/netpfil/pf/pf_table.c == --- head/sys/netpfil/pf/pf_table.c Mon May 11 17:42:04 2020 (r360902) +++ head/sys/netpfil/pf/pf_table.c Mon May 11 18:47:38 2020 (r360903) @@ -144,9 +144,9 @@ static void pfr_mark_addrs(struct pfr_ktable *); static struct pfr_kentry *pfr_lookup_addr(struct pfr_ktable *, struct pfr_addr *, int); -static bool pfr_create_kentry_counter(struct pfr_kcounters *, - int, int); -static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *); +static bool pfr_create_kentry_counter(struct pfr_kentry *, int, + int); +static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, bool); static void pfr_destroy_kentries(struct pfr_kentryworkq *); static void pfr_destroy_kentry_counter(struct pfr_kcounters *, int, int); @@ -155,8 +155,8 @@ static void pfr_insert_kentries(struct pfr_ktable *, struct pfr_kentryworkq *, long); static void pfr_remove_kentries(struct pfr_ktable *, struct pfr_kentryworkq *); -static void pfr_clstats_kentries(struct pfr_kentryworkq *, long, - int); +static void pfr_clstats_kentries(struct pfr_ktable *, + struct pfr_kentryworkq *, long, int); static void pfr_reset_feedback(struct pfr_addr *, int); static void pfr_prepare_network(union sockaddr_union *, int, int); static int pfr_route_kentry(struct pfr_ktable *, @@ -285,7 +285,8 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr * ad->pfra_fback = PFR_FB_NONE; } if (p == NULL && q == NULL) { - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, + (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(tmpkt, p)) { @@ -451,7 +452,8 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr * ad.pfra_fback = PFR_FB_DUPLICATE; goto _skip; } - p = pfr_create_kentry(); + p = pfr_create_kentry(, + (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(tmpkt, p)) { @@ -485,7 +487,7 @@ _skip: if (!(flags & PFR_FLAG_DUMMY)) { pfr_insert_kentries(kt, , tzero); pfr_remove_kentries(kt, ); - pfr_clstats_kentries(, tzero, INVERT_NEG_FLAG); + pfr_clstats_kentries(kt, , tzero, INVERT_NEG_FLAG); } else pfr_destroy_kentries(); if (nadd != NULL) @@ -623,7 +625,7 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astat pfr_walktree, ); if (!rv && (flags & PFR_FLAG_CLSTATS)) {
Re: svn commit: r360833 - head
On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > On Sat, May 09, 2020 at 02:01:29AM +, Kyle Evans wrote: > > Author: kevans > > Date: Sat May 9 02:01:29 2020 > > New Revision: 360833 > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > Log: > > installworld: attempt a certctl rehash at the tail end > > > > This can be run as root or normal user with no problem; if they hadn't > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to > > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL > > + > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > appropriate *ssl from somewhere else. > > > > Cross-builds are fine because this will always use the host certctl, or > > just > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > Modified: > > head/Makefile.inc1 > > > > Modified: head/Makefile.inc1 > > == > > --- head/Makefile.inc1Sat May 9 01:48:08 2020(r360832) > > +++ head/Makefile.inc1Sat May 9 02:01:29 2020(r360833) > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: > > _installcheck > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > .endfor > > .endif > > +.elif make(installworld) && ${MK_CAROOT} != "no" > > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > > + # friends, which we likely don't want. We'll rehash on a best-effort > > + # basis, otherwise we'll just mention that we're not doing it to raise > > + # awareness. > > + @if which certctl>/dev/null; then \ > > + certctl rehash \ > > Does this update METALOG with the added links? > > It seems a little weird to rely on DESTDIR from the environment. > > In general I'm not enthusiastic about additions to installworld that do > anything other than copying files, creating links, etc in simple ways. I will happily back this out if I can get some qualified eyes to review/improve it. It does not update METALOG, and it probably should. Agreed on DESTDIR. As for point #3, I guess we can continue spreading `certctl rehash` all over the tree in various points that may need it; the release(7) scripts will need to be done if we don't do it here at a minimum, and I haven't put much thought into it beyond that. The close-to-infuriating part of the caroot project has been that it's incredibly hard to get almost anyone else (with some obvious exceptions) to do more than informal discussion on the matter; actual review, in particular, is difficult to obtain. Thanks, Kyle Evans ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r360833 - head
On Sat, May 09, 2020 at 02:01:29AM +, Kyle Evans wrote: > Author: kevans > Date: Sat May 9 02:01:29 2020 > New Revision: 360833 > URL: https://svnweb.freebsd.org/changeset/base/360833 > > Log: > installworld: attempt a certctl rehash at the tail end > > This can be run as root or normal user with no problem; if they hadn't > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL + > WITH_CAROOT with a populated /etc/ssl that they can then use with an > appropriate *ssl from somewhere else. > > Cross-builds are fine because this will always use the host certctl, or just > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D24641 > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > == > --- head/Makefile.inc1Sat May 9 01:48:08 2020(r360832) > +++ head/Makefile.inc1Sat May 9 02:01:29 2020(r360833) > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installcheck > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > .endfor > .endif > +.elif make(installworld) && ${MK_CAROOT} != "no" > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > + # friends, which we likely don't want. We'll rehash on a best-effort > + # basis, otherwise we'll just mention that we're not doing it to raise > + # awareness. > + @if which certctl>/dev/null; then \ > + certctl rehash \ Does this update METALOG with the added links? It seems a little weird to rely on DESTDIR from the environment. In general I'm not enthusiastic about additions to installworld that do anything other than copying files, creating links, etc in simple ways. -- Brooks signature.asc Description: PGP signature
svn commit: r360902 - in head/sys/dev: e1000 ixgbe ixl
Author: erj Date: Mon May 11 17:42:04 2020 New Revision: 360902 URL: https://svnweb.freebsd.org/changeset/base/360902 Log: em/ix/ixv/ixl/iavf: Implement ifdi_needs_restart iflib method Pursuant to r360398, implement driver-specific versions of the ifdi_needs_restart iflib device method. Some (if not most?) Intel network cards don't need reinitializing when a VLAN is added or removed from the device hardware, so these implement ifdi_needs_restart in a way that tell iflib not to bring the interface up or down when a VLAN is added or removed, regardless of whether the VLAN_HWFILTER interface capability flag is set or not. This could potentially solve several PRs relating to link flaps that occur when VLANs are added/removed to devices. Signed-off-by: Eric Joyner PR: 240818, 241785 Reviewed by: gallatin@, olivier@ MFC after:3 days MFC with: r360398 Sponsored by: Intel Corporation Differential Revision:https://reviews.freebsd.org/D24659 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/if_iavf.c head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/e1000/if_em.c == --- head/sys/dev/e1000/if_em.c Mon May 11 16:14:20 2020(r360901) +++ head/sys/dev/e1000/if_em.c Mon May 11 17:42:04 2020(r360902) @@ -251,6 +251,7 @@ static void em_if_timer(if_ctx_t ctx, uint16_t qid); static voidem_if_vlan_register(if_ctx_t ctx, u16 vtag); static voidem_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static voidem_if_watchdog_reset(if_ctx_t ctx); +static boolem_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static voidem_identify_hardware(if_ctx_t ctx); static int em_allocate_pci_resources(if_ctx_t ctx); @@ -400,6 +401,7 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -437,6 +439,7 @@ static device_method_t igb_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -4035,6 +4038,25 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) adapter->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); + } +} + +/* em_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); } } Modified: head/sys/dev/ixgbe/if_ix.c == --- head/sys/dev/ixgbe/if_ix.c Mon May 11 16:14:20 2020(r360901) +++ head/sys/dev/ixgbe/if_ix.c Mon May 11 17:42:04 2020(r360902) @@ -139,6 +139,7 @@ static void ixgbe_if_update_admin_status(if_ctx_t ctx) static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag); static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); +static bool ixgbe_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); int ixgbe_intr(void *arg); / @@ -273,6 +274,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), + DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1234,6 +1236,25 @@ ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) req->dev_addr, >data[i]); return (0); } /* ixgbe_if_i2c_req */ + +/* ixgbe_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) {
svn commit: r360901 - stable/12/sys/riscv/riscv
Author: jhb Date: Mon May 11 16:14:20 2020 New Revision: 360901 URL: https://svnweb.freebsd.org/changeset/base/360901 Log: MFC 356840,357344: Add stricter checks on user changes to SSTATUS. 356840: Check for invalid sstatus values in set_mcontext(). Previously, this check was only in sys_sigreturn() which meant that user applications could write invalid values to the register via setcontext() or swapcontext(). 357344: Add stricter checks on user changes to SSTATUS. Rather than trying to blacklist which bits userland can't write to via sigreturn() or setcontext(), only permit changes to whitelisted bits. - Permit arbitrary writes to bits in the user-writable USTATUS register that shadows SSTATUS. - Ignore changes in write-only bits maintained by the CPU. - Ignore the user-supplied value of the FS field used to track floating point state and instead set it to a value matching the actions taken by set_fpcontext(). Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c == --- stable/12/sys/riscv/riscv/machdep.c Mon May 11 15:38:44 2020 (r360900) +++ stable/12/sys/riscv/riscv/machdep.c Mon May 11 16:14:20 2020 (r360901) @@ -365,6 +365,19 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf = td->td_frame; + /* +* Permit changes to the USTATUS bits of SSTATUS. +* +* Ignore writes to read-only bits (SD, XS). +* +* Ignore writes to the FS field as set_fpcontext() will set +* it explicitly. +*/ + if (((mcp->mc_gpregs.gp_sstatus ^ tf->tf_sstatus) & + ~(SSTATUS_SD | SSTATUS_XS_MASK | SSTATUS_FS_MASK | SSTATUS_UPIE | + SSTATUS_UIE)) != 0) + return (EINVAL); + memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t)); memcpy(tf->tf_s, mcp->mc_gpregs.gp_s, sizeof(tf->tf_s)); memcpy(tf->tf_a, mcp->mc_gpregs.gp_a, sizeof(tf->tf_a)); @@ -416,7 +429,12 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) { #ifdef FPE struct pcb *curpcb; +#endif + td->td_frame->tf_sstatus &= ~SSTATUS_FS_MASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_OFF; + +#ifdef FPE critical_enter(); if ((mcp->mc_flags & _MC_FP_VALID) != 0) { @@ -426,6 +444,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) sizeof(mcp->mc_fpregs)); curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; } critical_exit(); @@ -520,21 +539,11 @@ struct sigreturn_args { int sys_sigreturn(struct thread *td, struct sigreturn_args *uap) { - uint64_t sstatus; ucontext_t uc; int error; if (copyin(uap->sigcntxp, , sizeof(uc))) return (EFAULT); - - /* -* Make sure the processor mode has not been tampered with and -* interrupts have not been disabled. -* Supervisor interrupts in user mode are always enabled. -*/ - sstatus = uc.uc_mcontext.mc_gpregs.gp_sstatus; - if ((sstatus & SSTATUS_SPP) != 0) - return (EINVAL); error = set_mcontext(td, _mcontext); if (error != 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: r360900 - head/sys/kern
Author: freqlabs Date: Mon May 11 15:38:44 2020 New Revision: 360900 URL: https://svnweb.freebsd.org/changeset/base/360900 Log: vfs_exports: Tighten bounds and assert consistency of numsecflavors We know the value must be greater than 0 and less than MAXSECFLAVORS. Reject values outside this range in the initial check in vfs_export and add KASSERTs in the later consumers. Also check that we are called with one of either MNT_DELEXPORT or MNT_EXPORTED set. Reviewed by: rmacklem Approved by: mav (mentor) MFC after:1 week Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D24753 Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c == --- head/sys/kern/vfs_export.c Mon May 11 15:32:32 2020(r360899) +++ head/sys/kern/vfs_export.c Mon May 11 15:38:44 2020(r360900) @@ -112,6 +112,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * #endif int error; + KASSERT(argp->ex_numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + /* * XXX: This routine converts from a `struct xucred' * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This @@ -300,10 +305,14 @@ vfs_export(struct mount *mp, struct export_args *argp) struct netexport *nep; int error; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) + if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); + if ((argp->ex_flags & MNT_EXPORTED) != 0 && + (argp->ex_numsecflavors <= 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS)) + return (EINVAL); + error = 0; lockmgr(>mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; @@ -518,8 +527,13 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); - if (numsecflavors) + if (numsecflavors) { *numsecflavors = np->netc_numsecflavors; + KASSERT(*numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(*numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + } if (secflavors) *secflavors = np->netc_secflavors; lockmgr(>mnt_explock, LK_RELEASE, 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: r360899 - head/usr.sbin/bluetooth/hccontrol
Author: takawata Date: Mon May 11 15:32:32 2020 New Revision: 360899 URL: https://svnweb.freebsd.org/changeset/base/360899 Log: Add le_scan subcommand to hccontrol. PR: 246141 Submitted by: Marc Veldman Added: head/usr.sbin/bluetooth/hccontrol/adv_data.c (contents, props changed) Modified: head/usr.sbin/bluetooth/hccontrol/Makefile head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/hccontrol.h head/usr.sbin/bluetooth/hccontrol/le.c head/usr.sbin/bluetooth/hccontrol/node.c head/usr.sbin/bluetooth/hccontrol/util.c Modified: head/usr.sbin/bluetooth/hccontrol/Makefile == --- head/usr.sbin/bluetooth/hccontrol/Makefile Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/Makefile Mon May 11 15:32:32 2020 (r360899) @@ -8,7 +8,7 @@ PROG= hccontrol MAN= hccontrol.8 SRCS= send_recv.c link_policy.c link_control.c le.c\ host_controller_baseband.c info.c status.c node.c hccontrol.c \ - util.c + util.c adv_data.c WARNS?=2 LIBADD=bluetooth Added: head/usr.sbin/bluetooth/hccontrol/adv_data.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/hccontrol/adv_data.cMon May 11 15:32:32 2020(r360899) @@ -0,0 +1,249 @@ +/*- + * adv_data.c + * + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + + * Copyright (c) 2020 Marc Veldman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * $FreeBSD$ + */ + +#include +#include +#include +#include +#define L2CAP_SOCKET_CHECKED +#include +#include "hccontrol.h" + +static char* const adv_data2str(int len, uint8_t* data, char* buffer, + int size); +static char* const adv_name2str(int len, uint8_t* advdata, char* buffer, + int size); +static char* const adv_uuid2str(int datalen, uint8_t* data, char* buffer, + int size); + +void dump_adv_data(int len, uint8_t* advdata) +{ + int n=0; + fprintf(stdout, "\tADV Data: "); + for (n = 0; n < len+1; n++) { + fprintf(stdout, "%02x ", advdata[n]); + } + fprintf(stdout, "\n"); +} + +void print_adv_data(int len, uint8_t* advdata) +{ + int n=0; + while(n < len) + { + char buffer[2048]; + uint8_t datalen = advdata[n]; + uint8_t datatype = advdata[++n]; + /* Skip type */ + ++n; + datalen--; + switch (datatype) { + case 0x01: + fprintf(stdout, + "\tFlags: %s\n", + adv_data2str( + datalen, + [n], + buffer, + sizeof(buffer))); + break; + case 0x02: + fprintf(stdout, + "\tIncomplete list of service" + " class UUIDs (16-bit): %s\n", + adv_data2str( + datalen, + [n], + buffer, + sizeof(buffer))); +
svn commit: r360898 - in stable/12/tests/sys: fifo kern/pipe
Author: markj Date: Mon May 11 15:21:03 2020 New Revision: 360898 URL: https://svnweb.freebsd.org/changeset/base/360898 Log: MFC r360381: Add some regression tests for read and write kevents on pipes. Added: stable/12/tests/sys/fifo/fifo_kqueue.c - copied unchanged from r360381, head/tests/sys/fifo/fifo_kqueue.c stable/12/tests/sys/kern/pipe/pipe_kqueue_test.c - copied unchanged from r360381, head/tests/sys/kern/pipe/pipe_kqueue_test.c Modified: stable/12/tests/sys/fifo/Makefile stable/12/tests/sys/kern/pipe/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fifo/Makefile == --- stable/12/tests/sys/fifo/Makefile Mon May 11 15:20:40 2020 (r360897) +++ stable/12/tests/sys/fifo/Makefile Mon May 11 15:21:03 2020 (r360898) @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/fifo PLAIN_TESTS_C+=fifo_create PLAIN_TESTS_C+=fifo_io +ATF_TESTS_C+= fifo_kqueue PLAIN_TESTS_C+=fifo_misc PLAIN_TESTS_C+=fifo_open Copied: stable/12/tests/sys/fifo/fifo_kqueue.c (from r360381, head/tests/sys/fifo/fifo_kqueue.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/fifo/fifo_kqueue.c Mon May 11 15:21:03 2020 (r360898, copy of r360381, head/tests/sys/fifo/fifo_kqueue.c) @@ -0,0 +1,430 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Jan Kokemüller + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +ATF_TC_WITHOUT_HEAD(fifo_kqueue__writes); +ATF_TC_BODY(fifo_kqueue__writes, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET([0], p[1], EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0); + EV_SET([1], p[1], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + + ATF_REQUIRE(kevent(kq, kev, 2, NULL, 0, NULL) == 0); + + /* A new writer should immediately get a EVFILT_WRITE event. */ + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 16384); + ATF_REQUIRE(kev[0].udata == 0); + + /* Filling up the pipe should make the EVFILT_WRITE disappear. */ + + char c = 0; + ssize_t r; + while ((r = write(p[1], , 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Reading (PIPE_BUF - 1) bytes will not trigger a EVFILT_WRITE yet. */ + + for (int i = 0; i < PIPE_BUF - 1; ++i) { + ATF_REQUIRE(read(p[0], , 1) == 1); + } + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Reading one additional byte triggers the EVFILT_WRITE. */ + +
svn commit: r360897 - in stable/12: lib/libc/sys sys/kern
Author: markj Date: Mon May 11 15:20:40 2020 New Revision: 360897 URL: https://svnweb.freebsd.org/changeset/base/360897 Log: MFC r360380: Fix handling of EV_EOF for named pipes. PR: 203366, 224615, 246350 Modified: stable/12/lib/libc/sys/kqueue.2 stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/kqueue.2 == --- stable/12/lib/libc/sys/kqueue.2 Mon May 11 15:20:05 2020 (r360896) +++ stable/12/lib/libc/sys/kqueue.2 Mon May 11 15:20:40 2020 (r360897) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2020 +.Dd April 27, 2020 .Dt KQUEUE 2 .Os .Sh NAME @@ -323,8 +323,7 @@ When the last writer disconnects, the filter will set .Dv EV_EOF in .Va flags . -This may be cleared by passing in -.Dv EV_CLEAR , +This will be cleared by the filter when a new writer connects, at which point the filter will resume waiting for data to become available before returning. @@ -343,9 +342,10 @@ For sockets, pipes and fifos, .Va data will contain the amount of space remaining in the write buffer. -The filter will set EV_EOF when the reader disconnects, and for -the fifo case, this may be cleared by use of -.Dv EV_CLEAR . +The filter will set +.Dv EV_EOF +when the reader disconnects, and for the fifo case, this will be cleared +when a new reader connects. Note that this filter is not supported for vnodes or BPF devices. .Pp For sockets, the low water mark and socket error handling is Modified: stable/12/sys/kern/sys_pipe.c == --- stable/12/sys/kern/sys_pipe.c Mon May 11 15:20:05 2020 (r360896) +++ stable/12/sys/kern/sys_pipe.c Mon May 11 15:20:40 2020 (r360897) @@ -826,7 +826,12 @@ unlocked_error: } } - if ((rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt) >= PIPE_BUF) + /* +* Only wake up writers if there was actually something read. +* Otherwise, when calling read(2) at EOF, a spurious wakeup occurs. +*/ + if (nread > 0 && + rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt >= PIPE_BUF) pipeselwakeup(rpipe); PIPE_UNLOCK(rpipe); @@ -1728,48 +1733,54 @@ filt_pipedetach(struct knote *kn) static int filt_piperead(struct knote *kn, long hint) { + struct file *fp = kn->kn_fp; struct pipe *rpipe = kn->kn_hook; - struct pipe *wpipe = rpipe->pipe_peer; - int ret; PIPE_LOCK_ASSERT(rpipe, MA_OWNED); kn->kn_data = rpipe->pipe_buffer.cnt; if (kn->kn_data == 0) kn->kn_data = rpipe->pipe_map.cnt; - if ((rpipe->pipe_state & PIPE_EOF) || - wpipe->pipe_present != PIPE_ACTIVE || - (wpipe->pipe_state & PIPE_EOF)) { + if ((rpipe->pipe_state & PIPE_EOF) != 0 && + ((rpipe->pipe_state & PIPE_NAMED) == 0 || + fp->f_pipegen != rpipe->pipe_wgen)) { kn->kn_flags |= EV_EOF; return (1); } - ret = kn->kn_data > 0; - return ret; + kn->kn_flags &= ~EV_EOF; + return (kn->kn_data > 0); } /*ARGSUSED*/ static int filt_pipewrite(struct knote *kn, long hint) { - struct pipe *wpipe; + struct pipe *wpipe = kn->kn_hook; /* * If this end of the pipe is closed, the knote was removed from the * knlist and the list lock (i.e., the pipe lock) is therefore not held. */ - wpipe = kn->kn_hook; + if (wpipe->pipe_present == PIPE_ACTIVE || + (wpipe->pipe_state & PIPE_NAMED) != 0) { + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); + + if (wpipe->pipe_state & PIPE_DIRECTW) { + kn->kn_data = 0; + } else if (wpipe->pipe_buffer.size > 0) { + kn->kn_data = wpipe->pipe_buffer.size - + wpipe->pipe_buffer.cnt; + } else { + kn->kn_data = PIPE_BUF; + } + } + if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { - kn->kn_data = 0; kn->kn_flags |= EV_EOF; return (1); } - PIPE_LOCK_ASSERT(wpipe, MA_OWNED); - kn->kn_data = (wpipe->pipe_buffer.size > 0) ? - (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; - if (wpipe->pipe_state & PIPE_DIRECTW) - kn->kn_data = 0; - + kn->kn_flags &= ~EV_EOF; return (kn->kn_data >= PIPE_BUF); } ___ 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: r360896 - in stable/12/sys: fs/fifofs kern
Author: markj Date: Mon May 11 15:20:05 2020 New Revision: 360896 URL: https://svnweb.freebsd.org/changeset/base/360896 Log: MFC r360379: Call pipeselwakeup() after toggling PIPE_EOF. Modified: stable/12/sys/fs/fifofs/fifo_vnops.c stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fifofs/fifo_vnops.c == --- stable/12/sys/fs/fifofs/fifo_vnops.cMon May 11 15:17:57 2020 (r360895) +++ stable/12/sys/fs/fifofs/fifo_vnops.cMon May 11 15:20:05 2020 (r360896) @@ -173,8 +173,10 @@ fifo_open(ap) fip->fi_rgen++; if (fip->fi_readers == 1) { fpipe->pipe_state &= ~PIPE_EOF; - if (fip->fi_writers > 0) + if (fip->fi_writers > 0) { wakeup(>fi_writers); + pipeselwakeup(fpipe); + } } fp->f_pipegen = fpipe->pipe_wgen - fip->fi_writers; } @@ -189,8 +191,10 @@ fifo_open(ap) fip->fi_wgen++; if (fip->fi_writers == 1) { fpipe->pipe_state &= ~PIPE_EOF; - if (fip->fi_readers > 0) + if (fip->fi_readers > 0) { wakeup(>fi_readers); + pipeselwakeup(fpipe); + } } } if ((ap->a_mode & O_NONBLOCK) == 0) { @@ -209,6 +213,7 @@ fifo_open(ap) fpipe->pipe_state |= PIPE_EOF; if (fpipe->pipe_state & PIPE_WANTW) wakeup(fpipe); + pipeselwakeup(fpipe); PIPE_UNLOCK(fpipe); fifo_cleanup(vp); } @@ -237,6 +242,7 @@ fifo_open(ap) if (fpipe->pipe_state & PIPE_WANTR) wakeup(fpipe); fpipe->pipe_wgen++; + pipeselwakeup(fpipe); PIPE_UNLOCK(fpipe); fifo_cleanup(vp); } Modified: stable/12/sys/kern/sys_pipe.c == --- stable/12/sys/kern/sys_pipe.c Mon May 11 15:17:57 2020 (r360895) +++ stable/12/sys/kern/sys_pipe.c Mon May 11 15:20:05 2020 (r360896) @@ -1608,8 +1608,6 @@ pipeclose(struct pipe *cpipe) pipelock(cpipe, 0); pp = cpipe->pipe_pair; - pipeselwakeup(cpipe); - /* * If the other side is blocked, wake it up saying that * we want to close it down. @@ -1623,17 +1621,16 @@ pipeclose(struct pipe *cpipe) pipelock(cpipe, 0); } + pipeselwakeup(cpipe); /* * Disconnect from peer, if any. */ ppipe = cpipe->pipe_peer; if (ppipe->pipe_present == PIPE_ACTIVE) { - pipeselwakeup(ppipe); - ppipe->pipe_state |= PIPE_EOF; wakeup(ppipe); - KNOTE_LOCKED(>pipe_sel.si_note, 0); + pipeselwakeup(ppipe); } /* ___ 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: r360895 - stable/12/sys/kern
Author: markj Date: Mon May 11 15:17:57 2020 New Revision: 360895 URL: https://svnweb.freebsd.org/changeset/base/360895 Log: MFC r360378: Avoid returning POLLIN if the pipe descriptor is not open for reading. Modified: stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c == --- stable/12/sys/kern/sys_pipe.c Mon May 11 08:40:33 2020 (r360894) +++ stable/12/sys/kern/sys_pipe.c Mon May 11 15:17:57 2020 (r360895) @@ -1432,7 +1432,8 @@ pipe_poll(struct file *fp, int events, struct ucred *a if ((events & POLLINIGNEOF) == 0) { if (rpipe->pipe_state & PIPE_EOF) { - revents |= (events & (POLLIN | POLLRDNORM)); + if (fp->f_flag & FREAD) + revents |= (events & (POLLIN | POLLRDNORM)); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) revents |= POLLHUP; ___ 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: r360894 - in head/stand/i386: boot2 pxeldr zfsboot
Author: arichardson Date: Mon May 11 08:40:33 2020 New Revision: 360894 URL: https://svnweb.freebsd.org/changeset/base/360894 Log: Avoid using non-portable dd conv=osync option The same thing can be achieved using the bs=$SIZE and conv=sync options. Unlike conv=osync, conv=sync is support on both Linux and macOS. Reviewed By: imp, jhb (earlier version) Obtained from:CheriBSD Differential Revision: https://reviews.freebsd.org/D24788 Modified: head/stand/i386/boot2/Makefile head/stand/i386/pxeldr/Makefile head/stand/i386/zfsboot/Makefile Modified: head/stand/i386/boot2/Makefile == --- head/stand/i386/boot2/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/boot2/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -66,7 +66,7 @@ BOOT2SIZE=7680 boot2: boot2.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ Modified: head/stand/i386/pxeldr/Makefile == --- head/stand/i386/pxeldr/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/pxeldr/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync + ${DD} if=${.TARGET}.tmp of=${.TARGET} bs=2048 conv=sync rm ${.TARGET}.tmp LDFLAGS+=${LDFLAGS_BIN} Modified: head/stand/i386/zfsboot/Makefile == --- head/stand/i386/zfsboot/MakefileMon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/zfsboot/MakefileMon May 11 08:40:33 2020 (r360894) @@ -62,7 +62,7 @@ BOOT2SIZE=262144 zfsboot2: zfsboot.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ ___ 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: r360893 - stable/11/sbin/swapon
Author: delphij Date: Mon May 11 07:21:59 2020 New Revision: 360893 URL: https://svnweb.freebsd.org/changeset/base/360893 Log: MFC r360619: - Fix logic error in swapoff case: follow same handling of p and linelen in the swapon case. - Use strlcpy instead of strncpy. Modified: stable/11/sbin/swapon/swapon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/swapon/swapon.c == --- stable/11/sbin/swapon/swapon.c Mon May 11 07:20:37 2020 (r360892) +++ stable/11/sbin/swapon/swapon.c Mon May 11 07:21:59 2020 (r360893) @@ -527,8 +527,7 @@ swap_on_off_md(const char *name, char *mntops, int doi ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); errno = 0; ul = strtoul(linebuf, , 10); if (errno == 0) { @@ -583,14 +582,13 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, ); - if (p == NULL && - (linelen < 2 || linelen > sizeof(linebuf) - 1)) { + if (p == NULL || + (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (list) unexpected output"); ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); p = strchr(linebuf, ' '); if (p != NULL) *p = '\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: r360892 - stable/12/sbin/swapon
Author: delphij Date: Mon May 11 07:20:37 2020 New Revision: 360892 URL: https://svnweb.freebsd.org/changeset/base/360892 Log: MFC r360619: - Fix logic error in swapoff case: follow same handling of p and linelen in the swapon case. - Use strlcpy instead of strncpy. Modified: stable/12/sbin/swapon/swapon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/swapon/swapon.c == --- stable/12/sbin/swapon/swapon.c Mon May 11 07:01:10 2020 (r360891) +++ stable/12/sbin/swapon/swapon.c Mon May 11 07:20:37 2020 (r360892) @@ -548,8 +548,7 @@ swap_on_off_md(const char *name, char *mntops, int doi ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); errno = 0; ul = strtoul(linebuf, , 10); if (errno == 0) { @@ -604,14 +603,13 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, ); - if (p == NULL && - (linelen < 2 || linelen > sizeof(linebuf) - 1)) { + if (p == NULL || + (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (list) unexpected output"); ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); p = strchr(linebuf, ' '); if (p != NULL) *p = '\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: r360891 - stable/11/stand/libsa/zfs
Author: tsoome Date: Mon May 11 07:01:10 2020 New Revision: 360891 URL: https://svnweb.freebsd.org/changeset/base/360891 Log: MFC r360836: loader: vdev_read() can corrupt memory When reading less than sector size but from sector boundary, the vdev_read() will read full sector into the provided buffer and therefore corrupting memory past buffer end. Modified: stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/zfs/zfs.c == --- stable/11/stand/libsa/zfs/zfs.c Mon May 11 06:59:01 2020 (r360890) +++ stable/11/stand/libsa/zfs/zfs.c Mon May 11 07:01:10 2020 (r360891) @@ -417,7 +417,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void full_sec_size -= secsz; /* Return of partial sector data requires a bounce buffer. */ - if ((head > 0) || do_tail_read) { + if ((head > 0) || do_tail_read || bytes < secsz) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); @@ -441,14 +441,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void outbuf += min(secsz - head, bytes); } - /* Full data return from read sectors */ + /* +* Full data return from read sectors. +* Note, there is still corner case where we read +* from sector boundary, but less than sector size, e.g. reading 512B +* from 4k sector. +*/ if (full_sec_size > 0) { - res = read(fd, outbuf, full_sec_size); - if (res != full_sec_size) { - ret = EIO; - goto error; + if (bytes < full_sec_size) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, bytes); + } else { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; } - outbuf += full_sec_size; } /* Partial data return from last sector */ ___ 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: r360890 - stable/12/stand/libsa/zfs
Author: tsoome Date: Mon May 11 06:59:01 2020 New Revision: 360890 URL: https://svnweb.freebsd.org/changeset/base/360890 Log: MFC r360836: loader: vdev_read() can corrupt memory When reading less than sector size but from sector boundary, the vdev_read() will read full sector into the provided buffer and therefore corrupting memory past buffer end. Modified: stable/12/stand/libsa/zfs/zfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/zfs/zfs.c == --- stable/12/stand/libsa/zfs/zfs.c Mon May 11 06:09:18 2020 (r360889) +++ stable/12/stand/libsa/zfs/zfs.c Mon May 11 06:59:01 2020 (r360890) @@ -417,7 +417,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void full_sec_size -= secsz; /* Return of partial sector data requires a bounce buffer. */ - if ((head > 0) || do_tail_read) { + if ((head > 0) || do_tail_read || bytes < secsz) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); @@ -441,14 +441,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void outbuf += min(secsz - head, bytes); } - /* Full data return from read sectors */ + /* +* Full data return from read sectors. +* Note, there is still corner case where we read +* from sector boundary, but less than sector size, e.g. reading 512B +* from 4k sector. +*/ if (full_sec_size > 0) { - res = read(fd, outbuf, full_sec_size); - if (res != full_sec_size) { - ret = EIO; - goto error; + if (bytes < full_sec_size) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, bytes); + } else { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; } - outbuf += full_sec_size; } /* Partial data return from last sector */ ___ 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: r360889 - in head/sys/net: . route
Author: melifaro Date: Mon May 11 06:09:18 2020 New Revision: 360889 URL: https://svnweb.freebsd.org/changeset/base/360889 Log: Remove unused rnh_close callback from rtable & cleanup depends. rnh_close callbackes was used by the in[6]_clsroute() handlers, doing cleanup in the route cloning code. Route cloning was eliminated somewhere around r186119. Last callback user was eliminated in r186215, 11 years ago. Differential Revision:https://reviews.freebsd.org/D24793 Modified: head/sys/net/route.c head/sys/net/route/route_var.h Modified: head/sys/net/route.c == --- head/sys/net/route.cMon May 11 05:53:12 2020(r360888) +++ head/sys/net/route.cMon May 11 06:09:18 2020(r360889) @@ -426,11 +426,8 @@ sys_setfib(struct thread *td, struct setfib_args *uap) void rtfree(struct rtentry *rt) { - struct rib_head *rnh; KASSERT(rt != NULL,("%s: NULL rt", __func__)); - rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); - KASSERT(rnh != NULL,("%s: NULL rnh", __func__)); RT_LOCK_ASSERT(rt); @@ -445,18 +442,6 @@ rtfree(struct rtentry *rt) } /* -* On last reference give the "close method" a chance -* to cleanup private state. This also permits (for -* IPv4 and IPv6) a chance to decide if the routing table -* entry should be purged immediately or at a later time. -* When an immediate purge is to happen the close routine -* typically calls rtexpunge which clears the RTF_UP flag -* on the entry so that the code below reclaims the storage. -*/ - if (rt->rt_refcnt == 0 && rnh->rnh_close) - rnh->rnh_close((struct radix_node *)rt, >head); - - /* * If we are no longer "up" (and ref == 0) * then we can free the resources associated * with the route. @@ -1501,7 +1486,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in return (ENOBUFS); } rt->rt_flags = RTF_UP | flags; - rt->rt_fibnum = rnh->rib_fibnum; rt->rt_nhop = nh; /* Fill in dst */ Modified: head/sys/net/route/route_var.h == --- head/sys/net/route/route_var.h Mon May 11 05:53:12 2020 (r360888) +++ head/sys/net/route/route_var.h Mon May 11 06:09:18 2020 (r360889) @@ -50,7 +50,6 @@ struct rib_head { rn_lookup_f_t *rnh_lookup;/* exact match for sockaddr */ rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ - rn_close_t *rnh_close; /*do something when the last ref drops*/ rnh_preadd_entry_f_t*rnh_preadd;/* hook to alter record prior to insertion */ rt_gen_trnh_gen;/* generation counter */ int rnh_multipath; /* multipath capable ? */ @@ -144,7 +143,6 @@ struct rtentry { int rt_flags; /* up/down?, host/net */ int rt_refcnt; /* # held references */ - u_int rt_fibnum; /* which FIB */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ #definert_endzero rt_mtx ___ 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"