Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
Merge tag 'v3.18.113' into XOS-8.1
Browse files Browse the repository at this point in the history
This is the 3.18.113 stable release

* tag 'v3.18.113': (22 commits)
  Linux 3.18.113
  rtnetlink: validate attributes in do_setlink()
  team: use netdev_features_t instead of u32
  net/mlx4: Fix irq-unsafe spinlock usage
  net: usb: cdc_mbim: add flag FLAG_SEND_ZLP
  net/packet: refine check for priv area size
  isdn: eicon: fix a missing-check bug
  ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds
  enic: set DMA mask to 47 bit
  dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect()
  bnx2x: use the right constant
  drm: set FMODE_UNSIGNED_OFFSET for drm files
  mmap: relax file size limit for regular files
  mmap: introduce sane default mmap limits
  mm: fix the NULL mapping case in __isolate_lru_page()
  fix io_destroy()/aio_complete() race
  drm/i915: Disable LVDS on Radiant P845
  MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs
  tcp: avoid integer overflows in tcp_rcv_space_adjust()
  cfg80211: further limit wiphy names to 64 bytes
  ...
  • Loading branch information
Harsh Shandilya committed Jun 13, 2018
2 parents e88dbad + 3176776 commit 2e72b9e
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 112
SUBLEVEL = 113
EXTRAVERSION =
NAME = Diseased Newt

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ long arch_ptrace(struct task_struct *child, long request,
break;
}
#endif
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
break;
case PC:
tmp = regs->cp0_epc;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/ptrace32.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
addr & 1);
break;
}
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
break;
case PC:
tmp = regs->cp0_epc;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
return -ENOMEM;

filp->private_data = priv;
filp->f_mode |= FMODE_UNSIGNED_OFFSET;
priv->filp = filp;
priv->uid = current_euid();
priv->pid = get_pid(task_pid(current));
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"),
},
},
{
.callback = intel_no_lvds_dmi_callback,
.ident = "Radiant P845",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Radiant Systems Inc"),
DMI_MATCH(DMI_PRODUCT_NAME, "P845"),
},
},

{ } /* terminating entry */
};
Expand Down
22 changes: 15 additions & 7 deletions drivers/isdn/hardware/eicon/diva.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ void divasa_xdi_driver_unload(void)
** Receive and process command from user mode utility
*/
void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
int length,
int length, void *mptr,
divas_xdi_copy_from_user_fn_t cp_fn)
{
diva_xdi_um_cfg_cmd_t msg;
diva_xdi_um_cfg_cmd_t *msg = (diva_xdi_um_cfg_cmd_t *)mptr;
diva_os_xdi_adapter_t *a = NULL;
diva_os_spin_lock_magic_t old_irql;
struct list_head *tmp;
Expand All @@ -400,21 +400,21 @@ void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
length, sizeof(diva_xdi_um_cfg_cmd_t)))
return NULL;
}
if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
if ((*cp_fn) (os_handle, msg, src, sizeof(*msg)) <= 0) {
DBG_ERR(("A: A(?) open, write error"))
return NULL;
}
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
list_for_each(tmp, &adapter_queue) {
a = list_entry(tmp, diva_os_xdi_adapter_t, link);
if (a->controller == (int)msg.adapter)
if (a->controller == (int)msg->adapter)
break;
a = NULL;
}
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "open_adapter");

if (!a) {
DBG_ERR(("A: A(%d) open, adapter not found", msg.adapter))
DBG_ERR(("A: A(%d) open, adapter not found", msg->adapter))
}

return (a);
Expand All @@ -436,8 +436,10 @@ void diva_xdi_close_adapter(void *adapter, void *os_handle)

int
diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
int length, divas_xdi_copy_from_user_fn_t cp_fn)
int length, void *mptr,
divas_xdi_copy_from_user_fn_t cp_fn)
{
diva_xdi_um_cfg_cmd_t *msg = (diva_xdi_um_cfg_cmd_t *)mptr;
diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
void *data;

Expand All @@ -458,7 +460,13 @@ diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
return (-2);
}

