Skip to content

Commit 0f7500a

Browse files
committed
Merge tag 'v5.15.191' into 5.15-main
This is the 5.15.191 stable release # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmi5hgQACgkQONu9yGCS # aT50IQ//TfC7zauWEM89oXLBz7QQV67MExOxVHctGAVW8KFzOlyPptB8wq+g+Txw # /ranf6hu8QwCRR/ihnz4Oqu1t7nwjJq2oNSEYhjqlaCkra3e98zJhLmnBZZ01Jb/ # Ju/u+ldtORryZPznXjhQ9pRpzH1kbV4eSlvXC4XJDS7fudnANL/YI3BJfl7ihHcp # Av+6E09Sfh7et+aQ9BVQS6aAfqZuJ3CyudDXVwOHn+Ff3EsuouRmURC0GOtVietU # wIo0ken64t3qnx7Pkoz7cthTkH6aG6Ctp0ANvkX4maXbSkBYVcK4Yhj93v2EyO1s # rS+yRHhBcI9tdiZ/LZAVaPU1/6Am/T5+YiD/xp9nB+qwKEzHUFdUArJTAfcI6U4a # UWZ6mDKzz60TYyZPDgm8p6bN3VI/CsK/bagdCUoq9Go8Xiql4OB87Yy7tlt5QQ4t # 0XnNJQNVyNvo2uM1kNGbC/vYILN8QmMB3j3ojCBayV7iCdEvcDO+Yp51z5yoKASm # OayZCvdDb/bJfx3PMr6Llu9uKRuH6Sv7ArM32lVaBNyLwn0ULyoA2CqONMiJVZot # 8Yj8CojXRNTMq3Ub5goKc5YdzgY06rpcbfXvWsqlDBVfWuCpI/4tLjuZTW2Pi5oe # vRYofDIwXJAdANB+CnPtdbdy5ZB3o5KyDfXw6aJpnE9qjNGCF1s= # =Z+IQ # -----END PGP SIGNATURE----- # gpg: Signature made Thu Sep 4 14:28:52 2025 CEST # gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E # gpg: Can't check signature: No public key
2 parents 233514f + 7a6c2d0 commit 0f7500a

40 files changed

Lines changed: 326 additions & 207 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 5
33
PATCHLEVEL = 15
4-
SUBLEVEL = 190
4+
SUBLEVEL = 191
55
EXTRAVERSION =
66
NAME = Trick or Treat
77

arch/powerpc/kernel/kvm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,28 +632,28 @@ static void __init kvm_check_ins(u32 *inst, u32 features)
632632
#endif
633633
}
634634

