Linux 4.9.217
Greg KH
maintainerI'm announcing the release of the 4.9.217 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/filesystems/porting | 7 + Documentation/kernel-parameters.txt | 4 Makefile | 2 arch/arc/include/asm/linkage.h | 2 arch/arm/kernel/vdso.c | 2 arch/arm/lib/copy_from_user.S | 2 arch/x86/events/amd/uncore.c | 14 +- arch/x86/kvm/emulate.c | 1 drivers/acpi/acpi_watchdog.c | 12 +- drivers/block/virtio_blk.c | 8 - drivers/firmware/efi/efivars.c | 32 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 3 drivers/hid/hid-apple.c | 3 drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 8 + drivers/iommu/dmar.c | 21 ++- drivers/iommu/intel-iommu.c | 13 +- drivers/net/bonding/bond_alb.c | 20 +-- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 drivers/net/ethernet/freescale/fec_main.c | 6 - drivers/net/ethernet/micrel/ks8851_mll.c | 14 +- drivers/net/ipvlan/ipvlan_core.c | 19 +-- drivers/net/ipvlan/ipvlan_main.c | 5 drivers/net/macsec.c | 12 +- drivers/net/macvlan.c | 2 drivers/net/phy/phy_device.c | 18 +-- drivers/net/slip/slhc.c | 14 +- drivers/net/team/team.c | 2 drivers/net/usb/r8152.c | 6 + drivers/net/wireless/marvell/mwifiex/tdls.c | 70 +++++++++++- fs/cifs/dir.c | 1 fs/gfs2/inode.c | 2 fs/jbd2/transaction.c | 8 - fs/nfs/dir.c | 2 fs/open.c | 3 include/linux/phy.h | 2 include/net/fib_rules.h | 1 kernel/cgroup.c | 4 kernel/signal.c | 23 ++-- kernel/workqueue.c | 14 +- mm/memcontrol.c | 4 mm/slub.c | 9 + net/batman-adv/bat_iv_ogm.c | 105 +++++++++++++++---- net/batman-adv/bat_v.c | 25 ++-- net/batman-adv/bat_v_elp.c | 22 ++- net/batman-adv/bat_v_ogm.c | 42 ++++++- net/batman-adv/debugfs.c | 40 +++++++ net/batman-adv/debugfs.h | 11 + net/batman-adv/distributed-arp-table.c | 5 net/batman-adv/fragmentation.c | 22 ++- net/batman-adv/gateway_client.c | 11 + net/batman-adv/gateway_common.c | 5 net/batman-adv/hard-interface.c | 51 +++++++-- net/batman-adv/originator.c | 4 net/batman-adv/originator.h | 4 net/batman-adv/routing.c | 11 + net/batman-adv/soft-interface.c | 1 net/batman-adv/translation-table.c | 149 ++++++++++++++++++++++----- net/batman-adv/types.h | 22 +++ net/core/netclassid_cgroup.c | 47 ++++++-- net/ieee802154/nl_policy.c | 6 + net/ipv4/cipso_ipv4.c | 7 + net/ipv4/gre_demux.c | 12 +- net/ipv6/addrconf.c | 4 net/ipv6/ipv6_sockglue.c | 10 + net/mac80211/rx.c | 2 net/netfilter/nfnetlink_cthelper.c | 2 net/nfc/hci/core.c | 19 ++- net/nfc/netlink.c | 3 net/sched/sch_fq.c | 1 net/wireless/nl80211.c | 5 net/wireless/reg.c | 2 71 files changed, 808 insertions(+), 241 deletions(-)
Al Viro (2):
cifs_atomic_open(): fix double-put on late allocation failure gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
Colin Ian King (1):
drm/amd/display: remove duplicated assignment to grph_obj_type
Dan Carpenter (1):
net: nfc: fix bounds checking bugs on "pipe"
Daniel Drake (1):
iommu/vt-d: Ignore devices with out-of-spec domain number
David S. Miller (1):
phy: Revert toggling reset changes.
Dmitry Bogdanov (1):
net: macsec: update SCI upon MAC address change.
Dmitry Yakunin (1):
cgroup, netclassid: periodically release file_lock on classid updating
Eric Dumazet (5):
gre: fix uninit-value in __iptunnel_pull_header
ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast()
slip: make slhc_compress() more robust against malicious packets bonding/alb: make sure arp header is pulled before accessing it
ipv6: restrict IPV6_ADDRFORM operation
Eugeniy Paltsev (1):
ARC: define __ALIGN_STR and __ALIGN symbols for ARC
Florian Fainelli (2):
net: phy: Avoid multiple suspends
ARM: 8957/1: VDSO: Match ARMv8 timer in cntvct_functional()
Greg Kroah-Hartman (1):
Linux 4.9.217
Halil Pasic (1):
virtio-blk: fix hw_queue stopped on arbitrary error
Hangbin Liu (1):
ipv6/addrconf: call ipv6_mc_up() for non-Ethernet interface
Hans de Goede (2):
iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint iommu/vt-d: dmar: replace WARN_TAINT with pr_warn + add_taint
Heiner Kallweit (1):
net: phy: fix MDIO bus PM PHY resuming
Hillf Danton (1):
workqueue: don't use wq_select_unbound_cpu() for bound works
Jakub Kicinski (14):
fib: add missing attribute validation for tun_id
nl802154: add missing attribute validation
nl802154: add missing attribute validation for dev_type
macsec: add missing attribute validation for port
net: fq: add missing attribute validation for orphan mask
team: add missing attribute validation for port ifindex
team: add missing attribute validation for array index
nfc: add missing attribute validation for SE API
nfc: add missing attribute validation for vendor subcommand
net: fec: validate the new settings in fec_enet_set_coalesce()
nl80211: add missing attribute validation for critical protocol indication
nl80211: add missing attribute validation for beacon report scanning
nl80211: add missing attribute validation for channel switch
netfilter: cthelper: add missing attribute validation for cthelper
Jann Horn (1):
mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
Jean Delvare (1):
ACPI: watchdog: Allow disabling WDAT at boot
Jiri Wiesner (1):
ipvlan: do not add hardware address of master to its unicast filter list
Johannes Berg (1):
cfg80211: check reg_rule for NULL in handle_channel_custom()
Kai-Heng Feng (1):
HID: i2c-hid: add Trekstor Surfbook E11B to descriptor override
Kees Cook (1):
ARM: 8958/1: rename missed uaccess .fixup section
Kim Phillips (1):
perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag
Linus Lüssing (5):
batman-adv: Fix transmission of final, 16th fragment
batman-adv: fix TT sync flag inconsistencies
batman-adv: Fix TT sync flags for intermediate TT responses
batman-adv: Avoid storing non-TT-sync flags on singular entries too
batman-adv: Fix multicast TT issues with bogus ROAM flags
Linus Torvalds (1):
signal: avoid double atomic counter increments for user accounting
Madhuparna Bhowmik (1):
mac80211: rx: avoid RCU list traversal under mutex
Mahesh Bandewar (3):
ipvlan: add cond_resched_rcu() while processing muticast backlog
ipvlan: don't deref eth hdr before checking it's set
macvlan: add cond_resched() during multicast processing
Mansour Behabadi (1):
HID: apple: Add support for recent firmware on Magic Keyboards
Marek Lindner (1):
batman-adv: prevent TT request storms by not sending inconsistent TT TLVLs
Marek Vasut (1):
net: ks8851-ml: Fix IRQ handling and locking
Matteo Croce (1):
ipv4: ensure rcu_read_lock() in cipso_v4_error()
Matthias Schiffer (1):
batman-adv: update data pointers after skb_cow()
Paolo Abeni (1):
ipvlan: egress mcast packets are not exceptional
Petr Malat (1):
NFS: Remove superfluous kmap in nfs_readdir_xdr_to_array
Qian Cai (1):
jbd2: fix data races at struct journal_head
Shakeel Butt (1):
cgroup: memcg: net: do not associate sock with unrelated cgroup
Sven Eckelmann (20):
batman-adv: Fix double free during fragment merge error
batman-adv: Initialize gw sel_class via batadv_algo
batman-adv: Fix rx packet/bytes stats on local ARP reply
batman-adv: Use default throughput value on cfg80211 error
batman-adv: Accept only filled wifi station info
batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation
batman-adv: Always initialize fragment header priority
batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
batman-adv: Fix lock for ogm cnt access in batadv_iv_ogm_calc_tq
batman-adv: Fix internal interface indices types
batman-adv: Avoid race in TT TVLV allocator helper
batman-adv: Fix debugfs path for renamed hardif
batman-adv: Fix debugfs path for renamed softif
batman-adv: Prevent duplicated gateway_node entry
batman-adv: Fix duplicated OGMs on NETDEV_UP
batman-adv: Avoid free/alloc race when handling OGM2 buffer
batman-adv: Avoid free/alloc race when handling OGM buffer
batman-adv: Don't schedule OGM for disabled interface
batman-adv: Avoid probe ELP information leak
batman-adv: Use explicit tvlv padding for ELP packets
Vasundhara Volam (1):
bnxt_en: reinitialize IRQs when MTU is modified
Vitaly Kuznetsov (1):
KVM: x86: clear stale x86_emulate_ctxt->intercept value
Vladis Dronov (2):
efi: Fix a race and a buffer overflow while reading efivars via sysfs
efi: Add a sanity check to efivar_store_raw()
Yonghyun Hwang (1):
iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page
You-Sheng Yang (1):
r8152: check disconnect status after long sleep
Zhenzhong Duan (1):
iommu/vt-d: Fix the wrong printing in RHSA parsing
qize wang (1):
mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()
Greg KH
maintainerDocumentation/filesystems/porting +7 -0
@@ -596,3 +596,10 @@ in your dentry operations instead. [mandatory] ->rename() has an added flags argument. Any flags not handled by the filesystem should result in EINVAL being returned. +-- +[mandatory] + + [should've been added in 2016] stale comment in finish_open() + nonwithstanding, failure exits in ->atomic_open() instances should + *NOT* fput() the file, no matter what. Everything is handled by the + caller.
Documentation/kernel-parameters.txt +4 -0
@@ -335,6 +335,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. dynamic table installation which will install SSDT tables to /sys/firmware/acpi/tables/dynamic. + acpi_no_watchdog [HW,ACPI,WDT] + Ignore the ACPI-based watchdog interface (WDAT) and let + a native driver control the watchdog device instead. + acpi_rsdp= [ACPI,EFI,KEXEC] Pass the RSDP address to the kernel, mostly used on machines running EFI runtime service to boot the
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 216 +SUBLEVEL = 217 EXTRAVERSION = NAME = Roaring Lionus
arch/arc/include/asm/linkage.h +2 -0
@@ -14,6 +14,8 @@#ifdef __ASSEMBLY__#define ASM_NL `/* use '`' to mark new line in macro */ +#define __ALIGN .align 4 +#define __ALIGN_STR __stringify(__ALIGN)/* annotation for data we want in DCCM - if enabled in .config */ .macro ARCFP_DATA nm
arch/arm/kernel/vdso.c +2 -0
@@ -85,6 +85,8 @@ static bool __init cntvct_functional(void)* this. */ np =of_find_compatible_node (NULL ,NULL ,"arm,armv7-timer" ); +if (!np) + np =of_find_compatible_node (NULL ,NULL ,"arm,armv8-timer" );if (!np) goto out_put;
arch/arm/lib/copy_from_user.S +1 -1
@@ -100,7 +100,7 @@ ENTRY(arm_copy_from_user) ENDPROC(arm_copy_from_user) - .pushsection .fixup,"ax" + .pushsection .text.fixup,"ax" .align 0 copy_abort_preamble ldmfd sp!, {r1, r2, r3}
arch/x86/events/amd/uncore.c +7 -7
@@ -185,20 +185,18 @@ static int amd_uncore_event_init(struct perf_event *event)/* * NB and Last level cache counters (MSRs) are shared across all cores -* that share the same NB / Last level cache. Interrupts can be directed -* to a single target core, however, event counts generated by processes -* running on other cores cannot be masked out. So we do not support -* sampling and per-thread events. +* that share the same NB / Last level cache. On family 16h and below, +* Interrupts can be directed to a single target core, however, event +* counts generated by processes running on other cores cannot be masked +* out. So we do not support sampling and per-thread events via +* CAP_NO_INTERRUPT, and we do not enable counter overflow interrupts: */ -if (is_sampling_event (event) || event->attach_state &PERF_ATTACH_TASK ) -return -EINVAL ;/* NB and Last level cache counters do not have usr/os/guest/host bits */ if (event->attr.exclude_user || event->attr.exclude_kernel || event->attr.exclude_host || event->attr.exclude_guest)return -EINVAL ; -/* and we do not enable counter overflow interrupts */ hwc->config = event->attr.config &AMD64_RAW_EVENT_MASK_NB ; hwc->idx =-1 ;
@@ -275,6 +273,7 @@ static struct pmu amd_nb_pmu = { .start = amd_uncore_start, .stop = amd_uncore_stop, .read = amd_uncore_read, + .capabilities = PERF_PMU_CAP_NO_INTERRUPT, };static struct pmu amd_llc_pmu = {
@@ -287,6 +286,7 @@ static struct pmu amd_llc_pmu = { .start = amd_uncore_start, .stop = amd_uncore_stop, .read = amd_uncore_read, + .capabilities = PERF_PMU_CAP_NO_INTERRUPT, };static struct amd_uncore *amd_uncore_alloc (unsigned int cpu)
arch/x86/kvm/emulate.c +1 -0
@@ -5022,6 +5022,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) ctxt->fetch.ptr = ctxt->fetch.data; ctxt->fetch.end = ctxt->fetch.data + insn_len; ctxt->opcode_len =1 ; + ctxt->intercept = x86_intercept_none;if (insn_len >0 )memcpy (ctxt->fetch.data, insn, insn_len);else {
drivers/acpi/acpi_watchdog.c +11 -1
@@ -58,12 +58,14 @@ static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat) }#endif +static bool acpi_no_watchdog; +static const struct acpi_table_wdat *acpi_watchdog_get_wdat (void ) {const struct acpi_table_wdat *wdat =NULL ;acpi_status status; -if (acpi_disabled) +if (acpi_disabled || acpi_no_watchdog)return NULL ; status = acpi_get_table(ACPI_SIG_WDAT, 0,
@@ -91,6 +93,14 @@ bool acpi_has_watchdog(void) }EXPORT_SYMBOL_GPL (acpi_has_watchdog); +/* ACPI watchdog can be disabled on boot command line */ +static int __init disable_acpi_watchdog (char *str) +{ + acpi_no_watchdog = true; +return 1 ; +} +__setup ("acpi_no_watchdog" , disable_acpi_watchdog); +void __init acpi_watchdog_init (void ) {const struct acpi_wdat_entry *entries;
drivers/block/virtio_blk.c +5 -3
@@ -215,10 +215,12 @@ static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, err =__virtblk_add_req (vblk->vqs[qid].vq, vbr, vbr->sg, num);if (err) {virtqueue_kick (vblk->vqs[qid].vq); -blk_mq_stop_hw_queue (hctx); +/* Don't stop the queue if -ENOMEM: we may have failed to +* bounce the buffer due to global resource outage. +*/ +if (err == -ENOSPC ) +blk_mq_stop_hw_queue (hctx);spin_unlock_irqrestore (&vblk->vqs[qid].lock, flags); -/* Out of mem doesn't actually happen, since we fall back -* to direct descriptors */ if (err == -ENOMEM || err == -ENOSPC )return BLK_MQ_RQ_QUEUE_BUSY ;return BLK_MQ_RQ_QUEUE_ERROR ;
drivers/firmware/efi/efivars.c +23 -9
@@ -139,13 +139,16 @@ static ssize_t efivar_attr_read(struct efivar_entry *entry, char *buf) { struct efi_variable *var = &entry->var; +unsigned long size =sizeof (var->Data);char *str = buf; +int ret;if (!entry || !buf)return -EINVAL ; - var->DataSize =1024 ; -if (efivar_entry_get (entry, &var->Attributes, &var->DataSize, var->Data)) + ret =efivar_entry_get (entry, &var->Attributes, &size, var->Data); + var->DataSize = size; +if (ret)return -EIO ;if (var->Attributes &EFI_VARIABLE_NON_VOLATILE )
@@ -172,13 +175,16 @@ static ssize_t efivar_size_read(struct efivar_entry *entry, char *buf) { struct efi_variable *var = &entry->var; +unsigned long size =sizeof (var->Data);char *str = buf; +int ret;if (!entry || !buf)return -EINVAL ; - var->DataSize =1024 ; -if (efivar_entry_get (entry, &var->Attributes, &var->DataSize, var->Data)) + ret =efivar_entry_get (entry, &var->Attributes, &size, var->Data); + var->DataSize = size; +if (ret)return -EIO ; str +=sprintf (str,"0x%lx\n" , var->DataSize);
@@ -189,12 +195,15 @@ static ssize_t efivar_data_read(struct efivar_entry *entry, char *buf) { struct efi_variable *var = &entry->var; +unsigned long size =sizeof (var->Data); +int ret;if (!entry || !buf)return -EINVAL ; - var->DataSize =1024 ; -if (efivar_entry_get (entry, &var->Attributes, &var->DataSize, var->Data)) + ret =efivar_entry_get (entry, &var->Attributes, &size, var->Data); + var->DataSize = size; +if (ret)return -EIO ;memcpy (buf, var->Data, var->DataSize);
@@ -263,6 +272,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)u8 *data;int err; +if (!entry || !buf) +return -EINVAL ; +if (is_compat ()) {struct compat_efi_variable *compat;
@@ -314,14 +326,16 @@ efivar_show_raw(struct efivar_entry *entry, char *buf) {struct efi_variable *var = &entry->var;struct compat_efi_variable *compat; +unsigned long datasize =sizeof (var->Data);size_t size; +int ret;if (!entry || !buf)return 0 ; - var->DataSize =1024 ; -if (efivar_entry_get (entry, &entry->var.Attributes, - &entry->var.DataSize, entry->var.Data)) + ret =efivar_entry_get (entry, &var->Attributes, &datasize, var->Data); + var->DataSize = datasize; +if (ret)return -EIO ;if (is_compat ()) {
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +1 -2
@@ -363,8 +363,7 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * router.ddc_valid = false; router.cd_valid = false;for (j =0 ; j < ((le16_to_cpu (path->usSize) -8 ) /2 ); j++) { -uint8_t grph_obj_type= - grph_obj_type = +uint8_t grph_obj_type = (le16_to_cpu (path->usGraphicObjIds[j]) &OBJECT_TYPE_MASK ) >>OBJECT_TYPE_SHIFT ;
drivers/hid/hid-apple.c +2 -1
@@ -341,7 +341,8 @@ static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, unsigned long **bit, int *max) {if (usage->hid == (HID_UP_CUSTOM |0x0003 ) || - usage->hid == (HID_UP_MSVENDOR |0x0003 )) { + usage->hid == (HID_UP_MSVENDOR |0x0003 ) || + usage->hid == (HID_UP_HPVENDOR2 |0x0003 )) {/* The fn key on Apple USB keyboards */ set_bit (EV_REP , hi->input->evbit);hid_map_usage_clear (hi, usage, bit, max,EV_KEY ,KEY_FN );
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +8 -0
@@ -341,6 +341,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { }, .driver_data = (void *)&sipodev_desc }, + { + .ident = "Trekstor SURFBOOK E11B", + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"TREKSTOR" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SURFBOOK E11B"), + }, + .driver_data = (void *)&sipodev_desc + }, { .ident ="Direkt-Tek DTLAPY116-2" , .matches = {
drivers/iommu/dmar.c +15 -6
@@ -39,6 +39,7 @@#include <linux/dmi.h> #include <linux/slab.h> #include <linux/iommu.h> +#include <linux/limits.h> #include <asm/irq_remapping.h> #include <asm/iommu_table.h>
@@ -138,6 +139,13 @@ dmar_alloc_pci_notify_info(struct pci_dev *dev, unsigned long event)BUG_ON (dev->is_virtfn); +/* +* Ignore devices that have a domain number higher than what can +* be looked up in DMAR, e.g. VMD subdevices with domain 0x10000 +*/ +if (pci_domain_nr (dev->bus) >U16_MAX ) +return NULL ; +/* Only generate path[] for device addition event */ if (event ==BUS_NOTIFY_ADD_DEVICE )for (tmp = dev; tmp; tmp = tmp->bus->self)
@@ -450,12 +458,13 @@ static int __init dmar_parse_one_andd(struct acpi_dmar_header *header,/* Check for NUL termination within the designated length */ if (strnlen (andd->device_name, header->length -8 ) == header->length -8 ) { -WARN_TAINT (1 ,TAINT_FIRMWARE_WORKAROUND , +pr_warn (FW_BUG "Your BIOS is broken; ANDD object name is not NUL-terminated\n" "BIOS vendor: %s; Ver: %s; Product Version: %s\n" ,dmi_get_system_info (DMI_BIOS_VENDOR ),dmi_get_system_info (DMI_BIOS_VERSION ),dmi_get_system_info (DMI_PRODUCT_VERSION )); +add_taint (TAINT_FIRMWARE_WORKAROUND ,LOCKDEP_STILL_OK );return -EINVAL ; } pr_info("ANDD device: %x name: %s\n", andd->device_number,
@@ -481,14 +490,14 @@ static int dmar_parse_one_rhsa(struct acpi_dmar_header *header, void *arg)return 0 ; } } -WARN_TAINT ( -1 ,TAINT_FIRMWARE_WORKAROUND , +pr_warn (FW_BUG "Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n" "BIOS vendor: %s; Ver: %s; Product Version: %s\n" , - drhd->reg_base_addr, + rhsa->base_address,dmi_get_system_info (DMI_BIOS_VENDOR ),dmi_get_system_info (DMI_BIOS_VERSION ),dmi_get_system_info (DMI_PRODUCT_VERSION )); +add_taint (TAINT_FIRMWARE_WORKAROUND ,LOCKDEP_STILL_OK );return 0 ; }
@@ -834,14 +843,14 @@ int __init dmar_table_init(void)static void warn_invalid_dmar (u64 addr,const char *message) { -WARN_TAINT_ONCE ( -1 ,TAINT_FIRMWARE_WORKAROUND , +pr_warn_once (FW_BUG "Your BIOS is broken; DMAR reported at address %llx%s!\n" "BIOS vendor: %s; Ver: %s; Product Version: %s\n" , addr, message,dmi_get_system_info (DMI_BIOS_VENDOR ),dmi_get_system_info (DMI_BIOS_VERSION ),dmi_get_system_info (DMI_PRODUCT_VERSION )); +add_taint (TAINT_FIRMWARE_WORKAROUND ,LOCKDEP_STILL_OK ); } static int __ref
drivers/iommu/intel-iommu.c +8 -5
@@ -4085,10 +4085,11 @@ static void quirk_ioat_snb_local_iommu(struct pci_dev *pdev)/* we know that the this iommu should be at offset 0xa000 from vtbar */ drhd =dmar_find_matched_drhd_unit (pdev); -if (WARN_TAINT_ONCE (!drhd || drhd->reg_base_addr - vtbar !=0xa000 , -TAINT_FIRMWARE_WORKAROUND , -"BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n" )) +if (!drhd || drhd->reg_base_addr - vtbar !=0xa000 ) { +pr_warn_once (FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n" ); +add_taint (TAINT_FIRMWARE_WORKAROUND ,LOCKDEP_STILL_OK ); pdev->dev.archdata.iommu =DUMMY_DEVICE_DOMAIN_INFO ; + } }DECLARE_PCI_FIXUP_ENABLE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_IOAT_SNB , quirk_ioat_snb_local_iommu);
@@ -5192,8 +5193,10 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,u64 phys =0 ; pte =pfn_to_dma_pte (dmar_domain, iova >>VTD_PAGE_SHIFT , &level); -if (pte) - phys =dma_pte_addr (pte); +if (pte &&dma_pte_present (pte)) + phys =dma_pte_addr (pte) + + (iova & (BIT_MASK (level_to_offset_bits (level) + +VTD_PAGE_SHIFT ) -1 ));return phys; }
drivers/net/bonding/bond_alb.c +10 -10
@@ -71,11 +71,6 @@ struct arp_pkt { };#pragma pack() -static inline struct arp_pkt *arp_pkt (const struct sk_buff *skb) -{ -return (struct arp_pkt *)skb_network_header (skb); -} -/* Forward declaration */ static void alb_send_learning_packets (struct slave *slave,u8 mac_addr[],bool strict_match);
@@ -574,10 +569,11 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)spin_unlock (&bond->mode_lock); } -static struct slave *rlb_choose_channel (struct sk_buff *skb,struct bonding *bond) +static struct slave *rlb_choose_channel (struct sk_buff *skb, +struct bonding *bond, +const struct arp_pkt *arp) {struct alb_bond_info *bond_info = &(BOND_ALB_INFO (bond)); -struct arp_pkt *arp =arp_pkt (skb);struct slave *assigned_slave, *curr_active_slave;struct rlb_client_info *client_info;u32 hash_index =0 ;
@@ -674,8 +670,12 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon*/ static struct slave *rlb_arp_xmit (struct sk_buff *skb,struct bonding *bond) { -struct arp_pkt *arp =arp_pkt (skb);struct slave *tx_slave =NULL ; +struct arp_pkt *arp; + +if (!pskb_network_may_pull (skb,sizeof (*arp))) +return NULL ; + arp = (struct arp_pkt *)skb_network_header (skb);/* Don't modify or load balance ARPs that do not originate locally * (e.g.,arrive via a bridge).
@@ -685,7 +685,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)if (arp->op_code ==htons (ARPOP_REPLY )) {/* the arp must be sent on the selected rx channel */ - tx_slave =rlb_choose_channel (skb, bond); + tx_slave =rlb_choose_channel (skb, bond, arp);if (tx_slave)ether_addr_copy (arp->mac_src, tx_slave->dev->dev_addr);netdev_dbg (bond->dev,"Server sent ARP Reply packet\n" );
@@ -695,7 +695,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)* When the arp reply is received the entry will be updated * with the correct unicast address of the client. */ -rlb_choose_channel (skb, bond); +rlb_choose_channel (skb, bond, arp);/* The ARP reply packets must be delayed so that * they can cancel out the influence of the ARP request.
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -2
@@ -6439,13 +6439,13 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)return -EINVAL ;if (netif_running (dev)) -bnxt_close_nic (bp, false, false); +bnxt_close_nic (bp, true, false); dev->mtu = new_mtu;bnxt_set_ring_params (bp);if (netif_running (dev)) -return bnxt_open_nic (bp, false, false); +return bnxt_open_nic (bp, true, false);return 0 ; }
drivers/net/ethernet/freescale/fec_main.c +3 -3
@@ -2470,15 +2470,15 @@ fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)return -EINVAL ; } - cycle =fec_enet_us_to_itr_clock (ndev, fep->rx_time_itr); + cycle =fec_enet_us_to_itr_clock (ndev, ec->rx_coalesce_usecs);if (cycle >0xFFFF ) {pr_err ("Rx coalesced usec exceed hardware limitation\n" );return -EINVAL ; } - cycle =fec_enet_us_to_itr_clock (ndev, fep->tx_time_itr); + cycle =fec_enet_us_to_itr_clock (ndev, ec->tx_coalesce_usecs);if (cycle >0xFFFF ) { -pr_err ("Rx coalesced usec exceed hardware limitation\n" ); +pr_err ("Tx coalesced usec exceed hardware limitation\n" );return -EINVAL ; }
drivers/net/ethernet/micrel/ks8851_mll.c +8 -6
@@ -831,14 +831,17 @@ static irqreturn_t ks_irq(int irq, void *pw) {struct net_device *netdev = pw;struct ks_net *ks =netdev_priv (netdev); +unsigned long flags;u16 status; +spin_lock_irqsave (&ks->statelock, flags);/*this should be the first in IRQ handler */ ks_save_cmd_reg (ks); status =ks_rdreg16 (ks,KS_ISR );if (unlikely (!status)) {ks_restore_cmd_reg (ks); +spin_unlock_irqrestore (&ks->statelock, flags);return IRQ_NONE ; }
@@ -864,6 +867,7 @@ static irqreturn_t ks_irq(int irq, void *pw) ks->netdev->stats.rx_over_errors++;/* this should be the last in IRQ handler*/ ks_restore_cmd_reg (ks); +spin_unlock_irqrestore (&ks->statelock, flags);return IRQ_HANDLED ; }
@@ -933,6 +937,7 @@ static int ks_net_stop(struct net_device *netdev)/* shutdown RX/TX QMU */ ks_disable_qmu (ks); +ks_disable_int (ks);/* set powermode to soft power down to save power */ ks_set_powermode (ks,PMECR_PM_SOFTDOWN );
@@ -989,10 +994,9 @@ static netdev_tx_t ks_start_xmit(struct sk_buff *skb, struct net_device *netdev) {netdev_tx_t retv =NETDEV_TX_OK ;struct ks_net *ks =netdev_priv (netdev); +unsigned long flags; -disable_irq (netdev->irq); -ks_disable_int (ks); -spin_lock (&ks->statelock); +spin_lock_irqsave (&ks->statelock, flags);/* Extra space are required: * 4 byte for alignment, 4 for status/length, 4 for CRC
@@ -1006,9 +1010,7 @@ static netdev_tx_t ks_start_xmit(struct sk_buff *skb, struct net_device *netdev)dev_kfree_skb (skb); }else retv =NETDEV_TX_BUSY ; -spin_unlock (&ks->statelock); -ks_enable_int (ks); -enable_irq (netdev->irq); +spin_unlock_irqrestore (&ks->statelock, flags);return retv; }
drivers/net/ipvlan/ipvlan_core.c +11 -8
@@ -251,6 +251,7 @@ void ipvlan_process_multicast(struct work_struct *work) }else {kfree_skb (skb); } +cond_resched (); } }
@@ -443,19 +444,21 @@ static int ipvlan_process_outbound(struct sk_buff *skb)struct ethhdr *ethh =eth_hdr (skb);int ret =NET_XMIT_DROP ; -/* In this mode we dont care about multicast and broadcast traffic */ -if (is_multicast_ether_addr (ethh->h_dest)) { -pr_warn_ratelimited ("Dropped {multi|broad}cast of type= [%x]\n" , -ntohs (skb->protocol)); -kfree_skb (skb); - goto out; - } -/* The ipvlan is a pseudo-L2 device, so the packets that we receive * will have L2; which need to discarded and processed further * in the net-ns of the main-device. */ if (skb_mac_header_was_set (skb)) { +/* In this mode we dont care about +* multicast and broadcast traffic */ +if (is_multicast_ether_addr (ethh->h_dest)) { +pr_debug_ratelimited ( +"Dropped {multi|broad}cast of type=[%x]\n" , +ntohs (skb->protocol)); +kfree_skb (skb); + goto out; + } +skb_pull (skb,sizeof (*ethh)); skb->mac_header = (typeof(skb->mac_header))~0U;skb_reset_network_header (skb);
drivers/net/ipvlan/ipvlan_main.c +1 -4
@@ -217,7 +217,6 @@ static void ipvlan_uninit(struct net_device *dev)static int ipvlan_open (struct net_device *dev) {struct ipvl_dev *ipvlan =netdev_priv (dev); -struct net_device *phy_dev = ipvlan->phy_dev;struct ipvl_addr *addr; if (ipvlan->port->mode == IPVLAN_MODE_L3 ||
@@ -229,7 +228,7 @@ static int ipvlan_open(struct net_device *dev)list_for_each_entry (addr, &ipvlan->addrs, anode)ipvlan_ht_addr_add (ipvlan, addr); -return dev_uc_add (phy_dev, phy_dev->dev_addr); +return 0 ; }static int ipvlan_stop (struct net_device *dev)
@@ -241,8 +240,6 @@ static int ipvlan_stop(struct net_device *dev)dev_uc_unsync (phy_dev, dev);dev_mc_unsync (phy_dev, dev); -dev_uc_del (phy_dev, phy_dev->dev_addr); -list_for_each_entry (addr, &ipvlan->addrs, anode)ipvlan_ht_addr_del (addr);
drivers/net/macsec.c +7 -5
@@ -2871,6 +2871,11 @@ static void macsec_dev_set_rx_mode(struct net_device *dev)dev_uc_sync (real_dev, dev); } +static sci_t dev_to_sci (struct net_device *dev,__be16 port) +{ +return make_sci (dev->dev_addr, port); +} +static int macsec_set_mac_address (struct net_device *dev,void *p) {struct macsec_dev *macsec =macsec_priv (dev);
@@ -2892,6 +2897,7 @@ static int macsec_set_mac_address(struct net_device *dev, void *p) out:ether_addr_copy (dev->dev_addr, addr->sa_data); + macsec->secy.sci =dev_to_sci (dev,MACSEC_PORT_ES );return 0 ; }
@@ -2976,6 +2982,7 @@ static const struct device_type macsec_type = {static const struct nla_policy macsec_rtnl_policy[IFLA_MACSEC_MAX +1 ] = { [IFLA_MACSEC_SCI ] = { .type =NLA_U64 }, + [IFLA_MACSEC_PORT ] = { .type =NLA_U16 }, [IFLA_MACSEC_ICV_LEN ] = { .type =NLA_U8 }, [IFLA_MACSEC_CIPHER_SUITE ] = { .type =NLA_U64 }, [IFLA_MACSEC_WINDOW ] = { .type =NLA_U32 },
@@ -3160,11 +3167,6 @@ static bool sci_exists(struct net_device *dev, sci_t sci)return false; } -static sci_t dev_to_sci (struct net_device *dev,__be16 port) -{ -return make_sci (dev->dev_addr, port); -} -static int macsec_add_dev (struct net_device *dev,sci_t sci,u8 icv_len) {struct macsec_dev *macsec =macsec_priv (dev);
drivers/net/macvlan.c +2 -0
@@ -309,6 +309,8 @@ static void macvlan_process_broadcast(struct work_struct *w)if (src)dev_put (src->dev);kfree_skb (skb); + +cond_resched (); } }
drivers/net/phy/phy_device.c +11 -7
@@ -80,7 +80,7 @@ static LIST_HEAD(phy_fixup_list);static DEFINE_MUTEX (phy_fixup_lock);#ifdef CONFIG_PM -static bool mdio_bus_phy_may_suspend (struct phy_device *phydev,bool suspend) +static bool mdio_bus_phy_may_suspend (struct phy_device *phydev) {struct device_driver *drv = phydev->mdio.dev.driver;struct phy_driver *phydrv =to_phy_driver (drv);
@@ -92,11 +92,10 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev, bool suspend)/* PHY not attached? May suspend if the PHY has not already been * suspended as part of a prior call to phy_disconnect() -> * phy_detach() -> phy_suspend() because the parent netdev might be the -* MDIO bus driver and clock gated at this point. Also may resume if -* PHY is not attached. +* MDIO bus driver and clock gated at this point. */ if (!netdev) -return suspend ? !phydev->suspended : phydev->suspended; + goto out;/* Don't suspend PHY if the attached netdev parent may wakeup. * The parent may point to a PCI device, as in tg3 driver.
@@ -111,7 +110,8 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev, bool suspend)if (device_may_wakeup (&netdev->dev))return false; -return true; +out: +return !phydev->suspended; }static int mdio_bus_phy_suspend (struct device *dev)
@@ -126,9 +126,11 @@ static int mdio_bus_phy_suspend(struct device *dev)if (phydev->attached_dev && phydev->adjust_link)phy_stop_machine (phydev); -if (!mdio_bus_phy_may_suspend (phydev, true)) +if (!mdio_bus_phy_may_suspend (phydev))return 0 ; + phydev->suspended_by_mdio_bus = true; +return phy_suspend (phydev); }
@@ -137,9 +139,11 @@ static int mdio_bus_phy_resume(struct device *dev)struct phy_device *phydev =to_phy_device (dev);int ret; -if (!mdio_bus_phy_may_suspend (phydev, false)) +if (!phydev->suspended_by_mdio_bus) goto no_resume; + phydev->suspended_by_mdio_bus = false; + ret =phy_resume (phydev);if (ret <0 )return ret;
drivers/net/slip/slhc.c +10 -4
@@ -232,7 +232,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, registerstruct cstate *cs = lcs->next; registerunsigned long deltaS, deltaA; registershort changes =0 ; -int hlen; +int nlen, hlen;unsigned char new_seq[16 ]; registerunsigned char *cp = new_seq;struct iphdr *ip;
@@ -248,6 +248,8 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,return isize; ip = (struct iphdr *) icp; +if (ip->version !=4 || ip->ihl <5 ) +return isize;/* Bail if this packet isn't TCP, or is an IP fragment */ if (ip->protocol !=IPPROTO_TCP || (ntohs (ip->frag_off) &0x3fff )) {
@@ -258,10 +260,14 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, comp->sls_o_tcp++;return isize; } -/* Extract TCP header */ + nlen = ip->ihl *4 ; +if (isize < nlen +sizeof (*th)) +return isize; - th = (struct tcphdr *)(((unsigned char *)ip) + ip->ihl*4 ); - hlen = ip->ihl*4 + th->doff*4 ; + th = (struct tcphdr *)(icp + nlen); +if (th->doff <sizeof (struct tcphdr ) /4 ) +return isize; + hlen = nlen + th->doff *4 ;/* Bail if the TCP packet isn't `compressible' (i.e., ACK isn't set or * some other control bit is set). Also uncompressible if
drivers/net/team/team.c +2 -0
@@ -2216,6 +2216,8 @@ team_nl_option_policy[TEAM_ATTR_OPTION_MAX + 1] = { [TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG }, [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8 }, [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY }, + [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32 }, + [TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32 }, };static int team_nl_cmd_noop (struct sk_buff *skb,struct genl_info *info)
drivers/net/usb/r8152.c +6 -0
@@ -3423,7 +3423,10 @@ static void r8153_init(struct r8152 *tp)if (ocp_read_word (tp,MCU_TYPE_PLA ,PLA_BOOT_CTRL ) &AUTOLOAD_DONE )break ; +msleep (20 ); +if (test_bit (RTL8152_UNPLUG , &tp->flags)) +break ; }for (i =0 ; i <500 ; i++) {
@@ -3447,7 +3450,10 @@ static void r8153_init(struct r8152 *tp) ocp_data =ocp_reg_read (tp,OCP_PHY_STATUS ) &PHY_STAT_MASK ;if (ocp_data ==PHY_STAT_LAN_ON )break ; +msleep (20 ); +if (test_bit (RTL8152_UNPLUG , &tp->flags)) +break ; }usb_disable_lpm (tp->udev);
drivers/net/wireless/marvell/mwifiex/tdls.c +64 -6
123 lines not on this page · raw message
fs/cifs/dir.c +0 -1
@@ -551,7 +551,6 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,if (server->ops->close) server->ops->close (xid, tcon, &fid);cifs_del_pending_open (&open); -fput (file); rc = -ENOMEM ; }
fs/gfs2/inode.c +1 -1
@@ -1248,7 +1248,7 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,if (!(*opened &FILE_OPENED ))return finish_no_open (file, d);dput (d); -return 0 ; +return excl && (flags &O_CREAT ) ? -EEXIST :0 ; }BUG_ON (d !=NULL );
fs/jbd2/transaction.c +4 -4
@@ -1037,8 +1037,8 @@ static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh,/* For undo access buffer must have data copied */ if (undo && !jh->b_committed_data) goto out; -if (jh->b_transaction != handle->h_transaction && - jh->b_next_transaction != handle->h_transaction) +if (READ_ONCE (jh->b_transaction) != handle->h_transaction && +READ_ONCE (jh->b_next_transaction) != handle->h_transaction) goto out;/* * There are two reasons for the barrier here:
@@ -2448,8 +2448,8 @@ void __jbd2_journal_refile_buffer(struct journal_head *jh)* our jh reference and thus __jbd2_journal_file_buffer() must not * take a new one. */ - jh->b_transaction = jh->b_next_transaction; - jh->b_next_transaction =NULL ; +WRITE_ONCE (jh->b_transaction, jh->b_next_transaction); +WRITE_ONCE (jh->b_next_transaction,NULL );if (buffer_freed (bh)) jlist = BJ_Forget;else if (jh->b_modified)
fs/nfs/dir.c +0 -2
@@ -678,8 +678,6 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, goto out_label_free; } - array =kmap (page); - status =nfs_readdir_alloc_pages (pages, array_size);if (status <0 ) goto out_release_array;
fs/open.c +0 -3
@@ -824,9 +824,6 @@ static int do_dentry_open(struct file *f,* the return value of d_splice_alias(), then the caller needs to perform dput() * on it after finish_open(). * -* On successful return @file is a fully instantiated open file. After this, if -* an error occurs in ->atomic_open(), it needs to clean up with fput(). -* * Returns zero on success or -errno if the open failed. */ int finish_open(struct file *file, struct dentry *dentry,
include/linux/phy.h +2 -0
@@ -333,6 +333,7 @@ struct phy_c45_device_ids {* is_pseudo_fixed_link: Set to true if this phy is an Ethernet switch, etc. * has_fixups: Set to true if this phy has fixups/quirks. * suspended: Set to true if this phy has been suspended successfully. +* suspended_by_mdio_bus: Set to true if this phy was suspended by MDIO bus. * state: state of the PHY for management purposes * dev_flags: Device-specific flags used by the PHY driver. * link_timeout: The number of timer firings to wait before the
@@ -369,6 +370,7 @@ struct phy_device {bool is_pseudo_fixed_link;bool has_fixups;bool suspended; +bool suspended_by_mdio_bus;enum phy_state state;
include/net/fib_rules.h +1 -0
@@ -87,6 +87,7 @@ struct fib_rules_ops { [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ [FRA_PRIORITY] = { .type = NLA_U32 }, \ [FRA_FWMARK] = { .type = NLA_U32 }, \ + [FRA_TUN_ID] = { .type = NLA_U64 }, \ [FRA_FWMASK] = { .type = NLA_U32 }, \ [FRA_TABLE] = { .type = NLA_U32 }, \ [FRA_SUPPRESS_PREFIXLEN] = { .type = NLA_U32 }, \
kernel/cgroup.c +4 -0
@@ -6335,6 +6335,10 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd)return ; } +/* Don't associate the sock with unrelated interrupted task's cgroup. */ +if (in_interrupt ()) +return ; +rcu_read_lock ();while (true) {
kernel/signal.c +14 -9
@@ -373,27 +373,32 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi {struct sigqueue *q =NULL ;struct user_struct *user; +int sigpending;/* * Protect access to @t credentials. This can go away when all * callers hold rcu read lock. +* +* NOTE! A pending signal will hold on to the user refcount, +* and we get/put the refcount only when the sigpending count +* changes from/to zero. */ rcu_read_lock (); - user =get_uid (__task_cred (t)->user); -atomic_inc (&user->sigpending); + user =__task_cred (t)->user; + sigpending =atomic_inc_return (&user->sigpending); +if (sigpending ==1 ) +get_uid (user);rcu_read_unlock (); -if (override_rlimit || -atomic_read (&user->sigpending) <= -task_rlimit (t,RLIMIT_SIGPENDING )) { +if (override_rlimit ||likely (sigpending <=task_rlimit (t,RLIMIT_SIGPENDING ))) { q =kmem_cache_alloc (sigqueue_cachep, flags); }else {print_dropped_signal (sig); }if (unlikely (q ==NULL )) { -atomic_dec (&user->sigpending); -free_uid (user); +if (atomic_dec_and_test (&user->sigpending)) +free_uid (user); }else {INIT_LIST_HEAD (&q->list); q->flags =0 ;
@@ -407,8 +412,8 @@ static void __sigqueue_free(struct sigqueue *q) {if (q->flags &SIGQUEUE_PREALLOC )return ; -atomic_dec (&q->user->sigpending); -free_uid (q->user); +if (atomic_dec_and_test (&q->user->sigpending)) +free_uid (q->user);kmem_cache_free (sigqueue_cachep, q); }
kernel/workqueue.c +8 -6
@@ -1384,14 +1384,16 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, WARN_ON_ONCE(!is_chained_work(wq)))return ; retry: -if (req_cpu ==WORK_CPU_UNBOUND ) - cpu =wq_select_unbound_cpu (raw_smp_processor_id ()); -/* pwq which will be used unless @work is executing elsewhere */ -if (!(wq->flags &WQ_UNBOUND )) - pwq =per_cpu_ptr (wq->cpu_pwqs, cpu); -else +if (wq->flags &WQ_UNBOUND ) { +if (req_cpu ==WORK_CPU_UNBOUND ) + cpu =wq_select_unbound_cpu (raw_smp_processor_id ()); pwq =unbound_pwq_by_node (wq,cpu_to_node (cpu)); + }else { +if (req_cpu ==WORK_CPU_UNBOUND ) + cpu =raw_smp_processor_id (); + pwq =per_cpu_ptr (wq->cpu_pwqs, cpu); + }/* * If @work was previously on a different pool, it might still be
mm/memcontrol.c +4 -0
@@ -5726,6 +5726,10 @@ void mem_cgroup_sk_alloc(struct sock *sk)return ; } +/* Do not associate the sock with unrelated interrupted task's memcg. */ +if (in_interrupt ()) +return ; +rcu_read_lock (); memcg =mem_cgroup_from_task (current);if (memcg == root_mem_cgroup)
mm/slub.c +9 -0
@@ -3114,6 +3114,15 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size,void *object = c->freelist;if (unlikely (!object)) { +/* +* We may have removed an object from c->freelist using +* the fastpath in the previous iteration; in that case, +* c->tid has not been bumped yet. +* Since ___slab_alloc() may reenable interrupts while +* allocating memory, we should bump c->tid now. +*/ + c->tid =next_tid (c->tid); +/* * Invoking slow path likely have side-effect * of re-populating per CPU c->freelist
net/batman-adv/bat_iv_ogm.c +83 -22
264 lines not on this page · raw message
net/batman-adv/bat_v.c +16 -9
@@ -19,7 +19,6 @@#include "main.h" #include <linux/atomic.h> -#include <linux/bug.h> #include <linux/cache.h> #include <linux/errno.h> #include <linux/if_ether.h>
@@ -623,11 +622,11 @@ static int batadv_v_neigh_cmp(struct batadv_neigh_node *neigh1,int ret =0 ; ifinfo1 =batadv_neigh_ifinfo_get (neigh1, if_outgoing1); -if (WARN_ON (!ifinfo1)) +if (!ifinfo1) goto err_ifinfo1; ifinfo2 =batadv_neigh_ifinfo_get (neigh2, if_outgoing2); -if (WARN_ON (!ifinfo2)) +if (!ifinfo2) goto err_ifinfo2; ret = ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput;
@@ -649,11 +648,11 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,bool ret = false; ifinfo1 =batadv_neigh_ifinfo_get (neigh1, if_outgoing1); -if (WARN_ON (!ifinfo1)) +if (!ifinfo1) goto err_ifinfo1; ifinfo2 =batadv_neigh_ifinfo_get (neigh2, if_outgoing2); -if (WARN_ON (!ifinfo2)) +if (!ifinfo2) goto err_ifinfo2; threshold = ifinfo1->bat_v.throughput /4 ;
@@ -668,6 +667,16 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,return ret; } +/** +* batadv_v_init_sel_class - initialize GW selection class +* @bat_priv: the bat priv with all the soft interface information +*/ +static void batadv_v_init_sel_class (struct batadv_priv *bat_priv) +{ +/* set default throughput difference threshold to 5Mbps */ +atomic_set (&bat_priv->gw.sel_class,50 ); +} +static ssize_t batadv_v_store_sel_class (struct batadv_priv *bat_priv,char *buff,size_t count) {
@@ -805,7 +814,7 @@ static bool batadv_v_gw_is_eligible(struct batadv_priv *bat_priv, } orig_gw =batadv_gw_node_get (bat_priv, orig_node); -if (!orig_node) +if (!orig_gw) goto out;if (batadv_v_gw_throughput_get (orig_gw, &orig_throughput) <0 )
@@ -1054,6 +1063,7 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = { .dump = batadv_v_orig_dump, }, .gw = { + .init_sel_class = batadv_v_init_sel_class, .store_sel_class = batadv_v_store_sel_class, .show_sel_class = batadv_v_show_sel_class, .get_best_gw_node = batadv_v_gw_get_best_gw_node,
@@ -1094,9 +1104,6 @@ int batadv_v_mesh_init(struct batadv_priv *bat_priv)if (ret <0 )return ret; -/* set default throughput difference threshold to 5Mbps */ -atomic_set (&bat_priv->gw.sel_class,50 ); -return 0 ; }
net/batman-adv/bat_v_elp.c +16 -6
@@ -19,6 +19,7 @@#include "main.h" #include <linux/atomic.h> +#include <linux/bitops.h> #include <linux/byteorder/generic.h> #include <linux/errno.h> #include <linux/etherdevice.h>
@@ -29,6 +30,7 @@#include <linux/kernel.h> #include <linux/kref.h> #include <linux/netdevice.h> +#include <linux/nl80211.h> #include <linux/random.h> #include <linux/rculist.h> #include <linux/rcupdate.h>
@@ -100,8 +102,12 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)*/ return 0 ; } -if (!ret) -return sinfo.expected_throughput /100 ; +if (ret) + goto default_throughput; +if (!(sinfo.filled &BIT (NL80211_STA_INFO_EXPECTED_THROUGHPUT ))) + goto default_throughput; + +return sinfo.expected_throughput /100 ; }/* unsupported WiFi driver version */
@@ -185,6 +191,7 @@ batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh)struct sk_buff *skb;int probe_len, i;int elp_skb_len; +void *tmp;/* this probing routine is for Wifi neighbours only */ if (!batadv_is_wifi_netdev (hard_iface->net_dev))
@@ -216,7 +223,8 @@ batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh)* the packet to be exactly of that size to make the link * throughput estimation effective. */ -skb_put (skb, probe_len - hard_iface->bat_v.elp_skb->len); + tmp =skb_put (skb, probe_len - hard_iface->bat_v.elp_skb->len); +memset (tmp,0 , probe_len - hard_iface->bat_v.elp_skb->len); batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "Sending unicast (probe) ELP packet on interface %s to %pM\n",
@@ -327,21 +335,23 @@ static void batadv_v_elp_periodic_work(struct work_struct *work)*/ int batadv_v_elp_iface_enable (struct batadv_hard_iface *hard_iface) { +static const size_t tvlv_padding =sizeof (__be32);struct batadv_elp_packet *elp_packet;unsigned char *elp_buff;u32 random_seqno;size_t size;int res = -ENOMEM ; - size =ETH_HLEN +NET_IP_ALIGN +BATADV_ELP_HLEN ; + size =ETH_HLEN +NET_IP_ALIGN +BATADV_ELP_HLEN + tvlv_padding; hard_iface->bat_v.elp_skb =dev_alloc_skb (size);if (!hard_iface->bat_v.elp_skb) goto out;skb_reserve (hard_iface->bat_v.elp_skb,ETH_HLEN +NET_IP_ALIGN ); - elp_buff =skb_put (hard_iface->bat_v.elp_skb,BATADV_ELP_HLEN ); + elp_buff =skb_put (hard_iface->bat_v.elp_skb, +BATADV_ELP_HLEN + tvlv_padding); elp_packet = (struct batadv_elp_packet *)elp_buff; -memset (elp_packet,0 ,BATADV_ELP_HLEN ); +memset (elp_packet,0 ,BATADV_ELP_HLEN + tvlv_padding); elp_packet->packet_type =BATADV_ELP ; elp_packet->version =BATADV_COMPAT_VERSION ;
net/batman-adv/bat_v_ogm.c +34 -8
92 lines not on this page · raw message
net/batman-adv/debugfs.c +40 -0
@@ -18,6 +18,7 @@#include "debugfs.h" #include "main.h" +#include <linux/dcache.h> #include <linux/debugfs.h> #include <linux/device.h> #include <linux/errno.h>
@@ -339,6 +340,25 @@ int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)return -ENOMEM ; } +/** +* batadv_debugfs_rename_hardif() - Fix debugfs path for renamed hardif +* @hard_iface: hard interface which was renamed +*/ +void batadv_debugfs_rename_hardif (struct batadv_hard_iface *hard_iface) +{ +const char *name = hard_iface->net_dev->name; +struct dentry *dir; +struct dentry *d; + + dir = hard_iface->debug_dir; +if (!dir) +return ; + + d =debugfs_rename (dir->d_parent, dir, dir->d_parent, name); +if (!d) +pr_err ("Can't rename debugfs dir to %s\n" , name); +} +/** * batadv_debugfs_del_hardif - delete the base directory for a hard interface * in debugfs.
@@ -403,6 +423,26 @@ int batadv_debugfs_add_meshif(struct net_device *dev)return -ENOMEM ; } +/** +* batadv_debugfs_rename_meshif() - Fix debugfs path for renamed softif +* @dev: net_device which was renamed +*/ +void batadv_debugfs_rename_meshif (struct net_device *dev) +{ +struct batadv_priv *bat_priv =netdev_priv (dev); +const char *name = dev->name; +struct dentry *dir; +struct dentry *d; + + dir = bat_priv->debug_dir; +if (!dir) +return ; + + d =debugfs_rename (dir->d_parent, dir, dir->d_parent, name); +if (!d) +pr_err ("Can't rename debugfs dir to %s\n" , name); +} +void batadv_debugfs_del_meshif (struct net_device *dev) {struct batadv_priv *bat_priv =netdev_priv (dev);
net/batman-adv/debugfs.h +11 -0
@@ -29,8 +29,10 @@ struct net_device;void batadv_debugfs_init (void );void batadv_debugfs_destroy (void );int batadv_debugfs_add_meshif (struct net_device *dev); +void batadv_debugfs_rename_meshif (struct net_device *dev);void batadv_debugfs_del_meshif (struct net_device *dev);int batadv_debugfs_add_hardif (struct batadv_hard_iface *hard_iface); +void batadv_debugfs_rename_hardif (struct batadv_hard_iface *hard_iface);void batadv_debugfs_del_hardif (struct batadv_hard_iface *hard_iface);#else
@@ -48,6 +50,10 @@ static inline int batadv_debugfs_add_meshif(struct net_device *dev)return 0 ; } +static inline void batadv_debugfs_rename_meshif (struct net_device *dev) +{ +} +static inline void batadv_debugfs_del_meshif (struct net_device *dev) { }
@@ -58,6 +64,11 @@ int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface)return 0 ; } +static inline +void batadv_debugfs_rename_hardif (struct batadv_hard_iface *hard_iface) +{ +} +static inline void batadv_debugfs_del_hardif (struct batadv_hard_iface *hard_iface) {
net/batman-adv/distributed-arp-table.c +3 -2
@@ -1025,8 +1025,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,skb_reset_mac_header (skb_new); skb_new->protocol =eth_type_trans (skb_new, bat_priv->soft_iface); - bat_priv->stats.rx_packets++; - bat_priv->stats.rx_bytes += skb->len +ETH_HLEN + hdr_size; +batadv_inc_counter (bat_priv,BATADV_CNT_RX ); +batadv_add_counter (bat_priv,BATADV_CNT_RX_BYTES , + skb->len +ETH_HLEN + hdr_size); bat_priv->soft_iface->last_rx = jiffies;netif_rx (skb_new);
net/batman-adv/fragmentation.c +13 -9
@@ -232,8 +232,10 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,spin_unlock_bh (&chain->lock); err: -if (!ret) +if (!ret) {kfree (frag_entry_new); +kfree_skb (skb); + }return ret; }
@@ -305,7 +307,7 @@ batadv_frag_merge_packets(struct hlist_head *chain)* * There are three possible outcomes: 1) Packet is merged: Return true and * set *skb to merged packet; 2) Packet is buffered: Return true and set *skb -* to NULL; 3) Error: Return false and leave skb as is. +* to NULL; 3) Error: Return false and free skb. * * Return: true when packet is merged or buffered, false when skb is not not * used.
@@ -330,9 +332,9 @@ bool batadv_frag_skb_buffer(struct sk_buff **skb, goto out_err; out: - *skb = skb_out; ret = true; out_err: + *skb = skb_out;return ret; }
@@ -482,12 +484,20 @@ int batadv_frag_send_packet(struct sk_buff *skb,*/ if (skb->priority >=256 && skb->priority <=263 ) frag_header.priority = skb->priority -256 ; +else + frag_header.priority =0 ;ether_addr_copy (frag_header.orig, primary_if->net_dev->dev_addr);ether_addr_copy (frag_header.dest, orig_node->orig);/* Eat and send fragments from the tail of skb */ while (skb->len > max_fragment_size) { +/* The initial check in this function should cover this case */ +if (frag_header.no ==BATADV_FRAG_MAX_FRAGMENTS -1 ) { + ret =-1 ; + goto out; + } + skb_fragment =batadv_frag_create (skb, &frag_header, mtu);if (!skb_fragment) goto out;
@@ -505,12 +515,6 @@ int batadv_frag_send_packet(struct sk_buff *skb, } frag_header.no++; - -/* The initial check in this function should cover this case */ -if (frag_header.no ==BATADV_FRAG_MAX_FRAGMENTS -1 ) { - ret =-1 ; - goto out; - } }/* Make room for the fragment header. */
net/batman-adv/gateway_client.c +9 -2
@@ -31,6 +31,7 @@#include <linux/kernel.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/lockdep.h> #include <linux/netdevice.h> #include <linux/netlink.h> #include <linux/rculist.h>
@@ -325,6 +326,9 @@ void batadv_gw_check_election(struct batadv_priv *bat_priv,* @bat_priv: the bat priv with all the soft interface information * @orig_node: originator announcing gateway capabilities * @gateway: announced bandwidth information +* +* Has to be called with the appropriate locks being acquired +* (gw.list_lock). */ static void batadv_gw_node_add(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node,
@@ -332,6 +336,8 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv, {struct batadv_gw_node *gw_node; +lockdep_assert_held (&bat_priv->gw.list_lock); +if (gateway->bandwidth_down ==0 )return ;
@@ -346,10 +352,8 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv, gw_node->bandwidth_down =ntohl (gateway->bandwidth_down); gw_node->bandwidth_up =ntohl (gateway->bandwidth_up); -spin_lock_bh (&bat_priv->gw.list_lock);kref_get (&gw_node->refcount);hlist_add_head_rcu (&gw_node->list, &bat_priv->gw.list); -spin_unlock_bh (&bat_priv->gw.list_lock); batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "Found new gateway %pM -> gw bandwidth: %u.%u/%u.%u MBit\n",
@@ -404,11 +408,14 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv, {struct batadv_gw_node *gw_node, *curr_gw =NULL ; +spin_lock_bh (&bat_priv->gw.list_lock); gw_node =batadv_gw_node_get (bat_priv, orig_node);if (!gw_node) {batadv_gw_node_add (bat_priv, orig_node, gateway); +spin_unlock_bh (&bat_priv->gw.list_lock); goto out; } +spin_unlock_bh (&bat_priv->gw.list_lock);if ((gw_node->bandwidth_down ==ntohl (gateway->bandwidth_down)) && (gw_node->bandwidth_up ==ntohl (gateway->bandwidth_up)))
net/batman-adv/gateway_common.c +5 -0
@@ -253,6 +253,11 @@ static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,*/ void batadv_gw_init (struct batadv_priv *bat_priv) { +if (bat_priv->algo_ops->gw.init_sel_class) + bat_priv->algo_ops->gw.init_sel_class (bat_priv); +else +atomic_set (&bat_priv->gw.sel_class,1 ); +batadv_tvlv_handler_register (bat_priv, batadv_gw_tvlv_ogm_handler_v1,NULL ,BATADV_TVLV_GW ,1 ,BATADV_TVLV_HANDLER_OGM_CIFNOTFND );
net/batman-adv/hard-interface.c +43 -8
105 lines not on this page · raw message
net/batman-adv/originator.c +2 -2
@@ -1495,7 +1495,7 @@ int batadv_orig_dump(struct sk_buff *msg, struct netlink_callback *cb) }int batadv_orig_hash_add_if (struct batadv_hard_iface *hard_iface, -int max_if_num) +unsigned int max_if_num) {struct batadv_priv *bat_priv =netdev_priv (hard_iface->soft_iface);struct batadv_algo_ops *bao = bat_priv->algo_ops;
@@ -1530,7 +1530,7 @@ int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface, }int batadv_orig_hash_del_if (struct batadv_hard_iface *hard_iface, -int max_if_num) +unsigned int max_if_num) {struct batadv_priv *bat_priv =netdev_priv (hard_iface->soft_iface);struct batadv_hashtable *hash = bat_priv->orig_hash;
net/batman-adv/originator.h +2 -2
@@ -78,9 +78,9 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset);int batadv_orig_dump (struct sk_buff *msg,struct netlink_callback *cb);int batadv_orig_hardif_seq_print_text (struct seq_file *seq,void *offset);int batadv_orig_hash_add_if (struct batadv_hard_iface *hard_iface, -int max_if_num); +unsigned int max_if_num);int batadv_orig_hash_del_if (struct batadv_hard_iface *hard_iface, -int max_if_num); +unsigned int max_if_num);struct batadv_orig_node_vlan *batadv_orig_node_vlan_new (struct batadv_orig_node *orig_node,unsigned short vid);
net/batman-adv/routing.c +10 -1
@@ -930,7 +930,6 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,bool is4addr; unicast_packet = (struct batadv_unicast_packet *)skb->data; - unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; is4addr = unicast_packet->packet_type ==BATADV_UNICAST_4ADDR ;/* the caller function should have already pulled 2 bytes */
@@ -951,9 +950,13 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,if (!batadv_check_unicast_ttvn (bat_priv, skb, hdr_size))return NET_RX_DROP ; + unicast_packet = (struct batadv_unicast_packet *)skb->data; +/* packet for me */ if (batadv_is_my_mac (bat_priv, unicast_packet->dest)) {if (is4addr) { + unicast_4addr_packet = + (struct batadv_unicast_4addr_packet *)skb->data; subtype = unicast_4addr_packet->subtype;batadv_dat_inc_counter (bat_priv, subtype);
@@ -1080,6 +1083,12 @@ int batadv_recv_frag_packet(struct sk_buff *skb,batadv_inc_counter (bat_priv,BATADV_CNT_FRAG_RX );batadv_add_counter (bat_priv,BATADV_CNT_FRAG_RX_BYTES , skb->len); +/* batadv_frag_skb_buffer will always consume the skb and +* the caller should therefore never try to free the +* skb after this point +*/ + ret =NET_RX_SUCCESS ; +/* Add fragment to buffer and merge if possible. */ if (!batadv_frag_skb_buffer (&skb, orig_node_src)) goto out;
net/batman-adv/soft-interface.c +0 -1
@@ -808,7 +808,6 @@ static int batadv_softif_init_late(struct net_device *dev)atomic_set (&bat_priv->mcast.num_want_all_ipv6,0 );#endif atomic_set (&bat_priv->gw.mode,BATADV_GW_MODE_OFF ); -atomic_set (&bat_priv->gw.sel_class,20 );atomic_set (&bat_priv->gw.bandwidth_down,100 );atomic_set (&bat_priv->gw.bandwidth_up,20 );atomic_set (&bat_priv->orig_interval,1000 );
net/batman-adv/translation-table.c +122 -27
352 lines not on this page · raw message
net/batman-adv/types.h +17 -5
@@ -27,6 +27,7 @@#include <linux/compiler.h> #include <linux/if_ether.h> #include <linux/kref.h> +#include <linux/mutex.h> #include <linux/netdevice.h> #include <linux/netlink.h> #include <linux/sched.h> /* for linux/wait.h */
@@ -81,11 +82,13 @@ enum batadv_dhcp_recipient {* @ogm_buff: buffer holding the OGM packet * @ogm_buff_len: length of the OGM packet buffer * @ogm_seqno: OGM sequence number - used to identify each OGM +* @ogm_buff_mutex: lock protecting ogm_buff and ogm_buff_len */ struct batadv_hard_iface_bat_iv {unsigned char *ogm_buff;int ogm_buff_len;atomic_t ogm_seqno; +struct mutex ogm_buff_mutex; };/**
@@ -139,7 +142,7 @@ struct batadv_hard_iface_bat_v {*/ struct batadv_hard_iface {struct list_head list; -s16 if_num; +unsigned int if_num;char if_status;struct net_device *net_dev;u8 num_bcasts;
@@ -966,12 +969,14 @@ struct batadv_softif_vlan {* @ogm_buff: buffer holding the OGM packet * @ogm_buff_len: length of the OGM packet buffer * @ogm_seqno: OGM sequence number - used to identify each OGM +* @ogm_buff_mutex: lock protecting ogm_buff and ogm_buff_len * @ogm_wq: workqueue used to schedule OGM transmissions */ struct batadv_priv_bat_v {unsigned char *ogm_buff;int ogm_buff_len;atomic_t ogm_seqno; +struct mutex ogm_buff_mutex;struct delayed_work ogm_wq; };
@@ -1060,7 +1065,7 @@ struct batadv_priv {atomic_t bcast_seqno;atomic_t bcast_queue_left;atomic_t batman_queue_left; -char num_ifaces; +unsigned int num_ifaces;struct kobject *mesh_obj;struct dentry *debug_dir;struct hlist_head forw_bat_list;
@@ -1241,6 +1246,7 @@ struct batadv_tt_global_entry {* struct batadv_tt_orig_list_entry - orig node announcing a non-mesh client * @orig_node: pointer to orig node announcing this non-mesh client * @ttvn: translation table version number which added the non-mesh client +* @flags: per orig entry TT sync flags * @list: list node for batadv_tt_global_entry::orig_list * @refcount: number of contexts the object is used * @rcu: struct used for freeing in an RCU-safe manner
@@ -1248,6 +1254,7 @@ struct batadv_tt_global_entry {struct batadv_tt_orig_list_entry {struct batadv_orig_node *orig_node;u8 ttvn; +u8 flags;struct hlist_node list;struct kref refcount;struct rcu_head rcu;
@@ -1397,6 +1404,7 @@ struct batadv_forw_packet {* @activate: start routing mechanisms when hard-interface is brought up * (optional) * @enable: init routing info when hard-interface is enabled +* @enabled: notification when hard-interface was enabled (optional) * @disable: de-init routing info when hard-interface is disabled * @update_mac: (re-)init mac addresses of the protocol information * belonging to this hard-interface
@@ -1405,6 +1413,7 @@ struct batadv_forw_packet {struct batadv_algo_iface_ops {void (*activate)(struct batadv_hard_iface *hard_iface);int (*enable)(struct batadv_hard_iface *hard_iface); +void (*enabled)(struct batadv_hard_iface *hard_iface);void (*disable)(struct batadv_hard_iface *hard_iface);void (*update_mac)(struct batadv_hard_iface *hard_iface);void (*primary_set)(struct batadv_hard_iface *hard_iface);
@@ -1452,9 +1461,10 @@ struct batadv_algo_neigh_ops {*/ struct batadv_algo_orig_ops {void (*free)(struct batadv_orig_node *orig_node); -int (*add_if)(struct batadv_orig_node *orig_node,int max_if_num); -int (*del_if)(struct batadv_orig_node *orig_node,int max_if_num, -int del_if_num); +int (*add_if)(struct batadv_orig_node *orig_node, +unsigned int max_if_num); +int (*del_if)(struct batadv_orig_node *orig_node, +unsigned int max_if_num,unsigned int del_if_num);#ifdef CONFIG_BATMAN_ADV_DEBUGFS void (*print)(struct batadv_priv *priv,struct seq_file *seq,struct batadv_hard_iface *hard_iface);
@@ -1466,6 +1476,7 @@ struct batadv_algo_orig_ops {/** * struct batadv_algo_gw_ops - mesh algorithm callbacks (GW specific) +* @init_sel_class: initialize GW selection class (optional) * @store_sel_class: parse and stores a new GW selection class (optional) * @show_sel_class: prints the current GW selection class (optional) * @get_best_gw_node: select the best GW from the list of available nodes
@@ -1476,6 +1487,7 @@ struct batadv_algo_orig_ops {* @dump: dump gateways to a netlink socket (optional) */ struct batadv_algo_gw_ops { +void (*init_sel_class)(struct batadv_priv *bat_priv);ssize_t (*store_sel_class)(struct batadv_priv *bat_priv,char *buff,size_t count);ssize_t (*show_sel_class)(struct batadv_priv *bat_priv,char *buff);
net/core/netclassid_cgroup.c +37 -10
77 lines not on this page · raw message
net/ieee802154/nl_policy.c +6 -0
@@ -30,7 +30,13 @@ const struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = { [IEEE802154_ATTR_HW_ADDR] = { .type = NLA_HW_ADDR, }, [IEEE802154_ATTR_PAN_ID] = { .type = NLA_U16, }, [IEEE802154_ATTR_CHANNEL] = { .type = NLA_U8, }, + [IEEE802154_ATTR_BCN_ORD] = { .type = NLA_U8, }, + [IEEE802154_ATTR_SF_ORD] = { .type = NLA_U8, }, + [IEEE802154_ATTR_PAN_COORD] = { .type = NLA_U8, }, + [IEEE802154_ATTR_BAT_EXT] = { .type = NLA_U8, }, + [IEEE802154_ATTR_COORD_REALIGN] = { .type = NLA_U8, }, [IEEE802154_ATTR_PAGE] = { .type = NLA_U8, }, + [IEEE802154_ATTR_DEV_TYPE] = { .type = NLA_U8, }, [IEEE802154_ATTR_COORD_SHORT_ADDR] = { .type = NLA_U16, }, [IEEE802154_ATTR_COORD_HW_ADDR] = { .type = NLA_HW_ADDR, }, [IEEE802154_ATTR_COORD_PAN_ID] = { .type = NLA_U16, },
net/ipv4/cipso_ipv4.c +6 -1
@@ -1738,6 +1738,7 @@ void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway) {unsigned char optbuf[sizeof (struct ip_options ) +40 ];struct ip_options *opt = (struct ip_options *)optbuf; +int res;if (ip_hdr (skb)->protocol ==IPPROTO_ICMP || error != -EACCES )return ;
@@ -1749,7 +1750,11 @@ void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway)memset (opt,0 ,sizeof (struct ip_options )); opt->optlen =ip_hdr (skb)->ihl*4 -sizeof (struct iphdr ); -if (__ip_options_compile (dev_net (skb->dev), opt, skb,NULL )) +rcu_read_lock (); + res =__ip_options_compile (dev_net (skb->dev), opt, skb,NULL ); +rcu_read_unlock (); + +if (res)return ;if (gateway)
net/ipv4/gre_demux.c +10 -2
@@ -60,7 +60,9 @@ int gre_del_protocol(const struct gre_protocol *proto, u8 version) }EXPORT_SYMBOL_GPL (gre_del_protocol); -/* Fills in tpi and returns header length to be pulled. */ +/* Fills in tpi and returns header length to be pulled. +* Note that caller must use pskb_may_pull() before pulling GRE header. +*/ int gre_parse_header (struct sk_buff *skb,struct tnl_ptk_info *tpi,bool *csum_err,__be16 proto,int nhs) {
@@ -114,8 +116,14 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,* - When dealing with WCCPv2, Skip extra 4 bytes in GRE header */ if (greh->flags ==0 && tpi->proto ==htons (ETH_P_WCCP )) { +u8 _val, *val; + + val =skb_header_pointer (skb, nhs + hdr_len, +sizeof (_val), &_val); +if (!val) +return -EINVAL ; tpi->proto = proto; -if ((*(u8 *)options &0xF0 ) !=0x40 ) +if ((*val &0xF0 ) !=0x40 ) hdr_len +=4 ; } tpi->hdr_len = hdr_len;
net/ipv6/addrconf.c +4 -0
@@ -3189,6 +3189,10 @@ static void addrconf_dev_config(struct net_device *dev) (dev->type != ARPHRD_6LOWPAN) && (dev->type != ARPHRD_NONE)) {/* Alas, we support only Ethernet autoconfiguration. */ + idev =__in6_dev_get (dev); +if (!IS_ERR_OR_NULL (idev) && dev->flags &IFF_UP && + dev->flags &IFF_MULTICAST ) +ipv6_mc_up (idev);return ; }
net/ipv6/ipv6_sockglue.c +8 -2
@@ -184,9 +184,15 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, retv = -EBUSY ;break ; } - }else if (sk->sk_protocol !=IPPROTO_TCP ) + }else if (sk->sk_protocol ==IPPROTO_TCP ) { +if (sk->sk_prot != &tcpv6_prot) { + retv = -EBUSY ; +break ; + }break ; - + }else { +break ; + }if (sk->sk_state !=TCP_ESTABLISHED ) { retv = -ENOTCONN ;break ;
net/mac80211/rx.c +1 -1
@@ -3841,7 +3841,7 @@ void __ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata)lockdep_assert_held (&local->sta_mtx); -list_for_each_entry_rcu (sta, &local->sta_list, list) { +list_for_each_entry (sta, &local->sta_list, list) {if (sdata != sta->sdata && (!sta->sdata->bss || sta->sdata->bss != sdata->bss))continue ;
net/netfilter/nfnetlink_cthelper.c +2 -0
@@ -711,6 +711,8 @@ static const struct nla_policy nfnl_cthelper_policy[NFCTH_MAX+1] = { [NFCTH_NAME ] = { .type =NLA_NUL_STRING , .len = NF_CT_HELPER_NAME_LEN-1 }, [NFCTH_QUEUE_NUM] = { .type = NLA_U32, }, + [NFCTH_PRIV_DATA_LEN] = { .type = NLA_U32, }, + [NFCTH_STATUS] = { .type = NLA_U32, }, };static const struct nfnl_callback nfnl_cthelper_cb[NFNL_MSG_CTHELPER_MAX ] = {
net/nfc/hci/core.c +16 -3
@@ -193,13 +193,20 @@ void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result,void nfc_hci_cmd_received (struct nfc_hci_dev *hdev,u8 pipe,u8 cmd,struct sk_buff *skb) { -u8 gate = hdev->pipes[pipe].gate;u8 status =NFC_HCI_ANY_OK ;struct hci_create_pipe_resp *create_info;struct hci_delete_pipe_noti *delete_info;struct hci_all_pipe_cleared_noti *cleared_info; +u8 gate; -pr_debug ("from gate %x pipe %x cmd %x\n" , gate, pipe, cmd); +pr_debug ("from pipe %x cmd %x\n" , pipe, cmd); + +if (pipe >=NFC_HCI_MAX_PIPES ) { + status =NFC_HCI_ANY_E_NOK ; + goto exit; + } + + gate = hdev->pipes[pipe].gate;switch (cmd) {case NFC_HCI_ADM_NOTIFY_PIPE_CREATED :
@@ -387,8 +394,14 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, struct sk_buff *skb) {int r =0 ; -u8 gate = hdev->pipes[pipe].gate; +u8 gate; + +if (pipe >=NFC_HCI_MAX_PIPES ) { +pr_err ("Discarded event %x to invalid pipe %x\n" , event, pipe); + goto exit; + } + gate = hdev->pipes[pipe].gate;if (gate ==NFC_HCI_INVALID_GATE ) {pr_err ("Discarded event %x to unopened pipe %x\n" , event, pipe); goto exit;
net/nfc/netlink.c +3 -0
@@ -62,7 +62,10 @@ static const struct nla_policy nfc_genl_policy[NFC_ATTR_MAX + 1] = { [NFC_ATTR_LLC_SDP] = { .type = NLA_NESTED }, [NFC_ATTR_FIRMWARE_NAME ] = { .type =NLA_STRING , .len = NFC_FIRMWARE_NAME_MAXSIZE }, + [NFC_ATTR_SE_INDEX] = { .type = NLA_U32 }, [NFC_ATTR_SE_APDU] = { .type = NLA_BINARY }, + [NFC_ATTR_VENDOR_ID] = { .type = NLA_U32 }, + [NFC_ATTR_VENDOR_SUBCMD] = { .type = NLA_U32 }, [NFC_ATTR_VENDOR_DATA] = { .type = NLA_BINARY }, };
net/sched/sch_fq.c +1 -0
@@ -697,6 +697,7 @@ static const struct nla_policy fq_policy[TCA_FQ_MAX + 1] = { [TCA_FQ_FLOW_MAX_RATE] = { .type = NLA_U32 }, [TCA_FQ_BUCKETS_LOG] = { .type = NLA_U32 }, [TCA_FQ_FLOW_REFILL_DELAY] = { .type = NLA_U32 }, + [TCA_FQ_ORPHAN_MASK] = { .type = NLA_U32 }, [TCA_FQ_LOW_RATE_THRESHOLD] = { .type = NLA_U32 }, };
net/wireless/nl80211.c +5 -0
@@ -359,6 +359,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_KEY_DEFAULT_TYPES] = { .type = NLA_NESTED }, [NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED }, [NL80211_ATTR_STA_PLINK_STATE] = { .type = NLA_U8 }, + [NL80211_ATTR_MEASUREMENT_DURATION] = { .type = NLA_U16 }, + [NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY] = { .type = NLA_FLAG }, [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 }, [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED }, [NL80211_ATTR_SCAN_SUPP_RATES] = { .type = NLA_NESTED },
@@ -407,6 +409,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_MDID] = { .type = NLA_U16 }, [NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY, .len = IEEE80211_MAX_DATA_LEN }, + [NL80211_ATTR_CRIT_PROT_ID] = { .type = NLA_U16 }, + [NL80211_ATTR_MAX_CRIT_PROT_DURATION] = { .type = NLA_U16 }, [NL80211_ATTR_PEER_AID] = { .type = NLA_U16 }, [NL80211_ATTR_CH_SWITCH_COUNT] = { .type = NLA_U32 }, [NL80211_ATTR_CH_SWITCH_BLOCK_TX] = { .type = NLA_FLAG },
@@ -432,6 +436,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_USER_PRIO] = { .type = NLA_U8 }, [NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 }, [NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 }, + [NL80211_ATTR_OPER_CLASS] = { .type = NLA_U8 }, [NL80211_ATTR_MAC_MASK] = { .len = ETH_ALEN }, [NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG }, [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 },
net/wireless/reg.c +1 -1
@@ -1730,7 +1730,7 @@ static void handle_channel_custom(struct wiphy *wiphy,break ; } -if (IS_ERR (reg_rule)) { +if (IS_ERR_OR_NULL (reg_rule)) {pr_debug ("Disabling freq %d MHz as custom regd has no rule that fits it\n" , chan->center_freq);if (wiphy->regulatory_flags ®ULATORY_WIPHY_SELF_MANAGED ) {