summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2019-11-08Add support to iwm(4) for ADD_STA commands used by newer firmware.Stefan Sperling
Tested by phessler@, Tracey Emery, and myself on 8260 and 8265.
2019-11-08The u_long fields in struct disk_parms (secsize, heads, cyls, sectors)Kenneth R Westerback
are always initializd to u_int32_t values. And are then copied into u_int32_t fields in the disklabel. Switch them to u_int32_t. Cluebats and ok deraadt@ jca@
2019-11-08Substitute boolean_t/TRUE/FALSE/db_addr_t by int/1/0/vaddr_t.Martin Pieuchot
Tested by miod@, ok aoyama@
2019-11-08void being too clever about setting/clearing ifpromisc on the parent.David Gwynne
ifpromisc() already refcounts, so carp doesn't have to do it implicitly with the carpdev list. there's no functional change, the code just gets a bit simpler.
2019-11-08convert interface address change hooks to tasks and a task_list.David Gwynne
this follows what's been done for detach and link state hooks, and makes handling of hooks generally more robust. address hooks are a bit different to detach/link state hooks in that there's only a few things that register hooks (carp, pf, vxlan), but a lot of places to run the hooks (lots of ipv4 and ipv6 address configuration). an address hook cookie was in struct pfi_kif, which is part of the pf abi. rather than break pfctl -sI, this maintains the void * used for the cookie and uses it to store a task, which is then used as intended with the new api.
2019-11-08Add support for button 2 and 3 to imt(4).YASUOKA Masahiko
ok jcs
2019-11-07Remove get_pc_str_offset(), which has been unused since we switchedPatrick Wildt
to clang, where the stack frame format changed significantly. Prompted by guenther@ noticing deprecated ASM warnings ok drahn@
2019-11-07The compiler -pg option implies -fno-ret-protector, as we want to disablePhilip Guenther
retguard and similar when profiling. However, that missed all the .S files, as ${PROF} wasn't added when ${NORMAL_S} was converted from direct invocation of ${AS} to instead use ${CC}. Similarly, mcount.o still had retguards as it cannot be built with -pg. So: pass ${PROF} when compiling .S files, and compile "no profiling" files with -fno-ret-protector on archs with retguard. feedback and ok mpi@ mortimer@
2019-11-07sd_size() is a wrapper around sd_read_cap_10() and sd_read_cap_16() soKenneth R Westerback
rename it sd_read_cap(). Reduces possible confusion with the unrelated sdsize().
2019-11-07db_addr_t -> vaddr_tMartin Pieuchot
2019-11-07Substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
2019-11-07adjfreq(2): fix atomic swapcheloha
I broke adjfreq(2)'s atomic swap in kern_time.c,v1.112. By using the "f" variable to store both the new and old frequency adjustments, the new adjustment gets clobbered by the old adjustment if the caller asked for a swap. ok visa@ mpi@
2019-11-07Convert db_addr_t -> vaddr_t but leave the typedef for now.Martin Pieuchot
2019-11-07db_addr_t -> vaddr_t, missed in previous.Martin Pieuchot
ok deraadt@
2019-11-07Do propper kernel input validation for in_control() ioctl(2)Alexander Bluhm
SIOCGIFADDR, SIOCGIFNETMASK, SIOCGIFDSTADDR, SIOCGIFBRDADDR, SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFDSTADDR, and SIOCSIFBRDADDR. Name in_ioctl_set_ifaddr() consistently. Use in_sa2sin() to validate inet address. Combine if_addrlist loops and add comment. Although netmask is not a inet address, length must be valid. Reported-by: syzbot+5fc6da002fc4e8d994be@syzkaller.appspotmail.com OK visa@
2019-11-07Substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
2019-11-07db_addr_t -> vaddr_tMartin Pieuchot
ok deraadt@
2019-11-07Showing kernel WEP keys to userland has been disabled in genericAlexander Bluhm
ieee80211 ioctl(2) implementation. Do the same for the driver specific code of ac(4) and wi(4) wireless network devices. OK mpi@
2019-11-07Only root is allowed to set the WEP key. Add an suser() check toAlexander Bluhm
enforce this for the an(4) wireless network device. found by Ilja Van Sprundel; OK dlg@ deraadt@ mpi@
2019-11-07remove the detach and linkstate hooks when the parent is going away.David Gwynne
i think this is a fix for a real bug. pfsync leaked the hooks it had on a parent^Wsyncdev when the parent went away. now there's KASSERTs to make sure all hooks are removed before an interface goes away, the leak caused the KASSERTs to fire and made the bug obvious. found by hrvoje popovski
2019-11-07Avoid NULL dereference in arpinvalidate() and nd6_invalidate() byKenneth R Westerback
making RTM_INVALIDATE code path perform same check as RTM_DELETE does. ok mpi@
2019-11-07ANSIfy & substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
ok jasper@, deraadt@
2019-11-07Substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
ok dlg@, jasper@
2019-11-07FALSE -> 0, missed in previous.Martin Pieuchot
Spotted by deraadt@
2019-11-07move the port destructor calls in clone destroy back out of NET_LOCK.David Gwynne
it's no longer necessary to hold NET_LOCK to call interface hook adds or dels now, but it is necessary not to hold NET_LOCK when calling some barrier functions. found by hrvoje popovski
2019-11-07serialise hook adds and dels with a mutex instead of an implicit NET_LOCK.David Gwynne
i had NET_ASSERT_LOCKED() in the hook add and remove operations, because that's what's held when the hooks are run. some callers do not hold the NET_LOCK when calling them though, eg, bridge(4). aggr and tpmr used to not hold NET_LOCK while being destroyed, which also caused the asserts to fire, so i moved the port destroys inside NET_LOCK, but now I have deadlocks with some barrier calls. the hooks having their own lock means callers don't have to hold NET_LOCK and the list will stay sane. the code that runs the hooks gives up the mutex when calling the hook, but keeps track of where it's up to bey putting a cursor in the list. there's a single global mutex for all the interface linkstate and detach hooks, but this stuff isn't a hot path by any stretch of the imagination. based on (a lot of) testing by hrvoje popovski. thank you.
2019-11-07turn the linkstate hooks into a task list, like the detach hooks.David Gwynne
this is largely mechanical, except for carp. this moves the addition of the carp link state hook after we're committed to using the new interface as a carpdev. because the add can't fail, we avoid a complicated unwind dance. also, this tweaks the carp linkstate hook so it only updates the relevant carp interface, not all of the carpdevs on the parent. hrvoje popovski has tested an early version of this diff and it's generally ok, but there's some splasserts that this diff fires that i'll fix in an upcoming diff. ok claudio@
2019-11-06Make udl(4) and uts(4) compile again in debug mode by fixing IOCGROUPMarcus Glocker
and IOCPARM_LEN macros types.
2019-11-06Use atomic operations consistently while writing to kubsan_slot.anton
Otherwise, reports might go by unnoticed. Prodded by and ok visa@
2019-11-06Pull break into ifdef; noticed by bluhm who also OK'ed the previousFlorian Obser
commit.
2019-11-06Make iwn(4) flush remaining frames on the Tx aggregation queue whenStefan Sperling
Tx aggregation is stopped. Fixes a bug where outstanding frames on the aggregation queue interfere with roaming to another AP. net80211 will only roam once all outstanding frames destined for the old AP have been sent, i.e. once that AP node's Tx refcount goes to 0. Any outstanding frames sitting in the Tx aggregation queue, waiting to be ACKed, will keep this refcount above zero. To make roaming work reliably in combination with Tx aggregation, the driver must ensure that ieee80211_release_node() gets called for each frame on the queue when Tx aggregation is stopped. Problem observed by tobhe@ Fix tested + ok tobhe@ jca@
2019-11-06Fix RTA_DNS checks:Florian Obser
Do not overwrite the address family, we need to know if this is IPv4 or IPv6 to parse the message. Nameservers are IP addresses, not NUL-terminated strings. Check that the length is a multiple of the length of an IP address. OK krw
2019-11-06Raise net80211's "beacon miss" threshold to avoid frequent re-connectsStefan Sperling
to APs that are relatively far away and suffer some packet loss. The former threshold was 7 beacons (about 700 ms). This raises the threshold to 30 beacons (about 3 seconds). Should still be good enough for detecting APs that have disappeared, and makes wifi networks provided by the University of Bucharest more reliable in the p2k19 hackroom. While here, make 'ifconfig iwm0/iwn0 debug' print an obvious message when we believe that the AP has disappeared. Problem reported and fix tested by landry@ / pirofti@ ok mpi@ sthen@
2019-11-06Substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
ok dlg@, jasper@
2019-11-06ANSIfy functions and get rid of boolean_t.Martin Pieuchot
ok dlg@, jasper@
2019-11-06Substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
ok dlg@, jasper@, anton@
2019-11-06replace the hooks used with if_detachhooks with a task list.David Gwynne
the main semantic change is that things registering detach hooks have to allocate and set a task structure that then gets added to the list. this means if the task is allocated up front (eg, as part of carps softc or bridges port structure), it avoids the possibility that adding a hook can fail. a lot of drivers weren't checking for failure, and unwinding state in the event of failure in other parts was error prone. while doing this i discovered that the list operations have to be in a particular order, but drivers weren't doing that consistently either. this diff wraps the list ops up so you have to seriously go out of your way to screw them up. ive also sprinkled some NET_ASSERT_LOCKED around the list operations so we can make sure there's no potential for the list to be corrupted, especially while it's being run. hrvoje popovski has tested this a bit, and some issues he discovered have been fixed. ok sashan@
2019-11-05Remove mpls_inkloop and the corresponding sysctl net.mpls.maxloop_inkernel.Claudio Jeker
The value is no longer needed since the MPLS code got refactored some time ago. Found by Thomas Habets (thomas (at) habets se)
2019-11-05Kill uvm_deallocate(9) and use uvm_unmap() directly.Martin Pieuchot
ok kettenis@, semarie@, deraadt@
2019-11-05Give some END()s to assembly symbols.Martin Pieuchot
ok kettenis@, jca@
2019-11-04remove mobileip(4)David Gwynne
noone seems to use it, and we should not encourage people to use it by having it available. it's been disabled for most of the last release and noones asked for it in 6.6, so i'm taking that as an ok for this removal.
2019-11-04Restore the old way of dispatching dead procs through idle proc.Visa Hankala
The new way needs more thought.
2019-11-04Regularly poll and report kubsan findings using the timeout(9) APIanton
instead of task(9). Undefined behavior can potentially be present in any context and calling task_add() isn't always safe. ok visa@
2019-11-04Add ogx(4), a driver for the OCTEON III network processor.Visa Hankala
This network driver covers higher-end models of the OCTEON III family. They have a modified design whose interface is not compatible with the lower-end models or earlier chip generations. The code is still a work in progress. However, it is capable enough to make the SGMII port functional on the CN7360. No objection from deraadt@
2019-11-04Switch iwm 3160, 7260, and 7265 to -17 firmware images.Stefan Sperling
7260 tested by florian 7265 tested by kettenis 3160 should work as it's a trimmed-down variant of 7260 Please report any problems as soon as possible.
2019-11-04Make iwm send the DQA command later, as Linux does. We were sending it toStefan Sperling
the init firmware which does not need it. The main runtime firmware needs it. This actually enables DQA mode, and two further problems showed up: 1) Correctly configure the AUX station queue in the DQA case. 2) Always transmit our own frames via the AP's station. The AUX station is meant to be used for firmware-generated frames only. Tested on 7260, 7265, and 8265 with standard -current firmware images. Required for newer firmware versions. ok patrick@
2019-11-04Don't send the BT coex config command to iwm 8k init firmware because newerStefan Sperling
firmware versions will crash when we do that. Debugged together with patrick. ok patrick@
2019-11-04iwm API version -31 firmware and up will crash after load unless the driverStefan Sperling
explicitly enables support for 31 queues in the GP_CTRL register. Coincidence? Accident? Bad joke? In any case this took us several days to figure out; the root cause was eventually identified by patrick@ ok patrick@
2019-11-04Fix handling of iwm_sf_config() input argument.Stefan Sperling
Same change as dragonfly commit 666737f64b4f6dd42ffd9f0ace9fc46ccc1ebaab ok patrick@
2019-11-04Ignore FW_DBG_DEST and FW_DBG_CONF iwm firmware image TLV sections, for now.Stefan Sperling
ok patrick@