Merge 5.15.88 into android14-5.15

Changes in 5.15.88
	parisc: Align parisc MADV_XXX constants with all other architectures
	x86/fpu: Take task_struct* in copy_sigframe_from_user_to_xstate()
	x86/fpu: Add a pkru argument to copy_uabi_from_kernel_to_xstate().
	x86/fpu: Add a pkru argument to copy_uabi_to_xstate()
	x86/fpu: Allow PKRU to be (once again) written by ptrace.
	x86/fpu: Emulate XRSTOR's behavior if the xfeatures PKRU bit is not set
	selftests/vm/pkeys: Add a regression test for setting PKRU through ptrace
	serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
	net: sched: disallow noqueue for qdisc classes
	net/ulp: prevent ULP without clone op from entering the LISTEN status
	ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
	ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list
	ALSA: hda - Enable headset mic on another Dell laptop with ALC3254
	Linux 5.15.88

Change-Id: Ie44ecc4e8d82777f8f05714ed471dd15e309bb86
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2023-01-18 13:23:48 +00:00
20 changed files with 273 additions and 57 deletions

View File

@@ -1178,14 +1178,19 @@ static int snd_ctl_elem_read(struct snd_card *card,
const u32 pattern = 0xdeadbeef;
int ret;
down_read(&card->controls_rwsem);
kctl = snd_ctl_find_id(card, &control->id);
if (kctl == NULL)
return -ENOENT;
if (kctl == NULL) {
ret = -ENOENT;
goto unlock;
}
index_offset = snd_ctl_get_ioff(kctl, &control->id);
vd = &kctl->vd[index_offset];
if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL)
return -EPERM;
if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) {
ret = -EPERM;
goto unlock;
}
snd_ctl_build_ioff(&control->id, kctl, index_offset);
@@ -1195,7 +1200,7 @@ static int snd_ctl_elem_read(struct snd_card *card,
info.id = control->id;
ret = __snd_ctl_elem_info(card, kctl, &info, NULL);
if (ret < 0)
return ret;
goto unlock;
#endif
if (!snd_ctl_skip_validation(&info))
@@ -1205,7 +1210,7 @@ static int snd_ctl_elem_read(struct snd_card *card,
ret = kctl->get(kctl, control);
snd_power_unref(card);
if (ret < 0)
return ret;
goto unlock;
if (!snd_ctl_skip_validation(&info) &&
sanity_check_elem_value(card, control, &info, pattern) < 0) {
dev_err(card->dev,
@@ -1213,8 +1218,11 @@ static int snd_ctl_elem_read(struct snd_card *card,
control->id.iface, control->id.device,
control->id.subdevice, control->id.name,
control->id.index);
return -EINVAL;
ret = -EINVAL;
goto unlock;
}
unlock:
up_read(&card->controls_rwsem);
return ret;
}
@@ -1228,9 +1236,7 @@ static int snd_ctl_elem_read_user(struct snd_card *card,
if (IS_ERR(control))
return PTR_ERR(control);
down_read(&card->controls_rwsem);
result = snd_ctl_elem_read(card, control);
up_read(&card->controls_rwsem);
if (result < 0)
goto error;