length = (*cp_fn) (os_handle, data, src, length);
if (msg) {
*(diva_xdi_um_cfg_cmd_t *)data = *msg;
length = (*cp_fn) (os_handle, (char *)data + sizeof(*msg),
src + sizeof(*msg), length - sizeof(*msg));
} else {
length = (*cp_fn) (os_handle, data, src, length);
}
if (length > 0) {
if ((*(a->interface.cmd_proc))
(a, (diva_xdi_um_cfg_cmd_t *) data, length)) {
Expand Down
5 changes: 3 additions & 2 deletions drivers/isdn/hardware/eicon/diva.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ int diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
int max_length, divas_xdi_copy_to_user_fn_t cp_fn);

int diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
int length, divas_xdi_copy_from_user_fn_t cp_fn);
int length, void *msg,
divas_xdi_copy_from_user_fn_t cp_fn);

void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
int length,
int length, void *msg,
divas_xdi_copy_from_user_fn_t cp_fn);

void diva_xdi_close_adapter(void *adapter, void *os_handle);
Expand Down
18 changes: 11 additions & 7 deletions drivers/isdn/hardware/eicon/divasmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,19 +591,22 @@ static int divas_release(struct inode *inode, struct file *file)
static ssize_t divas_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
diva_xdi_um_cfg_cmd_t msg;
int ret = -EINVAL;

if (!file->private_data) {
file->private_data = diva_xdi_open_adapter(file, buf,
count,
count, &msg,
xdi_copy_from_user);
}
if (!file->private_data) {
return (-ENODEV);
if (!file->private_data)
return (-ENODEV);
ret = diva_xdi_write(file->private_data, file,
buf, count, &msg, xdi_copy_from_user);
} else {
ret = diva_xdi_write(file->private_data, file,
buf, count, NULL, xdi_copy_from_user);
}

ret = diva_xdi_write(file->private_data, file,
buf, count, xdi_copy_from_user);
switch (ret) {
case -1: /* Message should be removed from rx mailbox first */
ret = -EBUSY;
Expand All @@ -622,11 +625,12 @@ static ssize_t divas_write(struct file *file, const char __user *buf,
static ssize_t divas_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
diva_xdi_um_cfg_cmd_t msg;
int ret = -EINVAL;

if (!file->private_data) {
file->private_data = diva_xdi_open_adapter(file, buf,
count,
count, &msg,
xdi_copy_from_user);
}
if (!file->private_data) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static void bnx2x_ets_e3b0_nig_disabled(const struct link_params *params,
* slots for the highest priority.
*/
REG_WR(bp, (port) ? NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS :
NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100);
NIG_REG_P0_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100);
/* Mapping between the CREDIT_WEIGHT registers and actual client
* numbers
*/
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/cisco/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2362,11 +2362,11 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_master(pdev);

/* Query PCI controller on system for DMA addressing
* limitation for the device. Try 64-bit first, and
* limitation for the device. Try 47-bit first, and
* fail to 32-bit.
*/

err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(47));
if (err) {
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (err) {
Expand All @@ -2380,10 +2380,10 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_release_regions;
}
} else {
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(47));
if (err) {
dev_err(dev, "Unable to obtain %u-bit DMA "
"for consistent allocations, aborting\n", 64);
"for consistent allocations, aborting\n", 47);
goto err_out_release_regions;
}
using_dac = 1;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mellanox/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,11 @@ struct mlx4_qp *mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table;
struct mlx4_qp *qp;

spin_lock(&qp_table->lock);
spin_lock_irq(&qp_table->lock);

qp = __mlx4_qp_lookup(dev, qpn);

