Linux 4.18.18
Greg KH
maintainerI'm announcing the release of the 4.18.18 kernel.
All users of the 4.18 kernel series must upgrade.
The updated 4.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/x86/include/asm/fpu/internal.h | 2 arch/x86/include/asm/percpu.h | 8 +- arch/x86/kernel/pci-swiotlb.c | 2 arch/x86/kernel/setup.c | 2 arch/x86/kernel/time.c | 2 arch/x86/kernel/tsc.c | 6 - drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 10 ++ drivers/gpio/gpio-mxs.c | 4 - drivers/gpu/drm/drm_edid.c | 5 + drivers/gpu/drm/drm_fb_helper.c | 91 +++++++------------------ drivers/gpu/drm/sun4i/sun4i_dotclock.c | 12 +++ drivers/infiniband/core/ucm.c | 3 drivers/infiniband/core/ucma.c | 3 drivers/input/mouse/elan_i2c_core.c | 1 drivers/misc/eeprom/at24.c | 17 ++++ drivers/ptp/ptp_chardev.c | 4 + drivers/usb/class/cdc-acm.c | 16 ++-- drivers/usb/core/devio.c | 4 - drivers/usb/gadget/function/f_mass_storage.c | 3 drivers/usb/host/xhci-pci.c | 6 + drivers/usb/roles/intel-xhci-usb-role-switch.c | 2 drivers/usb/usbip/vhci_hcd.c | 57 +++++++++++---- fs/cachefiles/namei.c | 2 fs/fscache/cookie.c | 31 ++------ fs/fscache/internal.h | 1 fs/fscache/main.c | 4 - fs/ioctl.c | 2 fs/nfsd/vfs.c | 3 fs/overlayfs/copy_up.c | 2 fs/read_write.c | 17 ++++ include/drm/drm_edid.h | 6 - include/linux/bpf_verifier.h | 3 include/linux/fs.h | 17 ---- kernel/bpf/verifier.c | 10 +- kernel/sched/fair.c | 22 +++++- kernel/sched/sched.h | 2 kernel/trace/trace_events_hist.c | 32 ++++++-- 38 files changed, 243 insertions(+), 173 deletions(-)
Al Viro (1):
cachefiles: fix the race between cachefiles_bury_object() and rmdir(2)
Alan Chiang (1):
eeprom: at24: Add support for address-width property
Alan Stern (1):
USB: fix the usbfs flag sanitization for control transfers
Amir Goldstein (1):
vfs: swap names of {do,vfs}_clone_file_range()
Boris Brezillon (1):
drm/sun4i: Fix an ulong overflow in the dotclock driver
Chen-Yu Tsai (1):
clk: sunxi-ng: sun4i: Set VCO and PLL bias current to lowest setting
Christoph Hellwig (1):
x86/swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels
Clint Taylor (1):
drm/edid: VSDB yCBCr420 Deep Color mode bit definitions
Daniel Borkmann (1):
bpf: fix partial copy of map_ptr when dst is scalar
David Howells (1):
fscache: Fix incomplete initialisation of inline key space
Eric Sandeen (1):
fscache: Fix out of bound read in long cookie keys
Eugeniy Paltsev (1):
drm: fb-helper: Reject all pixel format changing requests
Greg Kroah-Hartman (1):
Linux 4.18.18
Gustavo A. R. Silva (4):
ptp: fix Spectre v1 vulnerability RDMA/ucma: Fix Spectre v1 vulnerability IB/ucm: Fix Spectre v1 vulnerability
usb: gadget: storage: Fix Spectre v1 vulnerability
Heikki Krogerus (1):
usb: xhci: pci: Enable Intel USB role mux on Apollo Lake platforms
Kai-Heng Feng (1):
drm/edid: Add 6 bpc quirk for BOE panel in HP Pavilion 15-n233sl
Linus Walleij (1):
gpio: mxs: Get rid of external API call
Masami Hiramatsu (2):
tracing: Fix synthetic event to accept unsigned modifier
tracing: Fix synthetic event to allow semicolon at end
Mikhail Nikiforov (1):
Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM
Nathan Chancellor (1):
x86/time: Correct the attribute on jiffies' definition
Oliver Neukum (1):
cdc-acm: fix race between reset and control messaging
Peter Zijlstra (2):
x86/tsc: Force inlining of cyc2ns bits
x86/percpu: Fix this_cpu_read()
Phil Auld (1):
sched/fair: Fix throttle_list starvation with low CFS quota
Sebastian Andrzej Siewior (1):
x86/fpu: Fix i486 + no387 boot crash by only saving FPU registers on context switch if there is an FPU
Shuah Khan (Samsung OSG) (1):
usb: usbip: Fix BUG: KASAN: slab-out-of-bounds in vhci_hub_control()
Tobias Herzog (2):
cdc-acm: do not reset notification buffer index upon urb unlinking
cdc-acm: correct counting of UART states in serial state notification
Wan Ahmad Zainie (1):
usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable
Zhimin Gu (1):
x86, hibernate: Fix nosave_regions setup for hibernation
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 18 -SUBLEVEL = 17 +SUBLEVEL = 18 EXTRAVERSION = NAME = Merciless Moray
arch/x86/include/asm/fpu/internal.h +1 -1
@@ -528,7 +528,7 @@ static inline void fpregs_activate(struct fpu *fpu)static inline void switch_fpu_prepare (struct fpu *old_fpu,int cpu) { -if (old_fpu->initialized) { +if (static_cpu_has (X86_FEATURE_FPU ) && old_fpu->initialized) {if (!copy_fpregs_to_fpstate (old_fpu)) old_fpu->last_cpu =-1 ;else
arch/x86/include/asm/percpu.h +4 -4
@@ -185,22 +185,22 @@ do { \typeof (var) pfo_ret__; \switch (sizeof (var)) { \case 1 : \ - asm(op "b "__percpu_arg(1)",%0" \ + asm volatile(op "b "__percpu_arg(1)",%0"\ : "=q" (pfo_ret__) \ : "m" (var)); \ break; \ case 2: \ - asm(op "w "__percpu_arg(1)",%0" \ + asm volatile(op "w "__percpu_arg(1)",%0"\ : "=r" (pfo_ret__) \ : "m" (var)); \ break; \ case 4: \ - asm(op "l "__percpu_arg(1)",%0" \ + asm volatile(op "l "__percpu_arg(1)",%0"\ : "=r" (pfo_ret__) \ : "m" (var)); \ break; \ case 8: \ - asm(op "q "__percpu_arg(1)",%0" \ + asm volatile(op "q "__percpu_arg(1)",%0"\ : "=r" (pfo_ret__) \: " m" (var)); \ break; \
arch/x86/kernel/pci-swiotlb.c +0 -2
@@ -42,10 +42,8 @@ IOMMU_INIT_FINISH(pci_swiotlb_detect_override,int __init pci_swiotlb_detect_4gb (void ) {/* don't initialize swiotlb if iommu=off (no_iommu=1) */ -#ifdef CONFIG_X86_64 if (!no_iommu && max_possible_pfn >MAX_DMA32_PFN ) swiotlb =1 ; -#endif /* * If SME is active then swiotlb will be set to 1 so that bounce
arch/x86/kernel/setup.c +1 -1
@@ -1258,7 +1258,7 @@ void __init setup_arch(char **cmdline_p) x86_init.hyper.guest_late_init ();e820__reserve_resources (); -e820__register_nosave_regions (max_low_pfn); +e820__register_nosave_regions (max_pfn); x86_init.resources.reserve_resources ();
arch/x86/kernel/time.c +1 -1
@@ -25,7 +25,7 @@#include <asm/time.h> #ifdef CONFIG_X86_64 -__visible volatile unsigned long jiffies __cacheline_aligned = INITIAL_JIFFIES; +__visible volatile unsigned long jiffies __cacheline_aligned_in_smp = INITIAL_JIFFIES;#endif unsigned long profile_pc (struct pt_regs *regs)
arch/x86/kernel/tsc.c +3 -3
@@ -60,7 +60,7 @@ struct cyc2ns { static DEFINE_PER_CPU_ALIGNED(struct cyc2ns, cyc2ns); -void cyc2ns_read_begin (struct cyc2ns_data *data) +void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data) {int seq, idx;
@@ -77,7 +77,7 @@ void cyc2ns_read_begin(struct cyc2ns_data *data) }while (unlikely (seq !=this_cpu_read (cyc2ns.seq.sequence))); } -void cyc2ns_read_end (void ) +void __always_inline cyc2ns_read_end(void) {preempt_enable_notrace (); }
@@ -123,7 +123,7 @@ static void __init cyc2ns_init(int cpu)seqcount_init (&c2n->seq); } -static inline unsigned long long cycles_2_ns (unsigned long long cyc) +static __always_inline unsigned long long cycles_2_ns (unsigned long long cyc) {struct cyc2ns_data data;unsigned long long ns;
drivers/clk/sunxi-ng/ccu-sun4i-a10.c +9 -1
@@ -1434,8 +1434,16 @@ static void __init sun4i_ccu_init(struct device_node *node,return ; } -/* Force the PLL-Audio-1x divider to 1 */ val =readl (reg +SUN4I_PLL_AUDIO_REG ); + +/* +* Force VCO and PLL bias current to lowest setting. Higher +* settings interfere with sigma-delta modulation and result +* in audible noise and distortions when using SPDIF or I2S. +*/ + val &= ~GENMASK (25 ,16 ); + +/* Force the PLL-Audio-1x divider to 1 */ val &= ~GENMASK (29 ,26 );writel (val | (1 <<26 ), reg +SUN4I_PLL_AUDIO_REG );
drivers/gpio/gpio-mxs.c +1 -3
@@ -18,8 +18,6 @@#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/gpio/driver.h> -/* FIXME: for gpio_get_value(), replace this by direct register read */ -#include <linux/gpio.h> #include <linux/module.h> #define MXS_SET 0x4
@@ -86,7 +84,7 @@ static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type) port->both_edges &= ~pin_mask;switch (type) {case IRQ_TYPE_EDGE_BOTH : - val =gpio_get_value (port->gc.base + d->hwirq); + val = port->gc.get (&port->gc, d->hwirq);if (val) edge =GPIO_INT_FALL_EDGE ;else
drivers/gpu/drm/drm_edid.c +4 -1
@@ -113,6 +113,9 @@ static const struct edid_quirk {/* AEO model 0 reports 8 bpc, but is a 6 bpc panel */ { "AEO", 0, EDID_QUIRK_FORCE_6BPC }, +/* BOE model on HP Pavilion 15-n233sl reports 8 bpc, but is a 6 bpc panel */ + { "BOE", 0x78b, EDID_QUIRK_FORCE_6BPC }, +/* CPT panel of Asus UX303LA reports 8 bpc, but is a 6 bpc panel */ { "CPT", 0x17df, EDID_QUIRK_FORCE_6BPC },
@@ -4279,7 +4282,7 @@ static void drm_parse_ycbcr420_deep_color_info(struct drm_connector *connector,struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; dc_mask = db[7 ] &DRM_EDID_YCBCR420_DC_MASK ; - hdmi->y420_dc_modes |= dc_mask; + hdmi->y420_dc_modes = dc_mask; } static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector,
drivers/gpu/drm/drm_fb_helper.c +26 -65
111 lines not on this page · raw message
drivers/gpu/drm/sun4i/sun4i_dotclock.c +11 -1
@@ -81,9 +81,19 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,int i;for (i = tcon->dclk_min_div; i <= tcon->dclk_max_div; i++) { -unsigned long ideal = rate * i; +u64 ideal = (u64 )rate * i;unsigned long rounded; +/* +* ideal has overflowed the max value that can be stored in an +* unsigned long, and every clk operation we might do on a +* truncated u64 value will give us incorrect results. +* Let's just stop there since bigger dividers will result in +* the same overflow issue. +*/ +if (ideal >ULONG_MAX ) + goto out; + rounded =clk_hw_round_rate (clk_hw_get_parent (hw), ideal);
drivers/infiniband/core/ucm.c +3 -0
@@ -46,6 +46,8 @@#include <linux/mutex.h> #include <linux/slab.h> +#include <linux/nospec.h> +#include <linux/uaccess.h> #include <rdma/ib.h>
@@ -1123,6 +1125,7 @@ static ssize_t ib_ucm_write(struct file *filp, const char __user *buf,if (hdr.cmd >=ARRAY_SIZE (ucm_cmd_table))return -EINVAL ; + hdr.cmd =array_index_nospec (hdr.cmd,ARRAY_SIZE (ucm_cmd_table));if (hdr.in +sizeof (hdr) > len)return -EINVAL ;
drivers/infiniband/core/ucma.c +3 -0
@@ -44,6 +44,8 @@#include <linux/module.h> #include <linux/nsproxy.h> +#include <linux/nospec.h> +#include <rdma/rdma_user_cm.h> #include <rdma/ib_marshall.h> #include <rdma/rdma_cm.h>
@@ -1676,6 +1678,7 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,if (hdr.cmd >=ARRAY_SIZE (ucma_cmd_table))return -EINVAL ; + hdr.cmd =array_index_nospec (hdr.cmd,ARRAY_SIZE (ucma_cmd_table));if (hdr.in +sizeof (hdr) > len)return -EINVAL ;
drivers/input/mouse/elan_i2c_core.c +1 -0
@@ -1346,6 +1346,7 @@ static const struct acpi_device_id elan_acpi_id[] = { { "ELAN0611", 0 }, { "ELAN0612", 0 }, { "ELAN0618", 0 }, + { "ELAN061C", 0 }, { "ELAN061D", 0 }, { "ELAN0622", 0 }, { "ELAN1000", 0 },
drivers/misc/eeprom/at24.c +17 -0
@@ -478,6 +478,23 @@ static void at24_properties_to_pdata(struct device *dev,if (device_property_present (dev,"no-read-rollover" )) chip->flags |=AT24_FLAG_NO_RDROL ; + err =device_property_read_u32 (dev,"address-width" , &val); +if (!err) { +switch (val) { +case 8 : +if (chip->flags &AT24_FLAG_ADDR16 ) +dev_warn (dev,"Override address width to be 8, while default is 16\n" ); + chip->flags &= ~AT24_FLAG_ADDR16 ; +break ; +case 16 : + chip->flags |=AT24_FLAG_ADDR16 ; +break ; +default : +dev_warn (dev,"Bad \"address-width\" property: %u\n" , + val); + } + } + err =device_property_read_u32 (dev,"size" , &val);if (!err) chip->byte_len = val;
drivers/ptp/ptp_chardev.c +4 -0
@@ -24,6 +24,8 @@#include <linux/slab.h> #include <linux/timekeeping.h> +#include <linux/nospec.h> +#include "ptp_private.h" static int ptp_disable_pinfunc(struct ptp_clock_info *ops,
@@ -248,6 +250,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) err = -EINVAL ;break ; } + pin_index =array_index_nospec (pin_index, ops->n_pins);if (mutex_lock_interruptible (&ptp->pincfg_mux))return -ERESTARTSYS ; pd = ops->pin_config[pin_index];
@@ -266,6 +269,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) err = -EINVAL ;break ; } + pin_index =array_index_nospec (pin_index, ops->n_pins);if (mutex_lock_interruptible (&ptp->pincfg_mux))return -ERESTARTSYS ; err =ptp_set_pinfunc (ptp, pin_index, pd.func, pd.chan);
drivers/usb/class/cdc-acm.c +8 -8
@@ -309,17 +309,17 @@ static void acm_process_notification(struct acm *acm, unsigned char *buf)if (difference &ACM_CTRL_DSR ) acm->iocount.dsr++; -if (difference &ACM_CTRL_BRK ) - acm->iocount.brk++; -if (difference &ACM_CTRL_RI ) - acm->iocount.rng++;if (difference &ACM_CTRL_DCD ) acm->iocount.dcd++; -if (difference &ACM_CTRL_FRAMING ) +if (newctrl &ACM_CTRL_BRK ) + acm->iocount.brk++; +if (newctrl &ACM_CTRL_RI ) + acm->iocount.rng++; +if (newctrl &ACM_CTRL_FRAMING ) acm->iocount.frame++; -if (difference &ACM_CTRL_PARITY ) +if (newctrl &ACM_CTRL_PARITY ) acm->iocount.parity++; -if (difference &ACM_CTRL_OVERRUN ) +if (newctrl &ACM_CTRL_OVERRUN ) acm->iocount.overrun++;spin_unlock (&acm->read_lock);
@@ -354,7 +354,6 @@ static void acm_ctrl_irq(struct urb *urb)case -ENOENT :case -ESHUTDOWN :/* this urb is terminated, clean up */ - acm->nb_index =0 ;dev_dbg (&acm->control->dev,"%s - urb shutting down with status: %d\n" , __func__, status);
@@ -1642,6 +1641,7 @@ static int acm_pre_reset(struct usb_interface *intf)struct acm *acm =usb_get_intfdata (intf);clear_bit (EVENT_RX_STALL , &acm->flags); + acm->nb_index =0 ;/* pending control transfers are lost */ return 0 ; }
drivers/usb/core/devio.c +2 -2
@@ -1473,8 +1473,6 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb u =0 ;switch (uurb->type) {case USBDEVFS_URB_TYPE_CONTROL : -if (is_in) - allow_short = true;if (!usb_endpoint_xfer_control (&ep->desc))return -EINVAL ;/* min 8 byte setup packet */
@@ -1504,6 +1502,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in =0 ; uurb->endpoint &= ~USB_DIR_IN ; } +if (is_in) + allow_short = true; snoop(&ps->dev->dev, "control urb: bRequestType=%02x " "bRequest=%02x wValue=%04x " "wIndex=%04x wLength=%04x\n",
drivers/usb/gadget/function/f_mass_storage.c +3 -0
@@ -222,6 +222,8 @@#include <linux/usb/gadget.h> #include <linux/usb/composite.h> +#include <linux/nospec.h> +#include "configfs.h"
@@ -3171,6 +3173,7 @@ static struct config_group *fsg_lun_make(struct config_group *group, fsg_opts =to_fsg_opts (&group->cg_item);if (num >=FSG_MAX_LUNS )return ERR_PTR (-ERANGE ); + num =array_index_nospec (num,FSG_MAX_LUNS );mutex_lock (&fsg_opts->lock);if (fsg_opts->refcnt || fsg_opts->common->luns[num]) {
drivers/usb/host/xhci-pci.c +4 -2
@@ -179,10 +179,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |=XHCI_PME_STUCK_QUIRK ; }if (pdev->vendor ==PCI_VENDOR_ID_INTEL && - pdev->device ==PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI ) { + pdev->device ==PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI ) xhci->quirks |=XHCI_SSIC_PORT_UNUSED ; +if (pdev->vendor ==PCI_VENDOR_ID_INTEL && + (pdev->device ==PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_APL_XHCI )) xhci->quirks |=XHCI_INTEL_USB_ROLE_SW ; - } if (pdev->vendor == PCI_VENDOR_ID_INTEL && (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
drivers/usb/roles/intel-xhci-usb-role-switch.c +2 -0
@@ -161,6 +161,8 @@ static int intel_xhci_usb_remove(struct platform_device *pdev) {struct intel_xhci_usb_data *data =platform_get_drvdata (pdev); +pm_runtime_disable (&pdev->dev); +usb_role_switch_unregister (data->role_sw);return 0 ; }
drivers/usb/usbip/vhci_hcd.c +42 -15
139 lines not on this page · raw message
fs/cachefiles/namei.c +1 -1
@@ -343,7 +343,7 @@ static int cachefiles_bury_object(struct cachefiles_cache *cache, trap =lock_rename (cache->graveyard, dir);/* do some checks before getting the grave dentry */ -if (rep->d_parent != dir) { +if (rep->d_parent != dir ||IS_DEADDIR (d_inode (rep))) {/* the entry was probably culled when we dropped the parent dir * lock */ unlock_rename (cache->graveyard, dir);
fs/fscache/cookie.c +10 -21
@@ -70,20 +70,7 @@ void fscache_free_cookie(struct fscache_cookie *cookie) }/* -* initialise an cookie jar slab element prior to any use -*/ -void fscache_cookie_init_once (void *_cookie) -{ -struct fscache_cookie *cookie = _cookie; - -memset (cookie,0 ,sizeof (*cookie)); -spin_lock_init (&cookie->lock); -spin_lock_init (&cookie->stores_lock); -INIT_HLIST_HEAD (&cookie->backing_objects); -} - -/* -* Set the index key in a cookie. The cookie struct has space for a 12-byte +* Set the index key in a cookie. The cookie struct has space for a 16-byte * key plus length and hash, but if that's not big enough, it's instead a * pointer to a buffer containing 3 bytes of hash, 1 byte of length and then * the key data.
@@ -93,20 +80,18 @@ static int fscache_set_key(struct fscache_cookie *cookie, {unsigned long long h;u32 *buf; +int bufs;int i; - cookie->key_len = index_key_len; + bufs =DIV_ROUND_UP (index_key_len,sizeof (*buf));if (index_key_len >sizeof (cookie->inline_key)) { - buf =kzalloc (index_key_len,GFP_KERNEL ); + buf =kcalloc (bufs,sizeof (*buf),GFP_KERNEL );if (!buf)return -ENOMEM ; cookie->key = buf; }else { buf = (u32 *)cookie->inline_key; - buf[0 ] =0 ; - buf[1 ] =0 ; - buf[2 ] =0 ; }memcpy (buf, index_key, index_key_len);
@@ -116,7 +101,8 @@ static int fscache_set_key(struct fscache_cookie *cookie,*/ h = (unsigned long )cookie->parent; h += index_key_len + cookie->type; -for (i =0 ; i < (index_key_len +sizeof (u32) -1 ) /sizeof (u32); i++) + +for (i =0 ; i < bufs; i++) h += buf[i]; cookie->key_hash = h ^ (h >>32 );
@@ -161,7 +147,7 @@ struct fscache_cookie *fscache_alloc_cookie(struct fscache_cookie *cookie;/* allocate and initialise a cookie */ - cookie =kmem_cache_alloc (fscache_cookie_jar,GFP_KERNEL ); + cookie =kmem_cache_zalloc (fscache_cookie_jar,GFP_KERNEL );if (!cookie)return NULL ;
@@ -192,6 +178,9 @@ struct fscache_cookie *fscache_alloc_cookie( cookie->netfs_data = netfs_data; cookie->flags = (1 <<FSCACHE_COOKIE_NO_DATA_YET ); cookie->type = def->type; +spin_lock_init (&cookie->lock); +spin_lock_init (&cookie->stores_lock); +INIT_HLIST_HEAD (&cookie->backing_objects);/* radix tree insertion won't use the preallocation pool unless it's * told it may not wait */
fs/fscache/internal.h +0 -1
@@ -51,7 +51,6 @@ extern struct fscache_cache *fscache_select_cache_for_object(extern struct kmem_cache *fscache_cookie_jar;extern void fscache_free_cookie (struct fscache_cookie *); -extern void fscache_cookie_init_once (void *); extern struct fscache_cookie *fscache_alloc_cookie(struct fscache_cookie *, const struct fscache_cookie_def *, const void *, size_t,
fs/fscache/main.c +1 -3
@@ -143,9 +143,7 @@ static int __init fscache_init(void) fscache_cookie_jar =kmem_cache_create ("fscache_cookie_jar" ,sizeof (struct fscache_cookie ), -0 , -0 , - fscache_cookie_init_once); +0 ,0 ,NULL );if (!fscache_cookie_jar) {pr_notice ("Failed to allocate a cookie jar\n" ); ret = -ENOMEM ;
fs/ioctl.c +1 -1
@@ -229,7 +229,7 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd, ret = -EXDEV ;if (src_file.file->f_path.mnt != dst_file->f_path.mnt) goto fdput; - ret =do_clone_file_range (src_file.file, off, dst_file, destoff, olen); + ret =vfs_clone_file_range (src_file.file, off, dst_file, destoff, olen); fdput:fdput (src_file);return ret;
fs/nfsd/vfs.c +2 -1
@@ -541,7 +541,8 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp,__be32 nfsd4_clone_file_range (struct file *src,u64 src_pos,struct file *dst,u64 dst_pos,u64 count) { -return nfserrno (do_clone_file_range (src, src_pos, dst, dst_pos, count)); +return nfserrno (vfs_clone_file_range (src, src_pos, dst, dst_pos, + count)); } ssize_t nfsd_copy_file_range(struct file *src, u64 src_pos, struct file *dst,
fs/overlayfs/copy_up.c +1 -1
@@ -156,7 +156,7 @@ static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len) }/* Try to use clone_file_range to clone up within the same fs */ - error =vfs_clone_file_range (old_file,0 , new_file,0 , len); + error =do_clone_file_range (old_file,0 , new_file,0 , len);if (!error) goto out;/* Couldn't clone, so now we try to copy the data */
fs/read_write.c +15 -2
@@ -1818,8 +1818,8 @@ int vfs_clone_file_prep_inodes(struct inode *inode_in, loff_t pos_in, }EXPORT_SYMBOL (vfs_clone_file_prep_inodes); -int vfs_clone_file_range (struct file *file_in,loff_t pos_in, -struct file *file_out,loff_t pos_out,u64 len) +int do_clone_file_range (struct file *file_in,loff_t pos_in, +struct file *file_out,loff_t pos_out,u64 len) {struct inode *inode_in =file_inode (file_in);struct inode *inode_out =file_inode (file_out);
@@ -1866,6 +1866,19 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,return ret; } +EXPORT_SYMBOL (do_clone_file_range); + +int vfs_clone_file_range (struct file *file_in,loff_t pos_in, +struct file *file_out,loff_t pos_out,u64 len) +{ +int ret; + +file_start_write (file_out); + ret =do_clone_file_range (file_in, pos_in, file_out, pos_out, len); +file_end_write (file_out); + +return ret; +}EXPORT_SYMBOL (vfs_clone_file_range);/*
include/drm/drm_edid.h +3 -3
@@ -214,9 +214,9 @@ struct detailed_timing {#define DRM_EDID_HDMI_DC_Y444 (1 << 3)/* YCBCR 420 deep color modes */ -#define DRM_EDID_YCBCR420_DC_48 (1 << 6) -#define DRM_EDID_YCBCR420_DC_36 (1 << 5) -#define DRM_EDID_YCBCR420_DC_30 (1 << 4) +#define DRM_EDID_YCBCR420_DC_48 (1 << 2) +#define DRM_EDID_YCBCR420_DC_36 (1 << 1) +#define DRM_EDID_YCBCR420_DC_30 (1 << 0)#define DRM_EDID_YCBCR420_DC_MASK (DRM_EDID_YCBCR420_DC_48 | \ DRM_EDID_YCBCR420_DC_36 | \ DRM_EDID_YCBCR420_DC_30)
include/linux/bpf_verifier.h +3 -0
@@ -50,6 +50,9 @@ struct bpf_reg_state {* PTR_TO_MAP_VALUE_OR_NULL */ struct bpf_map *map_ptr; + +/* Max size from any of the above. */ +unsigned long raw; };/* Fixed part of pointer offset, pointer types only */ s32 off;
include/linux/fs.h +3 -14
@@ -1813,8 +1813,10 @@ extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,extern int vfs_clone_file_prep_inodes (struct inode *inode_in,loff_t pos_in,struct inode *inode_out,loff_t pos_out,u64 *len,bool is_dedupe); +extern int do_clone_file_range (struct file *file_in,loff_t pos_in, +struct file *file_out,loff_t pos_out,u64 len);extern int vfs_clone_file_range (struct file *file_in,loff_t pos_in, -struct file *file_out,loff_t pos_out,u64 len); +struct file *file_out,loff_t pos_out,u64 len);extern int vfs_dedupe_file_range_compare (struct inode *src,loff_t srcoff,struct inode *dest,loff_t destoff,loff_t len,bool *is_same);
@@ -2755,19 +2757,6 @@ static inline void file_end_write(struct file *file)__sb_end_write (file_inode (file)->i_sb,SB_FREEZE_WRITE ); } -static inline int do_clone_file_range (struct file *file_in,loff_t pos_in, -struct file *file_out,loff_t pos_out, -u64 len) -{ -int ret; - -file_start_write (file_out); - ret =vfs_clone_file_range (file_in, pos_in, file_out, pos_out, len); -file_end_write (file_out); - -return ret; -} -/* * get_write_access() gets write permission for a file. * put_write_access() releases this write permission.
kernel/bpf/verifier.c +6 -4
@@ -2731,7 +2731,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, dst_reg->umax_value = umax_ptr; dst_reg->var_off = ptr_reg->var_off; dst_reg->off = ptr_reg->off + smin_val; - dst_reg->range = ptr_reg->range; + dst_reg->raw = ptr_reg->raw;break ; }/* A new variable offset is created. Note that off_reg->off
@@ -2761,10 +2761,11 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, } dst_reg->var_off =tnum_add (ptr_reg->var_off, off_reg->var_off); dst_reg->off = ptr_reg->off; + dst_reg->raw = ptr_reg->raw;if (reg_is_pkt_pointer (ptr_reg)) { dst_reg->id = ++env->id_gen;/* something was added to pkt_ptr, set range to zero */ - dst_reg->range =0 ; + dst_reg->raw =0 ; }break ;case BPF_SUB :
@@ -2793,7 +2794,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, dst_reg->var_off = ptr_reg->var_off; dst_reg->id = ptr_reg->id; dst_reg->off = ptr_reg->off - smin_val; - dst_reg->range = ptr_reg->range; + dst_reg->raw = ptr_reg->raw;break ; }/* A new variable offset is created. If the subtrahend is known
@@ -2819,11 +2820,12 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, } dst_reg->var_off =tnum_sub (ptr_reg->var_off, off_reg->var_off); dst_reg->off = ptr_reg->off; + dst_reg->raw = ptr_reg->raw;if (reg_is_pkt_pointer (ptr_reg)) { dst_reg->id = ++env->id_gen;/* something was added to pkt_ptr, set range to zero */ if (smin_val <0 ) - dst_reg->range =0 ; + dst_reg->raw =0 ; }break ;case BPF_AND :
kernel/sched/fair.c +19 -3
@@ -4797,9 +4797,13 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq)/* * Add to the _head_ of the list, so that an already-started -* distribute_cfs_runtime will not see us +* distribute_cfs_runtime will not see us. If disribute_cfs_runtime is +* not running add to the tail so that later runqueues don't get starved. */ -list_add_rcu (&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq); +if (cfs_b->distribute_running) +list_add_rcu (&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq); +else +list_add_tail_rcu (&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq);/* * If we're the first throttled task, make sure the bandwidth
@@ -4943,14 +4947,16 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun)* in us over-using our runtime if it is all used during this loop, but * only by limited amounts in that extreme case. */ -while (throttled && cfs_b->runtime >0 ) { +while (throttled && cfs_b->runtime >0 && !cfs_b->distribute_running) { runtime = cfs_b->runtime; + cfs_b->distribute_running =1 ;raw_spin_unlock (&cfs_b->lock);/* we can't nest cfs_b->lock while distributing bandwidth */ runtime =distribute_cfs_runtime (cfs_b, runtime, runtime_expires);raw_spin_lock (&cfs_b->lock); + cfs_b->distribute_running =0 ; throttled = !list_empty (&cfs_b->throttled_cfs_rq); cfs_b->runtime -=min (runtime, cfs_b->runtime);
@@ -5061,6 +5067,11 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)/* confirm we're still not at a refresh boundary */ raw_spin_lock (&cfs_b->lock); +if (cfs_b->distribute_running) { +raw_spin_unlock (&cfs_b->lock); +return ; + } +if (runtime_refresh_within (cfs_b, min_bandwidth_expiration)) {raw_spin_unlock (&cfs_b->lock);return ;
@@ -5070,6 +5081,9 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) runtime = cfs_b->runtime; expires = cfs_b->runtime_expires; +if (runtime) + cfs_b->distribute_running =1 ; +raw_spin_unlock (&cfs_b->lock);if (!runtime)
@@ -5080,6 +5094,7 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)raw_spin_lock (&cfs_b->lock);if (expires == cfs_b->runtime_expires) cfs_b->runtime -=min (runtime, cfs_b->runtime); + cfs_b->distribute_running =0 ;raw_spin_unlock (&cfs_b->lock); }
@@ -5188,6 +5203,7 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) cfs_b->period_timer.function = sched_cfs_period_timer;hrtimer_init (&cfs_b->slack_timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); cfs_b->slack_timer.function = sched_cfs_slack_timer; + cfs_b->distribute_running =0 ; }static void init_cfs_rq_runtime (struct cfs_rq *cfs_rq)
kernel/sched/sched.h +2 -0
@@ -346,6 +346,8 @@ struct cfs_bandwidth {int nr_periods;int nr_throttled;u64 throttled_time; + +bool distribute_running;#endif };
kernel/trace/trace_events_hist.c +25 -7
@@ -747,16 +747,30 @@ static void free_synth_field(struct synth_field *field)kfree (field); } -static struct synth_field *parse_synth_field (char *field_type, -char *field_name) +static struct synth_field *parse_synth_field (int argc,char **argv, +int *consumed) {struct synth_field *field; +const char *prefix =NULL ; +char *field_type = argv[0 ], *field_name;int len, ret =0 ;char *array;if (field_type[0 ] ==';' ) field_type++; +if (!strcmp (field_type,"unsigned" )) { +if (argc <3 ) +return ERR_PTR (-EINVAL ); + prefix ="unsigned " ; + field_type = argv[1 ]; + field_name = argv[2 ]; + *consumed =3 ; + }else { + field_name = argv[1 ]; + *consumed =2 ; + } + len =strlen (field_name);if (field_name[len -1 ] ==';' ) field_name[len -1 ] ='\0' ;
@@ -769,11 +783,15 @@ static struct synth_field *parse_synth_field(char *field_type, array =strchr (field_name,'[' );if (array) len +=strlen (array); +if (prefix) + len +=strlen (prefix); field->type =kzalloc (len,GFP_KERNEL );if (!field->type) { ret = -ENOMEM ; goto free; } +if (prefix) +strcat (field->type, prefix);strcat (field->type, field_type);if (array) {strcat (field->type, array);
@@ -1018,7 +1036,7 @@ static int create_synth_event(int argc, char **argv)struct synth_field *field, *fields[SYNTH_FIELDS_MAX ];struct synth_event *event =NULL ;bool delete_event = false; -int i, n_fields =0 , ret =0 ; +int i, consumed =0 , n_fields =0 , ret =0 ;char *name;mutex_lock (&synth_event_mutex);
@@ -1070,16 +1088,16 @@ static int create_synth_event(int argc, char **argv) goto err; } - field =parse_synth_field (argv[i], argv[i +1 ]); + field =parse_synth_field (argc - i, &argv[i], &consumed);if (IS_ERR (field)) { ret =PTR_ERR (field); goto err; } - fields[n_fields] = field; - i++; n_fields++; + fields[n_fields++] = field; + i += consumed -1 ; } -if (i < argc) { +if (i < argc &&strcmp (argv[i],";" ) !=0 ) { ret = -EINVAL ; goto err; }