Linux 4.14.279
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.14.279 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.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/bmips/setup.c | 2 arch/mips/lantiq/prom.c | 2 arch/mips/pic32/pic32mzda/init.c | 2 arch/mips/ralink/of.c | 2 drivers/block/drbd/drbd_nl.c | 13 ++-- drivers/mmc/host/rtsx_pci_sdmmc.c | 30 ++++++---- drivers/net/can/grcan.c | 38 ++++++------- fs/namespace.c | 9 ++- include/net/bluetooth/hci_core.h | 3 + include/sound/pcm.h | 2 mm/memory.c | 2 mm/userfaultfd.c | 3 + net/bluetooth/hci_core.c | 6 +- sound/core/pcm.c | 3 + sound/core/pcm_lib.c | 5 + sound/core/pcm_memory.c | 11 ++- sound/core/pcm_native.c | 110 ++++++++++++++++++++++++++------------ 18 files changed, 163 insertions(+), 82 deletions(-)
Andreas Larsson (2):
can: grcan: grcan_probe(): fix broken system id check for errata workaround needs
can: grcan: only use the NAPI poll budget for RX
ChenXiaoSong (1):
VFS: Fix memory leak caused by concurrently mounting fs with subtype
Greg Kroah-Hartman (1):
Linux 4.14.279
Itay Iellin (1):
Bluetooth: Fix the creation of hdev->name
Lee Jones (1):
block: drbd: drbd_nl: Make conversion to 'enum drbd_ret_code' explicit
Muchun Song (2):
mm: hugetlb: fix missing cache flush in copy_huge_page_from_user()
mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic()
Nathan Chancellor (1):
MIPS: Use address-of operator on section symbols
Ricky WU (1):
mmc: rtsx: add 74 Clocks in power on flow
Takashi Iwai (5):
ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
ALSA: pcm: Fix races among concurrent read/write and buffer changes
ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls
ALSA: pcm: Fix races among concurrent prealloc proc writes
ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 278 +SUBLEVEL = 279 EXTRAVERSION = NAME = Petit Gorille
arch/mips/bmips/setup.c +1 -1
@@ -174,7 +174,7 @@ void __init plat_mem_setup(void) dtb =phys_to_virt (fw_arg2); else if (fw_passed_dtb) /* UHI interface */ dtb = (void *)fw_passed_dtb; - else if (__dtb_start != __dtb_end) + else if (&__dtb_start != &__dtb_end) dtb = (void *)__dtb_start; else panic("no dtb found");
arch/mips/lantiq/prom.c +1 -1
@@ -82,7 +82,7 @@ void __init plat_mem_setup(void)if (fw_passed_dtb)/* UHI interface */ dtb = (void *)fw_passed_dtb; -else if (__dtb_start != __dtb_end) +else if (&__dtb_start != &__dtb_end) dtb = (void *)__dtb_start;else panic ("no dtb found" );
arch/mips/pic32/pic32mzda/init.c +1 -1
@@ -36,7 +36,7 @@ static ulong get_fdtaddr(void)if (fw_passed_dtb && !fw_arg2 && !fw_arg3)return (ulong )fw_passed_dtb; -if (__dtb_start < __dtb_end) +if (&__dtb_start < &__dtb_end) ftaddr = (ulong )__dtb_start;return ftaddr;
arch/mips/ralink/of.c +1 -1
@@ -79,7 +79,7 @@ void __init plat_mem_setup(void)*/ if (fw_passed_dtb) dtb = (void *)fw_passed_dtb; -else if (__dtb_start != __dtb_end) +else if (&__dtb_start != &__dtb_end) dtb = (void *)__dtb_start;__dt_setup_arch (dtb);
drivers/block/drbd/drbd_nl.c +8 -5
@@ -774,9 +774,11 @@ int drbd_adm_set_role(struct sk_buff *skb, struct genl_info *info)mutex_lock (&adm_ctx.resource->adm_mutex);if (info->genlhdr->cmd ==DRBD_ADM_PRIMARY ) - retcode =drbd_set_role (adm_ctx.device,R_PRIMARY , parms.assume_uptodate); + retcode = (enum drbd_ret_code )drbd_set_role (adm_ctx.device, +R_PRIMARY , parms.assume_uptodate);else - retcode =drbd_set_role (adm_ctx.device,R_SECONDARY ,0 ); + retcode = (enum drbd_ret_code )drbd_set_role (adm_ctx.device, +R_SECONDARY ,0 );mutex_unlock (&adm_ctx.resource->adm_mutex);genl_lock ();
@@ -1941,7 +1943,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)drbd_flush_workqueue (&connection->sender_work); rv =_drbd_request_state (device,NS (disk,D_ATTACHING ),CS_VERBOSE ); - retcode = rv;/* FIXME: Type mismatch. */ + retcode = (enum drbd_ret_code )rv;drbd_resume_io (device);if (rv <SS_SUCCESS ) goto fail;
@@ -2671,7 +2673,8 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) }rcu_read_unlock (); - retcode =conn_request_state (connection,NS (conn,C_UNCONNECTED ),CS_VERBOSE ); + retcode = (enum drbd_ret_code )conn_request_state (connection, +NS (conn,C_UNCONNECTED ),CS_VERBOSE );conn_reconfig_done (connection);mutex_unlock (&adm_ctx.resource->adm_mutex);
@@ -2777,7 +2780,7 @@ int drbd_adm_disconnect(struct sk_buff *skb, struct genl_info *info)mutex_lock (&adm_ctx.resource->adm_mutex); rv =conn_try_disconnect (connection, parms.force_disconnect);if (rv <SS_SUCCESS ) - retcode = rv;/* FIXME: Type mismatch. */ + retcode = (enum drbd_ret_code )rv;else retcode =NO_ERROR ;mutex_unlock (&adm_ctx.resource->adm_mutex);
drivers/mmc/host/rtsx_pci_sdmmc.c +20 -10
@@ -49,10 +49,7 @@ struct realtek_pci_sdmmc {bool double_clk;bool eject;bool initial_mode; -int power_state; -#define SDMMC_POWER_ON 1 -#define SDMMC_POWER_OFF 0 - +int prev_power_state;int sg_count;s32 cookie;int cookie_sg_count;
@@ -913,14 +910,21 @@ static int sd_set_bus_width(struct realtek_pci_sdmmc *host,return err; } -static int sd_power_on (struct realtek_pci_sdmmc *host) +static int sd_power_on (struct realtek_pci_sdmmc *host,unsigned char power_mode) {struct rtsx_pcr *pcr = host->pcr;int err; -if (host->power_state ==SDMMC_POWER_ON ) +if (host->prev_power_state ==MMC_POWER_ON )return 0 ; +if (host->prev_power_state ==MMC_POWER_UP ) { +rtsx_pci_write_register (pcr,SD_BUS_STAT ,SD_CLK_TOGGLE_EN ,0 ); + goto finish; + } + +msleep (100 ); +rtsx_pci_init_cmd (pcr);rtsx_pci_add_cmd (pcr,WRITE_REG_CMD ,CARD_SELECT ,0x07 ,SD_MOD_SEL ); rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
@@ -939,11 +943,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)if (err <0 )return err; +mdelay (1 ); + err =rtsx_pci_write_register (pcr,CARD_OE ,SD_OUTPUT_EN ,SD_OUTPUT_EN );if (err <0 )return err; - host->power_state =SDMMC_POWER_ON ; +/* send at least 74 clocks */ +rtsx_pci_write_register (pcr,SD_BUS_STAT ,SD_CLK_TOGGLE_EN ,SD_CLK_TOGGLE_EN ); + +finish: + host->prev_power_state = power_mode;return 0 ; }
@@ -952,7 +962,7 @@ static int sd_power_off(struct realtek_pci_sdmmc *host)struct rtsx_pcr *pcr = host->pcr;int err; - host->power_state =SDMMC_POWER_OFF ; + host->prev_power_state =MMC_POWER_OFF ;rtsx_pci_init_cmd (pcr);
@@ -978,7 +988,7 @@ static int sd_set_power_mode(struct realtek_pci_sdmmc *host,if (power_mode ==MMC_POWER_OFF ) err =sd_power_off (host);else - err =sd_power_on (host); + err =sd_power_on (host, power_mode);return err; }
@@ -1416,7 +1426,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev) host->mmc = mmc; host->pdev = pdev; host->cookie =-1 ; - host->power_state =SDMMC_POWER_OFF ; + host->prev_power_state =MMC_POWER_OFF ;INIT_WORK (&host->work, sd_request);platform_set_drvdata (pdev, host); pcr->slots[RTSX_SD_CARD ].p_dev = pdev;
drivers/net/can/grcan.c +18 -20
@@ -245,7 +245,7 @@ struct grcan_device_config { .rxsize = GRCAN_DEFAULT_BUFFER_SIZE, \ } -#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 0x4100 +#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 4100#define GRLIB_VERSION_MASK 0xffff/* GRCAN private data structure */
@@ -1141,7 +1141,7 @@ static int grcan_close(struct net_device *dev)return 0 ; } -static int grcan_transmit_catch_up (struct net_device *dev,int budget) +static void grcan_transmit_catch_up (struct net_device *dev) {struct grcan_priv *priv =netdev_priv (dev);unsigned long flags;
@@ -1149,7 +1149,7 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget)spin_lock_irqsave (&priv->lock, flags); - work_done =catch_up_echo_skb (dev, budget, true); + work_done =catch_up_echo_skb (dev,-1 , true);if (work_done) {if (!priv->resetting && !priv->closing && !(priv->can.ctrlmode &CAN_CTRLMODE_LISTENONLY ))
@@ -1163,8 +1163,6 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget) }spin_unlock_irqrestore (&priv->lock, flags); - -return work_done; }static int grcan_receive (struct net_device *dev,int budget)
@@ -1246,19 +1244,13 @@ static int grcan_poll(struct napi_struct *napi, int budget)struct net_device *dev = priv->dev;struct grcan_registers __iomem *regs = priv->regs;unsigned long flags; -int tx_work_done, rx_work_done; -int rx_budget = budget /2 ; -int tx_budget = budget - rx_budget; +int work_done; -/* Half of the budget for receiveing messages */ - rx_work_done =grcan_receive (dev, rx_budget); + work_done =grcan_receive (dev, budget); -/* Half of the budget for transmitting messages as that can trigger echo -* frames being received -*/ - tx_work_done =grcan_transmit_catch_up (dev, tx_budget); +grcan_transmit_catch_up (dev); -if (rx_work_done < rx_budget && tx_work_done < tx_budget) { +if (work_done < budget) {napi_complete (napi);/* Guarantee no interference with a running reset that otherwise
@@ -1275,7 +1267,7 @@ static int grcan_poll(struct napi_struct *napi, int budget)spin_unlock_irqrestore (&priv->lock, flags); } -return rx_work_done + tx_work_done; +return work_done; }/* Work tx bug by waiting while for the risky situation to clear. If that fails,
@@ -1665,6 +1657,7 @@ static int grcan_setup_netdev(struct platform_device *ofdev,static int grcan_probe (struct platform_device *ofdev) {struct device_node *np = ofdev->dev.of_node; +struct device_node *sysid_parent;struct resource *res;u32 sysid, ambafreq;int irq, err;
@@ -1674,10 +1667,15 @@ static int grcan_probe(struct platform_device *ofdev)/* Compare GRLIB version number with the first that does not * have the tx bug (see start_xmit) */ - err =of_property_read_u32 (np,"systemid" , &sysid); -if (!err && ((sysid &GRLIB_VERSION_MASK ) - >=GRCAN_TXBUG_SAFE_GRLIB_VERSION )) - txbug = false; + sysid_parent =of_find_node_by_path ("/ambapp0" ); +if (sysid_parent) { +of_node_get (sysid_parent); + err =of_property_read_u32 (sysid_parent,"systemid" , &sysid); +if (!err && ((sysid &GRLIB_VERSION_MASK ) >= +GRCAN_TXBUG_SAFE_GRLIB_VERSION )) + txbug = false; +of_node_put (sysid_parent); + } err =of_property_read_u32 (np,"freq" , &ambafreq);if (err) {
fs/namespace.c +6 -3
@@ -2570,9 +2570,12 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,return -ENODEV ; mnt =vfs_kern_mount (type, sb_flags, name, data); -if (!IS_ERR (mnt) && (type->fs_flags &FS_HAS_SUBTYPE ) && - !mnt->mnt_sb->s_subtype) - mnt =fs_set_subtype (mnt, fstype); +if (!IS_ERR (mnt) && (type->fs_flags &FS_HAS_SUBTYPE )) { +down_write (&mnt->mnt_sb->s_umount); +if (!mnt->mnt_sb->s_subtype) + mnt =fs_set_subtype (mnt, fstype); +up_write (&mnt->mnt_sb->s_umount); + }put_filesystem (type);if (IS_ERR (mnt))
include/net/bluetooth/hci_core.h +3 -0
@@ -34,6 +34,9 @@/* HCI priority */ #define HCI_PRIO_MAX 7 +/* HCI maximum id value */ +#define HCI_MAX_ID 10000 +/* HCI Core structures */ struct inquiry_data {bdaddr_t bdaddr;
include/sound/pcm.h +2 -0
@@ -396,6 +396,8 @@ struct snd_pcm_runtime {wait_queue_head_t sleep;/* poll sleep */ wait_queue_head_t tsleep;/* transfer sleep */ struct fasync_struct *fasync; +struct mutex buffer_mutex;/* protect for buffer changes */ +atomic_t buffer_accessing;/* >0: in r/w operation, <0: blocked */ /* -- private section -- */ void *private_data;
mm/memory.c +2 -0
@@ -4836,6 +4836,8 @@ long copy_huge_page_from_user(struct page *dst_page,if (rc)break ; +flush_dcache_page (subpage); +cond_resched (); }return ret_val;
mm/userfaultfd.c +3 -0
@@ -56,6 +56,8 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm,/* don't free the page */ goto out; } + +flush_dcache_page (page); }else { page = *pagep; *pagep =NULL ;
@@ -565,6 +567,7 @@ static __always_inline ssize_t __mcopy_atomic(struct mm_struct *dst_mm, err = -EFAULT ; goto out; } +flush_dcache_page (page); goto retry; }else BUG_ON (page);
net/bluetooth/hci_core.c +3 -3
@@ -3100,10 +3100,10 @@ int hci_register_dev(struct hci_dev *hdev)*/ switch (hdev->dev_type) {case HCI_PRIMARY : - id =ida_simple_get (&hci_index_ida,0 ,0 ,GFP_KERNEL ); + id =ida_simple_get (&hci_index_ida,0 ,HCI_MAX_ID ,GFP_KERNEL );break ;case HCI_AMP : - id =ida_simple_get (&hci_index_ida,1 ,0 ,GFP_KERNEL ); + id =ida_simple_get (&hci_index_ida,1 ,HCI_MAX_ID ,GFP_KERNEL );break ;default :return -EINVAL ;
@@ -3112,7 +3112,7 @@ int hci_register_dev(struct hci_dev *hdev)if (id <0 )return id; -sprintf (hdev->name,"hci%d" , id); +snprintf (hdev->name,sizeof (hdev->name),"hci%d" , id); hdev->id = id;BT_DBG ("%p name %s bus %d" , hdev, hdev->name, hdev->bus);
sound/core/pcm.c +3 -0
@@ -1032,6 +1032,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,init_waitqueue_head (&runtime->tsleep); runtime->status->state =SNDRV_PCM_STATE_OPEN ; +mutex_init (&runtime->buffer_mutex); +atomic_set (&runtime->buffer_accessing,0 ); substream->runtime = runtime; substream->private_data = pcm->private_data;
@@ -1063,6 +1065,7 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream) substream->runtime =NULL ;if (substream->timer)spin_unlock_irq (&substream->timer->lock); +mutex_destroy (&runtime->buffer_mutex);kfree (runtime);put_pid (substream->pid); substream->pid =NULL ;
sound/core/pcm_lib.c +5 -0
@@ -2226,10 +2226,15 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,snd_pcm_stream_unlock_irq (substream);return -EINVAL ; } +if (!atomic_inc_unless_negative (&runtime->buffer_accessing)) { + err = -EBUSY ; + goto _end_unlock; + }snd_pcm_stream_unlock_irq (substream); err =writer (substream, appl_ofs, data, offset, frames, transfer);snd_pcm_stream_lock_irq (substream); +atomic_dec (&runtime->buffer_accessing);if (err <0 ) goto _end_unlock; err =pcm_accessible_state (runtime);
sound/core/pcm_memory.c +7 -4
@@ -160,19 +160,20 @@ static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry,size_t size;struct snd_dma_buffer new_dmab; +mutex_lock (&substream->pcm->open_mutex);if (substream->runtime) { buffer->error = -EBUSY ; -return ; + goto unlock; }if (!snd_info_get_line (buffer, line,sizeof (line))) {snd_info_get_str (str, line,sizeof (str)); size =simple_strtoul (str,NULL ,10 ) *1024 ;if ((size !=0 && size <8192 ) || size > substream->dma_max) { buffer->error = -EINVAL ; -return ; + goto unlock; }if (substream->dma_buffer.bytes == size) -return ; + goto unlock;memset (&new_dmab,0 ,sizeof (new_dmab)); new_dmab.dev = substream->dma_buffer.dev;if (size >0 ) {
@@ -180,7 +181,7 @@ static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry, substream->dma_buffer.dev.dev, size, &new_dmab) < 0) { buffer->error = -ENOMEM ; -return ; + goto unlock; } substream->buffer_bytes_max = size; }else {
@@ -192,6 +193,8 @@ static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry, }else { buffer->error = -EINVAL ; } + unlock: +mutex_unlock (&substream->pcm->open_mutex); }static inline void preallocate_info_init (struct snd_pcm_substream *substream)
sound/core/pcm_native.c +78 -32
185 lines not on this page · raw message