Linux 4.9.177
Greg KH
maintainerI'm announcing the release of the 4.9.177 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
------------
Makefile | 2 arch/mips/ath79/setup.c | 6 arch/powerpc/include/asm/reg_booke.h | 2 arch/powerpc/kernel/security.c | 1 arch/powerpc/lib/code-patching.c | 2 arch/x86/entry/vdso/Makefile | 3 arch/x86/kernel/reboot.c | 21 arch/x86/kvm/trace.h | 4 drivers/gpu/drm/sun4i/sun4i_drv.c | 2 drivers/gpu/ipu-v3/ipu-dp.c | 12 drivers/hid/hid-input.c | 14 drivers/iio/adc/xilinx-xadc-core.c | 2 drivers/input/rmi4/rmi_driver.c | 6 drivers/irqchip/irq-ath79-misc.c | 11 drivers/isdn/mISDN/socket.c | 4 drivers/md/raid5.c | 19 drivers/net/bonding/bond_options.c | 7 drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 8 drivers/net/phy/spi_ks8995.c | 9 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 1 drivers/net/wireless/st/cw1200/scan.c | 5 drivers/nfc/st95hf/core.c | 7 drivers/nvdimm/btt_devs.c | 18 drivers/nvdimm/namespace_devs.c | 5 drivers/platform/x86/sony-laptop.c | 8 drivers/s390/block/dasd_eckd.c | 6 drivers/s390/char/con3270.c | 2 drivers/s390/char/fs3270.c | 3 drivers/s390/char/raw3270.c | 3 drivers/s390/char/raw3270.h | 4 drivers/s390/char/tty3270.c | 3 drivers/s390/net/ctcm_main.c | 1 drivers/usb/serial/generic.c | 39 + drivers/virt/fsl_hypervisor.c | 29 - include/linux/efi.h | 7 include/linux/list_nulls.h | 5 include/linux/rculist_nulls.h | 14 include/sound/pcm.h | 2 init/main.c | 4 kernel/bpf/hashtab.c | 99 ++-- net/8021q/vlan_dev.c | 4 net/bridge/br_if.c | 13 net/core/fib_rules.c | 6 net/ipv4/raw.c | 4 net/ipv6/sit.c | 2 net/mac80211/mesh_pathtbl.c | 2 net/netfilter/ipvs/ip_vs_core.c | 2 net/netfilter/x_tables.c | 2 net/packet/af_packet.c | 25 - sound/core/pcm_lib.c | 2 sound/core/pcm_native.c | 6 tools/lib/traceevent/event-parse.c | 2 tools/testing/selftests/net/run_netsocktests | 2 tools/testing/selftests/netfilter/Makefile | 2 tools/testing/selftests/netfilter/conntrack_icmp_related.sh | 283 ++++++++++++ 55 files changed, 604 insertions(+), 153 deletions(-)
Aditya Pakki (1):
libnvdimm/btt: Fix a kmemdup failure check
Alexei Starovoitov (2):
bpf: fix struct htab_elem layout
bpf: convert htab map to hlist_nulls
Alistair Strachan (2):
x86: vdso: Use $LD instead of $CC to link
x86/vdso: Pass --eh-frame-hdr to the linker
Arnd Bergmann (1):
s390: ctcm: fix ctcm_new_device error return code
Breno Leitao (1):
powerpc/64s: Include cpu header
Christophe Leroy (2):
net: ucc_geth - fix Oops when changing number of buffers in the ring powerpc/lib: fix book3s/32 boot failure due to code patching
Dan Carpenter (2):
drivers/virt/fsl_hypervisor.c: dereferencing error pointers in ioctl drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl
Dan Williams (1):
init: initialize jump labels before command line option parsing
Daniel Gomez (2):
spi: Micrel eth switch: declare missing of table
spi: ST ST95HF NFC: declare missing of table
David Ahern (1):
ipv4: Fix raw socket lookup for local traffic
Dmitry Torokhov (3):
HID: input: add mapping for Expose/Overview key
HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys
HID: input: add mapping for "Toggle Display" key
Felix Fietkau (1):
mac80211: fix unaligned access in mesh table hash function
Florian Westphal (1):
selftests: netfilter: check icmp pkttoobig errors are set as related
Francesco Ruggeri (1):
netfilter: compat: initialize all fields in xt_init
Greg Kroah-Hartman (1):
Linux 4.9.177
Gustavo A. R. Silva (2):
platform/x86: sony-laptop: Fix unintentional fall-through
rtlwifi: rtl8723ae: Fix missing break in switch statement
Hangbin Liu (2):
fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied
vlan: disable SIOCSHWTSTAMP in container
Jarod Wilson (1):
bonding: fix arp_validate toggling in active-backup mode
Jian-Hong Pan (1):
x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T
Johan Hovold (1):
USB: serial: fix unthrottle races
Julian Anastasov (1):
ipvs: do not schedule icmp errors from tunnels
Kangjie Lu (1):
libnvdimm/namespace: Fix a potential NULL pointer dereference
Laurentiu Tudor (1):
powerpc/booke64: set RI in default MSR
Lucas Stach (1):
gpu: ipu-v3: dp: fix CSC handling
Martin Schwidefsky (1):
s390/3270: fix lockdep false positive on view->lock
Nick Desaulniers (1):
x86/vdso: Drop implicit common-page-size linker flag
Nigel Croxon (1):
Don't jump to compute_result state from check_result state
Pan Bian (1):
Input: synaptics-rmi4 - fix possible double free
Paul Kocialkowski (1):
drm/sun4i: Set device driver data at bind time for use in unbind
Peter Oberparleiter (1):
s390/dasd: Fix capacity calculation for large volumes
Petr Štetiar (1):
MIPS: perf: ath79: Fix perfcount IRQ assignment
Po-Hsu Lin (1):
selftests/net: correct the return value for run_netsocktests
Rikard Falkeborn (1):
tools lib traceevent: Fix missing equality check for strcmp
Sasha Levin (2):
Revert "x86/vdso: Drop implicit common-page-size linker flag" Revert "x86: vdso: Use $LD instead of $CC to link"
Stephen Suryaputra (1):
vrf: sit mtu should not be updated when vrf netdev is the link
Sven Van Asbroeck (1):
iio: adc: xilinx: fix potential use-after-free on remove
Takashi Sakamoto (1):
ALSA: pcm: remove SNDRV_PCM_IOCTL1_INFO internal command
Tetsuo Handa (1):
mISDN: Check address length before reading address family
Tobin C. Harding (1):
bridge: Fix error path for kobject_init_and_add()
Vitaly Kuznetsov (1):
KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing
Wei Yongjun (1):
cw1200: fix missing unlock on error in cw1200_hw_scan()
YueHaibing (1):
packet: Fix error path in packet_init
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 176 +SUBLEVEL = 177 EXTRAVERSION = NAME = Roaring Lionus
arch/mips/ath79/setup.c +0 -6
@@ -183,12 +183,6 @@ const char *get_system_type(void)return ath79_sys_type; } -int get_c0_perfcount_int (void ) -{ -return ATH79_MISC_IRQ (5 ); -} -EXPORT_SYMBOL_GPL (get_c0_perfcount_int); -unsigned int get_c0_compare_int (void ) {return CP0_LEGACY_COMPARE_IRQ ;
arch/powerpc/include/asm/reg_booke.h +1 -1
@@ -41,7 +41,7 @@#if defined(CONFIG_PPC_BOOK3E_64 )#define MSR_64BIT MSR_CM -#define MSR_ (MSR_ME | MSR_CE) +#define MSR_ (MSR_ME | MSR_RI | MSR_CE)#define MSR_KERNEL (MSR_ | MSR_64BIT)#define MSR_USER32 (MSR_ | MSR_PR | MSR_EE)#define MSR_USER64 (MSR_USER32 | MSR_64BIT)
arch/powerpc/kernel/security.c +1 -0
@@ -4,6 +4,7 @@// // Copyright 2018, Michael Ellerman, IBM Corporation. +#include <linux/cpu.h> #include <linux/kernel.h> #include <linux/debugfs.h> #include <linux/device.h>
arch/powerpc/lib/code-patching.c +1 -1
@@ -23,7 +23,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr)int err;/* Make sure we aren't patching a freed init section */ -if (init_mem_is_free &&init_section_contains (addr,4 )) { +if (*PTRRELOC (&init_mem_is_free) &&init_section_contains (addr,4 )) {pr_debug ("Skipping init section patching addr: 0x%px\n" , addr);return 0 ; }
arch/x86/entry/vdso/Makefile +2 -1
@@ -167,7 +167,8 @@ quiet_cmd_vdso = VDSO $@ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ - $(call ld-option, --build-id) -Bsymbolic + $(call ld-option, --build-id) $(call ld-option, --eh-frame-hdr) \ + -Bsymbolic GCOV_PROFILE := n #
arch/x86/kernel/reboot.c +21 -0
@@ -82,6 +82,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)return 0 ; } +/* +* Some machines don't handle the default ACPI reboot method and +* require the EFI reboot method: +*/ +static int __init set_efi_reboot (const struct dmi_system_id *d) +{ +if (reboot_type !=BOOT_EFI && !efi_runtime_disabled ()) { + reboot_type =BOOT_EFI ; +pr_info ("%s series board detected. Selecting EFI-method for reboot.\n" , d->ident); + } +return 0 ; +} +void __noreturn machine_real_restart (unsigned int type) {local_irq_disable ();
@@ -167,6 +180,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), }, }, + { /* Handle reboot issue on Acer TravelMate X514-51T */ + .callback = set_efi_reboot, + .ident = "Acer TravelMate X514-51T", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"), + }, + },/* Apple */ {/* Handle problems with rebooting on Apple MacBook5 */
arch/x86/kvm/trace.h +2 -2
@@ -434,13 +434,13 @@ TRACE_EVENT(kvm_apic_ipi, ); TRACE_EVENT(kvm_apic_accept_irq, - TP_PROTO(__u32 apicid, __u16 dm, __u8 tm, __u8 vec), + TP_PROTO(__u32 apicid, __u16 dm, __u16 tm, __u8 vec), TP_ARGS(apicid, dm, tm, vec), TP_STRUCT__entry( __field( __u32, apicid ) __field( __u16, dm ) - __field( __u8, tm ) + __field( __u16, tm ) __field( __u8, vec ) ),
drivers/gpu/drm/sun4i/sun4i_drv.c +2 -0
@@ -137,6 +137,8 @@ static int sun4i_drv_bind(struct device *dev) ret = -ENOMEM ; goto free_drm; } + +dev_set_drvdata (dev, drm); drm->dev_private = drv;drm_vblank_init (drm,1 );
drivers/gpu/ipu-v3/ipu-dp.c +9 -3
@@ -195,7 +195,8 @@ int ipu_dp_setup_channel(struct ipu_dp *dp,ipu_dp_csc_init (flow, flow->foreground.in_cs, flow->out_cs,DP_COM_CONF_CSC_DEF_BOTH ); }else { -if (flow->foreground.in_cs == flow->out_cs) +if (flow->foreground.in_cs ==IPUV3_COLORSPACE_UNKNOWN || + flow->foreground.in_cs == flow->out_cs)/* * foreground identical to output, apply color * conversion on background
@@ -261,6 +262,8 @@ void ipu_dp_disable_channel(struct ipu_dp *dp)struct ipu_dp_priv *priv = flow->priv;u32 reg, csc; + dp->in_cs =IPUV3_COLORSPACE_UNKNOWN ; +if (!dp->foreground)return ;
@@ -268,8 +271,9 @@ void ipu_dp_disable_channel(struct ipu_dp *dp) reg =readl (flow->base +DP_COM_CONF ); csc = reg &DP_COM_CONF_CSC_DEF_MASK ; -if (csc ==DP_COM_CONF_CSC_DEF_FG ) - reg &= ~DP_COM_CONF_CSC_DEF_MASK ; + reg &= ~DP_COM_CONF_CSC_DEF_MASK ; +if (csc ==DP_COM_CONF_CSC_DEF_BOTH || csc ==DP_COM_CONF_CSC_DEF_BG ) + reg |=DP_COM_CONF_CSC_DEF_BG ; reg &= ~DP_COM_CONF_FG_EN ;writel (reg, flow->base +DP_COM_CONF );
@@ -350,6 +354,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base)mutex_init (&priv->mutex);for (i =0 ; i <IPUV3_NUM_FLOWS ; i++) { + priv->flow[i].background.in_cs =IPUV3_COLORSPACE_UNKNOWN ; + priv->flow[i].foreground.in_cs =IPUV3_COLORSPACE_UNKNOWN ; priv->flow[i].foreground.foreground = true; priv->flow[i].base = priv->base + ipu_dp_flow_base[i]; priv->flow[i].priv = priv;
drivers/hid/hid-input.c +14 -0
@@ -607,6 +607,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielbreak ; } +if ((usage->hid &0xf0 ) ==0xb0 ) {/* SC - Display */ +switch (usage->hid &0xf ) { +case 0x05 :map_key_clear (KEY_SWITCHVIDEOMODE );break ; +default : goto ignore; + } +break ; + } +/* * Some lazy vendors declare 255 usages for System Control, * leading to the creation of ABS_X|Y axis and too many others.
@@ -802,6 +810,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x074 :map_key_clear (KEY_BRIGHTNESS_MAX );break ;case 0x075 :map_key_clear (KEY_BRIGHTNESS_AUTO );break ; +case 0x079 :map_key_clear (KEY_KBDILLUMUP );break ; +case 0x07a :map_key_clear (KEY_KBDILLUMDOWN );break ; +case 0x07c :map_key_clear (KEY_KBDILLUMTOGGLE );break ; +case 0x082 :map_key_clear (KEY_VIDEO_NEXT );break ;case 0x083 :map_key_clear (KEY_LAST );break ;case 0x084 :map_key_clear (KEY_ENTER );break ;
@@ -932,6 +944,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielcase 0x2cb :map_key_clear (KEY_KBDINPUTASSIST_ACCEPT );break ;case 0x2cc :map_key_clear (KEY_KBDINPUTASSIST_CANCEL );break ; +case 0x29f :map_key_clear (KEY_SCALE );break ; +default :map_key_clear (KEY_UNKNOWN ); }break ;
drivers/iio/adc/xilinx-xadc-core.c +1 -1
@@ -1299,7 +1299,7 @@ static int xadc_remove(struct platform_device *pdev) }free_irq (irq, indio_dev);clk_disable_unprepare (xadc->clk); -cancel_delayed_work (&xadc->zynq_unmask_work); +cancel_delayed_work_sync (&xadc->zynq_unmask_work);kfree (xadc->data);kfree (indio_dev->channels);
drivers/input/rmi4/rmi_driver.c +1 -5
@@ -772,7 +772,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, error =rmi_register_function (fn);if (error) - goto err_put_fn; +return error;if (pdt->function_number ==0x01 ) data->f01_container = fn;
@@ -780,10 +780,6 @@ static int rmi_create_function(struct rmi_device *rmi_dev,list_add_tail (&fn->node, &data->function_list);return RMI_SCAN_CONTINUE ; - -err_put_fn: -put_device (&fn->dev); -return error; }int rmi_driver_suspend (struct rmi_device *rmi_dev)
drivers/irqchip/irq-ath79-misc.c +11 -0
@@ -22,6 +22,15 @@#define AR71XX_RESET_REG_MISC_INT_ENABLE 4#define ATH79_MISC_IRQ_COUNT 32 +#define ATH79_MISC_PERF_IRQ 5 + +static int ath79_perfcount_irq; + +int get_c0_perfcount_int (void ) +{ +return ath79_perfcount_irq; +} +EXPORT_SYMBOL_GPL (get_c0_perfcount_int);static void ath79_misc_irq_handler (struct irq_desc *desc) {
@@ -113,6 +122,8 @@ static void __init ath79_misc_intc_domain_init( {void __iomem *base = domain->host_data; + ath79_perfcount_irq =irq_create_mapping (domain,ATH79_MISC_PERF_IRQ ); +/* Disable and clear all interrupts */ __raw_writel (0 , base +AR71XX_RESET_REG_MISC_INT_ENABLE );__raw_writel (0 , base +AR71XX_RESET_REG_MISC_INT_STATUS );
drivers/isdn/mISDN/socket.c +2 -2
@@ -712,10 +712,10 @@ base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)struct sock *sk = sock->sk;int err =0 ; -if (!maddr || maddr->family !=AF_ISDN ) +if (addr_len <sizeof (struct sockaddr_mISDN ))return -EINVAL ; -if (addr_len <sizeof (struct sockaddr_mISDN )) +if (!maddr || maddr->family !=AF_ISDN )return -EINVAL ;lock_sock (sk);
drivers/md/raid5.c +4 -15
@@ -3914,26 +3914,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,case check_state_check_result: sh->check_state = check_state_idle; +if (s->failed >1 ) +break ;/* handle a successful check operation, if parity is correct * we are done. Otherwise update the mismatch count and repair * parity if !MD_RECOVERY_CHECK */ if (sh->ops.zero_sum_result ==0 ) { -/* both parities are correct */ -if (!s->failed) -set_bit (STRIPE_INSYNC , &sh->state); -else { -/* in contrast to the raid5 case we can validate -* parity, but still have a failure to write -* back -*/ - sh->check_state = check_state_compute_result; -/* Returning at this point means that we may go -* off and bring p and/or q uptodate again so -* we make sure to check zero_sum_result again -* to verify if p or q need writeback -*/ - } +/* Any parity checked was correct */ +set_bit (STRIPE_INSYNC , &sh->state); }else {atomic64_add (STRIPE_SECTORS , &conf->mddev->resync_mismatches);if (test_bit (MD_RECOVERY_CHECK , &conf->mddev->recovery))
drivers/net/bonding/bond_options.c +0 -7
@@ -1065,13 +1065,6 @@ static int bond_option_arp_validate_set(struct bonding *bond, {netdev_info (bond->dev,"Setting arp_validate to %s (%llu)\n" , newval->string, newval->value); - -if (bond->dev->flags &IFF_UP ) { -if (!newval->value) - bond->recv_probe =NULL ; -else if (bond->params.arp_interval) - bond->recv_probe = bond_arp_rcv; - } bond->params.arp_validate = newval->value;return 0 ;
drivers/net/ethernet/freescale/ucc_geth_ethtool.c +3 -5
@@ -250,14 +250,12 @@ uec_set_ringparam(struct net_device *netdev,return -EINVAL ; } +if (netif_running (netdev)) +return -EBUSY ; + ug_info->bdRingLenRx[queue] = ring->rx_pending; ug_info->bdRingLenTx[queue] = ring->tx_pending; -if (netif_running (netdev)) { -/* FIXME: restart automatically */ -netdev_info (netdev,"Please re-open the interface\n" ); - } -return ret; }
drivers/net/phy/spi_ks8995.c +9 -0
@@ -162,6 +162,14 @@ static const struct spi_device_id ks8995_id[] = { };MODULE_DEVICE_TABLE (spi, ks8995_id); +static const struct of_device_id ks8895_spi_of_match[] = { + { .compatible ="micrel,ks8995" }, + { .compatible ="micrel,ksz8864" }, + { .compatible ="micrel,ksz8795" }, + { }, + }; +MODULE_DEVICE_TABLE (of, ks8895_spi_of_match); +static inline u8 get_chip_id (u8 val) {return (val >>ID1_CHIPID_S ) &ID1_CHIPID_M ;
@@ -529,6 +537,7 @@ static int ks8995_remove(struct spi_device *spi)static struct spi_driver ks8995_driver = { .driver = { .name ="spi-ks8995" , + .of_match_table =of_match_ptr (ks8895_spi_of_match), }, .probe = ks8995_probe, .remove = ks8995_remove,
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c +1 -0
@@ -1703,6 +1703,7 @@ static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw, rtlhal->oem_id =RT_CID_819X_LENOVO ;break ; } +break ;case 0x1025 : rtlhal->oem_id =RT_CID_819X_ACER ;break ;
drivers/net/wireless/st/cw1200/scan.c +4 -1
@@ -84,8 +84,11 @@ int cw1200_hw_scan(struct ieee80211_hw *hw, frame.skb =ieee80211_probereq_get (hw, priv->vif->addr,NULL ,0 , req->ie_len); -if (!frame.skb) +if (!frame.skb) { +mutex_unlock (&priv->conf_mutex); +up (&priv->scan.lock);return -ENOMEM ; + }if (req->ie_len)memcpy (skb_put (frame.skb, req->ie_len), req->ie, req->ie_len);
drivers/nfc/st95hf/core.c +7 -0
@@ -1074,6 +1074,12 @@ static const struct spi_device_id st95hf_id[] = { };MODULE_DEVICE_TABLE (spi, st95hf_id); +static const struct of_device_id st95hf_spi_of_match[] = { + { .compatible ="st,st95hf" }, + { }, +}; +MODULE_DEVICE_TABLE (of, st95hf_spi_of_match); +static int st95hf_probe (struct spi_device *nfc_spi_dev) {int ret;
@@ -1260,6 +1266,7 @@ static struct spi_driver st95hf_driver = { .driver = { .name = "st95hf", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(st95hf_spi_of_match), }, .id_table = st95hf_id, .probe = st95hf_probe,
drivers/nvdimm/btt_devs.c +13 -5
@@ -190,14 +190,15 @@ static struct device *__nd_btt_create(struct nd_region *nd_region,return NULL ; nd_btt->id =ida_simple_get (&nd_region->btt_ida,0 ,0 ,GFP_KERNEL ); -if (nd_btt->id <0 ) { -kfree (nd_btt); -return NULL ; - } +if (nd_btt->id <0 ) + goto out_nd_btt; nd_btt->lbasize = lbasize; -if (uuid) +if (uuid) { uuid =kmemdup (uuid,16 ,GFP_KERNEL ); +if (!uuid) + goto out_put_id; + } nd_btt->uuid = uuid; dev = &nd_btt->dev;dev_set_name (dev,"btt%d.%d" , nd_region->id, nd_btt->id);
@@ -212,6 +213,13 @@ static struct device *__nd_btt_create(struct nd_region *nd_region,return NULL ; }return dev; + +out_put_id: +ida_simple_remove (&nd_region->btt_ida, nd_btt->id); + +out_nd_btt: +kfree (nd_btt); +return NULL ; }struct device *nd_btt_create (struct nd_region *nd_region)
drivers/nvdimm/namespace_devs.c +4 -1
@@ -2028,9 +2028,12 @@ struct device *create_namespace_blk(struct nd_region *nd_region,if (!nsblk->uuid) goto blk_err;memcpy (name, nd_label->name,NSLABEL_NAME_LEN ); -if (name[0 ]) +if (name[0 ]) { nsblk->alt_name =kmemdup (name,NSLABEL_NAME_LEN ,GFP_KERNEL ); +if (!nsblk->alt_name) + goto blk_err; + } res =nsblk_add_resource (nd_region, ndd, nsblk,__le64_to_cpu (nd_label->dpa));if (!res)
drivers/platform/x86/sony-laptop.c +5 -3
@@ -4422,14 +4422,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device)
drivers/s390/block/dasd_eckd.c +3 -3
@@ -2054,14 +2054,14 @@ static int dasd_eckd_end_analysis(struct dasd_block *block) blk_per_trk =recs_per_track (&private->rdc_data,0 , block->bp_block); raw: - block->blocks = (private->real_cyl * + block->blocks = ((unsigned long ) private->real_cyl * private->rdc_data.trk_per_cyl * blk_per_trk); dev_info(&device->cdev->dev, - "DASD with %d KB/block, %d KB total size, %d KB/track, " + "DASD with %u KB/block, %lu KB total size, %u KB/track, " "%s\n", (block->bp_block >> 10), - ((private->real_cyl * + (((unsigned long) private->real_cyl * private->rdc_data.trk_per_cyl * blk_per_trk * (block->bp_block >> 9)) >> 1), ((blk_per_trk * block->bp_block) >> 10),
drivers/s390/char/con3270.c +1 -1
@@ -628,7 +628,7 @@ con3270_init(void) (void (*)(unsigned long )) con3270_read_tasklet, (unsigned long) condev->read); -raw3270_add_view (&condev->view, &con3270_fn,1 ); +raw3270_add_view (&condev->view, &con3270_fn,1 ,RAW3270_VIEW_LOCK_IRQ );INIT_LIST_HEAD (&condev->freemem);for (i =0 ; i <CON3270_STRING_PAGES ; i++) {
drivers/s390/char/fs3270.c +2 -1
@@ -462,7 +462,8 @@ fs3270_open(struct inode *inode, struct file *filp)init_waitqueue_head (&fp->wait); fp->fs_pid =get_pid (task_pid (current)); - rc =raw3270_add_view (&fp->view, &fs3270_fn, minor); + rc =raw3270_add_view (&fp->view, &fs3270_fn, minor, +RAW3270_VIEW_LOCK_BH );if (rc) {fs3270_free_view (&fp->view); goto out;
drivers/s390/char/raw3270.c +2 -1
@@ -919,7 +919,7 @@ raw3270_deactivate_view(struct raw3270_view *view)* Add view to device with minor "minor". */ int -raw3270_add_view (struct raw3270_view *view,struct raw3270_fn *fn,int minor) +raw3270_add_view (struct raw3270_view *view,struct raw3270_fn *fn,int minor,int subclass) {unsigned long flags;struct raw3270 *rp;
@@ -941,6 +941,7 @@ raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor) view->cols = rp->cols; view->ascebc = rp->ascebc;spin_lock_init (&view->lock); +lockdep_set_subclass (&view->lock, subclass);list_add (&view->list, &rp->view_list); rc =0 ;spin_unlock_irqrestore (get_ccwdev_lock (rp->cdev), flags);
drivers/s390/char/raw3270.h +3 -1
@@ -149,6 +149,8 @@ struct raw3270_fn {struct raw3270_view {struct list_head list;spinlock_t lock; +#define RAW3270_VIEW_LOCK_IRQ 0 +#define RAW3270_VIEW_LOCK_BH 1atomic_t ref_count;struct raw3270 *dev;struct raw3270_fn *fn;
@@ -157,7 +159,7 @@ struct raw3270_view {unsigned char *ascebc;/* ascii -> ebcdic table */ }; -int raw3270_add_view (struct raw3270_view *,struct raw3270_fn *,int ); +int raw3270_add_view (struct raw3270_view *,struct raw3270_fn *,int ,int );int raw3270_activate_view (struct raw3270_view *);void raw3270_del_view (struct raw3270_view *);void raw3270_deactivate_view (struct raw3270_view *);
drivers/s390/char/tty3270.c +2 -1
@@ -978,7 +978,8 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)return PTR_ERR (tp); rc =raw3270_add_view (&tp->view, &tty3270_fn, - tty->index +RAW3270_FIRSTMINOR ); + tty->index +RAW3270_FIRSTMINOR , +RAW3270_VIEW_LOCK_BH );if (rc) {tty3270_free_view (tp);return rc;
drivers/s390/net/ctcm_main.c +1 -0
@@ -1595,6 +1595,7 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev)if (priv->channel[direction] ==NULL ) {if (direction ==CTCM_WRITE )channel_free (priv->channel[CTCM_READ ]); + result = -ENODEV ; goto out_dev; } priv->channel[direction]->netdev = dev;
drivers/usb/serial/generic.c +32 -7
@@ -350,6 +350,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)struct usb_serial_port *port = urb->context;unsigned char *data = urb->transfer_buffer;unsigned long flags; +bool stopped = false;int status = urb->status;int i;
@@ -357,33 +358,51 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)if (urb == port->read_urbs[i])break ; } -set_bit (i, &port->read_urbs_free);dev_dbg (&port->dev,"%s - urb %d, len %d\n" , __func__, i, urb->actual_length);switch (status) {case 0 : +usb_serial_debug_data (&port->dev, __func__, urb->actual_length, + data); + port->serial->type->process_read_urb (urb);break ;case -ENOENT :case -ECONNRESET :case -ESHUTDOWN :dev_dbg (&port->dev,"%s - urb stopped: %d\n" , __func__, status); -return ; + stopped = true; +break ;case -EPIPE :dev_err (&port->dev,"%s - urb stopped: %d\n" , __func__, status); -return ; + stopped = true; +break ;default :dev_dbg (&port->dev,"%s - nonzero urb status: %d\n" , __func__, status); - goto resubmit; +break ; } -usb_serial_debug_data (&port->dev, __func__, urb->actual_length, data); - port->serial->type->process_read_urb (urb); +/* +* Make sure URB processing is done before marking as free to avoid +* racing with unthrottle() on another CPU. Matches the barriers +* implied by the test_and_clear_bit() in +* usb_serial_generic_submit_read_urb(). +*/ +smp_mb__before_atomic (); +set_bit (i, &port->read_urbs_free); +/* +* Make sure URB is marked as free before checking the throttled flag +* to avoid racing with unthrottle() on another CPU. Matches the +* smp_mb() in unthrottle(). +*/ +smp_mb__after_atomic (); + +if (stopped) +return ; -resubmit:/* Throttle the device if requested by tty */ spin_lock_irqsave (&port->lock, flags); port->throttled = port->throttle_req;
@@ -458,6 +477,12 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty) port->throttled = port->throttle_req =0 ;spin_unlock_irq (&port->lock); +/* +* Matches the smp_mb__after_atomic() in +* usb_serial_generic_read_bulk_callback(). +*/ +smp_mb (); +if (was_throttled)usb_serial_generic_submit_read_urbs (port,GFP_KERNEL ); }
drivers/virt/fsl_hypervisor.c +16 -13
@@ -215,6 +215,9 @@ static long ioctl_memcpy(struct fsl_hv_ioctl_memcpy __user *p)* hypervisor. */ lb_offset = param.local_vaddr & (PAGE_SIZE -1 ); +if (param.count ==0 || + param.count >U64_MAX - lb_offset -PAGE_SIZE +1 ) +return -EINVAL ; num_pages = (param.count + lb_offset +PAGE_SIZE -1 ) >>PAGE_SHIFT ;/* Allocate the buffers we need */
@@ -334,8 +337,8 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)struct fsl_hv_ioctl_prop param;char __user *upath, *upropname;void __user *upropval; -char *path =NULL , *propname =NULL ; -void *propval =NULL ; +char *path, *propname; +void *propval;int ret =0 ;/* Get the parameters from the user. */
@@ -347,32 +350,30 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set) upropval = (void __user *)(uintptr_t )param.propval; path =strndup_user (upath,FH_DTPROP_MAX_PATHLEN ); -if (IS_ERR (path)) { - ret =PTR_ERR (path); - goto out; - } +if (IS_ERR (path)) +return PTR_ERR (path); propname =strndup_user (upropname,FH_DTPROP_MAX_PATHLEN );if (IS_ERR (propname)) { ret =PTR_ERR (propname); - goto out; + goto err_free_path; }if (param.proplen >FH_DTPROP_MAX_PROPLEN ) { ret = -EINVAL ; - goto out; + goto err_free_propname; } propval =kmalloc (param.proplen,GFP_KERNEL );if (!propval) { ret = -ENOMEM ; - goto out; + goto err_free_propname; }if (set) {if (copy_from_user (propval, upropval, param.proplen)) { ret = -EFAULT ; - goto out; + goto err_free_propval; } param.ret = fh_partition_set_dtprop(param.handle,
@@ -391,7 +392,7 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)if (copy_to_user (upropval, propval, param.proplen) ||put_user (param.proplen, &p->proplen)) { ret = -EFAULT ; - goto out; + goto err_free_propval; } } }
@@ -399,10 +400,12 @@ static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)if (put_user (param.ret, &p->ret)) ret = -EFAULT ; -out: -kfree (path); +err_free_propval:kfree (propval); +err_free_propname:kfree (propname); +err_free_path: +kfree (path);return ret; }
include/linux/efi.h +6 -1
@@ -1433,7 +1433,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, struct screen_info *si, efi_guid_t *proto, unsigned long size); -bool efi_runtime_disabled (void ); +#ifdef CONFIG_EFI +extern bool efi_runtime_disabled (void ); +#else +static inline bool efi_runtime_disabled (void ) {return true; } +#endif +extern void efi_call_virt_check_flags (unsigned long flags,const char *call);/*
include/linux/list_nulls.h +5 -0
@@ -29,6 +29,11 @@ struct hlist_nulls_node { ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls))#define hlist_nulls_entry (ptr, type, member) container_of(ptr,type,member) + +#define hlist_nulls_entry_safe (ptr, type, member) \ + ({ typeof(ptr) ____ptr = (ptr); \ + !is_a_nulls(____ptr) ? hlist_nulls_entry(____ptr, type, member) : NULL; \ + })/** * ptr_is_a_nulls - Test if a ptr is a nulls * @ptr: ptr to be tested
include/linux/rculist_nulls.h +14 -0
@@ -118,5 +118,19 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, ({ tpos =hlist_nulls_entry (pos,typeof (*tpos), member);1 ; }); \ pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) +/** +* hlist_nulls_for_each_entry_safe - +* iterate over list of given type safe against removal of list entry +* @tpos: the type * to use as a loop cursor. +* @pos: the &struct hlist_nulls_node to use as a loop cursor. +* @head: the head for your list. +* @member: the name of the hlist_nulls_node within the struct. +*/ +#define hlist_nulls_for_each_entry_safe (tpos, pos, head, member) \ + for (({barrier();}), \ + pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ + (!is_a_nulls(pos)) && \ + ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); \ + pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)); 1; });)#endif #endif
include/sound/pcm.h +1 -1
@@ -100,7 +100,7 @@ struct snd_pcm_ops {#endif #define SNDRV_PCM_IOCTL1_RESET 0 -#define SNDRV_PCM_IOCTL1_INFO 1 +/* 1 is absent slot. */ #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2#define SNDRV_PCM_IOCTL1_GSTATE 3#define SNDRV_PCM_IOCTL1_FIFO_SIZE 4
init/main.c +2 -2
@@ -516,6 +516,8 @@ asmlinkage __visible void __init start_kernel(void)page_alloc_init ();pr_notice ("Kernel command line: %s\n" , boot_command_line); +/* parameters may set static keys */ +jump_label_init ();parse_early_param (); after_dashes = parse_args("Booting kernel", static_command_line, __start___param,
@@ -525,8 +527,6 @@ asmlinkage __visible void __init start_kernel(void)parse_args ("Setting init args" , after_dashes,NULL ,0 ,-1 ,-1 ,NULL , set_init_arg); -jump_label_init (); -/* * These use large bootmem allocations and must precede * kmem_cache_init()
kernel/bpf/hashtab.c +70 -29
236 lines not on this page · raw message
net/8021q/vlan_dev.c +3 -1
@@ -366,10 +366,12 @@ static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ifrr.ifr_ifru = ifr->ifr_ifru;switch (cmd) { +case SIOCSHWTSTAMP : +if (!net_eq (dev_net (dev), &init_net)) +break ;case SIOCGMIIPHY :case SIOCGMIIREG :case SIOCSMIIREG : -case SIOCSHWTSTAMP :case SIOCGHWTSTAMP :if (netif_device_present (real_dev) && ops->ndo_do_ioctl) err = ops->ndo_do_ioctl (real_dev, &ifrr, cmd);
net/bridge/br_if.c +6 -7
@@ -519,13 +519,15 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)call_netdevice_notifiers (NETDEV_JOIN , dev); err =dev_set_allmulti (dev,1 ); -if (err) - goto put_back; +if (err) { +kfree (p);/* kobject not yet init'd, manually free */ + goto err1; + } err =kobject_init_and_add (&p->kobj, &brport_ktype, &(dev->dev.kobj),SYSFS_BRIDGE_PORT_ATTR );if (err) - goto err1; + goto err2; err =br_sysfs_addif (p);if (err)
@@ -608,12 +610,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)sysfs_remove_link (br->ifobj, p->dev->name); err2:kobject_put (&p->kobj); - p =NULL ;/* kobject_put frees */ -err1:dev_set_allmulti (dev,-1 ); -put_back: +err1:dev_put (dev); -kfree (p);return err; }
net/core/fib_rules.c +3 -3
@@ -429,9 +429,9 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh)if (rule->l3mdev && rule->table) goto errout_free; -if ((nlh->nlmsg_flags &NLM_F_EXCL ) && -rule_exists (ops, frh, tb, rule)) { - err = -EEXIST ; +if (rule_exists (ops, frh, tb, rule)) { +if (nlh->nlmsg_flags &NLM_F_EXCL ) + err = -EEXIST ; goto errout_free; }
net/ipv4/raw.c +2 -2
@@ -169,6 +169,7 @@ static int icmp_filter(const struct sock *sk, const struct sk_buff *skb)*/ static int raw_v4_input (struct sk_buff *skb,const struct iphdr *iph,int hash) { +int dif =inet_iif (skb);struct sock *sk;struct hlist_head *head;int delivered =0 ;
@@ -181,8 +182,7 @@ static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash) net =dev_net (skb->dev); sk =__raw_v4_lookup (net,__sk_head (head), iph->protocol, - iph->saddr, iph->daddr, - skb->dev->ifindex); + iph->saddr, iph->daddr, dif);while (sk) { delivered =1 ;
net/ipv6/sit.c +1 -1
@@ -1069,7 +1069,7 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)if (!tdev && tunnel->parms.link) tdev =__dev_get_by_index (tunnel->net, tunnel->parms.link); -if (tdev) { +if (tdev && !netif_is_l3_master (tdev)) {int t_hlen = tunnel->hlen +sizeof (struct iphdr ); dev->hard_header_len = tdev->hard_header_len +sizeof (struct iphdr );
net/mac80211/mesh_pathtbl.c +1 -1
@@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath);static u32 mesh_table_hash (const void *addr,u32 len,u32 seed) {/* Use last four bytes of hw addr as hash index */ -return jhash_1word (*(u32 *)(addr+2 ), seed); +return jhash_1word (__get_unaligned_cpu32 ((u8 *)addr +2 ), seed); }static const struct rhashtable_params mesh_rht_params = {
net/netfilter/ipvs/ip_vs_core.c +1 -1
@@ -1643,7 +1643,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,if (!cp) {int v; -if (!sysctl_schedule_icmp (ipvs)) +if (ipip || !sysctl_schedule_icmp (ipvs))return NF_ACCEPT ;if (!ip_vs_try_to_schedule (ipvs,AF_INET , skb, pd, &v, &cp, &ciph))
net/netfilter/x_tables.c +1 -1
@@ -1728,7 +1728,7 @@ static int __init xt_init(void)seqcount_init (&per_cpu (xt_recseq, i)); } - xt =kmalloc (sizeof (struct xt_af ) *NFPROTO_NUMPROTO ,GFP_KERNEL ); + xt =kcalloc (NFPROTO_NUMPROTO ,sizeof (struct xt_af ),GFP_KERNEL );if (!xt)return -ENOMEM ;
net/packet/af_packet.c +20 -5
@@ -4624,14 +4624,29 @@ static void __exit packet_exit(void)static int __init packet_init (void ) { -int rc =proto_register (&packet_proto,0 ); +int rc; -if (rc !=0 ) + rc =proto_register (&packet_proto,0 ); +if (rc) goto out; + rc =sock_register (&packet_family_ops); +if (rc) + goto out_proto; + rc =register_pernet_subsys (&packet_net_ops); +if (rc) + goto out_sock; + rc =register_netdevice_notifier (&packet_netdev_notifier); +if (rc) + goto out_pernet; -sock_register (&packet_family_ops); -register_pernet_subsys (&packet_net_ops); -register_netdevice_notifier (&packet_netdev_notifier); +return 0 ; + +out_pernet: +unregister_pernet_subsys (&packet_net_ops); +out_sock: +sock_unregister (PF_PACKET ); +out_proto: +proto_unregister (&packet_proto); out:return rc; }
sound/core/pcm_lib.c +0 -2
@@ -1849,8 +1849,6 @@ int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg) {switch (cmd) { -case SNDRV_PCM_IOCTL1_INFO : -return 0 ;case SNDRV_PCM_IOCTL1_RESET :return snd_pcm_lib_ioctl_reset (substream, arg);case SNDRV_PCM_IOCTL1_CHANNEL_INFO :
sound/core/pcm_native.c +1 -5
@@ -214,11 +214,7 @@ int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info) info->subdevices_avail = pstr->substream_count - pstr->substream_opened;strlcpy (info->subname, substream->name,sizeof (info->subname)); runtime = substream->runtime; -/* AB: FIXME!!! This is definitely nonsense */ -if (runtime) { - info->sync = runtime->sync; - substream->ops->ioctl (substream,SNDRV_PCM_IOCTL1_INFO , info); - } +return 0 ; }
tools/lib/traceevent/event-parse.c +1 -1
@@ -2204,7 +2204,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)return val &0xffffffff ;if (strcmp (type,"u64" ) ==0 || -strcmp (type,"s64" )) +strcmp (type,"s64" ) ==0 )return val;if (strcmp (type,"s8" ) ==0 )
tools/testing/selftests/net/run_netsocktests +1 -1
@@ -6,7 +6,7 @@ echo "--------------------" ./socket if [ $? -ne 0 ]; then echo "[FAIL]" + exit 1 else echo "[PASS]" fi -
tools/testing/selftests/netfilter/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for netfilter selftests -TEST_PROGS := nft_trans_stress.sh nft_nat.sh +TEST_PROGS := nft_trans_stress.sh nft_nat.sh conntrack_icmp_related.sh include ../lib.mk
tools/testing/selftests/netfilter/conntrack_icmp_related.sh new file +283 -0
283 lines not on this page · raw message