635-
switch (inst_no_rt & ~KVM_MASK_RB) {
636635
#ifdef CONFIG_PPC_BOOK3S_32
636+
switch (inst_no_rt & ~KVM_MASK_RB) {
637637
case KVM_INST_MTSRIN:
638638
if (features & KVM_MAGIC_FEAT_SR) {
639639
u32 inst_rb = _inst & KVM_MASK_RB;
640640
kvm_patch_ins_mtsrin(inst, inst_rt, inst_rb);
641641
}
642642
break;
643-
#endif
644643
}
644+
#endif
645645

646-
switch (_inst) {
647646
#ifdef CONFIG_BOOKE
647+
switch (_inst) {
648648
case KVM_INST_WRTEEI_0:
649649
kvm_patch_ins_wrteei_0(inst);
650650
break;
651651

652652
case KVM_INST_WRTEEI_1:
653653
kvm_patch_ins_wrtee(inst, 0, 1);
654654
break;
655-
#endif
656655
}
656+
#endif
657657
}
658658

659659
extern u32 kvm_template_start[];

arch/x86/kvm/lapic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,8 @@ static int __pv_send_ipi(unsigned long *ipi_bitmap, struct kvm_apic_map *map,
613613
if (min > map->max_apic_id)
614614
return 0;
615615

616+
min = array_index_nospec(min, map->max_apic_id + 1);
617+
616618
for_each_set_bit(i, ipi_bitmap,
617619
min((u32)BITS_PER_LONG, (map->max_apic_id - min + 1))) {
618620
if (map->phys_map[min + i]) {

arch/x86/kvm/x86.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8923,8 +8923,11 @@ static void kvm_sched_yield(struct kvm_vcpu *vcpu, unsigned long dest_id)
89238923
rcu_read_lock();
89248924
map = rcu_dereference(vcpu->kvm->arch.apic_map);
89258925

8926-
if (likely(map) && dest_id <= map->max_apic_id && map->phys_map[dest_id])
8927-
target = map->phys_map[dest_id]->vcpu;
8926+
if (likely(map) && dest_id <= map->max_apic_id) {
8927+
dest_id = array_index_nospec(dest_id, map->max_apic_id + 1);
8928+
if (map->phys_map[dest_id])
8929+
target = map->phys_map[dest_id]->vcpu;
8930+
}
89288931

89298932
rcu_read_unlock();
89308933

drivers/atm/atmtcp.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,19 @@ static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci)
279279
return NULL;
280280
}
281281

282+
static int atmtcp_c_pre_send(struct atm_vcc *vcc, struct sk_buff *skb)
283+
{
284+
struct atmtcp_hdr *hdr;
285+
286+
if (skb->len < sizeof(struct atmtcp_hdr))
287+
return -EINVAL;
288+
289+
hdr = (struct atmtcp_hdr *)skb->data;
290+
if (hdr->length == ATMTCP_HDR_MAGIC)
291+
return -EINVAL;
292+
293+
return 0;
294+
}
282295

283296
static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
284297
{
@@ -288,9 +301,6 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
288301
struct sk_buff *new_skb;
289302
int result = 0;
290303

291-
if (skb->len < sizeof(struct atmtcp_hdr))
292-
goto done;
293-
294304
dev = vcc->dev_data;
295305
hdr = (struct atmtcp_hdr *) skb->data;
296306
if (hdr->length == ATMTCP_HDR_MAGIC) {
@@ -347,6 +357,7 @@ static const struct atmdev_ops atmtcp_v_dev_ops = {
347357

348358
static const struct atmdev_ops atmtcp_c_dev_ops = {
349359
.close = atmtcp_c_close,
360+
.pre_send = atmtcp_c_pre_send,
350361
.send = atmtcp_c_send
351362
};
352363

drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,
9393
}
9494

9595
r = amdgpu_vm_bo_map(adev, *bo_va, csa_addr, 0, size,
96-
AMDGPU_VM_PAGE_READABLE | AMDGPU_VM_PAGE_WRITEABLE |
97-
AMDGPU_VM_PAGE_EXECUTABLE);
96+
AMDGPU_PTE_READABLE | AMDGPU_PTE_WRITEABLE |
97+
AMDGPU_PTE_EXECUTABLE);
9898

9999
if (r) {
100100
DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);

drivers/gpu/drm/drm_dp_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset,
336336
* monitor doesn't power down exactly after the throw away read.
337337
*/
338338
if (!aux->is_remote) {
339-
ret = drm_dp_dpcd_access(aux, DP_AUX_NATIVE_READ, DP_LANE0_1_STATUS,
339+
ret = drm_dp_dpcd_access(aux, DP_AUX_NATIVE_READ, DP_DPCD_REV,
340340
buffer, 1);
341341
if (ret != 1)
342342
goto out;

drivers/gpu/drm/nouveau/dispnv50/wndw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,10 @@ static bool nv50_plane_format_mod_supported(struct drm_plane *plane,
664664
struct nouveau_drm *drm = nouveau_drm(plane->dev);
665665
uint8_t i;
666666

667+
/* All chipsets can display all formats in linear layout */
668+
if (modifier == DRM_FORMAT_MOD_LINEAR)
669+
return true;
670+
667671
if (drm->client.device.info.chipset < 0xc0) {
668672
const struct drm_format_info *info = drm_format_info(format);
669673
const uint8_t kind = (modifier >> 12) & 0xff;

drivers/hid/hid-asus.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,13 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
11351135
return ret;
11361136
}
11371137

1138-
if (!drvdata->input) {
1138+
/*
1139+
* Check that input registration succeeded. Checking that
1140+
* HID_CLAIMED_INPUT is set prevents a UAF when all input devices
1141+
* were freed during registration due to no usages being mapped,
1142+
* leaving drvdata->input pointing to freed memory.
1143+
*/
1144+
if (!drvdata->input || !(hdev->claimed & HID_CLAIMED_INPUT)) {
11391145
hid_err(hdev, "Asus input not registered\n");
11401146
ret = -ENOMEM;
11411147
goto err_stop_hw;

drivers/hid/hid-mcp2221.c

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum {
4444
MCP2221_I2C_MASK_ADDR_NACK = 0x40,
4545
MCP2221_I2C_WRADDRL_SEND = 0x21,
4646
MCP2221_I2C_ADDR_NACK = 0x25,
47+
MCP2221_I2C_READ_PARTIAL = 0x54,
4748
MCP2221_I2C_READ_COMPL = 0x55,
4849
MCP2221_ALT_F_NOT_GPIOV = 0xEE,
4950
MCP2221_ALT_F_NOT_GPIOD = 0xEF,
@@ -169,6 +170,25 @@ static int mcp_cancel_last_cmd(struct mcp2221 *mcp)
169170
return mcp_send_data_req_status(mcp, mcp->txbuf, 8);
170171
}
171172

173+
/* Check if the last command succeeded or failed and return the result.
174+
* If the command did fail, cancel that command which will free the i2c bus.
175+
*/
176+
static int mcp_chk_last_cmd_status_free_bus(struct mcp2221 *mcp)
177+
{
178+
int ret;
179+
180+
ret = mcp_chk_last_cmd_status(mcp);
181+
if (ret) {
182+
/* The last command was a failure.
183+
* Send a cancel which will also free the bus.
184+
*/
185+
usleep_range(980, 1000);
186+
mcp_cancel_last_cmd(mcp);
187+
}
188+
189+
return ret;
190+
}
191+
172192
static int mcp_set_i2c_speed(struct mcp2221 *mcp)
173193
{
174194
int ret;
@@ -223,7 +243,7 @@ static int mcp_i2c_write(struct mcp2221 *mcp,
223243
usleep_range(980, 1000);
224244

225245
if (last_status) {
226-
ret = mcp_chk_last_cmd_status(mcp);
246+
ret = mcp_chk_last_cmd_status_free_bus(mcp);
227247
if (ret)
228248
return ret;
229249
}
@@ -260,6 +280,7 @@ static int mcp_i2c_smbus_read(struct mcp2221 *mcp,
260280
{
261281
int ret;
262282
u16 total_len;
283+
int retries = 0;
263284

264285
mcp->txbuf[0] = type;
265286
if (msg) {
@@ -283,20 +304,31 @@ static int mcp_i2c_smbus_read(struct mcp2221 *mcp,
283304
mcp->rxbuf_idx = 0;
284305

285306
do {
307+
/* Wait for the data to be read by the device */
308+
usleep_range(980, 1000);
309+
286310
memset(mcp->txbuf, 0, 4);
287311
mcp->txbuf[0] = MCP2221_I2C_GET_DATA;
288312

289313
ret = mcp_send_data_req_status(mcp, mcp->txbuf, 1);
290-
if (ret)
291-
return ret;
292-
293-
ret = mcp_chk_last_cmd_status(mcp);
294-
if (ret)
295-
return ret;
296-
297-
usleep_range(980, 1000);
314+
if (ret) {
315+
if (retries < 5) {
316+
/* The data wasn't ready to read.
317+
* Wait a bit longer and try again.
318+
*/
319+
usleep_range(90, 100);
320+
retries++;
321+
} else {
322+
return ret;
323+
}
324+
} else {
325+
retries = 0;
326+
}
298327
} while (mcp->rxbuf_idx < total_len);
299328

329+
usleep_range(980, 1000);
330+
ret = mcp_chk_last_cmd_status_free_bus(mcp);
331+
300332
return ret;
301333
}
302334

@@ -310,11 +342,6 @@ static int mcp_i2c_xfer(struct i2c_adapter *adapter,
310342

311343
mutex_lock(&mcp->lock);
312344

313-
/* Setting speed before every transaction is required for mcp2221 */
314-
ret = mcp_set_i2c_speed(mcp);
315-
if (ret)
316-
goto exit;
317-
318345
if (num == 1) {
319346
if (msgs->flags & I2C_M_RD) {
320347
ret = mcp_i2c_smbus_read(mcp, msgs, MCP2221_I2C_RD_DATA,
@@ -399,9 +426,7 @@ static int mcp_smbus_write(struct mcp2221 *mcp, u16 addr,
399426
if (last_status) {
400427
usleep_range(980, 1000);
401428

402-
ret = mcp_chk_last_cmd_status(mcp);
403-
if (ret)
404-
return ret;
429+
ret = mcp_chk_last_cmd_status_free_bus(mcp);
405430
}
406431

407432
return ret;
@@ -419,10 +444,6 @@ static int mcp_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
419444

420445
mutex_lock(&mcp->lock);
421446

422-
ret = mcp_set_i2c_speed(mcp);
423-
if (ret)
424-
goto exit;
425-
426447
switch (size) {
427448

428449
case I2C_SMBUS_QUICK:
@@ -768,7 +789,8 @@ static int mcp2221_raw_event(struct hid_device *hdev,
768789
mcp->status = -EIO;
769790
break;
770791
}
771-
if (data[2] == MCP2221_I2C_READ_COMPL) {
792+
if (data[2] == MCP2221_I2C_READ_COMPL ||
793+
data[2] == MCP2221_I2C_READ_PARTIAL) {
772794
buf = mcp->rxbuf;
773795
memcpy(&buf[mcp->rxbuf_idx], &data[4], data[3]);
774796
mcp->rxbuf_idx = mcp->rxbuf_idx + data[3];
@@ -870,6 +892,11 @@ static int mcp2221_probe(struct hid_device *hdev,
870892
if (i2c_clk_freq < 50)
871893
i2c_clk_freq = 50;
872894
mcp->cur_i2c_clk_div = (12000000 / (i2c_clk_freq * 1000)) - 3;
895+
ret = mcp_set_i2c_speed(mcp);
896+
if (ret) {
897+
hid_err(hdev, "can't set i2c speed: %d\n", ret);
898+
return ret;
899+
}
873900

874901
mcp->adapter.owner = THIS_MODULE;
875902
mcp->adapter.class = I2C_CLASS_HWMON;

0 commit comments

Comments
 (0)