spin_unlock(&qp_table->lock);
spin_unlock_irq(&qp_table->lock);
return qp;
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ static void team_port_disable(struct team *team,
static void __team_compute_features(struct team *team)
{
struct team_port *port;
u32 vlan_features = TEAM_VLAN_FEATURES & NETIF_F_ALL_FOR_ALL;
netdev_features_t vlan_features = TEAM_VLAN_FEATURES &
NETIF_F_ALL_FOR_ALL;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
IFF_XMIT_DST_RELEASE_PERM;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/cdc_mbim.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ static int cdc_mbim_resume(struct usb_interface *intf)

static const struct driver_info cdc_mbim_info = {
.description = "CDC MBIM",
.flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN,
.flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN | FLAG_SEND_ZLP,
.bind = cdc_mbim_bind,
.unbind = cdc_mbim_unbind,
.manage_power = cdc_mbim_manage_power,
Expand Down
3 changes: 1 addition & 2 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,8 @@ static void free_ioctx_users(struct percpu_ref *ref)
while (!list_empty(&ctx->active_reqs)) {
req = list_first_entry(&ctx->active_reqs,
struct kiocb, ki_list);

list_del_init(&req->ki_list);
kiocb_cancel(req);
list_del_init(&req->ki_list);
}

spin_unlock_irq(&ctx->ctx_lock);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ struct tcp_sock {

/* Receiver queue space */
struct {
int space;
u32 space;
u32 seq;
u32 time;
} rcvq_space;
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ enum nl80211_attrs {
#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS

#define NL80211_WIPHY_NAME_MAXLEN 128
#define NL80211_WIPHY_NAME_MAXLEN 64

#define NL80211_MAX_SUPP_RATES 32
#define NL80211_MAX_SUPP_HT_RATES 77
Expand Down
5 changes: 3 additions & 2 deletions kernel/trace/trace_events_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,10 @@ clear_event_triggers(struct trace_array *tr)
struct ftrace_event_file *file;

list_for_each_entry(file, &tr->events, list) {
struct event_trigger_data *data;
list_for_each_entry_rcu(data, &file->triggers, list) {
struct event_trigger_data *data, *n;
list_for_each_entry_safe(data, n, &file->triggers, list) {
trace_event_trigger_enable_disable(file, 0);
list_del_rcu(&data->list);
if (data->ops->free)
data->ops->free(data->ops, data);
}
Expand Down
32 changes: 32 additions & 0 deletions mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,35 @@ static inline int mlock_future_check(struct mm_struct *mm,
return 0;
}

static inline u64 file_mmap_size_max(struct file *file, struct inode *inode)
{
if (S_ISREG(inode->i_mode))
return MAX_LFS_FILESIZE;

if (S_ISBLK(inode->i_mode))
return MAX_LFS_FILESIZE;

/* Special "we do even unsigned file positions" case */
if (file->f_mode & FMODE_UNSIGNED_OFFSET)
return 0;

/* Yes, random drivers might want more. But I'm tired of buggy drivers */
return ULONG_MAX;
}

static inline bool file_mmap_ok(struct file *file, struct inode *inode,
unsigned long pgoff, unsigned long len)
{
u64 maxsize = file_mmap_size_max(file, inode);

if (maxsize && len > maxsize)
return false;
maxsize -= len;
if (pgoff > maxsize >> PAGE_SHIFT)
return false;
return true;
}

/*
* The caller must hold down_write(&current->mm->mmap_sem).
*/
Expand Down Expand Up @@ -1364,6 +1393,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
if (file) {
struct inode *inode = file_inode(file);

if (!file_mmap_ok(file, inode, pgoff, len))
return -EOVERFLOW;

switch (flags & MAP_TYPE) {
case MAP_SHARED:
if ((prot&PROT_WRITE) && !(file->f_mode&FMODE_WRITE))
Expand Down
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode)
return ret;

mapping = page_mapping(page);
migrate_dirty = mapping && mapping->a_ops->migratepage;
migrate_dirty = !mapping || mapping->a_ops->migratepage;
unlock_page(page);
if (!migrate_dirty)
return ret;
Expand Down
8 changes: 4 additions & 4 deletions net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,10 @@ static int do_setlink(const struct sk_buff *skb,
const struct net_device_ops *ops = dev->netdev_ops;
int err;

err = validate_linkmsg(dev, tb);
if (err < 0)
return err;

if (tb[IFLA_NET_NS_PID] || tb[IFLA_NET_NS_FD]) {
struct net *net = rtnl_link_get_net(dev_net(dev), tb);
if (IS_ERR(net)) {
Expand Down Expand Up @@ -1783,10 +1787,6 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh)
goto errout;
}

err = validate_linkmsg(dev, tb);
if (err < 0)
goto errout;

err = do_setlink(skb, dev, ifm, tb, ifname, 0);
errout:
return err;
Expand Down
2 changes: 0 additions & 2 deletions net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,7 @@ int dccp_disconnect(struct sock *sk, int flags)

dccp_clear_xmit_timers(sk);
ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
dp->dccps_hc_rx_ccid = NULL;
dp->dccps_hc_tx_ccid = NULL;

__skb_queue_purge(&sk->sk_receive_queue);
__skb_queue_purge(&sk->sk_write_queue);
Expand Down
Loading

0 comments on commit 2e72b9e

Please sign in to comment.