Skip to content

Commit

Permalink
Merge 4.4.222 into kernel.lnx.4.4.r38-rel
Browse files Browse the repository at this point in the history
Changes in 4.4.222: (19 commits)
        ext4: fix special inode number checks in __ext4_iget()
        drm/qxl: qxl_release leak in qxl_hw_surface_alloc()
        ALSA: pcm: oss: Place the plugin buffer overflow checks correctly
        PM: ACPI: Output correct message on target power state
        RDMA/mlx4: Initialize ib_spec on the stack
        vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn()
        ALSA: opti9xx: shut up gcc-10 range warning
        nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl
        dmaengine: dmatest: Fix iteration non-stop logic
        i2c: designware-pci: use IRQF_COND_SUSPEND flag
        perf hists: Fix HISTC_MEM_DCACHELINE width setting
        powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8
        perf/x86: Fix uninitialized value usage
        exynos4-is: fix a format string bug
        ASoC: wm8960: Fix WM8960_SYSCLK_PLL mode
        ASoC: imx-spdif: Fix crash on suspend
        ipv6: use READ_ONCE() for inet->hdrincl as in ipv4
        selinux: properly handle multiple messages in selinux_netlink_send()
        Linux 4.4.222

Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed May 6, 2020
2 parents c127c6b + b63f449 commit 7b57b34
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 80 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 221
SUBLEVEL = 222
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/power8-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ static struct power_pmu power8_pmu = {
.get_constraint = power8_get_constraint,
.get_alternatives = power8_get_alternatives,
.disable_pmc = power8_disable_pmc,
.flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S,
.flags = PPMU_HAS_SIER | PPMU_ARCH_207S,
.n_generic = ARRAY_SIZE(power8_generic_events),
.generic_events = power8_generic_events,
.cache_events = &power8_cache_events,
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/cpu/perf_event_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,8 @@ intel_bts_constraints(struct perf_event *event)

static int intel_alt_er(int idx, u64 config)
{
int alt_idx;
int alt_idx = idx;

if (!(x86_pmu.flags & PMU_FL_HAS_RSP_1))
return idx;

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ int acpi_device_set_power(struct acpi_device *device, int state)
end:
if (result) {
dev_warn(&device->dev, "Failed to change power state to %s\n",
acpi_power_state_string(state));
acpi_power_state_string(target_state));
} else {
device->power.state = target_state;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Device [%s] transitioned to %s\n",
device->pnp.bus_id,
acpi_power_state_string(state)));
acpi_power_state_string(target_state)));
}

return result;
Expand Down
4 changes: 2 additions & 2 deletions drivers/dma/dmatest.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ static int dmatest_func(void *data)
flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;

