summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MFC r311525:kib2017-01-134-28/+54
| | | | Lock tmpfs node tn_status updates done under the shared vnode lock.
* MFC r311524:kib2017-01-131-15/+15
| | | | Use vnode lock assertion expression, assert exclusive ownership.
* MFC r311523:kib2017-01-131-22/+0
| | | | Remove dead code.
* MFC r310718:amdmi32017-01-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | bzip2 does not exit after showing license as requested with --version or --license as most apps would do, instead it waits for data to compress on stdin. Because of that, if `bzip2 --version' is called, bogus `bzip2: I won't write compressed data to a terminal' error message will be displayed, and checking for bzip2 version in scripts as in bzip2 --version 2>&1 | grep -o "Version [^,]*" will hand as bzip2 would wait for data to compress on stdin. Fix this by exiting right after showing version/license text. I've tried to push this upstream for more than a year, but author is unresponsive, so upstream may be considered dead. Ubuntu applies similar fix, for the note. PR: 199443 Approved by: dim, bapt Differential Revision: D8924
* MFC r311381:ngie2017-01-131-6/+4
| | | | | | | | | | | | lsock_init_port: address issues with initializing sockaddr_un object - Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*]. - Use SUN_LEN(..) instead of spelling out calculation longhand (inspired by comment by jmallett). Tested with: dgram and stream support with both bsnmpwalk and snmpwalk CID: 1006825
* MFC r310586,r310587,r310588:ngie2017-01-134-180/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r310586: Refactor transport sources a bit to facilitate changes coming down pipeline Add recv callback to transport layer to better facilitate code reuse and readability and for symmetry with send callback. Move recv_dgram and recv_stream to udp_recv and lsock_recv, respectively, and make the beforementioned functions recv callbacks for the udp and lsock transports, respectively. Consolidate the check_priv* functions in their relevant trans*.c source to limit scope/use. Note: this code is roughly based content from the submitter, although this was modified to be more of a direct move from snmpd/main.c to the trans_*.c sources, and to reduce unnecessary static function declarations. r310587: Fix definition for recv_dgram(..); it should be "ssize_t", not "int" I'm not sure why this wasn't flagged as an issue by the compiler, yet r310588: Fix return type for `ret` (recv callback) and sort variables by alignment Again, for reasons I don't yet understand, this is not being flagged by the compiler. Unlike the issue addressed in r310587, this problem existed prior to r310586
* MFC r311739:ngie2017-01-137-8/+8
| | | | | | Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH
* MFC r311378:ngie2017-01-131-3/+2
| | | | | | | | | | | lm_load: fix string copying issues - Ensure `section` doesn't overrun section by using strlcpy instead of strcpy [*]. - Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity, but is an opportunistic change). CID: 1006826 [*]
* MFC r311390:ngie2017-01-131-1/+4
| | | | | | snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails CID: 1017276
* MFC r310892,r310894,r310989:ngie2017-01-131-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r310892: Don't call snmp_pdu_free(..) until finished with the pdu and when ready to allocate a new one via snmp_pdu_create(..) This fixes bsnmpwalk, so it no longer crashes after r310729 r310894: snmp_pdu_free the right object at the right time in snmptool_walk r310892 was on the right track, but unfortunately it was resolving the problem incorrectly and accidentally leaking memory in the process. - Call snmp_pdu_free on req before calling snmp_pdu_create on it at the bottom of the outer while loop - Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create in the inner loop r310989: Call snmp_pdu_free on req/resp with a consistent, correct pattern - snmp_pdu_free should be called before snmp_pdu_create is called again - snmp_pdu_free should be called on the resp to snmp_dialog when successful Tested with the following bsnmp commands: % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0" % bsnmpset $SNMP_ARGS sysLocation="MyAgent" % bsnmpget $SNMP_ARGS sysLocation % bsnmpwalk $SNMP_ARGS
* MFC r310729:ngie2017-01-131-1/+5
| | | | | | | | | | | | Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that could happen if a pdu was reused after calling the function, and as both stack and heap allocation types are used in contrib/bsnmp and usr.sbin/bsnmpd. snmp_value_free: NULL out value->v.octetstring.octets after calling free on it to prevent a double-free from occurring.
* MFC r311733:ngie2017-01-131-6/+6
| | | | Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)
* MFC r311290,r311293,r311294:ngie2017-01-131-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | r311290: Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name to avoid buffer overflows CID: 1006735, 1006737, 1006738 r311293: bridge_do_pfctl: allocate mib_name dynamically using asprintf This is being done to reduce wasted space, simplify complexity in the code, and to quell a Coverity warning about buffer overruns. warning about buffer overruns. CID: 1006736 r311294: style cleanup - bridge_pf_dump: use nitems instead of spelling it out longhand - bridge_do_pfctl: sort variables by alignment for type
* MFC r311282:ngie2017-01-131-1/+3
| | | | | | snmp_mibII(3) requires net/if.h and net/if_mib.h Document that requirement
* MFC r311268:ngie2017-01-131-0/+6
| | | | | | | | | | | | | | Clarify lifetime of child(..) function Ensure child exits when complete as it's always run in a forked process. Add a missing break statement in :pselect_sigmask when calling child(..) for clarity and to avoid weird domino effects if the child process somehow does something it's not supposed to do with the logfiles, file descriptors, etc CID: 1223369, 1223370, 1300301
* MFC r311265,r311274:ngie2017-01-132-0/+30
| | | | | | | | | | | | | | | | | | r311265: fpu: ensure calls to pthread_create succeed and test sched_yield to make sure it returns 0 sched_yield tests for values returning 0 of type int and sched_yield is of type long, so the test is a mismatch CID: 1254953, 1254954, 1254965, 1254966 r311274: run: ensure pthread_condattr_{init,setclock} is successful CID: 1268631, 1268633
* MFC r311715:ngie2017-01-131-13/+13
| | | | Use nitems({mib,name}) instead of hardcoding their value
* MFC r311709:ngie2017-01-131-6/+6
| | | | | | | Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib`
* MFC r311714:ngie2017-01-134-12/+12
| | | | | | | lib/libutil/kinfo_*: style cleanup - Use nitems(mib) instead of hardcoding mib's length - Sort sys/ #includes
* MFC r311870:ngie2017-01-131-3/+3
| | | | Merge the grammar fix for lib/libc/gen/raise_test:raise_stress
* MFC r311871:ngie2017-01-131-5/+3
| | | | | | Merge ^/vendor/NetBSD/tests/dist@r311868 This is the vendor accepted version of ^/head@r311245
* MFC r311511:ngie2017-01-131-0/+22
| | | | | | | Add integration makefile for contrib/bsnmp/gensnmpdef It's a whole lot less error prone than generating the file completely by hand.
* MFC r311711,r311712,r311713:ngie2017-01-131-53/+49
| | | | | | | | | | | | | | r311711: Clean up trailing whitespace r311712: Sort #includes r311713: Use nitems(mib) instead of hardcoding mib's length
* MFC r311710:ngie2017-01-131-4/+4
| | | | | | | Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length
* MFC r311548:ngie2017-01-131-1/+1
| | | | | | | | | | | | Carry over r311520 to tools/build/options/WITHOUT_USB_GADGET_EXAMPLES Discussed with: wblock r311520: Fix src.conf(5) description of WITHOUT_USB_GADGET_EXAMPLES. PR: 215831
* MFC r311701:loos2017-01-131-5/+12
| | | | | | | Convert gpioc to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. This was inspired on r311700.
* MFC r311700:loos2017-01-131-6/+13
| | | | | | | | Convert etherswitch to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. Suggested by: kib Sponsored by: Rubicon Communications, LLC (Netgate)
* MFC r310707:loos2017-01-131-1/+1
| | | | | | | | | | | Fix the parsing of NPt binat rules. In this specific case the src address can be set to any, which was not accepted prior to this commit. pfSense bug report: https://redmine.pfsense.org/issues/6985 Reviewed by: kp Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate)
* MFC 303946:jhb2017-01-123-43/+0
| | | | Remove files unused after pulling system call names from libsysdecode.
* MFC 307538,307948,308602,308603,311151: Move kdump's mksubr into libsysdecode.jhb2017-01-1247-1134/+2725
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 307538: Move mksubr from kdump into libsysdecode. Restructure this script so that it generates a header of tables instead of a source file. The tables are included in a flags.c source file which provides functions to decode various system call arguments. For functions that decode an enumeration, the function returns a pointer to a string for known values and NULL for unknown values. For functions that do more complex decoding (typically of a bitmask), the function accepts a pointer to a FILE object (open_memstream() can be used as a string builder) to which decoded values are written. If the function operates on a bitmask, the function returns true if any bits were decoded or false if the entire value was valid. Additionally, the third argument accepts a pointer to a value to which any undecoded bits are stored. This pointer can be NULL if the caller doesn't care about remaining bits. Convert kdump over to using decoder functions from libsysdecode instead of mksubr. truss also uses decoders from libsysdecode instead of private lookup tables, though lookup tables for objects not decoded by kdump remain in truss for now. Eventually most of these tables should move into libsysdecode as the automated table generation approach from mksubr is less stale than the static tables in truss. Some changes have been made to truss and kdump output: - The flags passed to open() are now properly decoded in that one of O_RDONLY, O_RDWR, O_WRONLY, or O_EXEC is always included in a decoded mask. - Optional arguments to open(), openat(), and fcntl() are only printed in kdump if they exist (e.g. the mode is only printed for open() if O_CREAT is set in the flags). - Print argument to F_GETLK/SETLK/SETLKW in kdump as a pointer, not int. - Include all procctl() commands. - Correctly decode pipe2() flags in truss by not assuming full open()-like flags with O_RDONLY, etc. - Decode file flags passed to *chflags() as file flags (UF_* and SF_*) rather than as a file mode. - Fix decoding of quotactl() commands by splitting out the two command components instead of assuming the raw command value matches the primary command component. In addition, truss and kdump now build without triggering any warnings. All of the sysdecode manpages now include the required headers in the synopsis. 307948: Use binary and (&) instead of logical to extract the mask of a capability. 308602: Generate and use a proper .depend file for tables.h. 308603: Move libsysdecode-specific hack out of buildworld. This should fix the lib32 build since it was not removing the generated ioctl.c. This file is generated by a find(1) call, so cannot use normal dependency tracking methods. 311151: Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'. As a followup to r310638, update libsysdecode (and kdump) to decode the 'mode' argument to getfsstat(). sysdecode_getfsstat_flags() has been renamed to sysdecode_getfsstat_mode() and now treats the argument as an enumerated value rather than a mask of flags.
* MFC r310118asomers2017-01-121-1/+1
| | | | | | | | Fix ls_tests:o_flag with ZFS TMPDIR Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is updated. The test must explicitly clear uarch to be portable across filesystems. Also, it doesn't need to run as root.
* MFC r311762: Fix typo.delphij2017-01-121-1/+1
|
* MFC 311224gnn2017-01-121-1/+1
| | | | | | | Fix PMC architecture check to handle later IPAs including Skylake Tested with tools/test/hwpmc/pmctest.py Obtained from: Oliver Pinter
* MFC r311452:kib2017-01-1213-174/+259
| | | | Do not allocate struct statfs on kernel stack.
* MFC r311447:kib2017-01-122-3/+4
| | | | Some style fixes for getfstat(2)-related code.
* MFC r311453hiren2017-01-121-0/+5
| | | | | | | sysctl net.inet.tcp.hostcache.list in a jail can see connections from other jails and the host. This commit fixes it. PR: 200361
* MFC r311706:bapt2017-01-111-60/+162
| | | | Update pciids to 2017.01.08
* MFC r311688:dim2017-01-111-1/+1
| | | | | | | | | | | | | | | | | Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg Differential Revision: https://reviews.freebsd.org/D9093
* MFC r311570:dim2017-01-111-2/+2
| | | | | | | | | In tcpdump's print-tcp.c, avoid increasing alignment when taking the addresses of members of struct ip, which is packed. Since the pointers are only used for memcmp'ing, they can be pointing to void instead. Note that upstream has removed the src and dst variables, in the mean time.
* MFC r311649:dim2017-01-111-1/+1
| | | | | | | | | | | | | Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c: contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!ifmr.ifm_status & IFM_AVALID) { ^ ~ Obviously, the masking needs to be done before the logical not operation. Add parentheses to make it so.
* MFC r311530:dim2017-01-111-2/+5
| | | | | | | | | | | | | | | | Fix clang 4.0.0 warnings about taking the address of a packed member of struct ip in ping(8): sbin/ping/ping.c:1684:53: error: taking address of packed member 'ip_src' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); ^~~~~~~~~~~~~~~~~ sbin/ping/ping.c:1685:53: error: taking address of packed member 'ip_dst' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); ^~~~~~~~~~~~~~~~~
* MFC r311565:dim2017-01-113-1/+3
| | | | | | | | | | | | Link llvm-ar to llvm-ranlib, if WITH_CLANG_EXTRAS is enabled. When invoked as llvm-ranlib, it can create an archive symbol table for archives of objects compiled for LTO by an LLVM compiler. Submitted by: Dan McGregor <danismostlikely@gmail.com> MFC r311806: After r311565, also remove llvm-ranlib from ObsoleteFiles.inc.
* MFC r311287:kib2017-01-111-19/+35
| | | | | __vdso_gettc(): be extra careful with /dev/hpet mappings, never unmap the mapping which might be accessed by other threads.
* MFC r310703:mav2017-01-111-2/+3
| | | | | | | Pass proper arguments (handles, not directly structure pointers) to scif_cb_domain_device_removed(). This should fix NULL dereference on task management function timeout.
* MFC r311914: MFV r311913:delphij2017-01-118-15/+55
| | | | | | | Fix multiple OpenSSH vulnerabilities. Submitted by: des Approved by: so
* MFC r310702: btxldr: process all PT_LOAD segments, not just the first twoemaste2017-01-111-7/+1
| | | | | | | | | With default settings GNU ld generates two PT_LOADs for loader.sym while LLD generates three, because it creates a rodata segment. Previously btxldr terminated phdr processing after two PT_LOADs. Remove the early termination to process all PT_LOADs. Sponsored by: The FreeBSD Foundation
* MFC 307060: Fix printf format warning.jhb2017-01-101-2/+2
|
* MFC r309252: Add more ASMedia PCI IDs from different sources.mav2017-01-101-2/+9
| | | | Exact device names are not clear, but its better then nothing at all.
* MFC r309251: Process port interrupt even is PxIS register is zero.mav2017-01-101-4/+0
| | | | | | | ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too.
* MFC r310258:ae2017-01-102-22/+46
| | | | | | | | | | | ip[6]_tryforward does inbound and outbound packet firewall processing. This can lead to change of mbuf pointer (packet filter could do m_pullup(), NAT, etc). Also in case of change of destination address, tryforward can decide that packet should be handled by local system. In this case modified mbuf can be returned to the ip[6]_input(). To handle this correctly, check M_FASTFWD_OURS flag after return from ip[6]_tryforward. And if it is present, update variables that depend from mbuf pointer and skip another inbound firewall processing.
OpenPOWER on IntegriCloud