ktime = ktime_get();
while (!kthread_should_stop()
&& !(params->iterations && total_tests >= params->iterations)) {
while (!(kthread_should_stop() ||
(params->iterations && total_tests >= params->iterations))) {
struct dma_async_tx_descriptor *tx = NULL;
struct dmaengine_unmap_data *um;
dma_addr_t srcs[src_cnt];
Expand Down
5 changes: 3 additions & 2 deletions drivers/gpu/drm/qxl/qxl_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,10 @@ int qxl_hw_surface_alloc(struct qxl_device *qdev,
return ret;

ret = qxl_release_reserve_list(release, true);
if (ret)
if (ret) {
qxl_release_free(qdev, release);
return ret;

}
cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release);
cmd->type = QXL_SURFACE_CMD_CREATE;
cmd->flags = QXL_SURF_FLAG_KEEP_DATA;
Expand Down
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-designware-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,8 @@ int i2c_dw_probe(struct dw_i2c_dev *dev)
i2c_set_adapdata(adap, dev);

i2c_dw_disable_int(dev);
r = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr, IRQF_SHARED,
r = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr,
IRQF_SHARED | IRQF_COND_SUSPEND,
dev_name(dev->dev), dev);
if (r) {
dev_err(dev->dev, "failure requesting irq %i: %d\n",
Expand Down
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,9 @@ static int __mlx4_ib_create_default_rules(
int i;

for (i = 0; i < ARRAY_SIZE(pdefault_rules->rules_create_list); i++) {
union ib_flow_spec ib_spec = {};
int ret;
union ib_flow_spec ib_spec;

switch (pdefault_rules->rules_create_list[i]) {
case 0:
/* no rule */
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/exynos4-is/fimc-isp-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ static void isp_video_capture_buffer_queue(struct vb2_buffer *vb)
ivb->dma_addr[i];

isp_dbg(2, &video->ve.vdev,
"dma_buf %pad (%d/%d/%d) addr: %pad\n",
&buf_index, ivb->index, i, vb->index,
"dma_buf %d (%d/%d/%d) addr: %pad\n",
buf_index, ivb->index, i, vb->index,
&ivb->dma_addr[i]);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/vfio/vfio_iommu_type1.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ static int vaddr_get_pfn(unsigned long vaddr, int prot, unsigned long *pfn)
vma = find_vma_intersection(current->mm, vaddr, vaddr + 1);

if (vma && vma->vm_flags & VM_PFNMAP) {
*pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
if (is_invalid_reserved_pfn(*pfn))
if (!follow_pfn(vma, vaddr, pfn) &&
is_invalid_reserved_pfn(*pfn))
ret = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4309,7 +4309,7 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
uid_t i_uid;
gid_t i_gid;

if (((flags & EXT4_IGET_NORMAL) &&
if ((!(flags & EXT4_IGET_SPECIAL) &&
(ino < EXT4_FIRST_INO(sb) && ino != EXT4_ROOT_INO)) ||
(ino < EXT4_ROOT_INO) ||
(ino > le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count))) {
Expand Down
22 changes: 15 additions & 7 deletions fs/nfs/nfs3acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,37 +213,45 @@ int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,

int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
struct posix_acl *alloc = NULL, *dfacl = NULL;
struct posix_acl *orig = acl, *dfacl = NULL, *alloc;
int status;

if (S_ISDIR(inode->i_mode)) {
switch(type) {
case ACL_TYPE_ACCESS:
alloc = dfacl = get_acl(inode, ACL_TYPE_DEFAULT);
alloc = get_acl(inode, ACL_TYPE_DEFAULT);
if (IS_ERR(alloc))
goto fail;
dfacl = alloc;
break;

case ACL_TYPE_DEFAULT:
dfacl = acl;
alloc = acl = get_acl(inode, ACL_TYPE_ACCESS);
alloc = get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(alloc))
goto fail;
dfacl = acl;
acl = alloc;
break;
}
}

if (acl == NULL) {
alloc = acl = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
alloc = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
if (IS_ERR(alloc))
goto fail;
acl = alloc;
}
status = __nfs3_proc_setacls(inode, acl, dfacl);
posix_acl_release(alloc);
out:
if (acl != orig)
posix_acl_release(acl);
if (dfacl != orig)
posix_acl_release(dfacl);
return status;

fail:
return PTR_ERR(alloc);
status = PTR_ERR(alloc);
goto out;
}

const struct xattr_handler *nfs3_xattr_handlers[] = {
Expand Down
12 changes: 10 additions & 2 deletions net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
int hlimit = -1;
int tclass = -1;
int dontfrag = -1;
int hdrincl;
u16 proto;
int err;

Expand All @@ -770,6 +771,13 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
if (msg->msg_flags & MSG_OOB)
return -EOPNOTSUPP;

/* hdrincl should be READ_ONCE(inet->hdrincl)
* but READ_ONCE() doesn't work with bit fields.
* Doing this indirectly yields the same result.
*/
hdrincl = inet->hdrincl;
hdrincl = READ_ONCE(hdrincl);

/*
* Get and verify the address.
*/
Expand Down Expand Up @@ -879,7 +887,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
fl6.flowi6_oif = np->ucast_oif;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));

if (inet->hdrincl)
if (hdrincl)
fl6.flowi6_flags |= FLOWI_FLAG_KNOWN_NH;

dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
Expand All @@ -900,7 +908,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
goto do_confirm;

back_from_confirm:
if (inet->hdrincl)
if (hdrincl)
err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, msg->msg_flags);
else {
lock_sock(sk);
Expand Down
69 changes: 45 additions & 24 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -4826,38 +4826,59 @@ static int selinux_tun_dev_open(void *security)

static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb)
{
int err = 0;
u32 perm;
int rc = 0;
unsigned int msg_len;
unsigned int data_len = skb->len;
unsigned char *data = skb->data;
struct nlmsghdr *nlh;
struct sk_security_struct *sksec = sk->sk_security;
u16 sclass = sksec->sclass;
u32 perm;

if (skb->len < NLMSG_HDRLEN) {
err = -EINVAL;
goto out;
}
nlh = nlmsg_hdr(skb);
while (data_len >= nlmsg_total_size(0)) {
nlh = (struct nlmsghdr *)data;

err = selinux_nlmsg_lookup(sksec->sclass, nlh->nlmsg_type, &perm);
if (err) {
if (err == -EINVAL) {
printk(KERN_WARNING
"SELinux: unrecognized netlink message:"
" protocol=%hu nlmsg_type=%hu sclass=%s\n",
sk->sk_protocol, nlh->nlmsg_type,
secclass_map[sksec->sclass - 1].name);
if (!selinux_enforcing || security_get_allow_unknown())
err = 0;
/* NOTE: the nlmsg_len field isn't reliably set by some netlink
* users which means we can't reject skb's with bogus
* length fields; our solution is to follow what
* netlink_rcv_skb() does and simply skip processing at
* messages with length fields that are clearly junk
*/
if (nlh->nlmsg_len < NLMSG_HDRLEN || nlh->nlmsg_len > data_len)
return 0;

rc = selinux_nlmsg_lookup(sclass, nlh->nlmsg_type, &perm);
if (rc == 0) {
rc = sock_has_perm(current, sk, perm);
if (rc)
return rc;
} else if (rc == -EINVAL) {
/* -EINVAL is a missing msg/perm mapping */
pr_warn_ratelimited("SELinux: unrecognized netlink"
" message: protocol=%hu nlmsg_type=%hu sclass=%s"
" pid=%d comm=%s\n",
sk->sk_protocol, nlh->nlmsg_type,
secclass_map[sclass - 1].name,
task_pid_nr(current), current->comm);
if (selinux_enforcing && !security_get_allow_unknown())
return rc;
rc = 0;
} else if (rc == -ENOENT) {
/* -ENOENT is a missing socket/class mapping, ignore */
rc = 0;
} else {
return rc;
}

/* Ignore */
if (err == -ENOENT)
err = 0;
goto out;
/* move to the next message after applying netlink padding */
msg_len = NLMSG_ALIGN(nlh->nlmsg_len);
if (msg_len >= data_len)
return 0;
data_len -= msg_len;
data += msg_len;
}

err = sock_has_perm(current, sk, perm);
out:
return err;
return rc;
}

#ifdef CONFIG_NETFILTER
Expand Down
20 changes: 12 additions & 8 deletions sound/core/oss/pcm_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,23 @@ static snd_pcm_sframes_t plug_client_size(struct snd_pcm_substream *plug,
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
plugin = snd_pcm_plug_last(plug);
while (plugin && drv_frames > 0) {
if (check_size && drv_frames > plugin->buf_frames)
drv_frames = plugin->buf_frames;
plugin_prev = plugin->prev;
if (plugin->src_frames)
drv_frames = plugin->src_frames(plugin, drv_frames);
if (check_size && plugin->buf_frames &&
drv_frames > plugin->buf_frames)
drv_frames = plugin->buf_frames;
plugin = plugin_prev;
}
} else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
plugin = snd_pcm_plug_first(plug);
while (plugin && drv_frames > 0) {
plugin_next = plugin->next;
if (check_size && plugin->buf_frames &&
drv_frames > plugin->buf_frames)
drv_frames = plugin->buf_frames;
if (plugin->dst_frames)
drv_frames = plugin->dst_frames(plugin, drv_frames);
if (check_size && drv_frames > plugin->buf_frames)
drv_frames = plugin->buf_frames;
plugin = plugin_next;
}
} else
Expand All @@ -251,26 +253,28 @@ static snd_pcm_sframes_t plug_slave_size(struct snd_pcm_substream *plug,
plugin = snd_pcm_plug_first(plug);
while (plugin && frames > 0) {
plugin_next = plugin->next;
if (check_size && plugin->buf_frames &&
frames > plugin->buf_frames)
frames = plugin->buf_frames;
if (plugin->dst_frames) {
frames = plugin->dst_frames(plugin, frames);
if (frames < 0)
return frames;
}
if (check_size && frames > plugin->buf_frames)
frames = plugin->buf_frames;
plugin = plugin_next;
}
} else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
plugin = snd_pcm_plug_last(plug);
while (plugin) {
if (check_size && frames > plugin->buf_frames)
frames = plugin->buf_frames;
plugin_prev = plugin->prev;
if (plugin->src_frames) {
frames = plugin->src_frames(plugin, frames);
if (frames < 0)
return frames;
}
if (check_size && plugin->buf_frames &&
frames > plugin->buf_frames)
frames = plugin->buf_frames;
plugin = plugin_prev;
}
} else
Expand Down
9 changes: 6 additions & 3 deletions sound/isa/opti9xx/miro.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,13 @@ static void snd_miro_write(struct snd_miro *chip, unsigned char reg,
spin_unlock_irqrestore(&chip->lock, flags);
}

static inline void snd_miro_write_mask(struct snd_miro *chip,
unsigned char reg, unsigned char value, unsigned char mask)
{
unsigned char oldval = snd_miro_read(chip, reg);

#define snd_miro_write_mask(chip, reg, value, mask) \
snd_miro_write(chip, reg, \
(snd_miro_read(chip, reg) & ~(mask)) | ((value) & (mask)))
snd_miro_write(chip, reg, (oldval & ~mask) | (value & mask));
}

/*
* Proc Interface
Expand Down
9 changes: 6 additions & 3 deletions sound/isa/opti9xx/opti92x-ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,13 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg,
}


#define snd_opti9xx_write_mask(chip, reg, value, mask) \
snd_opti9xx_write(chip, reg, \
(snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask)))
static inline void snd_opti9xx_write_mask(struct snd_opti9xx *chip,
unsigned char reg, unsigned char value, unsigned char mask)
{
unsigned char oldval = snd_opti9xx_read(chip, reg);

snd_opti9xx_write(chip, reg, (oldval & ~mask) | (value & mask));
}

static int snd_opti9xx_configure(struct snd_opti9xx *chip,
long port,
Expand Down
Loading

0 comments on commit 7b57b34

Please sign in to comment.