6.6.78-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 1/273 btrfs: fix assertion failure when splitting ordered extent after transaction abort
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit 0d85f5c2dd91df6b5da454406756f463ba923b69 ]
If while we are doing a direct IO write a transaction abort happens, we mark all existing ordered extents with the BTRFS_ORDERED_IOERR flag (done at btrfs_destroy_ordered_extents()), and then after that if we enter btrfs_split_ordered_extent() and the ordered extent has bytes left (meaning we have a bio that doesn't cover the whole ordered extent, see details at btrfs_extract_ordered_extent()), we will fail on the following assertion at btrfs_split_ordered_extent():
ASSERT(!(flags & ~BTRFS_ORDERED_TYPE_FLAGS));
because the BTRFS_ORDERED_IOERR flag is set and the definition of BTRFS_ORDERED_TYPE_FLAGS is just the union of all flags that identify the type of write (regular, nocow, prealloc, compressed, direct IO, encoded).
Fix this by returning an error from btrfs_extract_ordered_extent() if we find the BTRFS_ORDERED_IOERR flag in the ordered extent. The error will be the error that resulted in the transaction abort or -EIO if no transaction abort happened.
This was recently reported by syzbot with the following trace:
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted 6.13.0-rc5-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
fail_dump lib/fault-inject.c:53 [inline]
should_fail_ex+0x3b0/0x4e0 lib/fault-inject.c:154
should_failslab+0xac/0x100 mm/failslab.c:46
slab_pre_alloc_hook mm/slub.c:4072 [inline]
slab_alloc_node mm/slub.c:4148 [inline]
__do_kmalloc_node mm/slub.c:4297 [inline]
__kmalloc_noprof+0xdd/0x4c0 mm/slub.c:4310
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1037 [inline]
btrfs_chunk_alloc_add_chunk_item+0x244/0x1100 fs/btrfs/volumes.c:5742
reserve_chunk_space+0x1ca/0x2c0 fs/btrfs/block-group.c:4292
check_system_chunk fs/btrfs/block-group.c:4319 [inline]
do_chunk_alloc fs/btrfs/block-group.c:3891 [inline]
btrfs_chunk_alloc+0x77b/0xf80 fs/btrfs/block-group.c:4187
find_free_extent_update_loop fs/btrfs/extent-tree.c:4166 [inline]
find_free_extent+0x42d1/0x5810 fs/btrfs/extent-tree.c:4579
btrfs_reserve_extent+0x422/0x810 fs/btrfs/extent-tree.c:4672
btrfs_new_extent_direct fs/btrfs/direct-io.c:186 [inline]
btrfs_get_blocks_direct_write+0x706/0xfa0 fs/btrfs/direct-io.c:321
btrfs_dio_iomap_begin+0xbb7/0x1180 fs/btrfs/direct-io.c:525
iomap_iter+0x697/0xf60 fs/iomap/iter.c:90
__iomap_dio_rw+0xeb9/0x25b0 fs/iomap/direct-io.c:702
btrfs_dio_write fs/btrfs/direct-io.c:775 [inline]
btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880
btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1397
do_iter_readv_writev+0x600/0x880
vfs_writev+0x376/0xba0 fs/read_write.c:1050
do_pwritev fs/read_write.c:1146 [inline]
__do_sys_pwritev2 fs/read_write.c:1204 [inline]
__se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1281f85d29
RSP: 002b:00007f12819fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007f1282176080 RCX: 00007f1281f85d29
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005
RBP: 00007f12819fe090 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f1282176080 R15: 00007ffcb9e23328
</TASK>
BTRFS error (device loop0 state A): Transaction aborted (error -12)
BTRFS: error (device loop0 state A) in btrfs_chunk_alloc_add_chunk_item:5745: errno=-12 Out of memory
BTRFS info (device loop0 state EA): forced readonly
assertion failed: !(flags & ~BTRFS_ORDERED_TYPE_FLAGS), in fs/btrfs/ordered-data.c:1234
------------[ cut here ]------------
kernel BUG at fs/btrfs/ordered-data.c:1234!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted 6.13.0-rc5-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:btrfs_split_ordered_extent+0xd8d/0xe20 fs/btrfs/ordered-data.c:1234
RSP: 0018:ffffc9000d1df2b8 EFLAGS: 00010246
RAX: 0000000000000057 RBX: 000000000006a000 RCX: 9ce21886c4195300
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: 0000000000000091 R08: ffffffff817f0a3c R09: 1ffff92001a3bdf4
R10: dffffc0000000000 R11: fffff52001a3bdf5 R12: 1ffff1100a45f401
R13: ffff8880522fa018 R14: dffffc0000000000 R15: 000000000006a000
FS: 00007f12819fe6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557750bd7da8 CR3: 00000000400ea000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
btrfs_extract_ordered_extent fs/btrfs/direct-io.c:702 [inline]
btrfs_dio_submit_io+0x4be/0x6d0 fs/btrfs/direct-io.c:737
iomap_dio_submit_bio fs/iomap/direct-io.c:85 [inline]
iomap_dio_bio_iter+0x1022/0x1740 fs/iomap/direct-io.c:447
__iomap_dio_rw+0x13b7/0x25b0 fs/iomap/direct-io.c:703
btrfs_dio_write fs/btrfs/direct-io.c:775 [inline]
btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880
btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1397
do_iter_readv_writev+0x600/0x880
vfs_writev+0x376/0xba0 fs/read_write.c:1050
do_pwritev fs/read_write.c:1146 [inline]
__do_sys_pwritev2 fs/read_write.c:1204 [inline]
__se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1281f85d29
RSP: 002b:00007f12819fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007f1282176080 RCX: 00007f1281f85d29
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005
RBP: 00007f12819fe090 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f1282176080 R15: 00007ffcb9e23328
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_split_ordered_extent+0xd8d/0xe20 fs/btrfs/ordered-data.c:1234
RSP: 0018:ffffc9000d1df2b8 EFLAGS: 00010246
RAX: 0000000000000057 RBX: 000000000006a000 RCX: 9ce21886c4195300
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: 0000000000000091 R08: ffffffff817f0a3c R09: 1ffff92001a3bdf4
R10: dffffc0000000000 R11: fffff52001a3bdf5 R12: 1ffff1100a45f401
R13: ffff8880522fa018 R14: dffffc0000000000 R15: 000000000006a000
FS: 00007f12819fe6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557750bd7da8 CR3: 00000000400ea000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400In this case the transaction abort was due to (an injected) memory allocation failure when attempting to allocate a new chunk.
--- fs/btrfs/ordered-data.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
fs/btrfs/ordered-data.c +12 -0
@@ -1171,6 +1171,18 @@ struct btrfs_ordered_extent *btrfs_split_ordered_extent(*/ if (WARN_ON_ONCE (len >= ordered->num_bytes))return ERR_PTR (-EINVAL ); +/* +* If our ordered extent had an error there's no point in continuing. +* The error may have come from a transaction abort done either by this +* task or some other concurrent task, and the transaction abort path +* iterates over all existing ordered extents and sets the flag +* BTRFS_ORDERED_IOERR on them. +*/ +if (unlikely (flags & (1U <<BTRFS_ORDERED_IOERR ))) { +const int fs_error =BTRFS_FS_ERROR (fs_info); + +return fs_error ?ERR_PTR (fs_error) :ERR_PTR (-EIO ); + }/* We cannot split partially completed ordered extents. */ if (ordered->bytes_left) {ASSERT (!(flags & ~BTRFS_ORDERED_TYPE_FLAGS ));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 10/273 x86/amd_nb: Restrict init function to AMD-based systems
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yazen Ghannam <[email protected]>
[ Upstream commit bee9e840609cc67d0a7d82f22a2130fb7a0a766d ]
The code implicitly operates on AMD-based systems by matching on PCI IDs. However, the use of these IDs is going away.
Add an explicit CPU vendor check instead of relying on PCI IDs.
--- arch/x86/kernel/amd_nb.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/kernel/amd_nb.c +4 -0
@@ -537,6 +537,10 @@ static __init void fix_erratum_688(void)static __init int init_amd_nbs (void ) { +if (boot_cpu_data.x86_vendor !=X86_VENDOR_AMD && + boot_cpu_data.x86_vendor !=X86_VENDOR_HYGON ) +return 0 ; +amd_cache_northbridges ();amd_cache_gart ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 11/273 drm/virtio: New fence for every plane update
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dongwon Kim <[email protected]>
[ Upstream commit d3c55b8ab6fe5fa2e7ab02efd36d09c39ee5022f ]
Having a fence linked to a virtio_gpu_framebuffer in the plane update sequence would cause conflict when several planes referencing the same framebuffer (e.g. Xorg screen covering multi-displays configured for an extended mode) and those planes are updated concurrently. So it is needed to allocate a fence for every plane state instead of the framebuffer.
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 7 ++++ drivers/gpu/drm/virtio/virtgpu_plane.c | 58 +++++++++++++++++--------- 2 files changed, 46 insertions(+), 19 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +7 -0
@@ -191,6 +191,13 @@ struct virtio_gpu_framebuffer {#define to_virtio_gpu_framebuffer (x) \ container_of(x, struct virtio_gpu_framebuffer, base) +struct virtio_gpu_plane_state { +struct drm_plane_state base; +struct virtio_gpu_fence *fence; +}; +#define to_virtio_gpu_plane_state (x) \ + container_of(x, struct virtio_gpu_plane_state, base) +struct virtio_gpu_queue {struct virtqueue *vq;spinlock_t qlock;
drivers/gpu/drm/virtio/virtgpu_plane.c +39 -19
132 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 12/273 printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuan-Wei Chiu <[email protected]>
[ Upstream commit 3d6f83df8ff2d5de84b50377e4f0d45e25311c7a ]
Shifting 1 << 31 on a 32-bit int causes signed integer overflow, which leads to undefined behavior. To prevent this, cast 1 to u32 before performing the shift, ensuring well-defined behavior.
This change explicitly avoids any potential overflow by ensuring that the shift occurs on an unsigned 32-bit integer.
--- kernel/printk/printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/printk/printk.c +1 -1
@@ -474,7 +474,7 @@ static struct latched_seq clear_seq = {/* record buffer */ #define LOG_ALIGN __alignof__(unsigned long)#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) -#define LOG_BUF_LEN_MAX (u32)(1 << 31) +#define LOG_BUF_LEN_MAX ((u32)1 << 31)static char __log_buf[__LOG_BUF_LEN]__aligned(LOG_ALIGN) ;static char *log_buf = __log_buf;static u32 log_buf_len = __LOG_BUF_LEN;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 13/273 drm/connector: add mutex to protect ELD from concurrent access
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit df7c8e3dde37a9d81c0613285b43600f3cc70f34 ]
The connector->eld is accessed by the .get_eld() callback. This access can collide with the drm_edid_to_eld() updating the data at the same time. Add drm_connector.eld_mutex to protect the data from concurrenct access. Individual drivers are not updated (to reduce possible issues while applying the patch), maintainers are to find a best suitable way to lock that mutex while accessing the ELD data.
--- drivers/gpu/drm/drm_connector.c | 1 + drivers/gpu/drm/drm_edid.c | 6 ++++++ include/drm/drm_connector.h | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +1 -0
@@ -277,6 +277,7 @@ static int __drm_connector_init(struct drm_device *dev,INIT_LIST_HEAD (&connector->probed_modes);INIT_LIST_HEAD (&connector->modes);mutex_init (&connector->mutex); +mutex_init (&connector->eld_mutex);mutex_init (&connector->edid_override_mutex); connector->edid_blob_ptr =NULL ; connector->epoch_counter =0 ;
drivers/gpu/drm/drm_edid.c +6 -0
@@ -5499,7 +5499,9 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name);static void clear_eld (struct drm_connector *connector) { +mutex_lock (&connector->eld_mutex);memset (connector->eld,0 ,sizeof (connector->eld)); +mutex_unlock (&connector->eld_mutex); connector->latency_present[0 ] = false; connector->latency_present[1 ] = false;
@@ -5530,6 +5532,8 @@ static void drm_edid_to_eld(struct drm_connector *connector,if (!drm_edid)return ; +mutex_lock (&connector->eld_mutex); + mnl =get_monitor_name (drm_edid, &eld[DRM_ELD_MONITOR_NAME_STRING ]); drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD monitor %s\n", connector->base.id, connector->name,
@@ -5590,6 +5594,8 @@ static void drm_edid_to_eld(struct drm_connector *connector,drm_dbg_kms (connector->dev,"[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n" , connector->base.id, connector->name,drm_eld_size (eld), total_sad_count); + +mutex_unlock (&connector->eld_mutex); } static int _drm_edid_to_sad(const struct drm_edid *drm_edid,
include/drm/drm_connector.h +4 -1
@@ -1764,8 +1764,11 @@ struct drm_connector {struct drm_encoder *encoder;#define MAX_ELD_BYTES 128 -/** @eld: EDID-like data, if present */ +/** @eld: EDID-like data, if present, protected by @eld_mutex */ uint8_t eld[MAX_ELD_BYTES ]; +/** @eld_mutex: protection for concurrenct access to @eld */ +struct mutex eld_mutex; +/** @latency_present: AV delay info from ELD, if found */ bool latency_present[2 ];/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 14/273 drm/bridge: anx7625: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit e72bf423a60afd744d13e40ab2194044a3af5217 ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -0
@@ -2014,8 +2014,10 @@ static int anx7625_audio_get_eld(struct device *dev, void *data,memset (buf,0 , len); }else {dev_dbg (dev,"audio copy eld\n" ); +mutex_lock (&ctx->connector->eld_mutex);memcpy (buf, ctx->connector->eld,min (sizeof (ctx->connector->eld), len)); +mutex_unlock (&ctx->connector->eld_mutex); }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 15/273 drm/bridge: ite-it66121: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 39ead6e02ea7d19b421e9d42299d4293fed3064e ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/bridge/ite-it66121.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/ite-it66121.c +2 -0
@@ -1452,8 +1452,10 @@ static int it66121_audio_get_eld(struct device *dev, void *data,dev_dbg (dev,"No connector present, passing empty EDID data" );memset (buf,0 , len); }else { +mutex_lock (&ctx->connector->eld_mutex);memcpy (buf, ctx->connector->eld,min (sizeof (ctx->connector->eld), len)); +mutex_unlock (&ctx->connector->eld_mutex); }mutex_unlock (&ctx->lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 16/273 drm/amd/display: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 819bee01eea06282d7bda17d46caf29cae4f6d84 ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -955,8 +955,10 @@ static int amdgpu_dm_audio_component_get_eld(struct device *kdev, int port,continue ; *enabled = true; +mutex_lock (&connector->eld_mutex); ret =drm_eld_size (connector->eld);memcpy (buf, connector->eld,min (max_bytes, ret)); +mutex_unlock (&connector->eld_mutex);break ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/273 drm/exynos: hdmi: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 5e8436d334ed7f6785416447c50b42077c6503e0 ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +2 -0
@@ -1643,7 +1643,9 @@ static int hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf,struct hdmi_context *hdata =dev_get_drvdata (dev);struct drm_connector *connector = &hdata->connector; +mutex_lock (&connector->eld_mutex);memcpy (buf, connector->eld,min (sizeof (connector->eld), len)); +mutex_unlock (&connector->eld_mutex);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/273 drm/radeon: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit b54c14f82428c8a602392d4cae1958a71a578132 ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/radeon/radeon_audio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/radeon/radeon_audio.c +2 -0
@@ -773,8 +773,10 @@ static int radeon_audio_component_get_eld(struct device *kdev, int port,if (!dig->pin || dig->pin->id != port)continue ; *enabled = true; +mutex_lock (&connector->eld_mutex); ret =drm_eld_size (connector->eld);memcpy (buf, connector->eld,min (max_bytes, ret)); +mutex_unlock (&connector->eld_mutex);break ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/273 drm/sti: hdmi: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit e99c0b517bcd53cf61f998a3c4291333401cb391 ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/sti/sti_hdmi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/sti/sti_hdmi.c +2 -0
@@ -1221,7 +1221,9 @@ static int hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, sizestruct drm_connector *connector = hdmi->drm_connector;DRM_DEBUG_DRIVER ("\n" ); +mutex_lock (&connector->eld_mutex);memcpy (buf, connector->eld,min (sizeof (connector->eld), len)); +mutex_unlock (&connector->eld_mutex);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 2/273 btrfs: fix use-after-free when attempting to join an aborted transaction
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit e2f0943cf37305dbdeaf9846e3c941451bcdef63 ]
When we are trying to join the current transaction and if it's aborted, we read its 'aborted' field after unlocking fs_info->trans_lock and without holding any extra reference count on it. This means that a concurrent task that is aborting the transaction may free the transaction before we read its 'aborted' field, leading to a use-after-free.
Fix this by reading the 'aborted' field while holding fs_info->trans_lock since any freeing task must first acquire that lock and set fs_info->running_transaction to NULL before freeing the transaction.
This was reported by syzbot and Dmitry with the following stack traces from KASAN:
==================================================================
BUG: KASAN: slab-use-after-free in join_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
Read of size 4 at addr ffff888011839024 by task kworker/u4:9/1128
CPU: 0 UID: 0 PID: 1128 Comm: kworker/u4:9 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: events_unbound btrfs_async_reclaim_data_space
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x169/0x550 mm/kasan/report.c:489
kasan_report+0x143/0x180 mm/kasan/report.c:602
join_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
start_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
flush_space+0x448/0xcf0 fs/btrfs/space-info.c:803
btrfs_async_reclaim_data_space+0x159/0x510 fs/btrfs/space-info.c:1321
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
worker_thread+0x870/0xd30 kernel/workqueue.c:3398
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
</TASK>
Allocated by task 5315:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394
kasan_kmalloc include/linux/kasan.h:260 [inline]
__kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4329
kmalloc_noprof include/linux/slab.h:901 [inline]
join_transaction+0x144/0xda0 fs/btrfs/transaction.c:308
start_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
btrfs_create_common+0x1b2/0x2e0 fs/btrfs/inode.c:6572
lookup_open fs/namei.c:3649 [inline]
open_last_lookups fs/namei.c:3748 [inline]
path_openat+0x1c03/0x3590 fs/namei.c:3984
do_filp_open+0x27f/0x4e0 fs/namei.c:4014
do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
do_sys_open fs/open.c:1417 [inline]
__do_sys_creat fs/open.c:1495 [inline]
__se_sys_creat fs/open.c:1489 [inline]
__x64_sys_creat+0x123/0x170 fs/open.c:1489
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 5336:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582
poison_slab_object mm/kasan/common.c:247 [inline]
__kasan_slab_free+0x59/0x70 mm/kasan/common.c:264
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2353 [inline]
slab_free mm/slub.c:4613 [inline]
kfree+0x196/0x430 mm/slub.c:4761
cleanup_transaction fs/btrfs/transaction.c:2063 [inline]
btrfs_commit_transaction+0x2c97/0x3720 fs/btrfs/transaction.c:2598
insert_balance_item+0x1284/0x20b0 fs/btrfs/volumes.c:3757
btrfs_balance+0x992/0x10c0 fs/btrfs/volumes.c:4633
btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3670
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888011839000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 36 bytes inside of
freed 2048-byte region [ffff888011839000, ffff888011839800)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11838
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801ac42000 ffffea0000493400 dead000000000002
raw: 0000000000000000 0000000000080008 00000001f5000000 0000000000000000
head: 00fff00000000040 ffff88801ac42000 ffffea0000493400 dead000000000002
head: 0000000000000000 0000000000080008 00000001f5000000 0000000000000000
head: 00fff00000000003 ffffea0000460e01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 57, tgid 57 (kworker/0:2), ts 67248182943, free_ts 67229742023
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558
prep_new_page mm/page_alloc.c:1566 [inline]
get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476
__alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753
alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269
alloc_slab_page+0x6a/0x110 mm/slub.c:2423
allocate_slab+0x5a/0x2b0 mm/slub.c:2589
new_slab mm/slub.c:2642 [inline]
___slab_alloc+0xc27/0x14a0 mm/slub.c:3830
__slab_alloc+0x58/0xa0 mm/slub.c:3920
__slab_alloc_node mm/slub.c:3995 [inline]
slab_alloc_node mm/slub.c:4156 [inline]
__do_kmalloc_node mm/slub.c:4297 [inline]
__kmalloc_node_track_caller_noprof+0x2e9/0x4c0 mm/slub.c:4317
kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:609
__alloc_skb+0x1f3/0x440 net/core/skbuff.c:678
alloc_skb include/linux/skbuff.h:1323 [inline]
alloc_skb_with_frags+0xc3/0x820 net/core/skbuff.c:6612
sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2884
sock_alloc_send_skb include/net/sock.h:1803 [inline]
mld_newpack+0x1c3/0xaf0 net/ipv6/mcast.c:1747
add_grhead net/ipv6/mcast.c:1850 [inline]
add_grec+0x1492/0x19a0 net/ipv6/mcast.c:1988
mld_send_cr net/ipv6/mcast.c:2114 [inline]
mld_ifc_work+0x691/0xd90 net/ipv6/mcast.c:2651
page last free pid 5300 tgid 5300 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1127 [inline]
free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659
__slab_free+0x2c2/0x380 mm/slub.c:4524
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4119 [inline]
slab_alloc_node mm/slub.c:4168 [inline]
__do_kmalloc_node mm/slub.c:4297 [inline]
__kmalloc_noprof+0x236/0x4c0 mm/slub.c:4310
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1037 [inline]
fib_create_info+0xc14/0x25b0 net/ipv4/fib_semantics.c:1435
fib_table_insert+0x1f6/0x1f20 net/ipv4/fib_trie.c:1231
fib_magic+0x3d8/0x620 net/ipv4/fib_frontend.c:1112
fib_add_ifaddr+0x40c/0x5e0 net/ipv4/fib_frontend.c:1156
fib_netdev_event+0x375/0x490 net/ipv4/fib_frontend.c:1494
notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85
__dev_notify_flags+0x207/0x400
dev_change_flags+0xf0/0x1a0 net/core/dev.c:9045
do_setlink+0xc90/0x4210 net/core/rtnetlink.c:3109
rtnl_changelink net/core/rtnetlink.c:3723 [inline]
__rtnl_newlink net/core/rtnetlink.c:3875 [inline]
rtnl_newlink+0x1bb6/0x2210 net/core/rtnetlink.c:4012
Memory state around the buggy address:
ffff888011838f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888011838f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888011839000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888011839080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888011839100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================--- fs/btrfs/transaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/btrfs/transaction.c +3 -1
@@ -278,8 +278,10 @@ static noinline int join_transaction(struct btrfs_fs_info *fs_info, cur_trans = fs_info->running_transaction;if (cur_trans) {if (TRANS_ABORTED (cur_trans)) { +const int abort_error = cur_trans->aborted; +spin_unlock (&fs_info->trans_lock); -return cur_trans->aborted; +return abort_error; }if (btrfs_blocked_trans_types[cur_trans->state] & type) {spin_unlock (&fs_info->trans_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/273 drm/vc4: hdmi: use eld_mutex to protect access to connector->eld
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 81a9a93b169a273ccc4a9a1ee56f17e9981d3f98 ]
Reading access to connector->eld can happen at the same time the drm_edid_to_eld() updates the data. Take the newly added eld_mutex in order to protect connector->eld from concurrent access.
--- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_hdmi.c +2 -2
@@ -2655,9 +2655,9 @@ static int vc4_hdmi_audio_get_eld(struct device *dev, void *data,struct vc4_hdmi *vc4_hdmi =dev_get_drvdata (dev);struct drm_connector *connector = &vc4_hdmi->connector; -mutex_lock (&vc4_hdmi->mutex); +mutex_lock (&connector->eld_mutex);memcpy (buf, connector->eld,min (sizeof (connector->eld), len)); -mutex_unlock (&vc4_hdmi->mutex); +mutex_unlock (&connector->eld_mutex);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/273 drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fangzhi Zuo <[email protected]>
[ Upstream commit e56ad45e991128bf4db160b75a1d9f647a341d8f ]
Source --> DP2.1 MST hub --> DP1.4/2.1 monitor
When change from DP1.4 to DP2.1 from monitor manual, modes higher than 4k120 are all cutoff by mode validation. Switch back to DP1.4 gets all the modes up to 4k240 available to be enabled by dsc passthrough.
[why]
Compared to DP1.4 link from hub to monitor, DP2.1 link has larger full_pbn value that causes overflow in the process of doing conversion from pbn to kbps.
[how]
Change the data type accordingly to fit into the data limit during conversion calculation.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +3 -3
@@ -1578,16 +1578,16 @@ int pre_validate_dsc(struct drm_atomic_state *state,return ret; } -static unsigned int kbps_from_pbn (unsigned int pbn) +static uint32_t kbps_from_pbn (unsigned int pbn) { -unsigned int kbps = pbn; +uint64_t kbps = (uint64_t )pbn; kbps *= (1000000 /PEAK_FACTOR_X1000 ); kbps *=8 ; kbps *=54 ; kbps /=64 ; -return kbps; +return (uint32_t )kbps; } static bool is_dsc_common_config_possible(struct dc_stream_state *stream,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/273 drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hermes Wu <[email protected]>
[ Upstream commit 85597bc0d70c287ba41f17d14d3d857a38a3d727 ]
A HDCP source device shall support max downstream to 127 devices. Change definition MAX_HDCP_DOWN_STREAM_COUNT to 127
KSVs shall save for DRM blocked devices check.
This results in struct it6505 growth by ~0.5 KiB.
--- drivers/gpu/drm/bridge/ite-it6505.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it6505.c +1 -1
@@ -295,7 +295,7 @@#define MAX_LANE_COUNT 4#define MAX_LINK_RATE HBR#define AUTO_TRAIN_RETRY 3 -#define MAX_HDCP_DOWN_STREAM_COUNT 10 +#define MAX_HDCP_DOWN_STREAM_COUNT 127#define MAX_CR_LEVEL 0x03#define MAX_EQ_LEVEL 0x03#define AUX_WAIT_TIMEOUT_MS 15
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/273 drm/bridge: it6505: fix HDCP Bstatus check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hermes Wu <[email protected]>
[ Upstream commit 0fd2ff47d8c207fa3173661de04bb9e8201c0ad2 ]
When HDCP is activated,
a DisplayPort source receiving CP_IRQ from the sink shall check Bstatus from DPCD and process the corresponding value
--- drivers/gpu/drm/bridge/ite-it6505.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/ite-it6505.c +9 -3
@@ -2309,14 +2309,20 @@ static int it6505_process_hpd_irq(struct it6505 *it6505)DRM_DEV_DEBUG_DRIVER (dev,"dp_irq_vector = 0x%02x" , dp_irq_vector);if (dp_irq_vector &DP_CP_IRQ ) { -it6505_set_bits (it6505,REG_HDCP_TRIGGER ,HDCP_TRIGGER_CPIRQ , -HDCP_TRIGGER_CPIRQ ); - bstatus =it6505_dpcd_read (it6505,DP_AUX_HDCP_BSTATUS );if (bstatus <0 )return bstatus;DRM_DEV_DEBUG_DRIVER (dev,"Bstatus = 0x%02x" , bstatus); + +/*Check BSTATUS when recive CP_IRQ */ +if (bstatus &DP_BSTATUS_R0_PRIME_READY && + it6505->hdcp_status ==HDCP_AUTH_GOING ) +it6505_set_bits (it6505,REG_HDCP_TRIGGER ,HDCP_TRIGGER_CPIRQ , +HDCP_TRIGGER_CPIRQ ); +else if (bstatus & (DP_BSTATUS_REAUTH_REQ |DP_BSTATUS_LINK_FAILURE ) && + it6505->hdcp_status ==HDCP_AUTH_DONE ) +it6505_start_hdcp (it6505); } ret =drm_dp_dpcd_read_link_status (&it6505->aux, link_status);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/273 drm/bridge: it6505: fix HDCP encryption when R0 ready
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hermes Wu <[email protected]>
[ Upstream commit 8c01b0bae2f9e58f2fee0e811cb90d8331986554 ]
When starting HDCP authentication, HDCP encryption should be enabled when R0'is checked.
Change encryption enables time at R0' ready.
The hardware HDCP engine trigger is changed and the repeater KSV fails will restart HDCP.
--- drivers/gpu/drm/bridge/ite-it6505.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/bridge/ite-it6505.c +9 -8
@@ -2078,15 +2078,12 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work) ksv_list_check =it6505_hdcp_part2_ksvlist_check (it6505);DRM_DEV_DEBUG_DRIVER (dev,"ksv list ready, ksv list check %s" , ksv_list_check ?"pass" :"fail" ); -if (ksv_list_check) { -it6505_set_bits (it6505,REG_HDCP_TRIGGER , -HDCP_TRIGGER_KSV_DONE ,HDCP_TRIGGER_KSV_DONE ); + +if (ksv_list_check)return ; - } + timeout: -it6505_set_bits (it6505,REG_HDCP_TRIGGER , -HDCP_TRIGGER_KSV_DONE |HDCP_TRIGGER_KSV_FAIL , -HDCP_TRIGGER_KSV_DONE |HDCP_TRIGGER_KSV_FAIL ); +it6505_start_hdcp (it6505); }static void it6505_hdcp_work (struct work_struct *work)
@@ -2459,7 +2456,11 @@ static void it6505_irq_hdcp_ksv_check(struct it6505 *it6505) {struct device *dev = it6505->dev; -DRM_DEV_DEBUG_DRIVER (dev,"HDCP event Interrupt" ); +DRM_DEV_DEBUG_DRIVER (dev,"HDCP repeater R0 event Interrupt" ); +/* 1B01 HDCP encription should start when R0 is ready*/ +it6505_set_bits (it6505,REG_HDCP_TRIGGER , +HDCP_TRIGGER_KSV_DONE ,HDCP_TRIGGER_KSV_DONE ); +schedule_work (&it6505->hdcp_wait_ksv_list); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 25/273 drm/bridge: it6505: fix HDCP CTS compare V matching
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hermes Wu <[email protected]>
[ Upstream commit 0989c02c7a5c887c70afeae80c64d0291624e1a7 ]
When HDCP negotiation with a repeater device.
Checking SHA V' matching must retry 3 times before restarting HDCP.
--- drivers/gpu/drm/bridge/ite-it6505.c | 32 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-)
drivers/gpu/drm/bridge/ite-it6505.c +19 -13
@@ -2020,7 +2020,7 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505) {struct device *dev = it6505->dev;u8 av[5 ][4 ], bv[5 ][4 ]; -int i, err; +int i, err, retry; i =it6505_setup_sha1_input (it6505, it6505->sha1_input);if (i <=0 ) {
@@ -2029,22 +2029,28 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505) }it6505_sha1_digest (it6505, it6505->sha1_input, i, (u8 *)av); +/*1B-05 V' must retry 3 times */ +for (retry =0 ; retry <3 ; retry++) { + err =it6505_get_dpcd (it6505,DP_AUX_HDCP_V_PRIME (0 ), (u8 *)bv, +sizeof (bv)); - err =it6505_get_dpcd (it6505,DP_AUX_HDCP_V_PRIME (0 ), (u8 *)bv, -sizeof (bv)); +if (err <0 ) { +dev_err (dev,"Read V' value Fail %d" , retry); +continue ; + } -if (err <0 ) { -dev_err (dev,"Read V' value Fail" ); -return false; - } +for (i =0 ; i <5 ; i++) { +if (bv[i][3 ] != av[i][0 ] || bv[i][2 ] != av[i][1 ] || + av[i][1 ] != av[i][2 ] || bv[i][0 ] != av[i][3 ]) +break ; -for (i =0 ; i <5 ; i++) -if (bv[i][3 ] != av[i][0 ] || bv[i][2 ] != av[i][1 ] || - bv[i][1 ] != av[i][2 ] || bv[i][0 ] != av[i][3 ]) -return false; +DRM_DEV_DEBUG_DRIVER (dev,"V' all match!! %d, %d" , retry, i); +return true; + } + } -DRM_DEV_DEBUG_DRIVER (dev,"V' all match!!" ); -return true; +DRM_DEV_DEBUG_DRIVER (dev,"V' NOT match!! %d" , retry); +return false; }static void it6505_hdcp_wait_ksv_list (struct work_struct *work)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/273 drm/bridge: it6505: fix HDCP CTS KSV list wait timer
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hermes Wu <[email protected]>
[ Upstream commit 9f9eef9ec1a2b57d95a86fe81df758e8253a7766 ]
HDCP must disabled encryption and restart authentication after waiting KSV for 5s.
The original method uses a counter in a waitting loop that may wait much longer than it is supposed to.
Use time_after() for KSV wait timeout.
--- drivers/gpu/drm/bridge/ite-it6505.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/bridge/ite-it6505.c +10 -10
@@ -2058,12 +2058,13 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work) struct it6505 *it6505 = container_of(work, struct it6505, hdcp_wait_ksv_list);struct device *dev = it6505->dev; -unsigned int timeout =5000 ; -u8 bstatus =0 ; +u8 bstatus;bool ksv_list_check; +/* 1B-04 wait ksv list for 5s */ +unsigned long timeout = jiffies + +msecs_to_jiffies (5000 ) +1 ; - timeout /=20 ; -while (timeout >0 ) { +for (;;) {if (!it6505_get_sink_hpd_status (it6505))return ;
@@ -2072,13 +2073,12 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work)if (bstatus &DP_BSTATUS_READY )break ; -msleep (20 ); - timeout--; - } +if (time_after (jiffies, timeout)) { +DRM_DEV_DEBUG_DRIVER (dev,"KSV list wait timeout" ); + goto timeout; + } -if (timeout ==0 ) { -DRM_DEV_DEBUG_DRIVER (dev,"timeout and ksv list wait failed" ); - goto timeout; +msleep (20 ); } ksv_list_check =it6505_hdcp_part2_ksvlist_check (it6505);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/273 safesetid: check size of policy writes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leo Stone <[email protected]>
[ Upstream commit f09ff307c7299392f1c88f763299e24bc99811c7 ]
syzbot attempts to write a buffer with a large size to a sysfs entry with writes handled by handle_policy_update(), triggering a warning in kmalloc.
Check the size specified for write buffers before allocating.
--- security/safesetid/securityfs.c | 3 +++ 1 file changed, 3 insertions(+)
security/safesetid/securityfs.c +3 -0
@@ -143,6 +143,9 @@ static ssize_t handle_policy_update(struct file *file,char *buf, *p, *end;int err; +if (len >=KMALLOC_MAX_SIZE ) +return -EINVAL ; + pol =kmalloc (sizeof (struct setid_ruleset ),GFP_KERNEL );if (!pol)return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/273 wifi: rtw89: add crystal_cap check to avoid setting as overflow value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chih-Kang Chang <[email protected]>
[ Upstream commit 7b98caea39676561f22db58752551161bb36462b ]
In the original flow, the crystal_cap might be calculated as a negative value and set as an overflow value. Therefore, we added a check to limit the calculated crystal_cap value. Additionally, we shrank the crystal_cap adjustment according to specific CFO.
--- drivers/net/wireless/realtek/rtw89/phy.c | 11 ++++++----- drivers/net/wireless/realtek/rtw89/phy.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/net/wireless/realtek/rtw89/phy.c +6 -5
@@ -2438,7 +2438,6 @@ static void rtw89_phy_cfo_set_crystal_cap(struct rtw89_dev *rtwdev,if (!force && cfo->crystal_cap == crystal_cap)return ; - crystal_cap =clamp_t (u8, crystal_cap,0 ,127 );if (chip->chip_id ==RTL8852A || chip->chip_id ==RTL8851B ) {rtw89_phy_cfo_set_xcap_reg (rtwdev, true, crystal_cap);rtw89_phy_cfo_set_xcap_reg (rtwdev, false, crystal_cap);
@@ -2552,7 +2551,7 @@ static void rtw89_phy_cfo_crystal_cap_adjust(struct rtw89_dev *rtwdev, s32 curr_cfo) {struct rtw89_cfo_tracking_info *cfo = &rtwdev->cfo_tracking; -s8 crystal_cap = cfo->crystal_cap; +int crystal_cap = cfo->crystal_cap;s32 cfo_abs =abs (curr_cfo);int sign;
@@ -2569,15 +2568,17 @@ static void rtw89_phy_cfo_crystal_cap_adjust(struct rtw89_dev *rtwdev, } sign = curr_cfo >0 ?1 :-1 ;if (cfo_abs >CFO_TRK_STOP_TH_4 ) - crystal_cap +=7 * sign; + crystal_cap +=3 * sign;else if (cfo_abs >CFO_TRK_STOP_TH_3 ) - crystal_cap +=5 * sign; -else if (cfo_abs >CFO_TRK_STOP_TH_2 ) crystal_cap +=3 * sign; +else if (cfo_abs >CFO_TRK_STOP_TH_2 ) + crystal_cap +=1 * sign;else if (cfo_abs >CFO_TRK_STOP_TH_1 ) crystal_cap +=1 * sign;else return ; + + crystal_cap =clamp (crystal_cap,0 ,127 );rtw89_phy_cfo_set_crystal_cap (rtwdev, (u8 )crystal_cap, false); rtw89_debug(rtwdev, RTW89_DBG_CFO, "X_cap{Curr,Default}={0x%x,0x%x}\n",
drivers/net/wireless/realtek/rtw89/phy.h +1 -1
@@ -51,7 +51,7 @@#define CFO_TRK_STOP_TH_4 (30 << 2)#define CFO_TRK_STOP_TH_3 (20 << 2)#define CFO_TRK_STOP_TH_2 (10 << 2) -#define CFO_TRK_STOP_TH_1 (00 << 2) +#define CFO_TRK_STOP_TH_1 (03 << 2)#define CFO_TRK_STOP_TH (2 << 2)#define CFO_SW_COMP_FINE_TUNE (2 << 2)#define CFO_PERIOD_CNT 15
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 3/273 arm64/mm: Ensure adequate HUGE_MAX_HSTATE
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anshuman Khandual <[email protected]>
[ Upstream commit 1e5823c8e86de83a43d59a522b4de29066d3b306 ]
This asserts that HUGE_MAX_HSTATE is sufficient enough preventing potential hugetlb_max_hstate runtime overflow in hugetlb_add_hstate() thus triggering a BUG_ON() there after.
--- arch/arm64/mm/hugetlbpage.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/mm/hugetlbpage.c +12 -0
@@ -526,6 +526,18 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,static int __init hugetlbpage_init (void ) { +/* +* HugeTLB pages are supported on maximum four page table +* levels (PUD, CONT PMD, PMD, CONT PTE) for a given base +* page size, corresponding to hugetlb_add_hstate() calls +* here. +* +* HUGE_MAX_HSTATE should at least match maximum supported +* HugeTLB page sizes on the platform. Any new addition to +* supported HugeTLB page sizes will also require changing +* HUGE_MAX_HSTATE as well. +*/ +BUILD_BUG_ON (HUGE_MAX_HSTATE <4 );if (pud_sect_supported ())hugetlb_add_hstate (PUD_SHIFT -PAGE_SHIFT );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 4/273 exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 543841d1806029889c2f69f040e88b247aba8e22 ]
Zbigniew mentioned at Linux Plumber's that systemd is interested in switching to execveat() for service execution, but can't, because the contents of /proc/pid/comm are the file descriptor which was used, instead of the path to the binary[1]. This makes the output of tools like top and ps useless, especially in a world where most fds are opened CLOEXEC so the number is truly meaningless.
When the filename passed in is empty (e.g. with AT_EMPTY_PATH), use the dentry's filename for "comm" instead of using the useless numeral from the synthetic fdpath construction. This way the actual exec machinery is unchanged, but cosmetically the comm looks reasonable to admins investigating things.
Instead of adding TASK_COMM_LEN more bytes to bprm, use one of the unused flag bits to indicate that we need to set "comm" from the dentry.
--- fs/exec.c | 29 ++++++++++++++++++++++++++--- include/linux/binfmts.h | 4 +++- 2 files changed, 29 insertions(+), 4 deletions(-)
fs/exec.c +26 -3
@@ -1362,7 +1362,28 @@ int begin_new_exec(struct linux_binprm * bprm)set_dumpable (current->mm,SUID_DUMP_USER );perf_event_exec (); -__set_task_comm (me,kbasename (bprm->filename), true); + +/* +* If the original filename was empty, alloc_bprm() made up a path +* that will probably not be useful to admins running ps or similar. +* Let's fix it up to be something reasonable. +*/ +if (bprm->comm_from_dentry) { +/* +* Hold RCU lock to keep the name from being freed behind our back. +* Use acquire semantics to make sure the terminating NUL from +* __d_alloc() is seen. +* +* Note, we're deliberately sloppy here. We don't need to care about +* detecting a concurrent rename and just want a terminated name. +*/ +rcu_read_lock (); +__set_task_comm (me,smp_load_acquire (&bprm->file->f_path.dentry->d_name.name), + true); +rcu_read_unlock (); + }else { +__set_task_comm (me,kbasename (bprm->filename), true); + }/* An exec changes our domain. We are no longer part of the thread group */
@@ -1521,11 +1542,13 @@ static struct linux_binprm *alloc_bprm(int fd, struct filename *filename)if (fd ==AT_FDCWD || filename->name[0 ] =='/' ) { bprm->filename = filename->name; }else { -if (filename->name[0 ] =='\0' ) +if (filename->name[0 ] =='\0' ) { bprm->fdpath =kasprintf (GFP_KERNEL ,"/dev/fd/%d" , fd); -else + bprm->comm_from_dentry =1 ; + }else { bprm->fdpath =kasprintf (GFP_KERNEL ,"/dev/fd/%d/%s" , fd, filename->name); + }if (!bprm->fdpath) goto out_free;
include/linux/binfmts.h +3 -1
@@ -42,7 +42,9 @@ struct linux_binprm {* Set when errors can no longer be returned to the * original userspace. */ - point_of_no_return:1 ; + point_of_no_return:1 , +/* Set when "comm" must come from the dentry. */ + comm_from_dentry:1;struct file *executable;/* Executable to pass to the interpreter */ struct file *interpreter;struct file *file;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 5/273 s390/stackleak: Use exrl instead of ex in __stackleak_poison()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sven Schnelle <[email protected]>
[ Upstream commit a88c26bb8e04ee5f2678225c0130a5fbc08eef85 ]
exrl is present in all machines currently supported, therefore prefer it over ex. This saves one instruction and doesn't need an additional register to hold the address of the target instruction.
--- arch/s390/include/asm/processor.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/include/asm/processor.h +1 -2
@@ -140,8 +140,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low," la %[addr],256(%[addr])\n" " brctg %[tmp],0b\n" "1: stg %[poison],0(%[addr])\n" -" larl %[tmp],3f\n" -" ex %[count],0(%[tmp])\n" +" exrl %[count],3f\n" " j 4f\n" "2: stg %[poison],0(%[addr])\n" " j 4f\n"
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 6/273 btrfs: fix data race when accessing the inodes disk_i_size at btrfs_drop_extents()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao-ran Zheng <[email protected]>
[ Upstream commit 5324c4e10e9c2ce307a037e904c0d9671d7137d9 ]
A data race occurs when the function insert_ordered_extent_file_extent() and the function btrfs_inode_safe_disk_i_size_write() are executed concurrently. The function insert_ordered_extent_file_extent() is not locked when reading inode->disk_i_size, causing btrfs_inode_safe_disk_i_size_write() to cause data competition when writing inode->disk_i_size, thus affecting the value of modify_tree.
The specific call stack that appears during testing is as follows:
============DATA_RACE============
btrfs_drop_extents+0x89a/0xa060 [btrfs] insert_reserved_file_extent+0xb54/0x2960 [btrfs] insert_ordered_extent_file_extent+0xff5/0x1760 [btrfs] btrfs_finish_one_ordered+0x1b85/0x36a0 [btrfs] btrfs_finish_ordered_io+0x37/0x60 [btrfs] finish_ordered_fn+0x3e/0x50 [btrfs] btrfs_work_helper+0x9c9/0x27a0 [btrfs] process_scheduled_works+0x716/0xf10 worker_thread+0xb6a/0x1190 kthread+0x292/0x330 ret_from_fork+0x4d/0x80 ret_from_fork_asm+0x1a/0x30 ============OTHER_INFO============ btrfs_inode_safe_disk_i_size_write+0x4ec/0x600 [btrfs] btrfs_finish_one_ordered+0x24c7/0x36a0 [btrfs] btrfs_finish_ordered_io+0x37/0x60 [btrfs] finish_ordered_fn+0x3e/0x50 [btrfs] btrfs_work_helper+0x9c9/0x27a0 [btrfs] process_scheduled_works+0x716/0xf10 worker_thread+0xb6a/0x1190 kthread+0x292/0x330 ret_from_fork+0x4d/0x80 ret_from_fork_asm+0x1a/0x30 =================================
The main purpose of the check of the inode's disk_i_size is to avoid taking write locks on a btree path when we have a write at or beyond EOF, since in these cases we don't expect to find extent items in the root to drop. However if we end up taking write locks due to a data race on disk_i_size, everything is still correct, we only add extra lock contention on the tree in case there's concurrency from other tasks. If the race causes us to not take write locks when we actually need them, then everything is functionally correct as well, since if we find out we have extent items to drop and we took read locks (modify_tree set to 0), we release the path and retry again with write locks.
Since this data race does not affect the correctness of the function, it is a harmless data race, use data_race() to check inode->disk_i_size.
--- fs/btrfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/file.c +1 -1
@@ -241,7 +241,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,if (args->drop_cache)btrfs_drop_extent_map_range (inode, args->start, args->end -1 , false); -if (args->start >= inode->disk_i_size && !args->replace_extent) +if (data_race (args->start >= inode->disk_i_size) && !args->replace_extent) modify_tree =0 ; update_refs = (root->root_key.objectid !=BTRFS_TREE_LOG_OBJECTID );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 7/273 btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 6a4730b325aaa48f7a5d5ba97aff0a955e2d9cec ]
This BUG_ON is meant to catch backref cache problems, but these can arise from either bugs in the backref cache or corruption in the extent tree. Fix it to be a proper error.
--- fs/btrfs/relocation.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
fs/btrfs/relocation.c +12 -2
@@ -4378,8 +4378,18 @@ int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,WARN_ON (!first_cow && level ==0 ); node = rc->backref_cache.path[level]; -BUG_ON (node->bytenr != buf->start && - node->new_bytenr != buf->start); + +/* +* If node->bytenr != buf->start and node->new_bytenr != +* buf->start then we've got the wrong backref node for what we +* expected to see here and the cache is incorrect. +*/ +if (unlikely (node->bytenr != buf->start && node->new_bytenr != buf->start)) { +btrfs_err (fs_info, +"bytenr %llu was found but our backref cache was expecting %llu or %llu" , + buf->start, node->bytenr, node->new_bytenr); +return -EUCLEAN ; + }btrfs_backref_drop_node_buffer (node);atomic_inc (&cow->refs);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 8/273 sched: Dont try to catch up excess steal time.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suleiman Souhlal <[email protected]>
[ Upstream commit 108ad0999085df2366dd9ef437573955cb3f5586 ]
When steal time exceeds the measured delta when updating clock_task, we currently try to catch up the excess in future updates. However, this results in inaccurate run times for the future things using clock_task, in some situations, as they end up getting additional steal time that did not actually happen.
This is because there is a window between reading the elapsed time in update_rq_clock() and sampling the steal time in update_rq_clock_task(). If the VCPU gets preempted between those two points, any additional steal time is accounted to the outgoing task even though the calculated delta did not actually contain any of that "stolen" time. When this race happens, we can end up with steal time that exceeds the calculated delta, and the previous code would try to catch up that excess steal time in future clock updates, which is given to the next, incoming task, even though it did not actually have any time stolen.
This behavior is particularly bad when steal time can be very long, which we've seen when trying to extend steal time to contain the duration that the host was suspended [0]. When this happens, clock_task stays frozen, during which the running task stays running for the whole duration, since its run time doesn't increase.
However the race can happen even under normal operation.
Ideally we would read the elapsed cpu time and the steal time atomically, to prevent this race from happening in the first place, but doing so is non-trivial.
Since the time between those two points isn't otherwise accounted anywhere, neither to the outgoing task nor the incoming task (because the "end of outgoing task" and "start of incoming task" timestamps are the same), I would argue that the right thing to do is to simply drop any excess steal time, in order to prevent these issues.
[0] https://lore.kernel.org/kvm/[email protected]/
--- kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched/core.c +4 -2
@@ -726,13 +726,15 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)#endif #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING if (static_key_false ((¶virt_steal_rq_enabled))) { - steal =paravirt_steal_clock (cpu_of (rq)); +u64 prev_steal; + + steal = prev_steal =paravirt_steal_clock (cpu_of (rq)); steal -= rq->prev_steal_time_rq;if (unlikely (steal > delta)) steal = delta; - rq->prev_steal_time_rq += steal; + rq->prev_steal_time_rq = prev_steal; delta -= steal; }#endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 9/273 lockdep: Fix upper limit for LOCKDEP_*_BITS configs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Llamas <[email protected]>
[ Upstream commit e638072e61726cae363d48812815197a2a0e097f ]
Lockdep has a set of configs used to determine the size of the static arrays that it uses. However, the upper limit that was initially setup for these configs is too high (30 bit shift). This equates to several GiB of static memory for individual symbols. Using such high values leads to linker errors:
$ make defconfig $ ./scripts/config -e PROVE_LOCKING --set-val LOCKDEP_BITS 30 $ make olddefconfig all [...] ld: kernel image bigger than KERNEL_IMAGE_SIZE ld: section .bss VMA wraps around address space
Adjust the upper limits to the maximum values that avoid these issues. The need for anything more, likely points to a problem elsewhere. Note that LOCKDEP_CHAINS_BITS was intentionally left out as its upper limit had a different symptom and has already been fixed [1].
--- lib/Kconfig.debug | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/Kconfig.debug +4 -4
@@ -1454,7 +1454,7 @@ config LOCKDEP_SMALL config LOCKDEP_BITS int "Bitsize for MAX_LOCKDEP_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 24 default 15 help Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message.
@@ -1470,7 +1470,7 @@ config LOCKDEP_CHAINS_BITS config LOCKDEP_STACK_TRACE_BITS int "Bitsize for MAX_STACK_TRACE_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 19 help Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message.
@@ -1478,7 +1478,7 @@ config LOCKDEP_STACK_TRACE_BITS config LOCKDEP_STACK_TRACE_HASH_BITS int "Bitsize for STACK_TRACE_HASH_SIZE" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 14 help Try increasing this value if you need large STACK_TRACE_HASH_SIZE.
@@ -1486,7 +1486,7 @@ config LOCKDEP_STACK_TRACE_HASH_BITS config LOCKDEP_CIRCULAR_QUEUE_BITS int "Bitsize for elements in circular_queue struct" depends on LOCKDEP - range 10 30 + range 10 26 default 12 help Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainercover 6.6.78-rc1 review
This is the start of the stable review cycle for the 6.6.78 release. There are 273 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 15 Feb 2025 14:23:11 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.78-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.6.78-rc1
Sean Christopherson <[email protected]>
KVM: x86: Re-split x2APIC ICR into ICR+ICR2 for AMD (x2AVIC)
Sean Christopherson <[email protected]>
KVM: x86: Make x2APIC ID 100% readonly
Sean Anderson <[email protected]>
tty: xilinx_uartps: split sysrq handling
Steve Wahl <[email protected]>
x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: join: fix AF_INET6 variable
Paolo Abeni <[email protected]>
mptcp: prevent excessive coalescing on receive
Matthieu Baerts (NGI0) <[email protected]>
mptcp: pm: only set fullmesh for subflow endp
Zizhi Wo <[email protected]>
cachefiles: Fix NULL pointer dereference in object->file
Filipe Manana <[email protected]>
btrfs: avoid monopolizing a core when activating a swap file
Koichiro Den <[email protected]>
Revert "btrfs: avoid monopolizing a core when activating a swap file"
Su Yue <[email protected]>
ocfs2: check dir i_size in ocfs2_find_entry
Paul Fertser <[email protected]>
net/ncsi: use dev_set_mac_address() for Get MC MAC Address handling
Bence Csókás <[email protected]>
spi: atmel-qspi: Memory barriers after memory-mapped I/O
Csókás, Bence <[email protected]>
spi: atmel-quadspi: Create atmel_qspi_ops to support newer SoC families
WangYuli <[email protected]>
MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
Michal Simek <[email protected]>
rtc: zynqmp: Fix optional clock name property
Thomas Weißschuh <[email protected]>
ptp: Ensure info->enable callback is always set
Javier Carrasco <[email protected]>
pinctrl: samsung: fix fwnode refcount cleanup if platform_get_irq_optional() fails
Tomas Glozar <[email protected]>
rtla/timerlat_top: Stop timerlat tracer on signal
Tomas Glozar <[email protected]>
rtla/timerlat_hist: Stop timerlat tracer on signal
Tomas Glozar <[email protected]>
rtla: Add trace_instance_stop
Tomas Glozar <[email protected]>
rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
Tomas Glozar <[email protected]>
rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
Tomas Glozar <[email protected]>
rtla/osnoise: Distinguish missing workload option
Steven Rostedt <[email protected]>
tracing/osnoise: Fix resetting of tracepoints
Jan Kiszka <[email protected]>
scripts/gdb: fix aarch64 userspace detection in get_current_task
Wei Yang <[email protected]>
maple_tree: simplify split calculation
Milos Reljin <[email protected]>
net: phy: c45-tjaxx: add delay between MDIO write and read in soft_reset
Paul Fertser <[email protected]>
net/ncsi: wait for the last response to Deselect Package before configuring channel
Ekansh Gupta <[email protected]>
misc: fastrpc: Fix copy buffer page size
Ekansh Gupta <[email protected]>
misc: fastrpc: Fix registered buffer page address
Anandu Krishnan E <[email protected]>
misc: fastrpc: Deregister device nodes properly in error scenarios
Vimal Agrawal <[email protected]>
misc: misc_minor_alloc to use ida for all dynamic/misc dynamic minors
Ivan Stepchenko <[email protected]>
mtd: onenand: Fix uninitialized retlen in do_otp_read()
Nick Chan <[email protected]>
irqchip/apple-aic: Only handle PMC interrupt as FIQ when configured so
Frank Li <[email protected]>
i3c: master: Fix missing 'ret' assignment in set_speed()
Dan Carpenter <[email protected]>
NFC: nci: Add bounds checking in nci_hci_create_pipe()
Pekka Pessi <[email protected]>
mailbox: tegra-hsp: Clear mailbox before using message
Nikita Zhandarovich <[email protected]>
nilfs2: fix possible int overflows in nilfs_fiemap()
Matthew Wilcox (Oracle) <[email protected]>
ocfs2: handle a symlink read error correctly
Heming Zhao <[email protected]>
ocfs2: fix incorrect CPU endianness conversion causing mount failure
Mike Snitzer <[email protected]>
pnfs/flexfiles: retry getting layout segment for reads
Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: connect: -f: no reconnect
Alex Williamson <[email protected]>
vfio/platform: check the bounds of read/write syscalls
Pavel Begunkov <[email protected]>
io_uring/rw: commit provided buffer state on async
Pavel Begunkov <[email protected]>
io_uring: fix io_req_prep_async with provided buffers
Jens Axboe <[email protected]>
io_uring/net: don't retry connect operation on EPOLLERR
Pavel Begunkov <[email protected]>
io_uring: fix multishots with selected buffers
Sascha Hauer <[email protected]>
nvmem: imx-ocotp-ele: set word length to 1
Sascha Hauer <[email protected]>
nvmem: imx-ocotp-ele: fix reading from non zero offset
Sascha Hauer <[email protected]>
nvmem: imx-ocotp-ele: simplify read beyond device check
Jennifer Berringer <[email protected]>
nvmem: core: improve range check for nvmem_cell_write()
Luca Weiss <[email protected]>
nvmem: qcom-spmi-sdam: Set size in struct nvmem_config
Bartosz Golaszewski <[email protected]>
crypto: qce - unregister previously registered algos in error path
Bartosz Golaszewski <[email protected]>
crypto: qce - fix goto jump in error path
Niklas Cassel <[email protected]>
ata: libata-sff: Ensure that we cannot write outside the allocated buffer
Catalin Marinas <[email protected]>
mm: kmemleak: fix upper boundary check for physical address objects
Ricardo Ribalda <[email protected]>
media: uvcvideo: Remove redundant NULL assignment
Ricardo Ribalda <[email protected]>
media: uvcvideo: Support partial control reads
Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix event flags in uvc_ctrl_send_events
Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix crash during unbind if gpio unit is in use
Tomi Valkeinen <[email protected]>
media: i2c: ds90ub960: Fix logging SP & EQ status only for UB9702
Tomi Valkeinen <[email protected]>
media: i2c: ds90ub960: Fix UB9702 VC map
Tomi Valkeinen <[email protected]>
media: i2c: ds90ub960: Fix use of non-existing registers on UB9702
Tomi Valkeinen <[email protected]>
media: i2c: ds90ub9x3: Fix extra fwnode_handle_put()
Mehdi Djait <[email protected]>
media: ccs: Fix cleanup order in ccs_probe()
Sakari Ailus <[email protected]>
media: ccs: Fix CCS static data parsing for large block sizes
Sam Bobrowicz <[email protected]>
media: ov5640: fix get_light_freq on auto
Naushir Patuck <[email protected]>
media: imx296: Add standby delay during probe
Cosmin Tanislav <[email protected]>
media: mc: fix endpoint iteration
Lubomir Rintel <[email protected]>
media: mmp: Bring back registration of the device
Krzysztof Kozlowski <[email protected]>
soc: qcom: smem_state: fix missing of_node_put in error path
Krzysztof Kozlowski <[email protected]>
soc: mediatek: mtk-devapc: Fix leaking IO map on error paths
Javier Carrasco <[email protected]>
iio: light: as73211: fix channel handling in only-color triggered buffer
Sakari Ailus <[email protected]>
media: ccs: Clean up parsed CCS static data on parse failure
Marco Elver <[email protected]>
kfence: skip __GFP_THISNODE allocations on NUMA systems
Gabriele Monaco <[email protected]>
rv: Reset per-task monitors also for idle tasks
Jarkko Sakkinen <[email protected]>
tpm: Change to kvalloc() in eventlog/acpi.c
Aubrey Li <[email protected]>
ACPI: PRM: Remove unnecessary strict handler address checks
Wentao Liang <[email protected]>
xfs: Add error handling for xfs_reflink_cancel_cow_range
Wentao Liang <[email protected]>
xfs: Propagate errors from xfs_reflink_cancel_cow_range in xfs_dax_write_iomap_end
Conor Dooley <[email protected]>
pwm: microchip-core: fix incorrect comparison with max period
Sumit Gupta <[email protected]>
arm64: tegra: Disable Tegra234 sce-fabric node
Sumit Gupta <[email protected]>
arm64: tegra: Fix typo in Tegra234 dce-fabric compatible
Eric Biggers <[email protected]>
crypto: qce - fix priority to be less than ARMv8 CE
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8550: correct MDSS interconnects
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550: Fix MPSS memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550: Fix CDSP memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8450: Fix MPSS memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8450: Fix CDSP memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8350: Fix MPSS memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8350: Fix CDSP memory base and length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8350: Fix ADSP memory base and length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6375: Fix MPSS memory base and length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6375: Fix CDSP memory base and length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6375: Fix ADSP memory length
Luca Weiss <[email protected]>
arm64: dts: qcom: sm6350: Fix uart1 interconnect path
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6350: Fix MPSS memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6350: Fix ADSP memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6115: Fix ADSP memory base and length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6115: Fix CDSP memory length
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6115: Fix MPSS memory length
Andreas Kemnade <[email protected]>
ARM: dts: ti/omap: gta04: fix pm issues caused by spi module
Romain Naour <[email protected]>
ARM: dts: dra7: Add bus_dma_limit for l4 cfg bus
Denis Arefev <[email protected]>
ubi: Add a check for ubi_num
Nathan Chancellor <[email protected]>
x86/boot: Use '-std=gnu11' to fix build with GCC 15
Miguel Ojeda <[email protected]>
rust: init: use explicit ABI to clean warning in future compilers
Nathan Chancellor <[email protected]>
kbuild: Move -Wenum-enum-conversion to W=2
Long Li <[email protected]>
scsi: storvsc: Set correct data length for sending SCSI command without payload
Eric Biggers <[email protected]>
scsi: ufs: qcom: Fix crypto key eviction
Quinn Tran <[email protected]>
scsi: qla2xxx: Move FCE Trace buffer allocation to user control
Kai Mäkisara <[email protected]>
scsi: st: Don't set pos_unknown just after device recognition
Georg Gottleuber <[email protected]>
nvme-pci: Add TUXEDO IBP Gen9 to Samsung sleep quirk
Georg Gottleuber <[email protected]>
nvme-pci: Add TUXEDO InfinityFlex to Samsung sleep quirk
Zijun Hu <[email protected]>
PCI: endpoint: Finish virtual EP removal in pci_epf_remove_vepf()
Werner Sembach <[email protected]>
PCI: Avoid putting some root ports into D3 on TUXEDO Sirius Gen1
Brad Griffis <[email protected]>
arm64: tegra: Fix Tegra234 PCIe interrupt-map
Kuan-Wei Chiu <[email protected]>
ALSA: hda: Fix headset detection failure due to unstable sort
Edson Juliano Drosdeck <[email protected]>
ALSA: hda/realtek: Enable headset mic on Positivo C6400
Thadeu Lima de Souza Cascardo <[email protected]>
Revert "media: uvcvideo: Require entities to have a non-zero unique ID"
Jens Axboe <[email protected]>
block: don't revert iter for -EIOCBQUEUED
Mateusz Jończyk <[email protected]>
mips/math-emu: fix emulation of the prefx instruction
Hou Tao <[email protected]>
dm-crypt: track tag_offset in convert_context
Hou Tao <[email protected]>
dm-crypt: don't update io->sector after kcryptd_crypt_write_io_submit()
Narayana Murty N <[email protected]>
powerpc/pseries/eeh: Fix get PE state translation
Tiezhu Yang <[email protected]>
LoongArch: Extend the maximum number of watchpoints
Kexy Biscuit <[email protected]>
MIPS: Loongson64: remove ROM Size unit in boardinfo
Claudiu Beznea <[email protected]>
serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use
Claudiu Beznea <[email protected]>
serial: sh-sci: Drop __initdata macro for port_cfg
Stephan Gerhold <[email protected]>
soc: qcom: socinfo: Avoid out of bounds read of serial number
Mario Limonciello <[email protected]>
ASoC: acp: Support microphone from Lenovo Go S
Foster Snowhill <[email protected]>
usbnet: ipheth: document scope of NCM implementation
Foster Snowhill <[email protected]>
usbnet: ipheth: fix DPE OoB read
Foster Snowhill <[email protected]>
usbnet: ipheth: break up NCM header size computation
Foster Snowhill <[email protected]>
usbnet: ipheth: refactor NCM datagram loop
Foster Snowhill <[email protected]>
usbnet: ipheth: check that DPE points past NCM header
Foster Snowhill <[email protected]>
usbnet: ipheth: use static NDP16 location in URB
Foster Snowhill <[email protected]>
usbnet: ipheth: fix possible overflow in DPE length check
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Don't prepare BOT write request twice
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Decrement command ref count on cleanup
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Translate error to sense
Shayne Chen <[email protected]>
wifi: mt76: mt7915: add module param to select 5 GHz or 6 GHz on MT7916
Fiona Klute <[email protected]>
wifi: rtw88: sdio: Fix disconnection after beacon loss
Nick Morrow <[email protected]>
wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH
Marcel Hamer <[email protected]>
wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize()
Bitterblue Smith <[email protected]>
wifi: rtlwifi: rtl8821ae: Fix media status report
Heiko Stuebner <[email protected]>
HID: hid-sensor-hub: don't use stale platform-data on remove
Zijun Hu <[email protected]>
of: reserved-memory: Fix using wrong number of cells to get property 'alignment'
Zijun Hu <[email protected]>
of: Fix of_find_node_opts_by_path() handling of alias+path+options
Zijun Hu <[email protected]>
of: Correct child specifier used as input of the 2nd nexus node
Bao D. Nguyen <[email protected]>
scsi: ufs: core: Fix the HIGH/LOW_TEMP Bit Definitions
Kuan-Wei Chiu <[email protected]>
perf bench: Fix undefined behavior in cmpworker()
Nathan Chancellor <[email protected]>
efi: libstub: Use '-std=gnu11' to fix build with GCC 15
Zijun Hu <[email protected]>
blk-cgroup: Fix class @block_class's subsystem refcount leakage
Daniel Golle <[email protected]>
clk: mediatek: mt2701-mm: add missing dummy clk
Daniel Golle <[email protected]>
clk: mediatek: mt2701-img: add missing dummy clk
Daniel Golle <[email protected]>
clk: mediatek: mt2701-bdp: add missing dummy clk
Daniel Golle <[email protected]>
clk: mediatek: mt2701-aud: fix conversion to mtk_clk_simple_probe
Daniel Golle <[email protected]>
clk: mediatek: mt2701-vdec: fix conversion to mtk_clk_simple_probe
Anastasia Belova <[email protected]>
clk: qcom: clk-rpmh: prevent integer overflow in recalc_rate
Satya Priya Kakitapalli <[email protected]>
clk: qcom: gcc-mdm9607: Fix cmd_rcgr offset for blsp1_uart6 rcg
Luca Weiss <[email protected]>
clk: qcom: dispcc-sm6350: Add missing parent_map for a clock
Luca Weiss <[email protected]>
clk: qcom: gcc-sm6350: Add missing parent_map for two clocks
Manivannan Sadhasivam <[email protected]>
clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable()
Gabor Juhos <[email protected]>
clk: qcom: clk-alpha-pll: fix alpha mode configuration
Tomi Valkeinen <[email protected]>
media: i2c: ds90ub960: Fix UB9702 refclk register access
Cody Eksal <[email protected]>
clk: sunxi-ng: a100: enable MMC clock reparenting
Fedor Pchelkin <[email protected]>
Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection
Fedor Pchelkin <[email protected]>
Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc
Ville Syrjälä <[email protected]>
drm/i915: Drop 64bpp YUV formats from ICL+ SDR planes
Haoxiang Li <[email protected]>
drm/komeda: Add check for komeda_get_layer_fourcc_list()
Brian Geffon <[email protected]>
drm/i915: Fix page cleanup on DMA remap failure
Daniele Ceraolo Spurio <[email protected]>
drm/i915/guc: Debug print LRC state entries only if the context is pinned
Tom Chung <[email protected]>
Revert "drm/amd/display: Use HW lock mgr for PSR1"
Prike Liang <[email protected]>
drm/amdkfd: only flush the validate MES contex
Lijo Lazar <[email protected]>
drm/amd/pm: Mark MM activity as unsupported
Dan Carpenter <[email protected]>
ksmbd: fix integer overflows on 32 bit systems
David Hildenbrand <[email protected]>
KVM: s390: vsie: fix some corner-cases when grabbing vsie pages
Sean Christopherson <[email protected]>
KVM: Explicitly verify target vCPU is online in kvm_get_vcpu()
Jakob Unterwurzacher <[email protected]>
arm64: dts: rockchip: increase gmac rx_delay on rk3399-puma
Thomas Zimmermann <[email protected]>
drm/rockchip: cdn-dp: Use drm_connector_helper_hpd_irq_event()
Marc Zyngier <[email protected]>
KVM: arm64: timer: Always evaluate the need for a soft timer
Dan Carpenter <[email protected]>
binfmt_flat: Fix integer overflow bug on 32 bit systems
Nam Cao <[email protected]>
fs/proc: do_task_stat: Fix ESP not readable during coredump
Thomas Zimmermann <[email protected]>
m68k: vga: Fix I/O defines
Heiko Carstens <[email protected]>
s390/futex: Fix FUTEX_OP_ANDN implementation
Meetakshi Setiya <[email protected]>
smb: client: change lease epoch type from unsigned int to __u16
Ruben Devos <[email protected]>
smb: client: fix order of arguments of tracepoints
Maarten Lankhorst <[email protected]>
drm/modeset: Handle tiled displays in pan_display_atomic.
Sebastian Wiese-Wagner <[email protected]>
ALSA: hda/realtek: Enable Mute LED on HP Laptop 14s-fq1xxx
Alexander Sverdlin <[email protected]>
leds: lp8860: Write full EEPROM, not only half of it
Viresh Kumar <[email protected]>
cpufreq: s3c64xx: Fix compilation warning
David Howells <[email protected]>
rxrpc: Fix call state set to not include the SERVER_SECURING state
Ido Schimmel <[email protected]>
net: sched: Fix truncation of offloaded action statistics
Willem de Bruijn <[email protected]>
tun: revert fix group permission check
Cong Wang <[email protected]>
netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()
Andy Shevchenko <[email protected]>
ACPI: property: Fix return value for nval == 0 in acpi_data_prop_read()
Juergen Gross <[email protected]>
x86/xen: add FRAME_END to xen_hypercall_hvm()
Juergen Gross <[email protected]>
x86/xen: fix xen_hypercall_hvm() to not clobber %rbx
Eric Dumazet <[email protected]>
net: rose: lock the socket in rose_bind()
Jacob Moroni <[email protected]>
net: atlantic: fix warning during hot unplug
Mark Tomlinson <[email protected]>
gpio: pca953x: Improve interrupt support
David Howells <[email protected]>
rxrpc: Fix the rxrpc_connection attend queue handling
Yan Zhai <[email protected]>
udp: gso: do not drop small packets when PMTU reduces
Lenny Szubowicz <[email protected]>
tg3: Disable tg3 PCIe AER on system reboot
Sankararaman Jayaraman <[email protected]>
vmxnet3: Fix tx queue race condition with XDP
Jiasheng Jiang <[email protected]>
ice: Add check for devm_kzalloc()
Florian Fainelli <[email protected]>
net: bcmgenet: Correct overlaying of PHY and MAC Wake-on-LAN
Daniel Wagner <[email protected]>
nvme-fc: use ctrl state getter
Maciej Fijalkowski <[email protected]>
ice: put Rx buffers after being done with current frame
Hans Verkuil <[email protected]>
gpu: drm_dp_cec: fix broken CEC adapter properties check
Prasad Pandit <[email protected]>
firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry
Daniel Wagner <[email protected]>
nvme: handle connectivity loss in nvme_set_queue_count
Paul Fertser <[email protected]>
net/ncsi: fix locking in Get MAC Address handling
Peter Delevoryas <[email protected]>
net/ncsi: Add NC-SI 1.2 Get MC MAC Address command
Paolo Bonzini <[email protected]>
KVM: e500: always restore irqs
Sean Christopherson <[email protected]>
KVM: PPC: e500: Use __kvm_faultin_pfn() to handle page faults
Sean Christopherson <[email protected]>
KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock
Sean Christopherson <[email protected]>
KVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map()
Armin Wolf <[email protected]>
platform/x86: acer-wmi: Ignore AC events
Illia Ostapyshyn <[email protected]>
Input: allocate keycode for phone linking
Yu-Chun Lin <[email protected]>
ASoC: amd: Add ACPI dependency to fix build error
Kuninori Morimoto <[email protected]>
ASoC: soc-pcm: don't use soc_pcm_ret() on .prepare callback
Hans de Goede <[email protected]>
platform/x86: int3472: Check for adev == NULL
Robin Murphy <[email protected]>
iommu/arm-smmu-v3: Clean up more on probe failure
Richard Acayan <[email protected]>
iommu/arm-smmu-qcom: add sdm670 adreno iommu compatible
David Woodhouse <[email protected]>
x86/kexec: Allocate PGD for x86_64 transition page tables separately
Liu Ye <[email protected]>
selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()
Dan Carpenter <[email protected]>
tipc: re-order conditions in tipc_crypto_key_rcv()
Yuanjie Yang <[email protected]>
mmc: sdhci-msm: Correctly set the load for the regulator
Maciej S. Szmigiero <[email protected]>
net: wwan: iosm: Fix hibernation by re-binding the driver around it
Mazin Al Haddad <[email protected]>
Bluetooth: MGMT: Fix slab-use-after-free Read in mgmt_remove_adv_monitor_sync
Borislav Petkov <[email protected]>
APEI: GHES: Have GHES honor the panic= setting
Randolph Ha <[email protected]>
i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz
Miri Korenblit <[email protected]>
wifi: iwlwifi: avoid memory leak
Stefan Dösinger <[email protected]>
wifi: brcmfmac: Check the return value of of_property_read_string_index()
Vadim Fedorenko <[email protected]>
net/mlx5: use do_aux_work for PHC overflow checks
Even Xu <[email protected]>
HID: Wacom: Add PCI Wacom device support
Konrad Dybcio <[email protected]>
clk: qcom: Make GCC_8150 depend on QCOM_GDSC
Hans de Goede <[email protected]>
mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id
Tetsuo Handa <[email protected]>
tomoyo: don't emit warning in tomoyo_write_control()
Dmitry Antipov <[email protected]>
wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy()
Shawn Lin <[email protected]>
mmc: core: Respect quirk_max_rate for non-UHS SDIO card
Stas Sergeev <[email protected]>
tun: fix group permission check
Chih-Kang Chang <[email protected]>
wifi: rtw89: add crystal_cap check to avoid setting as overflow value
Leo Stone <[email protected]>
safesetid: check size of policy writes
Hermes Wu <[email protected]>
drm/bridge: it6505: fix HDCP CTS KSV list wait timer
Hermes Wu <[email protected]>
drm/bridge: it6505: fix HDCP CTS compare V matching
Hermes Wu <[email protected]>
drm/bridge: it6505: fix HDCP encryption when R0 ready
Hermes Wu <[email protected]>
drm/bridge: it6505: fix HDCP Bstatus check
Hermes Wu <[email protected]>
drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT
Fangzhi Zuo <[email protected]>
drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor
Dmitry Baryshkov <[email protected]>
drm/vc4: hdmi: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/sti: hdmi: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/radeon: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/exynos: hdmi: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/amd/display: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/bridge: ite-it66121: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/bridge: anx7625: use eld_mutex to protect access to connector->eld
Dmitry Baryshkov <[email protected]>
drm/connector: add mutex to protect ELD from concurrent access
Kuan-Wei Chiu <[email protected]>
printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX
Dongwon Kim <[email protected]>
drm/virtio: New fence for every plane update
Yazen Ghannam <[email protected]>
x86/amd_nb: Restrict init function to AMD-based systems
Carlos Llamas <[email protected]>
lockdep: Fix upper limit for LOCKDEP_*_BITS configs
Suleiman Souhlal <[email protected]>
sched: Don't try to catch up excess steal time.
Josef Bacik <[email protected]>
btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling
Hao-ran Zheng <[email protected]>
btrfs: fix data race when accessing the inode's disk_i_size at btrfs_drop_extents()
Sven Schnelle <[email protected]>
s390/stackleak: Use exrl instead of ex in __stackleak_poison()
Kees Cook <[email protected]>
exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case
Anshuman Khandual <[email protected]>
arm64/mm: Ensure adequate HUGE_MAX_HSTATE
Filipe Manana <[email protected]>
btrfs: fix use-after-free when attempting to join an aborted transaction
Filipe Manana <[email protected]>
btrfs: fix assertion failure when splitting ordered extent after transaction abort
-------------
Diffstat:
Makefile | 4 +- arch/arm/boot/dts/ti/omap/dra7-l4.dtsi | 2 + arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi | 10 + arch/arm64/boot/dts/nvidia/tegra234.dtsi | 6 +- arch/arm64/boot/dts/qcom/sm6115.dtsi | 8 +- arch/arm64/boot/dts/qcom/sm6350.dtsi | 6 +- arch/arm64/boot/dts/qcom/sm6375.dtsi | 10 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 492 ++++++++++----------- arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 +- arch/arm64/boot/dts/qcom/sm8550.dtsi | 9 +- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 2 +- arch/arm64/kvm/arch_timer.c | 4 +- arch/arm64/mm/hugetlbpage.c | 12 + arch/loongarch/include/uapi/asm/ptrace.h | 10 + arch/loongarch/kernel/ptrace.c | 6 +- arch/m68k/include/asm/vga.h | 8 +- arch/mips/kernel/ftrace.c | 2 +- arch/mips/loongson64/boardinfo.c | 2 - arch/mips/math-emu/cp1emu.c | 2 +- arch/powerpc/kvm/e500_mmu_host.c | 21 +- arch/powerpc/platforms/pseries/eeh_pseries.c | 6 +- arch/s390/include/asm/futex.h | 2 +- arch/s390/include/asm/processor.h | 3 +- arch/s390/kvm/vsie.c | 25 +- arch/x86/boot/compressed/Makefile | 1 + arch/x86/include/asm/kexec.h | 18 +- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kernel/amd_nb.c | 4 + arch/x86/kernel/machine_kexec_64.c | 45 +- arch/x86/kvm/lapic.c | 64 ++- arch/x86/kvm/svm/svm.c | 2 + arch/x86/kvm/vmx/vmx.c | 2 + arch/x86/mm/ident_map.c | 23 +- arch/x86/pci/fixup.c | 30 ++ arch/x86/xen/xen-head.S | 5 +- block/blk-cgroup.c | 1 + block/fops.c | 5 +- drivers/acpi/apei/ghes.c | 10 +- drivers/acpi/prmt.c | 4 +- drivers/acpi/property.c | 10 +- drivers/ata/libata-sff.c | 18 +- drivers/char/misc.c | 37 +- drivers/char/tpm/eventlog/acpi.c | 15 +- drivers/clk/mediatek/clk-mt2701-aud.c | 10 + drivers/clk/mediatek/clk-mt2701-bdp.c | 1 + drivers/clk/mediatek/clk-mt2701-img.c | 1 + drivers/clk/mediatek/clk-mt2701-mm.c | 1 + drivers/clk/mediatek/clk-mt2701-vdec.c | 1 + drivers/clk/qcom/Kconfig | 1 + drivers/clk/qcom/clk-alpha-pll.c | 2 + drivers/clk/qcom/clk-rpmh.c | 2 +- drivers/clk/qcom/dispcc-sm6350.c | 7 +- drivers/clk/qcom/gcc-mdm9607.c | 2 +- drivers/clk/qcom/gcc-sm6350.c | 22 +- drivers/clk/qcom/gcc-sm8550.c | 8 +- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 6 +- drivers/cpufreq/s3c64xx-cpufreq.c | 11 +- drivers/crypto/qce/aead.c | 2 +- drivers/crypto/qce/core.c | 13 +- drivers/crypto/qce/sha.c | 2 +- drivers/crypto/qce/skcipher.c | 2 +- drivers/firmware/Kconfig | 2 +- drivers/firmware/efi/libstub/Makefile | 2 +- drivers/gpio/gpio-pca953x.c | 19 - .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 7 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 + .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +- .../gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 3 +- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 - .../drm/arm/display/komeda/komeda_wb_connector.c | 4 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2 + drivers/gpu/drm/bridge/ite-it6505.c | 83 ++-- drivers/gpu/drm/bridge/ite-it66121.c | 2 + drivers/gpu/drm/display/drm_dp_cec.c | 14 +- drivers/gpu/drm/drm_connector.c | 1 + drivers/gpu/drm/drm_edid.c | 6 + drivers/gpu/drm/drm_fb_helper.c | 14 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 + drivers/gpu/drm/i915/display/skl_universal_plane.c | 4 - drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 +- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 20 +- drivers/gpu/drm/radeon/radeon_audio.c | 2 + drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 + drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 7 + drivers/gpu/drm/virtio/virtgpu_plane.c | 58 ++- drivers/hid/hid-sensor-hub.c | 21 +- drivers/hid/wacom_wac.c | 5 + drivers/i2c/i2c-core-acpi.c | 22 + drivers/i3c/master.c | 2 +- drivers/iio/light/as73211.c | 24 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 17 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + drivers/irqchip/irq-apple-aic.c | 3 +- drivers/leds/leds-lp8860.c | 2 +- drivers/mailbox/tegra-hsp.c | 6 +- drivers/md/dm-crypt.c | 27 +- drivers/media/i2c/ccs/ccs-core.c | 6 +- drivers/media/i2c/ccs/ccs-data.c | 14 +- drivers/media/i2c/ds90ub913.c | 1 - drivers/media/i2c/ds90ub953.c | 1 - drivers/media/i2c/ds90ub960.c | 123 +++--- drivers/media/i2c/imx296.c | 2 + drivers/media/i2c/ov5640.c | 1 + drivers/media/platform/marvell/mmp-driver.c | 21 +- drivers/media/usb/uvc/uvc_ctrl.c | 8 +- drivers/media/usb/uvc/uvc_driver.c | 98 ++-- drivers/media/usb/uvc/uvc_video.c | 21 + drivers/media/usb/uvc/uvcvideo.h | 1 + drivers/media/v4l2-core/v4l2-mc.c | 2 +- drivers/mfd/lpc_ich.c | 3 +- drivers/misc/fastrpc.c | 8 +- drivers/mmc/core/sdio.c | 2 + drivers/mmc/host/sdhci-msm.c | 53 ++- drivers/mtd/nand/onenand/onenand_base.c | 1 + drivers/mtd/ubi/build.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 4 +- drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 16 +- drivers/net/ethernet/broadcom/tg3.c | 58 +++ drivers/net/ethernet/intel/ice/ice_devlink.c | 3 + drivers/net/ethernet/intel/ice/ice_txrx.c | 79 ++-- .../net/ethernet/mellanox/mlx5/core/lib/clock.c | 24 +- drivers/net/phy/nxp-c45-tja11xx.c | 2 + drivers/net/tun.c | 2 +- drivers/net/usb/ipheth.c | 69 ++- drivers/net/vmxnet3/vmxnet3_xdp.c | 14 +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 5 + .../net/wireless/broadcom/brcm80211/brcmfmac/of.c | 8 +- .../broadcom/brcm80211/brcmsmac/phy/phy_n.c | 3 + drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 13 +- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 21 +- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 4 +- drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 3 + .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.h | 4 +- drivers/net/wireless/realtek/rtw88/sdio.c | 2 + drivers/net/wireless/realtek/rtw89/phy.c | 13 +- drivers/net/wireless/realtek/rtw89/phy.h | 2 +- drivers/net/wwan/iosm/iosm_ipc_pcie.c | 56 ++- drivers/nvme/host/core.c | 8 +- drivers/nvme/host/fc.c | 9 +- drivers/nvme/host/pci.c | 4 +- drivers/nvmem/core.c | 2 + drivers/nvmem/imx-ocotp-ele.c | 16 +- drivers/nvmem/qcom-spmi-sdam.c | 1 + drivers/of/base.c | 8 +- drivers/of/of_reserved_mem.c | 4 +- drivers/pci/endpoint/pci-epf-core.c | 1 + drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- drivers/platform/x86/acer-wmi.c | 4 + drivers/platform/x86/intel/int3472/discrete.c | 3 + drivers/platform/x86/intel/int3472/tps68470.c | 3 + drivers/ptp/ptp_clock.c | 8 + drivers/pwm/pwm-microchip-core.c | 2 +- drivers/rtc/rtc-zynqmp.c | 4 +- drivers/scsi/qla2xxx/qla_def.h | 2 + drivers/scsi/qla2xxx/qla_dfs.c | 122 ++++- drivers/scsi/qla2xxx/qla_gbl.h | 3 + drivers/scsi/qla2xxx/qla_init.c | 28 +- drivers/scsi/st.c | 6 + drivers/scsi/st.h | 1 + drivers/scsi/storvsc_drv.c | 1 + drivers/soc/mediatek/mtk-devapc.c | 18 +- drivers/soc/qcom/smem_state.c | 3 +- drivers/soc/qcom/socinfo.c | 2 +- drivers/spi/atmel-quadspi.c | 118 +++-- drivers/tty/serial/sh-sci.c | 25 +- drivers/tty/serial/xilinx_uartps.c | 10 +- drivers/ufs/host/ufs-qcom.c | 18 +- drivers/usb/gadget/function/f_tcm.c | 52 +-- drivers/vfio/platform/vfio_platform_common.c | 10 + fs/binfmt_flat.c | 2 +- fs/btrfs/file.c | 2 +- fs/btrfs/inode.c | 4 +- fs/btrfs/ordered-data.c | 12 + fs/btrfs/relocation.c | 14 +- fs/btrfs/transaction.c | 4 +- fs/cachefiles/interface.c | 14 +- fs/cachefiles/ondemand.c | 30 +- fs/exec.c | 29 +- fs/nfs/flexfilelayout/flexfilelayout.c | 27 +- fs/nilfs2/inode.c | 6 +- fs/ocfs2/dir.c | 25 +- fs/ocfs2/super.c | 2 +- fs/ocfs2/symlink.c | 5 +- fs/proc/array.c | 2 +- fs/smb/client/cifsglob.h | 14 +- fs/smb/client/dir.c | 6 +- fs/smb/client/smb1ops.c | 2 +- fs/smb/client/smb2inode.c | 108 ++--- fs/smb/client/smb2ops.c | 18 +- fs/smb/client/smb2pdu.c | 2 +- fs/smb/client/smb2proto.h | 2 +- fs/smb/server/transport_ipc.c | 9 + fs/xfs/xfs_inode.c | 7 +- fs/xfs/xfs_iomap.c | 6 +- include/drm/drm_connector.h | 5 +- include/linux/binfmts.h | 4 +- include/linux/kvm_host.h | 9 + include/linux/mlx5/driver.h | 1 - include/net/sch_generic.h | 2 +- include/rv/da_monitor.h | 4 + include/trace/events/rxrpc.h | 1 + include/uapi/linux/input-event-codes.h | 1 + include/ufs/ufs.h | 4 +- io_uring/io_uring.c | 5 +- io_uring/net.c | 5 + io_uring/poll.c | 4 + io_uring/rw.c | 10 + kernel/printk/printk.c | 2 +- kernel/sched/core.c | 6 +- kernel/trace/trace_osnoise.c | 17 +- lib/Kconfig.debug | 8 +- lib/maple_tree.c | 23 +- mm/kfence/core.c | 2 + mm/kmemleak.c | 2 +- net/bluetooth/l2cap_sock.c | 7 +- net/bluetooth/mgmt.c | 12 +- net/ipv4/udp.c | 4 +- net/ipv6/udp.c | 4 +- net/mptcp/pm_netlink.c | 3 +- net/mptcp/protocol.c | 1 + net/ncsi/internal.h | 2 + net/ncsi/ncsi-cmd.c | 3 +- net/ncsi/ncsi-manage.c | 38 +- net/ncsi/ncsi-pkt.h | 10 + net/ncsi/ncsi-rsp.c | 58 ++- net/nfc/nci/hci.c | 2 + net/rose/af_rose.c | 24 +- net/rxrpc/ar-internal.h | 2 +- net/rxrpc/call_object.c | 6 +- net/rxrpc/conn_event.c | 21 +- net/rxrpc/conn_object.c | 1 + net/rxrpc/input.c | 2 +- net/rxrpc/sendmsg.c | 2 +- net/sched/sch_netem.c | 2 +- net/tipc/crypto.c | 4 +- rust/kernel/init.rs | 2 +- scripts/Makefile.extrawarn | 5 +- scripts/gdb/linux/cpus.py | 2 +- security/safesetid/securityfs.c | 3 + security/tomoyo/common.c | 2 +- sound/pci/hda/hda_auto_parser.c | 8 +- sound/pci/hda/hda_auto_parser.h | 1 + sound/pci/hda/patch_realtek.c | 2 + sound/soc/amd/Kconfig | 2 +- sound/soc/amd/yc/acp6x-mach.c | 28 ++ sound/soc/soc-pcm.c | 32 +- tools/perf/bench/epoll-wait.c | 7 +- tools/testing/selftests/net/ipsec.c | 3 +- tools/testing/selftests/net/mptcp/mptcp_connect.c | 2 +- tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +- tools/testing/selftests/net/udpgso.c | 26 ++ tools/tracing/rtla/src/osnoise.c | 2 +- tools/tracing/rtla/src/timerlat_hist.c | 26 +- tools/tracing/rtla/src/timerlat_top.c | 27 +- tools/tracing/rtla/src/trace.c | 8 + tools/tracing/rtla/src/trace.h | 1 + 258 files changed, 2392 insertions(+), 1203 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 30/273 mmc: core: Respect quirk_max_rate for non-UHS SDIO card
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shawn Lin <[email protected]>
[ Upstream commit a2a44f8da29352f76c99c6904ee652911b8dc7dd ]
The card-quirk was added to limit the clock-rate for a card with UHS-mode support, although let's respect the quirk for non-UHS mode too, to make the behaviour consistent.
Message-ID: <[email protected]>
--- drivers/mmc/core/sdio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/core/sdio.c +2 -0
@@ -458,6 +458,8 @@ static unsigned mmc_sdio_get_max_clock(struct mmc_card *card)if (mmc_card_sd_combo (card)) max_dtr =min (max_dtr,mmc_sd_get_max_clock (card)); + max_dtr =min_not_zero (max_dtr, card->quirk_max_rate); +return max_dtr; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/273 i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randolph Ha <[email protected]>
[ Upstream commit bfd74cd1fbc026f04446e67d6915c7e199c2bffd ]
When a 400KHz freq is used on this model of ELAN touchpad in Linux, excessive smoothing (similar to when the touchpad's firmware detects a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo V15 G4) ACPI tables specify a 400KHz frequency for this device and some I2C busses (e.g, Designware I2C) default to a 400KHz freq, force the speed to 100KHz as a workaround.
For future investigation: This problem may be related to the default HCNT/LCNT values given by some busses' drivers, because they are not specified in the aforementioned devices' ACPI tables, and because the device works without issues on Windows at what is expected to be a 400KHz frequency. The root cause of the issue is not known.
--- drivers/i2c/i2c-core-acpi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/i2c/i2c-core-acpi.c +22 -0
@@ -355,6 +355,25 @@ static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = { {} }; +static const struct acpi_device_id i2c_acpi_force_100khz_device_ids[] = { +/* +* When a 400KHz freq is used on this model of ELAN touchpad in Linux, +* excessive smoothing (similar to when the touchpad's firmware detects +* a noisy signal) is sometimes applied. As some devices' (e.g, Lenovo +* V15 G4) ACPI tables specify a 400KHz frequency for this device and +* some I2C busses (e.g, Designware I2C) default to a 400KHz freq, +* force the speed to 100KHz as a workaround. +* +* For future investigation: This problem may be related to the default +* HCNT/LCNT values given by some busses' drivers, because they are not +* specified in the aforementioned devices' ACPI tables, and because +* the device works without issues on Windows at what is expected to be +* a 400KHz frequency. The root cause of the issue is not known. +*/ + {"ELAN06FA" ,0 }, + {} +}; +static acpi_status i2c_acpi_lookup_speed (acpi_handle handle,u32 level,void *data,void **return_value) {
@@ -373,6 +392,9 @@ static acpi_status i2c_acpi_lookup_speed(acpi_handle handle, u32 level,if (acpi_match_device_ids (adev, i2c_acpi_force_400khz_device_ids) ==0 ) lookup->force_speed =I2C_MAX_FAST_MODE_FREQ ; +if (acpi_match_device_ids (adev, i2c_acpi_force_100khz_device_ids) ==0 ) + lookup->force_speed =I2C_MAX_STANDARD_MODE_FREQ ; +return AE_OK ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/273 APEI: GHES: Have GHES honor the panic= setting
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <[email protected]>
[ Upstream commit 5c0e00a391dd0099fe95991bb2f962848d851916 ]
The GHES driver overrides the panic= setting by force-rebooting the system after a fatal hw error has been reported. The intent being that such an error would be reported earlier.
However, this is not optimal when a hard-to-debug issue requires long time to reproduce and when that happens, the box will get rebooted after 30 seconds and thus destroy the whole hw context of when the error happened.
So rip out the default GHES panic timeout and honor the global one.
In the panic disabled (panic=0) case, the error will still be logged to dmesg for later inspection and if panic after a hw error is really required, then that can be controlled the usual way - use panic= on the cmdline or set it in the kernel .config's CONFIG_PANIC_TIMEOUT.
--- drivers/acpi/apei/ghes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/apei/ghes.c +5 -5
@@ -170,8 +170,6 @@ static struct gen_pool *ghes_estatus_pool;static struct ghes_estatus_cache __rcu *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE ];static atomic_t ghes_estatus_cache_alloced; -static int ghes_panic_timeout__read_mostly =30 ; -static void __iomem *ghes_map (u64 pfn,enum fixed_addresses fixmap_idx) {phys_addr_t paddr;
@@ -899,14 +897,16 @@ static void __ghes_panic(struct ghes *ghes,struct acpi_hest_generic_status *estatus, u64 buf_paddr, enum fixed_addresses fixmap_idx) { + const char *msg = GHES_PFX "Fatal hardware error"; +__ghes_print_estatus (KERN_EMERG , ghes->generic, estatus);ghes_clear_estatus (ghes, estatus, buf_paddr, fixmap_idx); -/* reboot to log the error! */ if (!panic_timeout) - panic_timeout = ghes_panic_timeout; -panic ("Fatal hardware error!" ); +pr_emerg ("%s but panic disabled\n" , msg); + +panic (msg); }static int ghes_proc (struct ghes *ghes)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 41/273 Bluetooth: MGMT: Fix slab-use-after-free Read in mgmt_remove_adv_monitor_sync
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mazin Al Haddad <[email protected]>
[ Upstream commit 26fbd3494a7dd26269cb0817c289267dbcfdec06 ]
This fixes the following crash:
==================================================================
BUG: KASAN: slab-use-after-free in mgmt_remove_adv_monitor_sync+0x3a/0xd0 net/bluetooth/mgmt.c:5543 Read of size 8 at addr ffff88814128f898 by task kworker/u9:4/5961 CPU: 1 UID: 0 PID: 5961 Comm: kworker/u9:4 Not tainted 6.12.0-syzkaller-10684-gf1cd565ce577 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: hci0 hci_cmd_sync_work Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 mgmt_remove_adv_monitor_sync+0x3a/0xd0 net/bluetooth/mgmt.c:5543 hci_cmd_sync_work+0x22b/0x400 net/bluetooth/hci_sync.c:332 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 </TASK> Allocated by task 16026: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4314 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] mgmt_pending_new+0x65/0x250 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x36/0x120 net/bluetooth/mgmt_util.c:296 remove_adv_monitor+0x102/0x1b0 net/bluetooth/mgmt.c:5568 hci_mgmt_cmd+0xc47/0x11d0 net/bluetooth/hci_sock.c:1712 hci_sock_sendmsg+0x7b8/0x11c0 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:726 sock_write_iter+0x2d7/0x3f0 net/socket.c:1147 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xaeb/0xd30 fs/read_write.c:679 ksys_write+0x18f/0x2b0 fs/read_write.c:731 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 16022: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kfree+0x196/0x420 mm/slub.c:4746 mgmt_pending_foreach+0xd1/0x130 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x183/0x430 net/bluetooth/mgmt.c:9550 hci_dev_close_sync+0x6c4/0x11c0 net/bluetooth/hci_sync.c:5208 hci_dev_do_close net/bluetooth/hci_core.c:483 [inline] hci_dev_close+0x112/0x210 net/bluetooth/hci_core.c:508 sock_do_ioctl+0x158/0x460 net/socket.c:1209 sock_ioctl+0x626/0x8e0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
--- net/bluetooth/mgmt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
net/bluetooth/mgmt.c +11 -1
@@ -5453,10 +5453,16 @@ static void mgmt_remove_adv_monitor_complete(struct hci_dev *hdev, {struct mgmt_rp_remove_adv_monitor rp;struct mgmt_pending_cmd *cmd = data; -struct mgmt_cp_remove_adv_monitor *cp = cmd->param; +struct mgmt_cp_remove_adv_monitor *cp; + +if (status == -ECANCELED || + cmd !=pending_find (MGMT_OP_REMOVE_ADV_MONITOR , hdev)) +return ;hci_dev_lock (hdev); + cp = cmd->param; + rp.monitor_handle = cp->monitor_handle;if (!status)
@@ -5474,6 +5480,10 @@ static void mgmt_remove_adv_monitor_complete(struct hci_dev *hdev,static int mgmt_remove_adv_monitor_sync (struct hci_dev *hdev,void *data) {struct mgmt_pending_cmd *cmd = data; + +if (cmd !=pending_find (MGMT_OP_REMOVE_ADV_MONITOR , hdev)) +return -ECANCELED ; +struct mgmt_cp_remove_adv_monitor *cp = cmd->param;u16 handle =__le16_to_cpu (cp->monitor_handle);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 42/273 net: wwan: iosm: Fix hibernation by re-binding the driver around it
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej S. Szmigiero <[email protected]>
[ Upstream commit 0b6f6593aa8c3a05f155c12fd0e7ad33a5149c31 ]
Currently, the driver is seriously broken with respect to the hibernation (S4): after image restore the device is back into IPC_MEM_EXEC_STAGE_BOOT (which AFAIK means bootloader stage) and needs full re-launch of the rest of its firmware, but the driver restore handler treats the device as merely sleeping and just sends it a wake-up command.
This wake-up command times out but device nodes (/dev/wwan*) remain accessible.
However attempting to use them causes the bootloader to crash and enter IPC_MEM_EXEC_STAGE_CD_READY stage (which apparently means "a crash dump is ready").
It seems that the device cannot be re-initialized from this crashed stage without toggling some reset pin (on my test platform that's apparently what the device _RST ACPI method does).
While it would theoretically be possible to rewrite the driver to tear down the whole MUX / IPC layers on hibernation (so the bootloader does not crash from improper access) and then re-launch the device on restore this would require significant refactoring of the driver (believe me, I've tried), since there are quite a few assumptions hard-coded in the driver about the device never being partially de-initialized (like channels other than devlink cannot be closed, for example).
Probably this would also need some programming guide for this hardware.
Considering that the driver seems orphaned [1] and other people are hitting this issue too [2] fix it by simply unbinding the PCI driver before hibernation and re-binding it after restore, much like USB_QUIRK_RESET_RESUME does for USB devices that exhibit a similar problem.
Tested on XMM7360 in HP EliteBook 855 G7 both with s2idle (which uses the existing suspend / resume handlers) and S4 (which uses the new code).
[1]: https://lore.kernel.org/all/[email protected]/
[2]:
https://github.com/xmm7360/xmm7360-pci/issues/211#issuecomment-1804139413
--- drivers/net/wwan/iosm/iosm_ipc_pcie.c | 56 ++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-)
drivers/net/wwan/iosm/iosm_ipc_pcie.c +55 -1
@@ -6,6 +6,7 @@#include <linux/acpi.h> #include <linux/bitfield.h> #include <linux/module.h> +#include <linux/suspend.h> #include <net/rtnetlink.h> #include "iosm_ipc_imem.h"
@@ -18,6 +19,7 @@ MODULE_LICENSE("GPL v2");/* WWAN GUID */ static guid_t wwan_acpi_guid =GUID_INIT (0xbad01b75 ,0x22a8 ,0x4f48 ,0x87 ,0x92 ,0xbd ,0xde ,0x94 ,0x67 ,0x74 ,0x7d ); +static bool pci_registered;static void ipc_pcie_resources_release (struct iosm_pcie *ipc_pcie) {
@@ -448,7 +450,6 @@ static struct pci_driver iosm_ipc_driver = { }, .id_table = iosm_ipc_ids, }; -module_pci_driver (iosm_ipc_driver);int ipc_pcie_addr_map (struct iosm_pcie *ipc_pcie,unsigned char *data,size_t size,dma_addr_t *mapping,int direction)
@@ -530,3 +531,56 @@ void ipc_pcie_kfree_skb(struct iosm_pcie *ipc_pcie, struct sk_buff *skb)IPC_CB (skb)->mapping =0 ;dev_kfree_skb (skb); } + +static int pm_notify (struct notifier_block *nb,unsigned long mode,void *_unused) +{ +if (mode ==PM_HIBERNATION_PREPARE || mode ==PM_RESTORE_PREPARE ) { +if (pci_registered) { +pci_unregister_driver (&iosm_ipc_driver); + pci_registered = false; + } + }else if (mode ==PM_POST_HIBERNATION || mode ==PM_POST_RESTORE ) { +if (!pci_registered) { +int ret; + + ret =pci_register_driver (&iosm_ipc_driver); +if (ret) { +pr_err (KBUILD_MODNAME ": unable to re-register PCI driver: %d\n" , + ret); + }else { + pci_registered = true; + } + } + } + +return 0 ; +} + +static struct notifier_block pm_notifier = { + .notifier_call = pm_notify, +}; + +static int __init iosm_ipc_driver_init (void ) +{ +int ret; + + ret =pci_register_driver (&iosm_ipc_driver); +if (ret) +return ret; + + pci_registered = true; + +register_pm_notifier (&pm_notifier); + +return 0 ; +} +module_init (iosm_ipc_driver_init); + +static void __exit iosm_ipc_driver_exit(void) +{ +unregister_pm_notifier (&pm_notifier); + +if (pci_registered) +pci_unregister_driver (&iosm_ipc_driver); +} +module_exit (iosm_ipc_driver_exit);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 43/273 mmc: sdhci-msm: Correctly set the load for the regulator
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuanjie Yang <[email protected]>
[ Upstream commit 20a0c37e44063997391430c4ae09973e9cbc3911 ]
Qualcomm regulator supports two power supply modes: HPM and LPM. Currently, the sdhci-msm.c driver does not set the load to adjust the current for eMMC and SD. If the regulator dont't set correct load in LPM state, it will lead to the inability to properly initialize eMMC and SD.
Set the correct regulator current for eMMC and SD to ensure that the device can work normally even when the regulator is in LPM.
--- drivers/mmc/host/sdhci-msm.c | 53 ++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-msm.c +51 -2
@@ -134,9 +134,18 @@/* Timeout value to avoid infinite waiting for pwr_irq */ #define MSM_PWR_IRQ_TIMEOUT_MS 5000 +/* Max load for eMMC Vdd supply */ +#define MMC_VMMC_MAX_LOAD_UA 570000 +/* Max load for eMMC Vdd-io supply */ #define MMC_VQMMC_MAX_LOAD_UA 325000 +/* Max load for SD Vdd supply */ +#define SD_VMMC_MAX_LOAD_UA 800000 + +/* Max load for SD Vdd-io supply */ +#define SD_VQMMC_MAX_LOAD_UA 22000 +#define msm_host_readl (msm_host, host, offset) \ msm_host->var_ops->msm_readl_relaxed(host, offset)
@@ -1403,11 +1412,48 @@ static int sdhci_msm_set_pincfg(struct sdhci_msm_host *msm_host, bool level)return ret; } -static int sdhci_msm_set_vmmc (struct mmc_host *mmc) +static void msm_config_vmmc_regulator (struct mmc_host *mmc,bool hpm) +{ +int load; + +if (!hpm) + load =0 ; +else if (!mmc->card) + load =max (MMC_VMMC_MAX_LOAD_UA ,SD_VMMC_MAX_LOAD_UA ); +else if (mmc_card_mmc (mmc->card)) + load =MMC_VMMC_MAX_LOAD_UA ; +else if (mmc_card_sd (mmc->card)) + load =SD_VMMC_MAX_LOAD_UA ; +else +return ; + +regulator_set_load (mmc->supply.vmmc, load); +} + +static void msm_config_vqmmc_regulator (struct mmc_host *mmc,bool hpm) +{ +int load; + +if (!hpm) + load =0 ; +else if (!mmc->card) + load =max (MMC_VQMMC_MAX_LOAD_UA ,SD_VQMMC_MAX_LOAD_UA ); +else if (mmc_card_sd (mmc->card)) + load =SD_VQMMC_MAX_LOAD_UA ; +else +return ; + +regulator_set_load (mmc->supply.vqmmc, load); +} + +static int sdhci_msm_set_vmmc (struct sdhci_msm_host *msm_host, +struct mmc_host *mmc,bool hpm) {if (IS_ERR (mmc->supply.vmmc))return 0 ; +msm_config_vmmc_regulator (mmc, hpm); +return mmc_regulator_set_ocr (mmc, mmc->supply.vmmc, mmc->ios.vdd); }
@@ -1420,6 +1466,8 @@ static int msm_toggle_vqmmc(struct sdhci_msm_host *msm_host,if (msm_host->vqmmc_enabled == level)return 0 ; +msm_config_vqmmc_regulator (mmc, level); +if (level) {/* Set the IO voltage regulator to default voltage level */ if (msm_host->caps_0 &CORE_3_0V_SUPPORT )
@@ -1642,7 +1690,8 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq) }if (pwr_state) { - ret =sdhci_msm_set_vmmc (mmc); + ret =sdhci_msm_set_vmmc (msm_host, mmc, + pwr_state &REQ_BUS_ON );if (!ret) ret =sdhci_msm_set_vqmmc (msm_host, mmc, pwr_state &REQ_BUS_ON );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 44/273 tipc: re-order conditions in tipc_crypto_key_rcv()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 5fe71fda89745fc3cd95f70d06e9162b595c3702 ]
On a 32bit system the "keylen + sizeof(struct tipc_aead_key)" math could have an integer wrapping issue. It doesn't matter because the "keylen" is checked on the next line, but just to make life easier for static analysis tools, let's re-order these conditions and avoid the integer overflow.
--- net/tipc/crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/tipc/crypto.c +2 -2
@@ -2293,8 +2293,8 @@ static bool tipc_crypto_key_rcv(struct tipc_crypto *rx, struct tipc_msg *hdr) keylen =ntohl (*((__be32 *)(data +TIPC_AEAD_ALG_NAME )));/* Verify the supplied size values */ -if (unlikely (size != keylen +sizeof (struct tipc_aead_key ) || - keylen >TIPC_AEAD_KEY_SIZE_MAX )) { +if (unlikely (keylen >TIPC_AEAD_KEY_SIZE_MAX || + size != keylen +sizeof (struct tipc_aead_key ))) {pr_debug ("%s: invalid MSG_CRYPTO key size\n" , rx->name); goto exit; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/273 selftests/net/ipsec: Fix Null pointer dereference in rtattr_pack()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Ye <[email protected]>
[ Upstream commit 3a0b7fa095212b51ed63892540c4f249991a2d74 ]
Address Null pointer dereference / undefined behavior in rtattr_pack (note that size is 0 in the bad case).
Flagged by cppcheck as:
tools/testing/selftests/net/ipsec.c:230:25: warning: Possible null pointer
dereference: payload [nullPointer]
memcpy(RTA_DATA(attr), payload, size);
^
tools/testing/selftests/net/ipsec.c:1618:54: note: Calling function 'rtattr_pack',
4th argument 'NULL' value is 0
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_IF_ID, NULL, 0)) {
^
tools/testing/selftests/net/ipsec.c:230:25: note: Null pointer dereference
memcpy(RTA_DATA(attr), payload, size);
^--- tools/testing/selftests/net/ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/net/ipsec.c +2 -1
@@ -227,7 +227,8 @@ static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz, attr->rta_len =RTA_LENGTH (size); attr->rta_type = rta_type; -memcpy (RTA_DATA (attr), payload, size); +if (payload) +memcpy (RTA_DATA (attr), payload, size);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/273 x86/kexec: Allocate PGD for x86_64 transition page tables separately
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
[ Upstream commit 4b5bc2ec9a239bce261ffeafdd63571134102323 ]
Now that the following fix:
d0ceea662d45 ("x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables")
stops kernel_ident_mapping_init() from scribbling over the end of a 4KiB PGD by assuming the following 4KiB will be a userspace PGD, there's no good reason for the kexec PGD to be part of a single 8KiB allocation with the control_code_page.
( It's not clear that that was the reason for x86_64 kexec doing it that
way in the first place either; there were no comments to that effect and it seems to have been the case even before PTI came along. It looks like it was just a happy accident which prevented memory corruption on kexec. )
Either way, it definitely isn't needed now. Just allocate the PGD separately on x86_64, like i386 already does.
--- arch/x86/include/asm/kexec.h | 18 +++++++++--- arch/x86/kernel/machine_kexec_64.c | 45 ++++++++++++++++-------------- 2 files changed, 38 insertions(+), 25 deletions(-)
arch/x86/include/asm/kexec.h +14 -4
@@ -16,6 +16,7 @@# define PAGES_NR 4#endif +# define KEXEC_CONTROL_PAGE_SIZE 4096# define KEXEC_CONTROL_CODE_MAX_SIZE 2048#ifndef __ASSEMBLY__
@@ -44,7 +45,6 @@ struct kimage;/* Maximum address we can use for the control code buffer */ # define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE -# define KEXEC_CONTROL_PAGE_SIZE 4096/* The native architecture */ # define KEXEC_ARCH KEXEC_ARCH_386
@@ -59,9 +59,6 @@ struct kimage;/* Maximum address we can use for the control pages */ # define KEXEC_CONTROL_MEMORY_LIMIT (MAXMEM-1) -/* Allocate one page for the pdp and the second for the code */ -# define KEXEC_CONTROL_PAGE_SIZE (4096UL + 4096UL) -/* The native architecture */ # define KEXEC_ARCH KEXEC_ARCH_X86_64#endif
@@ -146,6 +143,19 @@ struct kimage_arch { }; #else struct kimage_arch { + /* + * This is a kimage control page, as it must not overlap with either + * source or destination address ranges. + */ + pgd_t *pgd; + /* + * The virtual mapping of the control code page itself is used only + * during the transition, while the current kernel's pages are all + * in place. Thus the intermediate page table pages used to map it + * are not control pages, but instead just normal pages obtained + * with get_zeroed_page(). And have to be tracked (below) so that + * they can be freed. + */ p4d_t *p4d; pud_t *pud; pmd_t *pmd;
arch/x86/kernel/machine_kexec_64.c +24 -21
123 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/273 iommu/arm-smmu-qcom: add sdm670 adreno iommu compatible
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Acayan <[email protected]>
[ Upstream commit 42314738906380cbd3b6e9caf3ad34e1b2d66035 ]
Add the compatible for the separate IOMMU on SDM670 for the Adreno GPU.
This IOMMU has the compatible strings:
"qcom,sdm670-smmu-v2", "qcom,adreno-smmu", "qcom,smmu-v2"
While the SMMU 500 doesn't need an entry for this specific SoC, the SMMU v2 compatible should have its own entry, as the fallback entry in arm-smmu.c handles "qcom,smmu-v2" without per-process page table support unless there is an entry here. This entry can't be the "qcom,adreno-smmu" compatible because dedicated GPU IOMMUs can also be SMMU 500 with different handling.
--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1 -0
@@ -554,6 +554,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500", .data = &qcom_smmu_500_impl0_data }, { .compatible = "qcom,sc8280xp-smmu-500", .data = &qcom_smmu_500_impl0_data }, { .compatible = "qcom,sdm630-smmu-v2", .data = &qcom_smmu_v2_data }, + { .compatible = "qcom,sdm670-smmu-v2", .data = &qcom_smmu_v2_data }, { .compatible = "qcom,sdm845-smmu-v2", .data = &qcom_smmu_v2_data }, { .compatible = "qcom,sdm845-smmu-500", .data = &sdm845_smmu_500_data }, { .compatible = "qcom,sm6115-smmu-500", .data = &qcom_smmu_500_impl0_data},
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/273 iommu/arm-smmu-v3: Clean up more on probe failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robin Murphy <[email protected]>
[ Upstream commit fcbd621567420b3a2f21f49bbc056de8b273c625 ]
kmemleak noticed that the iopf queue allocated deep down within arm_smmu_init_structures() can be leaked by a subsequent error return from arm_smmu_device_probe(). Furthermore, after arm_smmu_device_reset() we will also leave the SMMU enabled with an empty Stream Table, silently blocking all DMA. This proves rather annoying for debugging said probe failure, so let's handle it a bit better by putting the SMMU back into (more or less) the same state as if it hadn't probed at all.
--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +12 -5
@@ -3875,7 +3875,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)/* Initialise in-memory data structures */ ret =arm_smmu_init_structures (smmu);if (ret) -return ret; + goto err_free_iopf;/* Record our private device structure */ platform_set_drvdata (pdev, smmu);
@@ -3886,22 +3886,29 @@ static int arm_smmu_device_probe(struct platform_device *pdev)/* Reset the device */ ret =arm_smmu_device_reset (smmu, bypass);if (ret) -return ret; + goto err_disable;/* And we're up. Go go go! */ ret =iommu_device_sysfs_add (&smmu->iommu, dev,NULL ,"smmu3.%pa" , &ioaddr);if (ret) -return ret; + goto err_disable; ret =iommu_device_register (&smmu->iommu, &arm_smmu_ops, dev);if (ret) {dev_err (dev,"Failed to register iommu\n" ); -iommu_device_sysfs_remove (&smmu->iommu); -return ret; + goto err_free_sysfs; }return 0 ; + +err_free_sysfs: +iommu_device_sysfs_remove (&smmu->iommu); +err_disable: +arm_smmu_device_disable (smmu); +err_free_iopf: +iopf_queue_free (smmu->evtq.iopf); +return ret; }static void arm_smmu_device_remove (struct platform_device *pdev)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 31/273 wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 3f4a0948c3524ae50f166dbc6572a3296b014e62 ]
In 'wlc_phy_iqcal_gainparams_nphy()', add gain range check to WARN() instead of possible out-of-bounds 'tbl_iqcal_gainparams_nphy' access. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c +3 -0
@@ -23427,6 +23427,9 @@ wlc_phy_iqcal_gainparams_nphy(struct brcms_phy *pi, u16 core_no,break ; } +if (WARN_ON (k ==NPHY_IQCAL_NUMGAINS )) +return ; + params->txgm = tbl_iqcal_gainparams_nphy[band_idx][k][1 ]; params->pga = tbl_iqcal_gainparams_nphy[band_idx][k][2 ]; params->pad = tbl_iqcal_gainparams_nphy[band_idx][k][3 ];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/273 platform/x86: int3472: Check for adev == NULL
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit cd2fd6eab480dfc247b737cf7a3d6b009c4d0f1c ]
Not all devices have an ACPI companion fwnode, so adev might be NULL. This can e.g. (theoretically) happen when a user manually binds one of the int3472 drivers to another i2c/platform device through sysfs.
Add a check for adev not being set and return -ENODEV in that case to avoid a possible NULL pointer deref in skl_int3472_get_acpi_buffer().
--- drivers/platform/x86/intel/int3472/discrete.c | 3 +++ drivers/platform/x86/intel/int3472/tps68470.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/platform/x86/intel/int3472/discrete.c +3 -0
@@ -284,6 +284,9 @@ static int skl_int3472_discrete_probe(struct platform_device *pdev)struct int3472_cldb cldb;int ret; +if (!adev) +return -ENODEV ; + ret =skl_int3472_fill_cldb (adev, &cldb);if (ret) {dev_err (&pdev->dev,"Couldn't fill CLDB structure\n" );
drivers/platform/x86/intel/int3472/tps68470.c +3 -0
@@ -152,6 +152,9 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client)int ret;int i; +if (!adev) +return -ENODEV ; + n_consumers =skl_int3472_fill_clk_pdata (&client->dev, &clk_pdata);if (n_consumers <0 )return n_consumers;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/273 ASoC: soc-pcm: dont use soc_pcm_ret() on .prepare callback
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <[email protected]>
[ Upstream commit 301c26a018acb94dd537a4418cefa0f654500c6f ]
commit 1f5664351410 ("ASoC: lower "no backend DAIs enabled for ... Port" log severity") ignores -EINVAL error message on common soc_pcm_ret(). It is used from many functions, ignoring -EINVAL is over-kill.
The reason why -EINVAL was ignored was it really should only be used upon invalid parameters coming from userspace and in that case we don't want to log an error since we do not want to give userspace a way to do a denial-of-service attack on the syslog / diskspace.
So don't use soc_pcm_ret() on .prepare callback is better idea.
--- sound/soc/soc-pcm.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
sound/soc/soc-pcm.c +28 -4
@@ -38,7 +38,6 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,switch (ret) {case -EPROBE_DEFER :case -ENOTSUPP : -case -EINVAL :break ;default : dev_err(rtd->dev,
@@ -902,7 +901,13 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd, } out: -return soc_pcm_ret (rtd, ret); +/* +* Don't use soc_pcm_ret() on .prepare callback to lower error log severity +* +* We don't want to log an error since we do not want to give userspace a way to do a +* denial-of-service attack on the syslog / diskspace. +*/ +return ret; }/* PCM prepare ops for non-DPCM streams */
@@ -914,6 +919,13 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)snd_soc_dpcm_mutex_lock (rtd); ret =__soc_pcm_prepare (rtd, substream);snd_soc_dpcm_mutex_unlock (rtd); + +/* +* Don't use soc_pcm_ret() on .prepare callback to lower error log severity +* +* We don't want to log an error since we do not want to give userspace a way to do a +* denial-of-service attack on the syslog / diskspace. +*/ return ret; }
@@ -2461,7 +2473,13 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) be->dpcm[stream].state =SND_SOC_DPCM_STATE_PREPARE ; } -return soc_pcm_ret (fe, ret); +/* +* Don't use soc_pcm_ret() on .prepare callback to lower error log severity +* +* We don't want to log an error since we do not want to give userspace a way to do a +* denial-of-service attack on the syslog / diskspace. +*/ +return ret; }static int dpcm_fe_dai_prepare (struct snd_pcm_substream *substream)
@@ -2501,7 +2519,13 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)dpcm_set_fe_update_state (fe, stream,SND_SOC_DPCM_UPDATE_NO );snd_soc_dpcm_mutex_unlock (fe); -return soc_pcm_ret (fe, ret); +/* +* Don't use soc_pcm_ret() on .prepare callback to lower error log severity +* +* We don't want to log an error since we do not want to give userspace a way to do a +* denial-of-service attack on the syslog / diskspace. +*/ +return ret; }static int dpcm_run_update_shutdown (struct snd_soc_pcm_runtime *fe,int stream)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/273 ASoC: amd: Add ACPI dependency to fix build error
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu-Chun Lin <[email protected]>
[ Upstream commit 7e24ec93aecd12e33d31e38e5af4625553bbc727 ]
As reported by the kernel test robot, the following error occurs:
sound/soc/amd/yc/acp6x-mach.c: In function 'acp6x_probe':
Quoted 1 line
Quoted 1 line
sound/soc/amd/yc/acp6x-mach.c:573:15: error: implicit declaration of function 'acpi_evaluate_integer'; did you mean 'acpi_evaluate_object'? [-Werror=implicit-function-declaration]
573 | ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
| ^~~~~~~~~~~~~~~~~~~~~
| acpi_evaluate_objectcc1: some warnings being treated as errors
The function 'acpi_evaluate_integer' and its prototype in 'acpi_bus.h' are only available when 'CONFIG_ACPI' is enabled. Add a 'depends on ACPI' directive in Kconfig to ensure proper compilation.
--- sound/soc/amd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/Kconfig +1 -1
@@ -105,7 +105,7 @@ config SND_SOC_AMD_ACP6x config SND_SOC_AMD_YC_MACH tristate "AMD YC support for DMIC" select SND_SOC_DMIC - depends on SND_SOC_AMD_ACP6x + depends on SND_SOC_AMD_ACP6x && ACPI help This option enables machine driver for Yellow Carp platform using dmic. ACP IP has PDM Decoder block with DMA controller.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 52/273 Input: allocate keycode for phone linking
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Illia Ostapyshyn <[email protected]>
[ Upstream commit 1bebc7869c99d466f819dd2cffaef0edf7d7a035 ]
The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s Gen 5 laptops includes a symbol showing a smartphone and a laptop chained together. According to the user manual, it starts the Microsoft Phone Link software used to connect to Android/iOS devices and relay messages/calls or sync data.
As there are no suitable keycodes for this action, introduce a new one.
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
@@ -519,6 +519,7 @@#define KEY_NOTIFICATION_CENTER 0x1bc/* Show/hide the notification center */ #define KEY_PICKUP_PHONE 0x1bd/* Answer incoming call */ #define KEY_HANGUP_PHONE 0x1be/* Decline incoming call */ +#define KEY_LINK_PHONE 0x1bf/* AL Phone Syncing */ #define KEY_DEL_EOL 0x1c0#define KEY_DEL_EOS 0x1c1
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 53/273 platform/x86: acer-wmi: Ignore AC events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit f6bfa25c6665f8721421ea94fe506cc22f1d4b43 ]
On the Acer Swift SFG14-41, the events 8 - 1 and 8 - 0 are printed on AC connect/disconnect. Ignore those events to avoid spamming the kernel log with error messages.
--- drivers/platform/x86/acer-wmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/platform/x86/acer-wmi.c +4 -0
@@ -88,6 +88,7 @@ enum acer_wmi_event_ids {WMID_HOTKEY_EVENT =0x1 ,WMID_ACCEL_OR_KBD_DOCK_EVENT =0x5 ,WMID_GAMING_TURBO_KEY_EVENT =0x7 , + WMID_AC_EVENT = 0x8, }; static const struct key_entry acer_wmi_keymap[] __initconst = {
@@ -1999,6 +2000,9 @@ static void acer_wmi_notify(u32 value, void *context)if (return_value.key_num ==0x4 )acer_toggle_turbo ();break ; +case WMID_AC_EVENT : +/* We ignore AC events here */ +break ;default :pr_warn ("Unknown function number - %d - %d\n" , return_value.function, return_value.key_num);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 54/273 KVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
[ Upstream commit c9be85dabb376299504e0d391d15662c0edf8273 ]
Mark the underlying page as dirty in kvmppc_e500_ref_setup()'s sole caller, kvmppc_e500_shadow_map(), which will allow converting e500 to __kvm_faultin_pfn() + kvm_release_faultin_page() without having to do a weird dance between ref_setup() and shadow_map().
Opportunistically drop the redundant kvm_set_pfn_accessed(), as shadow_map() puts the page via kvm_release_pfn_clean().
Message-ID: <[email protected]>
Stable-dep-of: 87ecfdbc699c ("KVM: e500: always restore irqs")
--- arch/powerpc/kvm/e500_mmu_host.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
arch/powerpc/kvm/e500_mmu_host.c +6 -7
@@ -242,7 +242,7 @@ static inline int tlbe_is_writable(struct kvm_book3e_206_tlb_entry *tlbe)return tlbe->mas7_3 & (MAS3_SW |MAS3_UW ); } -static inline void kvmppc_e500_ref_setup (struct tlbe_ref *ref, +static inline bool kvmppc_e500_ref_setup (struct tlbe_ref *ref,struct kvm_book3e_206_tlb_entry *gtlbe,kvm_pfn_t pfn,unsigned int wimg) {
@@ -252,11 +252,7 @@ static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref,/* Use guest supplied MAS2_G and MAS2_E */ ref->flags |= (gtlbe->mas2 &MAS2_ATTRIB_MASK ) | wimg; -/* Mark the page accessed */ -kvm_set_pfn_accessed (pfn); - -if (tlbe_is_writable (gtlbe)) -kvm_set_pfn_dirty (pfn); +return tlbe_is_writable (gtlbe); }static inline void kvmppc_e500_ref_release (struct tlbe_ref *ref)
@@ -337,6 +333,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,unsigned int wimg =0 ;pgd_t *pgdir;unsigned long flags; +bool writable = false;/* used to check for invalidations in progress */ mmu_seq = kvm->mmu_invalidate_seq;
@@ -490,7 +487,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, goto out; } } -kvmppc_e500_ref_setup (ref, gtlbe, pfn, wimg); + writable =kvmppc_e500_ref_setup (ref, gtlbe, pfn, wimg); +if (writable) +kvm_set_pfn_dirty (pfn);kvmppc_e500_setup_stlbe (&vcpu_e500->vcpu, gtlbe, tsize, ref, gvaddr, stlbe);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 55/273 KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
[ Upstream commit 84cf78dcd9d65c45ab73998d4ad50f433d53fb93 ]
Mark pages accessed before dropping mmu_lock when faulting in guest memory so that shadow_map() can convert to kvm_release_faultin_page() without tripping its lockdep assertion on mmu_lock being held. Marking pages accessed outside of mmu_lock is ok (not great, but safe), but marking pages _dirty_ outside of mmu_lock can make filesystems unhappy.
Message-ID: <[email protected]>
Stable-dep-of: 87ecfdbc699c ("KVM: e500: always restore irqs")
--- arch/powerpc/kvm/e500_mmu_host.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/kvm/e500_mmu_host.c +1 -3
@@ -498,11 +498,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,kvmppc_mmu_flush_icache (pfn); out: -spin_unlock (&kvm->mmu_lock); -/* Drop refcount on page, so that mmu notifiers can clear it */ kvm_release_pfn_clean (pfn); - +spin_unlock (&kvm->mmu_lock);return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 56/273 KVM: PPC: e500: Use __kvm_faultin_pfn() to handle page faults
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
[ Upstream commit 419cfb983ca93e75e905794521afefcfa07988bb ]
Convert PPC e500 to use __kvm_faultin_pfn()+kvm_release_faultin_page(), and continue the inexorable march towards the demise of kvm_pfn_to_refcounted_page().
Message-ID: <[email protected]>
Stable-dep-of: 87ecfdbc699c ("KVM: e500: always restore irqs")
--- arch/powerpc/kvm/e500_mmu_host.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/kvm/e500_mmu_host.c +3 -5
@@ -322,6 +322,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, {struct kvm_memory_slot *slot;unsigned long pfn =0 ;/* silence GCC warning */ +struct page *page =NULL ;unsigned long hva;int pfnmap =0 ;int tsize =BOOK3E_PAGESZ_4K ;
@@ -443,7 +444,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,if (likely (!pfnmap)) { tsize_pages =1UL << (tsize +10 -PAGE_SHIFT ); - pfn =gfn_to_pfn_memslot (slot, gfn); + pfn =__kvm_faultin_pfn (slot, gfn,FOLL_WRITE ,NULL , &page);if (is_error_noslot_pfn (pfn)) {if (printk_ratelimit ()) pr_err("%s: real page not found for gfn %lx\n",
@@ -488,8 +489,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, } } writable =kvmppc_e500_ref_setup (ref, gtlbe, pfn, wimg); -if (writable) -kvm_set_pfn_dirty (pfn);kvmppc_e500_setup_stlbe (&vcpu_e500->vcpu, gtlbe, tsize, ref, gvaddr, stlbe);
@@ -498,8 +497,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,kvmppc_mmu_flush_icache (pfn); out: -/* Drop refcount on page, so that mmu notifiers can clear it */ -kvm_release_pfn_clean (pfn); +kvm_release_faultin_page (kvm, page, !!ret, writable);spin_unlock (&kvm->mmu_lock);return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 57/273 KVM: e500: always restore irqs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <[email protected]>
[ Upstream commit 87ecfdbc699cc95fac73291b52650283ddcf929d ]
If find_linux_pte fails, IRQs will not be restored. This is unlikely to happen in practice since it would have been reported as hanging hosts, but it should of course be fixed anyway.
--- arch/powerpc/kvm/e500_mmu_host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kvm/e500_mmu_host.c +2 -2
@@ -479,7 +479,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,if (pte_present (pte)) { wimg = (pte_val (pte) >>PTE_WIMGE_SHIFT ) &MAS2_WIMGE_MASK ; -local_irq_restore (flags); }else {local_irq_restore (flags); pr_err_ratelimited("%s: pte not present: gfn %lx,pfn %lx\n",
@@ -488,8 +487,9 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, goto out; } } - writable =kvmppc_e500_ref_setup (ref, gtlbe, pfn, wimg); +local_irq_restore (flags); + writable =kvmppc_e500_ref_setup (ref, gtlbe, pfn, wimg);kvmppc_e500_setup_stlbe (&vcpu_e500->vcpu, gtlbe, tsize, ref, gvaddr, stlbe);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 58/273 net/ncsi: Add NC-SI 1.2 Get MC MAC Address command
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Delevoryas <[email protected]>
[ Upstream commit b8291cf3d1180b5b61299922f17c9441616a805a ]
This change adds support for the NC-SI 1.2 Get MC MAC Address command, specified here:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.2.0.pdf
It serves the exact same function as the existing OEM Get MAC Address commands, so if a channel reports that it supports NC-SI 1.2, we prefer to use the standard command rather than the OEM command.
Verified with an invalid MAC address and 2 valid ones:
[ 55.137072] ftgmac100 1e690000.ftgmac eth0: NCSI: Received 3 provisioned MAC addresses [ 55.137614] ftgmac100 1e690000.ftgmac eth0: NCSI: MAC address 0: 00:00:00:00:00:00 [ 55.138026] ftgmac100 1e690000.ftgmac eth0: NCSI: MAC address 1: fa:ce:b0:0c:20:22 [ 55.138528] ftgmac100 1e690000.ftgmac eth0: NCSI: MAC address 2: fa:ce:b0:0c:20:23 [ 55.139241] ftgmac100 1e690000.ftgmac eth0: NCSI: Unable to assign 00:00:00:00:00:00 to device [ 55.140098] ftgmac100 1e690000.ftgmac eth0: NCSI: Set MAC address to fa:ce:b0:0c:20:22
Stable-dep-of: 9e2bbab94b88 ("net/ncsi: fix locking in Get MAC Address handling")
--- net/ncsi/ncsi-cmd.c | 3 ++- net/ncsi/ncsi-manage.c | 9 +++++++-- net/ncsi/ncsi-pkt.h | 10 ++++++++++ net/ncsi/ncsi-rsp.c | 41 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 59 insertions(+), 4 deletions(-)
net/ncsi/ncsi-cmd.c +2 -1
@@ -270,7 +270,8 @@ static struct ncsi_cmd_handler { { NCSI_PKT_CMD_GPS, 0, ncsi_cmd_handler_default }, { NCSI_PKT_CMD_OEM, -1, ncsi_cmd_handler_oem }, { NCSI_PKT_CMD_PLDM, 0, NULL }, - { NCSI_PKT_CMD_GPUUID, 0, ncsi_cmd_handler_default } + { NCSI_PKT_CMD_GPUUID, 0, ncsi_cmd_handler_default }, + { NCSI_PKT_CMD_GMCMA, 0, ncsi_cmd_handler_default } };static struct ncsi_request *ncsi_alloc_command (struct ncsi_cmd_arg *nca)
net/ncsi/ncsi-manage.c +7 -2
@@ -1040,11 +1040,16 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp)case ncsi_dev_state_config_oem_gma: nd->state = ncsi_dev_state_config_clear_vids; - nca.type =NCSI_PKT_CMD_OEM ; nca.package = np->id; nca.channel = nc->id; ndp->pending_req_num =1 ; - ret =ncsi_gma_handler (&nca, nc->version.mf_id); +if (nc->version.major >=1 && nc->version.minor >=2 ) { + nca.type =NCSI_PKT_CMD_GMCMA ; + ret =ncsi_xmit_cmd (&nca); + }else { + nca.type =NCSI_PKT_CMD_OEM ; + ret =ncsi_gma_handler (&nca, nc->version.mf_id); + }if (ret <0 )schedule_work (&ndp->work);
net/ncsi/ncsi-pkt.h +10 -0
@@ -338,6 +338,14 @@ struct ncsi_rsp_gpuuid_pkt {__be32 checksum; }; +/* Get MC MAC Address */ +struct ncsi_rsp_gmcma_pkt { +struct ncsi_rsp_pkt_hdr rsp; +unsigned char address_count; +unsigned char reserved[3 ]; +unsigned char addresses[][ETH_ALEN ]; +}; +/* AEN: Link State Change */ struct ncsi_aen_lsc_pkt {struct ncsi_aen_pkt_hdr aen;/* AEN header */
@@ -398,6 +406,7 @@ struct ncsi_aen_hncdsc_pkt {#define NCSI_PKT_CMD_GPUUID 0x52/* Get package UUID */ #define NCSI_PKT_CMD_QPNPR 0x56/* Query Pending NC PLDM request */ #define NCSI_PKT_CMD_SNPR 0x57/* Send NC PLDM Reply */ +#define NCSI_PKT_CMD_GMCMA 0x58/* Get MC MAC Address */ /* NCSI packet responses */
@@ -433,6 +442,7 @@ struct ncsi_aen_hncdsc_pkt {#define NCSI_PKT_RSP_GPUUID (NCSI_PKT_CMD_GPUUID + 0x80)#define NCSI_PKT_RSP_QPNPR (NCSI_PKT_CMD_QPNPR + 0x80)#define NCSI_PKT_RSP_SNPR (NCSI_PKT_CMD_SNPR + 0x80) +#define NCSI_PKT_RSP_GMCMA (NCSI_PKT_CMD_GMCMA + 0x80)/* NCSI response code/reason */ #define NCSI_PKT_RSP_C_COMPLETED 0x0000/* Command Completed */
net/ncsi/ncsi-rsp.c +40 -1
53 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/273 tomoyo: dont emit warning in tomoyo_write_control()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 3df7546fc03b8f004eee0b9e3256369f7d096685 ]
syzbot is reporting too large allocation warning at tomoyo_write_control(), for one can write a very very long line without new line character. To fix this warning, I use __GFP_NOWARN rather than checking for KMALLOC_MAX_SIZE, for practically a valid line should be always shorter than 32KB where the "too small to fail" memory-allocation rule applies.
One might try to write a valid line that is longer than 32KB, but such request will likely fail with -ENOMEM. Therefore, I feel that separately returning -EINVAL when a line is longer than KMALLOC_MAX_SIZE is redundant. There is no need to distinguish over-32KB and over-KMALLOC_MAX_SIZE.
--- security/tomoyo/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/tomoyo/common.c +1 -1
@@ -2665,7 +2665,7 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head,if (head->w.avail >= head->writebuf_size -1 ) {const int len = head->writebuf_size *2 ; -char *cp =kzalloc (len,GFP_NOFS ); +char *cp =kzalloc (len,GFP_NOFS | __GFP_NOWARN);if (!cp) { error = -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 59/273 net/ncsi: fix locking in Get MAC Address handling
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Fertser <[email protected]>
[ Upstream commit 9e2bbab94b88295dcc57c7580393c9ee08d7314d ]
Obtaining RTNL lock in a response handler is not allowed since it runs in an atomic softirq context. Postpone setting the MAC address by adding a dedicated step to the configuration FSM.
--- net/ncsi/internal.h | 2 ++ net/ncsi/ncsi-manage.c | 16 ++++++++++++++-- net/ncsi/ncsi-rsp.c | 19 ++++++------------- 3 files changed, 22 insertions(+), 15 deletions(-)
net/ncsi/internal.h +2 -0
@@ -289,6 +289,7 @@ enum { ncsi_dev_state_config_sp =0x0301 , ncsi_dev_state_config_cis, ncsi_dev_state_config_oem_gma, + ncsi_dev_state_config_apply_mac, ncsi_dev_state_config_clear_vids, ncsi_dev_state_config_svf, ncsi_dev_state_config_ev,
@@ -322,6 +323,7 @@ struct ncsi_dev_priv {#define NCSI_DEV_RESHUFFLE 4#define NCSI_DEV_RESET 8/* Reset state of NC */ unsigned int gma_flag;/* OEM GMA flag */ +struct sockaddr pending_mac;/* MAC address received from GMA */ spinlock_t lock;/* Protect the NCSI device */ unsigned int package_probe_id;/* Current ID during probe */ unsigned int package_num;/* Number of packages */
net/ncsi/ncsi-manage.c +14 -2
@@ -1038,7 +1038,7 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) : ncsi_dev_state_config_clear_vids;break ;case ncsi_dev_state_config_oem_gma: - nd->state = ncsi_dev_state_config_clear_vids; + nd->state = ncsi_dev_state_config_apply_mac; nca.package = np->id; nca.channel = nc->id;
@@ -1050,10 +1050,22 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) nca.type =NCSI_PKT_CMD_OEM ; ret =ncsi_gma_handler (&nca, nc->version.mf_id); } -if (ret <0 ) +if (ret <0 ) { + nd->state = ncsi_dev_state_config_clear_vids;schedule_work (&ndp->work); + }break ; +case ncsi_dev_state_config_apply_mac: +rtnl_lock (); + ret =dev_set_mac_address (dev, &ndp->pending_mac,NULL ); +rtnl_unlock (); +if (ret <0 ) +netdev_warn (dev,"NCSI: 'Writing MAC address to device failed\n" ); + + nd->state = ncsi_dev_state_config_clear_vids; + + fallthrough;case ncsi_dev_state_config_clear_vids:case ncsi_dev_state_config_svf:case ncsi_dev_state_config_ev:
net/ncsi/ncsi-rsp.c +6 -13
@@ -628,16 +628,14 @@ static int ncsi_rsp_handler_snfc(struct ncsi_request *nr)static int ncsi_rsp_handler_oem_gma (struct ncsi_request *nr,int mfr_id) {struct ncsi_dev_priv *ndp = nr->ndp; +struct sockaddr *saddr = &ndp->pending_mac;struct net_device *ndev = ndp->ndev.dev;struct ncsi_rsp_oem_pkt *rsp; -struct sockaddr saddr;u32 mac_addr_off =0 ; -int ret =0 ;/* Get the response header */ rsp = (struct ncsi_rsp_oem_pkt *)skb_network_header (nr->rsp); - saddr.sa_family = ndev->type; ndev->priv_flags |=IFF_LIVE_ADDR_CHANGE ;if (mfr_id ==NCSI_OEM_MFR_BCM_ID ) mac_addr_off =BCM_MAC_ADDR_OFFSET ;
@@ -646,22 +644,17 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id)else if (mfr_id ==NCSI_OEM_MFR_INTEL_ID ) mac_addr_off =INTEL_MAC_ADDR_OFFSET ; -memcpy (saddr.sa_data, &rsp->data[mac_addr_off],ETH_ALEN ); + saddr->sa_family = ndev->type; +memcpy (saddr->sa_data, &rsp->data[mac_addr_off],ETH_ALEN );if (mfr_id ==NCSI_OEM_MFR_BCM_ID || mfr_id ==NCSI_OEM_MFR_INTEL_ID ) -eth_addr_inc ((u8 *)saddr.sa_data); -if (!is_valid_ether_addr ((const u8 *)saddr.sa_data)) +eth_addr_inc ((u8 *)saddr->sa_data); +if (!is_valid_ether_addr ((const u8 *)saddr->sa_data))return -ENXIO ;/* Set the flag for GMA command which should only be called once */ ndp->gma_flag =1 ; -rtnl_lock (); - ret =dev_set_mac_address (ndev, &saddr,NULL ); -rtnl_unlock (); -if (ret <0 ) -netdev_warn (ndev,"NCSI: 'Writing mac address to device failed\n" ); - -return ret; +return 0 ; }/* Response handler for Mellanox card */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 60/273 nvme: handle connectivity loss in nvme_set_queue_count
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit 294b2b7516fd06a8dd82e4a6118f318ec521e706 ]
When the set feature attempts fails with any NVME status code set in nvme_set_queue_count, the function still report success. Though the numbers of queues set to 0. This is done to support controllers in degraded state (the admin queue is still up and running but no IO queues).
Though there is an exception. When nvme_set_features reports an host path error, nvme_set_queue_count should propagate this error as the connectivity is lost, which means also the admin queue is not working anymore.
--- drivers/nvme/host/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +7 -1
@@ -1553,7 +1553,13 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count) status =nvme_set_features (ctrl,NVME_FEAT_NUM_QUEUES , q_count,NULL ,0 , &result); -if (status <0 ) + +/* +* It's either a kernel error or the host observed a connection +* lost. In either case it's not possible communicate with the +* controller and thus enter the error code path. +*/ +if (status <0 || status ==NVME_SC_HOST_PATH_ERROR )return status;/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 61/273 firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prasad Pandit <[email protected]>
[ Upstream commit e1e17a1715982201034024863efbf238bee2bdf9 ]
Fix ISCSI_IBFT Kconfig entry, replace tab with a space character.
--- drivers/firmware/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/Kconfig +1 -1
@@ -139,7 +139,7 @@ config ISCSI_IBFT select ISCSI_BOOT_SYSFS select ISCSI_IBFT_FIND if X86 depends on ACPI && SCSI && SCSI_LOWLEVEL - default n + default n help This option enables support for detection and exposing of iSCSI Boot Firmware Table (iBFT) via sysfs to userspace. If you wish to
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 62/273 gpu: drm_dp_cec: fix broken CEC adapter properties check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <[email protected]>
[ Upstream commit 6daaae5ff7f3b23a2dacc9c387ff3d4f95b67cad ]
If the hotplug detect of a display is low for longer than one second (configurable through drm_dp_cec_unregister_delay), then the CEC adapter is unregistered since we assume the display was disconnected. If the HPD went low for less than one second, then we check if the properties of the CEC adapter have changed, since that indicates that we actually switch to new hardware and we have to unregister the old CEC device and register a new one.
Unfortunately, the test for changed properties was written poorly, and after a new CEC capability was added to the CEC core code the test always returned true (i.e. the properties had changed).
As a result the CEC device was unregistered and re-registered for every HPD toggle. If the CEC remote controller integration was also enabled (CONFIG_MEDIA_CEC_RC was set), then the corresponding input device was also unregistered and re-registered. As a result the input device in /sys would keep incrementing its number, e.g.:
/sys/devices/pci0000:00/0000:00:08.1/0000:e7:00.0/rc/rc0/input20
Since short HPD toggles are common, the number could over time get into the thousands.
While not a serious issue (i.e. nothing crashes), it is not intended to work that way.
This patch changes the test so that it only checks for the single CEC capability that can actually change, and it ignores any other capabilities, so this is now safe as well if new caps are added in the future.
With the changed test the bit under #ifndef CONFIG_MEDIA_CEC_RC can be dropped as well, so that's a nice cleanup.
--- drivers/gpu/drm/display/drm_dp_cec.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/display/drm_dp_cec.c +3 -11
@@ -310,16 +310,6 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)if (!aux->transfer)return ; -#ifndef CONFIG_MEDIA_CEC_RC -/* -* CEC_CAP_RC is part of CEC_CAP_DEFAULTS, but it is stripped by -* cec_allocate_adapter() if CONFIG_MEDIA_CEC_RC is undefined. -* -* Do this here as well to ensure the tests against cec_caps are -* correct. -*/ - cec_caps &= ~CEC_CAP_RC ; -#endif cancel_delayed_work_sync (&aux->cec.unregister_work);mutex_lock (&aux->cec.lock);
@@ -336,7 +326,9 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid) num_las =CEC_MAX_LOG_ADDRS ;if (aux->cec.adap) { -if (aux->cec.adap->capabilities == cec_caps && +/* Check if the adapter properties have changed */ +if ((aux->cec.adap->capabilities &CEC_CAP_MONITOR_ALL ) == + (cec_caps &CEC_CAP_MONITOR_ALL ) && aux->cec.adap->available_log_addrs == num_las) {/* Unchanged, so just set the phys addr */ cec_s_phys_addr_from_edid (aux->cec.adap, edid);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 63/273 ice: put Rx buffers after being done with current frame
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <[email protected]>
[ Upstream commit 743bbd93cf29f653fae0e1416a31f03231689911 ]
Introduce a new helper ice_put_rx_mbuf() that will go through gathered frags from current frame and will call ice_put_rx_buf() on them. Current logic that was supposed to simplify and optimize the driver where we go through a batch of all buffers processed in current NAPI instance turned out to be broken for jumbo frames and very heavy load that was coming from both multi-thread iperf and nginx/wrk pair between server and client. The delay introduced by approach that we are dropping is simply too big and we need to take the decision regarding page recycling/releasing as quick as we can.
While at it, address an error path of ice_add_xdp_frag() - we were missing buffer putting from day 1 there.
As a nice side effect we get rid of annoying and repetitive three-liner:
xdp->data = NULL; rx_ring->first_desc = ntc; rx_ring->nr_frags = 0;
by embedding it within introduced routine.
--- drivers/net/ethernet/intel/ice/ice_txrx.c | 79 ++++++++++++++--------- 1 file changed, 50 insertions(+), 29 deletions(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +50 -29
@@ -1101,6 +1101,49 @@ ice_put_rx_buf(struct ice_rx_ring *rx_ring, struct ice_rx_buf *rx_buf) rx_buf->page =NULL ; } +/** +* ice_put_rx_mbuf - ice_put_rx_buf() caller, for all frame frags +* @rx_ring: Rx ring with all the auxiliary data +* @xdp: XDP buffer carrying linear + frags part +* @xdp_xmit: XDP_TX/XDP_REDIRECT verdict storage +* @ntc: a current next_to_clean value to be stored at rx_ring +* +* Walk through gathered fragments and satisfy internal page +* recycle mechanism; we take here an action related to verdict +* returned by XDP program; +*/ +static void ice_put_rx_mbuf (struct ice_rx_ring *rx_ring,struct xdp_buff *xdp, +u32 *xdp_xmit,u32 ntc) +{ +u32 nr_frags = rx_ring->nr_frags +1 ; +u32 idx = rx_ring->first_desc; +u32 cnt = rx_ring->count; +struct ice_rx_buf *buf; +int i; + +for (i =0 ; i < nr_frags; i++) { + buf = &rx_ring->rx_buf[idx]; + +if (buf->act & (ICE_XDP_TX |ICE_XDP_REDIR )) { +ice_rx_buf_adjust_pg_offset (buf, xdp->frame_sz); + *xdp_xmit |= buf->act; + }else if (buf->act &ICE_XDP_CONSUMED ) { + buf->pagecnt_bias++; + }else if (buf->act ==ICE_XDP_PASS ) { +ice_rx_buf_adjust_pg_offset (buf, xdp->frame_sz); + } + +ice_put_rx_buf (rx_ring, buf); + +if (++idx == cnt) + idx =0 ; + } + + xdp->data =NULL ; + rx_ring->first_desc = ntc; + rx_ring->nr_frags =0 ; +} +/** * ice_clean_rx_irq - Clean completed descriptors from Rx ring - bounce buf * @rx_ring: Rx descriptor ring to transact packets on
@@ -1118,7 +1161,6 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)unsigned int total_rx_bytes =0 , total_rx_pkts =0 ;unsigned int offset = rx_ring->rx_offset;struct xdp_buff *xdp = &rx_ring->xdp; -u32 cached_ntc = rx_ring->first_desc;struct ice_tx_ring *xdp_ring =NULL ;struct bpf_prog *xdp_prog =NULL ;u32 ntc = rx_ring->next_to_clean;
@@ -1126,7 +1168,6 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)u32 xdp_xmit =0 ;u32 cached_ntu;bool failure; -u32 first; xdp_prog =READ_ONCE (rx_ring->xdp_prog);if (xdp_prog) {
@@ -1189,6 +1230,7 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)xdp_prepare_buff (xdp, hard_start, offset, size, !!offset);xdp_buff_clear_frags_flag (xdp); }else if (ice_add_xdp_frag (rx_ring, xdp, rx_buf, size)) { +ice_put_rx_mbuf (rx_ring, xdp,NULL , ntc);break ; }if (++ntc == cnt)
@@ -1204,9 +1246,8 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget) total_rx_bytes +=xdp_get_buff_len (xdp); total_rx_pkts++; - xdp->data =NULL ; - rx_ring->first_desc = ntc; - rx_ring->nr_frags =0 ; +ice_put_rx_mbuf (rx_ring, xdp, &xdp_xmit, ntc); +continue ; construct_skb:if (likely (ice_ring_uses_build_skb (rx_ring)))
@@ -1220,14 +1261,11 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)if (unlikely (xdp_buff_has_frags (xdp)))ice_set_rx_bufs_act (xdp, rx_ring,ICE_XDP_CONSUMED ); - xdp->data =NULL ; - rx_ring->first_desc = ntc; - rx_ring->nr_frags =0 ; -break ; } - xdp->data =NULL ; - rx_ring->first_desc = ntc; - rx_ring->nr_frags =0 ; +ice_put_rx_mbuf (rx_ring, xdp, &xdp_xmit, ntc); + +if (!skb) +break ; stat_err_bits =BIT (ICE_RX_FLEX_DESC_STATUS0_RXE_S ); if (unlikely(ice_test_staterr(rx_desc->wb.status_error0,
@@ -1259,23 +1297,6 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget) total_rx_pkts++; } - first = rx_ring->first_desc; -while (cached_ntc != first) { -struct ice_rx_buf *buf = &rx_ring->rx_buf[cached_ntc]; - -if (buf->act & (ICE_XDP_TX |ICE_XDP_REDIR )) { -ice_rx_buf_adjust_pg_offset (buf, xdp->frame_sz); - xdp_xmit |= buf->act; - }else if (buf->act &ICE_XDP_CONSUMED ) { - buf->pagecnt_bias++; - }else if (buf->act ==ICE_XDP_PASS ) { -ice_rx_buf_adjust_pg_offset (buf, xdp->frame_sz); - } - -ice_put_rx_buf (rx_ring, buf); -if (++cached_ntc >= cnt) - cached_ntc =0 ; - } rx_ring->next_to_clean = ntc;/* return up to cleaned_count buffers to hardware */ failure =ice_alloc_rx_bufs (rx_ring,ICE_RX_DESC_UNUSED (rx_ring));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/273 mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 1e89d21f8189d286f80b900e1b7cf57cb1f3037e ]
On N4100 / N4120 Gemini Lake SoCs the ISA bridge PCI device-id is 31e8 rather the 3197 found on e.g. the N4000 / N4020.
While at fix the existing GLK PCI-id table entry breaking the table being sorted by device-id.
--- drivers/mfd/lpc_ich.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mfd/lpc_ich.c +2 -1
@@ -756,8 +756,9 @@ static const struct pci_device_id lpc_ich_ids[] = { { PCI_VDEVICE(INTEL, 0x2917), LPC_ICH9ME}, { PCI_VDEVICE(INTEL, 0x2918), LPC_ICH9}, { PCI_VDEVICE(INTEL, 0x2919), LPC_ICH9M}, - { PCI_VDEVICE(INTEL, 0x3197), LPC_GLK}, { PCI_VDEVICE(INTEL, 0x2b9c), LPC_COUGARMOUNTAIN}, + { PCI_VDEVICE(INTEL, 0x3197), LPC_GLK}, + { PCI_VDEVICE(INTEL, 0x31e8), LPC_GLK}, { PCI_VDEVICE(INTEL, 0x3a14), LPC_ICH10DO}, { PCI_VDEVICE(INTEL, 0x3a16), LPC_ICH10R}, { PCI_VDEVICE(INTEL, 0x3a18), LPC_ICH10},
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/273 clk: qcom: Make GCC_8150 depend on QCOM_GDSC
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 1474149c4209943b37a2c01b82f07ba39465e5fe ]
Like all other non-ancient Qualcomm clock drivers, QCOM_GDSC is required, as the GCC driver defines and instantiates a bunch of GDSCs.
Add the missing dependency.
--- drivers/clk/qcom/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/clk/qcom/Kconfig +1 -0
@@ -881,6 +881,7 @@ config SM_GCC_7150 config SM_GCC_8150 tristate "SM8150 Global Clock Controller" depends on ARM64 || COMPILE_TEST + select QCOM_GDSC help Support for the global clock controller on SM8150 devices. Say Y if you want to use peripheral devices such as UART,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/273 HID: Wacom: Add PCI Wacom device support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Even Xu <[email protected]>
[ Upstream commit c4c123504a65583e3689b3de04a61dc5272e453a ]
Add PCI device ID of wacom device into driver support list.
--- drivers/hid/wacom_wac.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hid/wacom_wac.c +5 -0
@@ -4911,6 +4911,10 @@ static const struct wacom_features wacom_features_0x94 = HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ .driver_data = (kernel_ulong_t)&wacom_features_##prod +#define PCI_DEVICE_WACOM (prod) \ + HID_DEVICE(BUS_PCI, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ + .driver_data = (kernel_ulong_t)&wacom_features_##prod +#define USB_DEVICE_LENOVO (prod) \ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ .driver_data = (kernel_ulong_t)&wacom_features_##prod
@@ -5080,6 +5084,7 @@ const struct hid_device_id wacom_ids[] = { { USB_DEVICE_WACOM(HID_ANY_ID) }, { I2C_DEVICE_WACOM(HID_ANY_ID) }, + { PCI_DEVICE_WACOM(HID_ANY_ID) }, { BT_DEVICE_WACOM(HID_ANY_ID) }, { } };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/273 net/mlx5: use do_aux_work for PHC overflow checks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vadim Fedorenko <[email protected]>
[ Upstream commit e61e6c415ba9ff2b32bb6780ce1b17d1d76238f1 ]
The overflow_work is using system wq to do overflow checks and updates for PHC device timecounter, which might be overhelmed by other tasks. But there is dedicated kthread in PTP subsystem designed for such things. This patch changes the work queue to proper align with PTP subsystem and to avoid overloading system work queue.
The adjfine() function acts the same way as overflow check worker, we can postpone ptp aux worker till the next overflow period after adjfine() was called.
--- .../ethernet/mellanox/mlx5/core/lib/clock.c | 24 ++++++++++--------- include/linux/mlx5/driver.h | 1 - 2 files changed, 13 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +13 -11
@@ -237,17 +237,16 @@ static void mlx5_pps_out(struct work_struct *work) } } -static void mlx5_timestamp_overflow (struct work_struct *work) +static long mlx5_timestamp_overflow (struct ptp_clock_info *ptp_info) { -struct delayed_work *dwork =to_delayed_work (work);struct mlx5_core_dev *mdev;struct mlx5_timer *timer;struct mlx5_clock *clock;unsigned long flags; - timer = container_of(dwork, struct mlx5_timer, overflow_work); - clock = container_of(timer, struct mlx5_clock, timer); + clock = container_of(ptp_info, struct mlx5_clock, ptp_info); mdev = container_of(clock, struct mlx5_core_dev, clock); + timer = &clock->timer;if (mdev->state ==MLX5_DEVICE_STATE_INTERNAL_ERROR ) goto out;
@@ -258,7 +257,7 @@ static void mlx5_timestamp_overflow(struct work_struct *work)write_sequnlock_irqrestore (&clock->lock, flags); out: -schedule_delayed_work (&timer->overflow_work, timer->overflow_period); +return timer->overflow_period; } static int mlx5_ptp_settime_real_time(struct mlx5_core_dev *mdev,
@@ -435,6 +434,7 @@ static int mlx5_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) timer->cycles.mult = mult;mlx5_update_clock_info_page (mdev);write_sequnlock_irqrestore (&clock->lock, flags); +ptp_schedule_worker (clock->ptp, timer->overflow_period);return 0 ; }
@@ -770,6 +770,7 @@ static const struct ptp_clock_info mlx5_ptp_clock_info = { .settime64 = mlx5_ptp_settime, .enable = NULL, .verify = NULL, + .do_aux_work = mlx5_timestamp_overflow, }; static int mlx5_query_mtpps_pin_mode(struct mlx5_core_dev *mdev, u8 pin,
@@ -970,12 +971,11 @@ static void mlx5_init_overflow_period(struct mlx5_clock *clock)do_div (ns,NSEC_PER_SEC /HZ ); timer->overflow_period = ns; -INIT_DELAYED_WORK (&timer->overflow_work, mlx5_timestamp_overflow); -if (timer->overflow_period) -schedule_delayed_work (&timer->overflow_work,0 ); -else +if (!timer->overflow_period) { + timer->overflow_period =HZ ;mlx5_core_warn (mdev, -"invalid overflow period, overflow_work is not scheduled\n" ); +"invalid overflow period, overflow_work is scheduled once per second\n" ); + }if (clock_info) clock_info->overflow_period = timer->overflow_period;
@@ -1061,6 +1061,9 @@ void mlx5_init_clock(struct mlx5_core_dev *mdev)MLX5_NB_INIT (&clock->pps_nb, mlx5_pps_event,PPS_EVENT );mlx5_eq_notifier_register (mdev, &clock->pps_nb); + +if (clock->ptp) +ptp_schedule_worker (clock->ptp,0 ); }void mlx5_cleanup_clock (struct mlx5_core_dev *mdev)
@@ -1077,7 +1080,6 @@ void mlx5_cleanup_clock(struct mlx5_core_dev *mdev) }cancel_work_sync (&clock->pps_info.out_work); -cancel_delayed_work_sync (&clock->timer.overflow_work);if (mdev->clock_info) {free_page ((unsigned long )mdev->clock_info);
include/linux/mlx5/driver.h +0 -1
@@ -709,7 +709,6 @@ struct mlx5_timer {struct timecounter tc;u32 nominal_c_mult;unsigned long overflow_period; -struct delayed_work overflow_work; };struct mlx5_clock {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/273 wifi: brcmfmac: Check the return value of of_property_read_string_index()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Dösinger <[email protected]>
[ Upstream commit 082d9e263af8de68f0c34f67b251818205160f6e ]
Somewhen between 6.10 and 6.11 the driver started to crash on my MacBookPro14,3. The property doesn't exist and 'tmp' remains uninitialized, so we pass a random pointer to devm_kstrdup().
The crash I am getting looks like this:
BUG: unable to handle page fault for address: 00007f033c669379 PF: supervisor read access in kernel mode PF: error_code(0x0001) - permissions violation PGD 8000000101341067 P4D 8000000101341067 PUD 101340067 PMD 1013bb067 PTE 800000010aee9025 Oops: Oops: 0001 [#1] SMP PTI CPU: 4 UID: 0 PID: 827 Comm: (udev-worker) Not tainted 6.11.8-gentoo #1 Hardware name: Apple Inc. MacBookPro14,3/Mac-551B86E5744E2388, BIOS 529.140.2.0.0 06/23/2024 RIP: 0010:strlen+0x4/0x30 Code: f7 75 ec 31 c0 c3 cc cc cc cc 48 89 f8 c3 cc cc cc cc 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa <80> 3f 00 74 14 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 c3 cc RSP: 0018:ffffb4aac0683ad8 EFLAGS: 00010202 RAX: 00000000ffffffea RBX: 00007f033c669379 RCX: 0000000000000001 RDX: 0000000000000cc0 RSI: 00007f033c669379 RDI: 00007f033c669379 RBP: 00000000ffffffea R08: 0000000000000000 R09: 00000000c0ba916a R10: ffffffffffffffff R11: ffffffffb61ea260 R12: ffff91f7815b50c8 R13: 0000000000000cc0 R14: ffff91fafefffe30 R15: ffffb4aac0683b30 FS: 00007f033ccbe8c0(0000) GS:ffff91faeed00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f033c669379 CR3: 0000000107b1e004 CR4: 00000000003706f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ? __die+0x23/0x70 ? page_fault_oops+0x149/0x4c0 ? raw_spin_rq_lock_nested+0xe/0x20 ? sched_balance_newidle+0x22b/0x3c0 ? update_load_avg+0x78/0x770 ? exc_page_fault+0x6f/0x150 ? asm_exc_page_fault+0x26/0x30 ? __pfx_pci_conf1_write+0x10/0x10 ? strlen+0x4/0x30 devm_kstrdup+0x25/0x70 brcmf_of_probe+0x273/0x350 [brcmfmac]
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +4 -4
@@ -96,13 +96,13 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,/* Set board-type to the first string of the machine compatible prop */ root =of_find_node_by_path ("/" );if (root && err) { -char *board_type; +char *board_type =NULL ;const char *tmp; -of_property_read_string_index (root,"compatible" ,0 , &tmp); -/* get rid of '/' in the compatible string to be able to find the FW */ - board_type =devm_kstrdup (dev, tmp,GFP_KERNEL ); +if (!of_property_read_string_index (root,"compatible" ,0 , &tmp)) + board_type =devm_kstrdup (dev, tmp,GFP_KERNEL ); +if (!board_type) {of_node_put (root);return ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/273 wifi: iwlwifi: avoid memory leak
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miri Korenblit <[email protected]>
[ Upstream commit 80e96206a3ef348fbd658d98f2f43149c36df8bc ]
A caller of iwl_acpi_get_dsm_object must free the returned object. iwl_acpi_get_dsm_integer returns immediately without freeing it if the expected size is more than 8 bytes. Fix that.
Note that with the current code this will never happen, since the caller of iwl_acpi_get_dsm_integer already checks that the expected size if either 1 or 4 bytes, so it can't exceed 8 bytes.
While at it, print the DSM value instead of the return value, as this was the intention in the first place.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +8 -5
@@ -155,7 +155,7 @@ static int iwl_acpi_get_dsm_integer(struct device *dev, int rev, int func, size_t expected_size) {union acpi_object *obj; -int ret =0 ; +int ret; obj =iwl_acpi_get_dsm_object (dev, rev, func,NULL , guid);if (IS_ERR (obj)) {
@@ -170,8 +170,10 @@ static int iwl_acpi_get_dsm_integer(struct device *dev, int rev, int func, }else if (obj->type ==ACPI_TYPE_BUFFER ) {__le64 le_value =0 ; -if (WARN_ON_ONCE (expected_size >sizeof (le_value))) -return -EINVAL ; +if (WARN_ON_ONCE (expected_size >sizeof (le_value))) { + ret = -EINVAL ; + goto out; + }/* if the buffer size doesn't match the expected size */ if (obj->buffer.length != expected_size)
@@ -192,8 +194,9 @@ static int iwl_acpi_get_dsm_integer(struct device *dev, int rev, int func, }IWL_DEBUG_DEV_RADIO (dev, -"ACPI: DSM method evaluated: func=%d, ret=%d\n" , - func, ret); +"ACPI: DSM method evaluated: func=%d, value=%lld\n" , + func, *value); + ret =0 ; out:ACPI_FREE (obj);return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/273 tun: fix group permission check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stas Sergeev <[email protected]>
[ Upstream commit 3ca459eaba1bf96a8c7878de84fa8872259a01e3 ]
Currently tun checks the group permission even if the user have matched. Besides going against the usual permission semantic, this has a very interesting implication: if the tun group is not among the supplementary groups of the tun user, then effectively no one can access the tun device. CAP_SYS_ADMIN still can, but its the same as not setting the tun ownership.
This patch relaxes the group checking so that either the user match or the group match is enough. This avoids the situation when no one can access the device even though the ownership is properly set.
Also I simplified the logic by removing the redundant inversions:tun_not_capable() --> !tun_capable()
--- drivers/net/tun.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/tun.c +9 -5
@@ -574,14 +574,18 @@ static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb,return ret; } -static inline bool tun_not_capable (struct tun_struct *tun) +static inline bool tun_capable (struct tun_struct *tun) {const struct cred *cred =current_cred ();struct net *net =dev_net (tun->dev); -return ((uid_valid (tun->owner) && !uid_eq (cred->euid, tun->owner)) || - (gid_valid (tun->group) && !in_egroup_p (tun->group))) && - !ns_capable (net->user_ns,CAP_NET_ADMIN ); +if (ns_capable (net->user_ns,CAP_NET_ADMIN )) +return 1 ; +if (uid_valid (tun->owner) &&uid_eq (cred->euid, tun->owner)) +return 1 ; +if (gid_valid (tun->group) &&in_egroup_p (tun->group)) +return 1 ; +return 0 ; }static void tun_set_real_num_queues (struct tun_struct *tun)
@@ -2778,7 +2782,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) !!(tun->flags & IFF_MULTI_QUEUE))return -EINVAL ; -if (tun_not_capable (tun)) +if (!tun_capable (tun))return -EPERM ; err =security_tun_dev_open (tun->security);if (err <0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 65/273 net: bcmgenet: Correct overlaying of PHY and MAC Wake-on-LAN
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
[ Upstream commit 46ded709232344b5750a852747a8881763c721ab ]
Some Wake-on-LAN modes such as WAKE_FILTER may only be supported by the MAC, while others might be only supported by the PHY. Make sure that the .get_wol() returns the union of both rather than only that of the PHY if the PHY supports Wake-on-LAN.
When disabling Wake-on-LAN, make sure that this is done at both the PHY and MAC level, rather than doing an early return from the PHY driver.
--- .../net/ethernet/broadcom/genet/bcmgenet_wol.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +12 -4
@@ -41,9 +41,12 @@ void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) {struct bcmgenet_priv *priv =netdev_priv (dev);struct device *kdev = &priv->pdev->dev; +u32 phy_wolopts =0 ; -if (dev->phydev) +if (dev->phydev) {phy_ethtool_get_wol (dev->phydev, wol); + phy_wolopts = wol->wolopts; + }/* MAC is not wake-up capable, return what the PHY does */ if (!device_can_wakeup (kdev))
@@ -51,9 +54,14 @@ void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)/* Overlay MAC capabilities with that of the PHY queried before */ wol->supported |=WAKE_MAGIC |WAKE_MAGICSECURE |WAKE_FILTER ; - wol->wolopts = priv->wolopts; -memset (wol->sopass,0 ,sizeof (wol->sopass)); + wol->wolopts |= priv->wolopts; +/* Return the PHY configured magic password */ +if (phy_wolopts &WAKE_MAGICSECURE ) +return ; + +/* Otherwise the MAC one */ +memset (wol->sopass,0 ,sizeof (wol->sopass));if (wol->wolopts &WAKE_MAGICSECURE )memcpy (wol->sopass, priv->sopass,sizeof (priv->sopass)); }
@@ -70,7 +78,7 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)/* Try Wake-on-LAN from the PHY first */ if (dev->phydev) { ret =phy_ethtool_set_wol (dev->phydev, wol); -if (ret != -EOPNOTSUPP ) +if (ret != -EOPNOTSUPP && wol->wolopts)return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 74/273 x86/xen: fix xen_hypercall_hvm() to not clobber %rbx
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Juergen Gross <[email protected]>
[ Upstream commit 98a5cfd2320966f40fe049a9855f8787f0126825 ]
xen_hypercall_hvm(), which is used when running as a Xen PVH guest at most only once during early boot, is clobbering %rbx. Depending on whether the caller relies on %rbx to be preserved across the call or not, this clobbering might result in an early crash of the system.
This can be avoided by using an already saved register instead of %rbx.
--- arch/x86/xen/xen-head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/xen/xen-head.S +2 -2
@@ -117,8 +117,8 @@ SYM_FUNC_START(xen_hypercall_hvm) pop %ebx pop %eax #else - lea xen_hypercall_amd(%rip), %rbx - cmp %rax, %rbx + lea xen_hypercall_amd(%rip), %rcx + cmp %rax, %rcx #ifdef CONFIG_FRAME_POINTER pop %rax /* Dummy pop. */ #endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 75/273 x86/xen: add FRAME_END to xen_hypercall_hvm()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Juergen Gross <[email protected]>
[ Upstream commit 0bd797b801bd8ee06c822844e20d73aaea0878dd ]
xen_hypercall_hvm() is missing a FRAME_END at the end, add it.
--- arch/x86/xen/xen-head.S | 1 + 1 file changed, 1 insertion(+)
arch/x86/xen/xen-head.S +1 -0
@@ -132,6 +132,7 @@ SYM_FUNC_START(xen_hypercall_hvm) pop %rcx pop %rax #endif + FRAME_END /* Use correct hypercall function. */ jz xen_hypercall_amd jmp xen_hypercall_intel
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 76/273 ACPI: property: Fix return value for nval == 0 in acpi_data_prop_read()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit ab930483eca9f3e816c35824b5868599af0c61d7 ]
While analysing code for software and OF node for the corner case when caller asks to read zero items in the supposed to be an array of values I found that ACPI behaves differently to what OF does, i.e.
1. It returns -EINVAL when caller asks to read zero items from integer array, while OF returns 0, if no other errors happened.
2. It returns -EINVAL when caller asks to read zero items from string array, while OF returns -ENODATA, if no other errors happened.
Amend ACPI implementation to follow what OF does.
--- drivers/acpi/property.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/property.c +5 -5
@@ -1116,8 +1116,6 @@ static int acpi_data_prop_read(const struct acpi_device_data *data, }break ; } -if (nval ==0 ) -return -EINVAL ;if (obj->type ==ACPI_TYPE_BUFFER ) {if (proptype !=DEV_PROP_U8 )
@@ -1141,9 +1139,11 @@ static int acpi_data_prop_read(const struct acpi_device_data *data, ret =acpi_copy_property_array_uint (items, (u64 *)val, nval);break ;case DEV_PROP_STRING : - ret =acpi_copy_property_array_string ( - items, (char **)val, -min_t (u32, nval, obj->package.count)); + nval =min_t (u32, nval, obj->package.count); +if (nval ==0 ) +return -ENODATA ; + + ret =acpi_copy_property_array_string (items, (char **)val, nval);break ;default : ret = -EINVAL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 77/273 netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 638ba5089324796c2ee49af10427459c2de35f71 ]
qdisc_tree_reduce_backlog() notifies parent qdisc only if child qdisc becomes empty, therefore we need to reduce the backlog of the child qdisc before calling it. Otherwise it would miss the opportunity to call cops->qlen_notify(), in the case of DRR, it resulted in UAF since DRR uses ->qlen_notify() to maintain its active list.
--- net/sched/sch_netem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_netem.c +1 -1
@@ -748,9 +748,9 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)if (err !=NET_XMIT_SUCCESS ) {if (net_xmit_drop_count (err))qdisc_qstats_drop (sch); -qdisc_tree_reduce_backlog (sch,1 , pkt_len); sch->qstats.backlog -= pkt_len; sch->q.qlen--; +qdisc_tree_reduce_backlog (sch,1 , pkt_len); } goto tfifo_dequeue; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/273 tun: revert fix group permission check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit a70c7b3cbc0688016810bb2e0b9b8a0d6a530045 ]
This reverts commit 3ca459eaba1bf96a8c7878de84fa8872259a01e3.
The blamed commit caused a regression when neither tun->owner nor tun->group is set. This is intended to be allowed, but now requires CAP_NET_ADMIN.
Discussion in the referenced thread pointed out that the original issue that prompted this patch can be resolved in userspace.
The relaxed access control may also make a device accessible when it previously wasn't, while existing users may depend on it to not be.
This is a clean pure git revert, except for fixing the indentation on the gid_valid line that checkpatch correctly flagged.
--- drivers/net/tun.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/net/tun.c +5 -9
@@ -574,18 +574,14 @@ static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb,return ret; } -static inline bool tun_capable (struct tun_struct *tun) +static inline bool tun_not_capable (struct tun_struct *tun) {const struct cred *cred =current_cred ();struct net *net =dev_net (tun->dev); -if (ns_capable (net->user_ns,CAP_NET_ADMIN )) -return 1 ; -if (uid_valid (tun->owner) &&uid_eq (cred->euid, tun->owner)) -return 1 ; -if (gid_valid (tun->group) &&in_egroup_p (tun->group)) -return 1 ; -return 0 ; +return ((uid_valid (tun->owner) && !uid_eq (cred->euid, tun->owner)) || + (gid_valid (tun->group) && !in_egroup_p (tun->group))) && + !ns_capable (net->user_ns,CAP_NET_ADMIN ); }static void tun_set_real_num_queues (struct tun_struct *tun)
@@ -2782,7 +2778,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) !!(tun->flags & IFF_MULTI_QUEUE))return -EINVAL ; -if (!tun_capable (tun)) +if (tun_not_capable (tun))return -EPERM ; err =security_tun_dev_open (tun->security);if (err <0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/273 net: sched: Fix truncation of offloaded action statistics
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 811b8f534fd85e17077bd2ac0413bcd16cc8fb9b ]
In case of tc offload, when user space queries the kernel for tc action statistics, tc will query the offloaded statistics from device drivers. Among other statistics, drivers are expected to pass the number of packets that hit the action since the last query as a 64-bit number.
Unfortunately, tc treats the number of packets as a 32-bit number, leading to truncation and incorrect statistics when the number of packets since the last query exceeds 0xffffffff:
$ tc -s filter show dev swp2 ingress
filter protocol all pref 1 flower chain 0
filter protocol all pref 1 flower chain 0 handle 0x1
skip_sw
in_hw in_hw_count 1
action order 1: mirred (Egress Redirect to device swp1) stolen
index 1 ref 1 bind 1 installed 58 sec used 0 sec
Action statistics:
Sent 1133877034176 bytes 536959475 pkt (dropped 0, overlimits 0 requeues 0)
[...]According to the above, 2111-byte packets were redirected which is impossible as only 64-byte packets were transmitted and the MTU was 1500.
Fix by treating packets as a 64-bit number:
$ tc -s filter show dev swp2 ingress
filter protocol all pref 1 flower chain 0
filter protocol all pref 1 flower chain 0 handle 0x1
skip_sw
in_hw in_hw_count 1
action order 1: mirred (Egress Redirect to device swp1) stolen
index 1 ref 1 bind 1 installed 61 sec used 0 sec
Action statistics:
Sent 1370624380864 bytes 21416005951 pkt (dropped 0, overlimits 0 requeues 0)
[...]Which shows that only 64-byte packets were redirected (1370624380864 / 21416005951 = 64).
--- include/net/sch_generic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/sch_generic.h +1 -1
@@ -849,7 +849,7 @@ static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch, }static inline void _bstats_update (struct gnet_stats_basic_sync *bstats, -__u64 bytes,__u32 packets) +__u64 bytes,__u64 packets) {u64_stats_update_begin (&bstats->syncp);u64_stats_add (&bstats->bytes, bytes);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/273 rxrpc: Fix call state set to not include the SERVER_SECURING state
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 41b996ce83bf944de5569d6263c8dbd5513e7ed0 ]
The RXRPC_CALL_SERVER_SECURING state doesn't really belong with the other states in the call's state set as the other states govern the call's Rx/Tx phase transition and govern when packets can and can't be received or transmitted. The "Securing" state doesn't actually govern the reception of packets and would need to be split depending on whether or not we've received the last packet yet (to mirror RECV_REQUEST/ACK_REQUEST).
The "Securing" state is more about whether or not we can start forwarding packets to the application as recvmsg will need to decode them and the decoding can't take place until the challenge/response exchange has completed.
Fix this by removing the RXRPC_CALL_SERVER_SECURING state from the state set and, instead, using a flag, RXRPC_CALL_CONN_CHALLENGING, to track whether or not we can queue the call for reception by recvmsg() or notify the kernel app that data is ready. In the event that we've already received all the packets, the connection event handler will poke the app layer in the appropriate manner.
Also there's a race whereby the app layer sees the last packet before rxrpc has managed to end the rx phase and change the state to one amenable to allowing a reply. Fix this by queuing the packet after calling rxrpc_end_rx_phase().
--- net/rxrpc/ar-internal.h | 2 +- net/rxrpc/call_object.c | 6 ++---- net/rxrpc/conn_event.c | 4 +--- net/rxrpc/input.c | 2 +- net/rxrpc/sendmsg.c | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-)
net/rxrpc/ar-internal.h +1 -1
@@ -558,6 +558,7 @@ enum rxrpc_call_flag {RXRPC_CALL_EXCLUSIVE ,/* The call uses a once-only connection */ RXRPC_CALL_RX_IS_IDLE ,/* recvmsg() is idle - send an ACK */ RXRPC_CALL_RECVMSG_READ_ALL ,/* recvmsg() read all of the received data */ + RXRPC_CALL_CONN_CHALLENGING, /* The connection is being challenged */ };/*
@@ -578,7 +579,6 @@ enum rxrpc_call_state {RXRPC_CALL_CLIENT_AWAIT_REPLY ,/* - client awaiting reply */ RXRPC_CALL_CLIENT_RECV_REPLY ,/* - client receiving reply phase */ RXRPC_CALL_SERVER_PREALLOC ,/* - service preallocation */ -RXRPC_CALL_SERVER_SECURING ,/* - server securing request connection */ RXRPC_CALL_SERVER_RECV_REQUEST ,/* - server receiving request */ RXRPC_CALL_SERVER_ACK_REQUEST ,/* - server pending ACK of request */ RXRPC_CALL_SERVER_SEND_REPLY, /* - server sending reply */
net/rxrpc/call_object.c +2 -4
@@ -22,7 +22,6 @@ const char *const rxrpc_call_states[NR__RXRPC_CALL_STATES] = { [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl", [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl", [RXRPC_CALL_SERVER_PREALLOC] = "SvPrealc", - [RXRPC_CALL_SERVER_SECURING] = "SvSecure", [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq", [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq", [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl",
@@ -458,17 +457,16 @@ void rxrpc_incoming_call(struct rxrpc_sock *rx, call->cong_tstamp = skb->tstamp;__set_bit (RXRPC_CALL_EXPOSED , &call->flags); -rxrpc_set_call_state (call,RXRPC_CALL_SERVER_SECURING ); +rxrpc_set_call_state (call,RXRPC_CALL_SERVER_RECV_REQUEST );spin_lock (&conn->state_lock);switch (conn->state) {case RXRPC_CONN_SERVICE_UNSECURED :case RXRPC_CONN_SERVICE_CHALLENGING : -rxrpc_set_call_state (call,RXRPC_CALL_SERVER_SECURING ); +__set_bit (RXRPC_CALL_CONN_CHALLENGING , &call->flags);break ;case RXRPC_CONN_SERVICE : -rxrpc_set_call_state (call,RXRPC_CALL_SERVER_RECV_REQUEST );break ;case RXRPC_CONN_ABORTED :
net/rxrpc/conn_event.c +1 -3
@@ -222,10 +222,8 @@ static void rxrpc_abort_calls(struct rxrpc_connection *conn)*/ static void rxrpc_call_is_secure (struct rxrpc_call *call) { -if (call &&__rxrpc_call_state (call) ==RXRPC_CALL_SERVER_SECURING ) { -rxrpc_set_call_state (call,RXRPC_CALL_SERVER_RECV_REQUEST ); +if (call &&__test_and_clear_bit (RXRPC_CALL_CONN_CHALLENGING , &call->flags))rxrpc_notify_socket (call); - } }/*
net/rxrpc/input.c +1 -1
@@ -574,7 +574,7 @@ static bool rxrpc_input_split_jumbo(struct rxrpc_call *call, struct sk_buff *skbrxrpc_propose_delay_ACK (call, sp->hdr.serial, rxrpc_propose_ack_input_data); } -if (notify) { +if (notify && !test_bit (RXRPC_CALL_CONN_CHALLENGING , &call->flags)) {trace_rxrpc_notify_socket (call->debug_id, sp->hdr.serial);rxrpc_notify_socket (call); }
net/rxrpc/sendmsg.c +1 -1
@@ -658,7 +658,7 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len) }else {switch (rxrpc_call_state (call)) {case RXRPC_CALL_CLIENT_AWAIT_CONN : -case RXRPC_CALL_SERVER_SECURING : +case RXRPC_CALL_SERVER_RECV_REQUEST :if (p.command ==RXRPC_CMD_SEND_ABORT )break ; fallthrough;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/273 cpufreq: s3c64xx: Fix compilation warning
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
commit 43855ac61483cb914f060851535ea753c094b3e0 upstream.
The driver generates following warning when regulator support isn't enabled in the kernel. Fix it.
drivers/cpufreq/s3c64xx-cpufreq.c: In function 's3c64xx_cpufreq_set_target':
Quoted 1 line
Quoted 1 line
drivers/cpufreq/s3c64xx-cpufreq.c:55:22: warning: variable 'old_freq' set but not used [-Wunused-but-set-variable]
55 | unsigned int old_freq, new_freq;
| ^~~~~~~~Quoted 1 line
Quoted 1 line
drivers/cpufreq/s3c64xx-cpufreq.c:54:30: warning: variable 'dvfs' set but not used [-Wunused-but-set-variable]
54 | struct s3c64xx_dvfs *dvfs;
| ^~~~--- drivers/cpufreq/s3c64xx-cpufreq.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/cpufreq/s3c64xx-cpufreq.c +7 -4
@@ -24,6 +24,7 @@ struct s3c64xx_dvfs {unsigned int vddarm_max; }; +#ifdef CONFIG_REGULATOR static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = { [0 ] = {1000000 ,1150000 }, [1] = { 1050000, 1150000 },
@@ -31,6 +32,7 @@ static struct s3c64xx_dvfs s3c64xx_dvfs_ [3] = { 1200000, 1350000 }, [4] = { 1300000, 1350000 }, }; +#endif static struct cpufreq_frequency_table s3c64xx_freq_table[] = { {0 ,0 ,66000 },
@@ -51,15 +53,16 @@ static struct cpufreq_frequency_table s3 static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) { - struct s3c64xx_dvfs *dvfs; - unsigned int old_freq, new_freq; + unsigned int new_freq = s3c64xx_freq_table[index].frequency; int ret; +#ifdef CONFIG_REGULATOR + struct s3c64xx_dvfs *dvfs; + unsigned int old_freq; + old_freq = clk_get_rate(policy->clk) / 1000; - new_freq = s3c64xx_freq_table[index].frequency; dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[index].driver_data]; -#ifdef CONFIG_REGULATOR if (vddarm && new_freq > old_freq) { ret = regulator_set_voltage(vddarm, dvfs->vddarm_min,
Greg Kroah-Hartman
maintainerPATCH 82/273 leds: lp8860: Write full EEPROM, not only half of it
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Sverdlin <[email protected]>
commit 0d2e820a86793595e2a776855d04701109e46663 upstream.
I struggle to explain dividing an ARRAY_SIZE() by the size of an element once again. As the latter equals to 2, only the half of EEPROM was ever written. Drop the unexplainable division and write full ARRAY_SIZE().
--- drivers/leds/leds-lp8860.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-lp8860.c +1 -1
@@ -265,7 +265,7 @@ static int lp8860_init(struct lp8860_led goto out; } - reg_count =ARRAY_SIZE (lp8860_eeprom_disp_regs) /sizeof (lp8860_eeprom_disp_regs[0 ]); + reg_count =ARRAY_SIZE (lp8860_eeprom_disp_regs);for (i =0 ; i < reg_count; i++) { ret = regmap_write(led->eeprom_regmap, lp8860_eeprom_disp_regs[i].reg,
Greg Kroah-Hartman
maintainerPATCH 83/273 ALSA: hda/realtek: Enable Mute LED on HP Laptop 14s-fq1xxx
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Wiese-Wagner <[email protected]>
commit 711aad3c43a9853657e00225466d204e46ae528b upstream.
This HP Laptop uses ALC236 codec with COEF 0x07 controlling the mute LED. Enable existing quirk for this device.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9949,6 +9949,7 @@ static const struct hda_quirk alc269_fixSND_PCI_QUIRK (0x103c ,0x8870 ,"HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ),SND_PCI_QUIRK (0x103c ,0x8873 ,"HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ),SND_PCI_QUIRK (0x103c ,0x887a ,"HP Laptop 15s-eq2xxx" ,ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 ), +SND_PCI_QUIRK (0x103c ,0x887c ,"HP Laptop 14s-fq1xxx" ,ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 ),SND_PCI_QUIRK (0x103c ,0x888a ,"HP ENVY x360 Convertible 15-eu0xxx" ,ALC245_FIXUP_HP_X360_MUTE_LEDS ),SND_PCI_QUIRK (0x103c ,0x888d ,"HP ZBook Power 15.6 inch G8 Mobile Workstation PC" ,ALC236_FIXUP_HP_GPIO_LED ), SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
Greg Kroah-Hartman
maintainerPATCH 66/273 ice: Add check for devm_kzalloc()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiasheng Jiang <[email protected]>
[ Upstream commit a8aa6a6ddce9b5585f2b74f27f3feea1427fb4e7 ]
Add check for the return value of devm_kzalloc() to guarantee the success of allocation.
--- drivers/net/ethernet/intel/ice/ice_devlink.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ice/ice_devlink.c +3 -0
@@ -999,6 +999,9 @@ static int ice_devlink_rate_node_new(struct devlink_rate *rate_node, void **priv/* preallocate memory for ice_sched_node */ node =devm_kzalloc (ice_hw_to_dev (pi->hw),sizeof (*node),GFP_KERNEL ); +if (!node) +return -ENOMEM ; + *priv = node;return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/273 drm/modeset: Handle tiled displays in pan_display_atomic.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maarten Lankhorst <[email protected]>
commit f4a9dd57e549a17a7dac1c1defec26abd7e5c2d4 upstream.
Tiled displays have a different x/y offset to begin with. Instead of attempting to remember this, just apply a delta instead.
This fixes the first tile being duplicated on other tiles when vt switching.
--- drivers/gpu/drm/drm_fb_helper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +8 -6
@@ -1361,14 +1361,14 @@ int drm_fb_helper_set_par(struct fb_info }EXPORT_SYMBOL (drm_fb_helper_set_par); -static void pan_set (struct drm_fb_helper *fb_helper,int x,int y) +static void pan_set (struct drm_fb_helper *fb_helper,int dx,int dy) {struct drm_mode_set *mode_set;mutex_lock (&fb_helper->client.modeset_mutex);drm_client_for_each_modeset (mode_set, &fb_helper->client) { - mode_set->x = x; - mode_set->y = y; + mode_set->x += dx; + mode_set->y += dy; }mutex_unlock (&fb_helper->client.modeset_mutex); }
@@ -1377,16 +1377,18 @@ static int pan_display_atomic(struct fb_ struct fb_info *info) {struct drm_fb_helper *fb_helper = info->par; -int ret; +int ret, dx, dy; -pan_set (fb_helper, var->xoffset, var->yoffset); + dx = var->xoffset - info->var.xoffset; + dy = var->yoffset - info->var.yoffset; +pan_set (fb_helper, dx, dy); ret =drm_client_modeset_commit_locked (&fb_helper->client);if (!ret) { info->var.xoffset = var->xoffset; info->var.yoffset = var->yoffset; }else -pan_set (fb_helper, info->var.xoffset, info->var.yoffset); +pan_set (fb_helper, -dx, -dy);return ret; }
Greg Kroah-Hartman
maintainerPATCH 85/273 smb: client: fix order of arguments of tracepoints
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruben Devos <[email protected]>
commit 11f8b80ab9f99291dc88d09855b9f8f43b772335 upstream.
The tracepoints based on smb3_inf_compound_*_class have tcon id and session id swapped around. This results in incorrect output in trace-cmd report.
Fix the order of arguments to resolve this issue. The trace-cmd output below shows the before and after of the smb3_delete_enter and smb3_delete_done events as an example. The smb3_cmd_* events show the correct session and tcon id for reference.
Also fix tracepoint set -> get in the SMB2_OP_GET_REPARSE case.
BEFORE:
rm-2211 [001] ..... 1839.550888: smb3_delete_enter: xid=281 sid=0x5 tid=0x3d path=\hello2.txt rm-2211 [001] ..... 1839.550894: smb3_cmd_enter: sid=0x1ac000000003d tid=0x5 cmd=5 mid=61 rm-2211 [001] ..... 1839.550896: smb3_cmd_enter: sid=0x1ac000000003d tid=0x5 cmd=6 mid=62 rm-2211 [001] ..... 1839.552091: smb3_cmd_done: sid=0x1ac000000003d tid=0x5 cmd=5 mid=61 rm-2211 [001] ..... 1839.552093: smb3_cmd_done: sid=0x1ac000000003d tid=0x5 cmd=6 mid=62 rm-2211 [001] ..... 1839.552103: smb3_delete_done: xid=281 sid=0x5 tid=0x3d
AFTER:
rm-2501 [001] ..... 3237.656110: smb3_delete_enter: xid=88 sid=0x1ac0000000041 tid=0x5 path=\hello2.txt rm-2501 [001] ..... 3237.656122: smb3_cmd_enter: sid=0x1ac0000000041 tid=0x5 cmd=5 mid=84 rm-2501 [001] ..... 3237.656123: smb3_cmd_enter: sid=0x1ac0000000041 tid=0x5 cmd=6 mid=85 rm-2501 [001] ..... 3237.657909: smb3_cmd_done: sid=0x1ac0000000041 tid=0x5 cmd=5 mid=84 rm-2501 [001] ..... 3237.657909: smb3_cmd_done: sid=0x1ac0000000041 tid=0x5 cmd=6 mid=85 rm-2501 [001] ..... 3237.657922: smb3_delete_done: xid=88 sid=0x1ac0000000041 tid=0x5
--- fs/smb/client/dir.c | 6 +- fs/smb/client/smb2inode.c | 108 +++++++++++++++++++++++----------------------- 2 files changed, 57 insertions(+), 57 deletions(-)
fs/smb/client/dir.c +3 -3
@@ -627,7 +627,7 @@ int cifs_mknod(struct mnt_idmap *idmap, goto mknod_out; } -trace_smb3_mknod_enter (xid, tcon->ses->Suid, tcon->tid, full_path); +trace_smb3_mknod_enter (xid, tcon->tid, tcon->ses->Suid, full_path); rc = tcon->ses->server->ops->make_node(xid, inode, direntry, tcon, full_path, mode,
@@ -635,9 +635,9 @@ int cifs_mknod(struct mnt_idmap *idmap, mknod_out:if (rc) -trace_smb3_mknod_err (xid, tcon->ses->Suid, tcon->tid, rc); +trace_smb3_mknod_err (xid, tcon->tid, tcon->ses->Suid, rc);else -trace_smb3_mknod_done (xid, tcon->ses->Suid, tcon->tid); +trace_smb3_mknod_done (xid, tcon->tid, tcon->ses->Suid);free_dentry_path (page);free_xid (xid);
fs/smb/client/smb2inode.c +54 -54
246 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 86/273 smb: client: change lease epoch type from unsigned int to __u16
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Meetakshi Setiya <[email protected]>
commit 57e4a9bd61c308f607bc3e55e8fa02257b06b552 upstream.
MS-SMB2 section 2.2.13.2.10 specifies that 'epoch' should be a 16-bit unsigned integer used to track lease state changes. Change the data type of all instances of 'epoch' from unsigned int to __u16. This simplifies the epoch change comparisons and makes the code more compliant with the protocol spec.
--- fs/smb/client/cifsglob.h | 14 +++++++------- fs/smb/client/smb1ops.c | 2 +- fs/smb/client/smb2ops.c | 18 +++++++++--------- fs/smb/client/smb2pdu.c | 2 +- fs/smb/client/smb2proto.h | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-)
fs/smb/client/cifsglob.h +7 -7
@@ -323,7 +323,7 @@ struct smb_version_operations {int (*handle_cancelled_mid)(struct mid_q_entry *,struct TCP_Server_Info *);void (*downgrade_oplock)(struct TCP_Server_Info *server,struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache); +__u16 epoch,bool *purge_cache);/* process transaction2 response */ bool (*check_trans2)(struct mid_q_entry *,struct TCP_Server_Info *,char *,int );
@@ -519,12 +519,12 @@ struct smb_version_operations {/* if we can do cache read operations */ bool (*is_read_op)(__u32 );/* set oplock level for the inode */ -void (*set_oplock_level)(struct cifsInodeInfo *,__u32 ,unsigned int , -bool *); +void (*set_oplock_level)(struct cifsInodeInfo *cinode,__u32 oplock,__u16 epoch, +bool *purge_cache);/* create lease context buffer for CREATE request */ char * (*create_lease_buf)(u8 *lease_key,u8 oplock);/* parse lease context buffer and return oplock/epoch info */ -__u8 (*parse_lease_buf)(void *buf,unsigned int *epoch,char *lkey); +__u8 (*parse_lease_buf)(void *buf, __u16 *epoch, char *lkey); ssize_t (*copychunk_range)(const unsigned int, struct cifsFileInfo *src_file, struct cifsFileInfo *target_file,
@@ -1412,7 +1412,7 @@ struct cifs_fid {__u8 create_guid[16 ];__u32 access;struct cifs_pending_open *pending_open; -unsigned int epoch; +__u16 epoch;#ifdef CONFIG_CIFS_DEBUG2 __u64 mid;#endif /* CIFS_DEBUG2 */
@@ -1445,7 +1445,7 @@ struct cifsFileInfo { bool oplock_break_cancelled:1; bool status_file_deleted:1; /* file has been deleted */ bool offload:1; /* offload final part of _put to a wq */ -unsigned int oplock_epoch;/* epoch from the lease break */ +__u16 oplock_epoch;/* epoch from the lease break */ __u32 oplock_level;/* oplock/lease level from the lease break */ int count;spinlock_t file_info_lock;/* protects four flag/count fields above */
@@ -1584,7 +1584,7 @@ struct cifsInodeInfo {spinlock_t open_file_lock;/* protects openFileList */ __u32 cifsAttrs;/* e.g. DOS archive bit, sparse, compressed, system */ unsigned int oplock;/* oplock/lease level we have */ -unsigned int epoch;/* used to track lease state changes */ +__u16 epoch;/* used to track lease state changes */ #define CIFS_INODE_PENDING_OPLOCK_BREAK (0)/* oplock break in progress */ #define CIFS_INODE_PENDING_WRITERS (1)/* Writes in progress */ #define CIFS_INODE_FLAG_UNUSED (2)/* Unused flag */
fs/smb/client/smb1ops.c +1 -1
@@ -377,7 +377,7 @@ coalesce_t2(char *second_buf, struct smbstatic void cifs_downgrade_oplock (struct TCP_Server_Info *server,struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache) +__u16 epoch,bool *purge_cache) {cifs_set_oplock_level (cinode, oplock); }
fs/smb/client/smb2ops.c +9 -9
@@ -3867,22 +3867,22 @@ static long smb3_fallocate(struct file *static void smb2_downgrade_oplock (struct TCP_Server_Info *server,struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache) +__u16 epoch,bool *purge_cache) { server->ops->set_oplock_level (cinode, oplock,0 ,NULL ); }static void smb21_set_oplock_level (struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache); +__u16 epoch,bool *purge_cache);static void smb3_downgrade_oplock (struct TCP_Server_Info *server,struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache) +__u16 epoch,bool *purge_cache) {unsigned int old_state = cinode->oplock; -unsigned int old_epoch = cinode->epoch; +__u16 old_epoch = cinode->epoch;unsigned int new_state;if (epoch > old_epoch) {
@@ -3902,7 +3902,7 @@ smb3_downgrade_oplock(struct TCP_Server_static void smb2_set_oplock_level (struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache) +__u16 epoch,bool *purge_cache) { oplock &=0xFF ; cinode->lease_granted = false;
@@ -3926,7 +3926,7 @@ smb2_set_oplock_level(struct cifsInodeInstatic void smb21_set_oplock_level (struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache) +__u16 epoch,bool *purge_cache) {char message[5 ] = {0 };unsigned int new_oplock =0 ;
@@ -3963,7 +3963,7 @@ smb21_set_oplock_level(struct cifsInodeIstatic void smb3_set_oplock_level (struct cifsInodeInfo *cinode,__u32 oplock, -unsigned int epoch,bool *purge_cache) +__u16 epoch,bool *purge_cache) {unsigned int old_oplock = cinode->oplock;
@@ -4077,7 +4077,7 @@ smb3_create_lease_buf(u8 *lease_key, u8 }static __u8 -smb2_parse_lease_buf (void *buf,unsigned int *epoch,char *lease_key) +smb2_parse_lease_buf (void *buf,__u16 *epoch,char *lease_key) {struct create_lease *lc = (struct create_lease *)buf;
@@ -4088,7 +4088,7 @@ smb2_parse_lease_buf(void *buf, unsigned }static __u8 -smb3_parse_lease_buf (void *buf,unsigned int *epoch,char *lease_key) +smb3_parse_lease_buf (void *buf,__u16 *epoch,char *lease_key) {struct create_lease_v2 *lc = (struct create_lease_v2 *)buf;
fs/smb/client/smb2pdu.c +1 -1
@@ -2322,7 +2322,7 @@ parse_posix_ctxt(struct create_context *int smb2_parse_contexts (struct TCP_Server_Info *server,struct kvec *rsp_iov, -unsigned int *epoch, +__u16 *epoch,char *lease_key,__u8 *oplock,struct smb2_file_all_info *buf,struct create_posix_rsp *posix)
fs/smb/client/smb2proto.h +1 -1
@@ -283,7 +283,7 @@ extern enum securityEnum smb2_select_sec enum securityEnum);int smb2_parse_contexts (struct TCP_Server_Info *server,struct kvec *rsp_iov, -unsigned int *epoch, +__u16 *epoch,char *lease_key,__u8 *oplock,struct smb2_file_all_info *buf,struct create_posix_rsp *posix);
Greg Kroah-Hartman
maintainerPATCH 87/273 s390/futex: Fix FUTEX_OP_ANDN implementation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
commit 26701574cee6777f867f89b4a5c667817e1ee0dd upstream.
The futex operation FUTEX_OP_ANDN is supposed to implement
*(int *)UADDR2 &= ~OPARG;
The s390 implementation just implements an AND instead of ANDN. Add the missing bitwise not operation to oparg to fix this.
This is broken since nearly 19 years, so it looks like user space is not making use of this operation.
--- arch/s390/include/asm/futex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/futex.h +1 -1
@@ -44,7 +44,7 @@ static inline int arch_futex_atomic_op_ibreak ;case FUTEX_OP_ANDN :__futex_atomic_op ("lr %2,%1\nnr %2,%5\n" , - ret, oldval, newval, uaddr, oparg); + ret, oldval, newval, uaddr, ~oparg);break ;case FUTEX_OP_XOR : __futex_atomic_op("lr %2,%1\nxr %2,%5\n",
Greg Kroah-Hartman
maintainerPATCH 88/273 m68k: vga: Fix I/O defines
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit 53036937a101b5faeaf98e7438555fa854a1a844 upstream.
Including m68k's <asm/raw_io.h> in vga.h on nommu platforms results in conflicting defines with io_no.h for various I/O macros from the __raw_read and __raw_write families. An example error is
In file included from arch/m68k/include/asm/vga.h:12,
from include/video/vga.h:22, from include/linux/vgaarb.h:34, from drivers/video/aperture.c:12:
Quoted 1 line
Quoted 1 line
arch/m68k/include/asm/raw_io.h:39: warning: "__raw_readb" redefined
39 | #define __raw_readb in_8
|
In file included from arch/m68k/include/asm/io.h:6,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/asm-generic/hardirq.h:17,
from ./arch/m68k/include/generated/asm/hardirq.h:1,
from include/linux/hardirq.h:11,
from include/linux/interrupt.h:11,
from include/linux/trace_recursion.h:5,
from include/linux/ftrace.h:10,
from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/linux/fb.h:6,
from drivers/video/aperture.c:5:
arch/m68k/include/asm/io_no.h:16: note: this is the location of the previous definition
16 | #define __raw_readb(addr) \
|Include <asm/io.h>, which avoids raw_io.h on nommu platforms. Also change the defined values of some of the read/write symbols in vga.h to __raw_read/__raw_write as the raw_in/raw_out symbols are not generally available.
--- arch/m68k/include/asm/vga.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/m68k/include/asm/vga.h +4 -4
@@ -9,7 +9,7 @@*/ #ifndef CONFIG_PCI -#include <asm/raw_io.h> +#include <asm/io.h> #include <asm/kmap.h> /*
@@ -29,9 +29,9 @@#define inw_p (port) 0#define outb_p (port, val) do { } while (0)#define outw (port, val) do { } while (0) -#define readb raw_inb -#define writeb raw_outb -#define writew raw_outw +#define readb __raw_readb +#define writeb __raw_writeb +#define writew __raw_writew#endif /* CONFIG_PCI */ #endif /* _ASM_M68K_VGA_H */
Greg Kroah-Hartman
maintainerPATCH 89/273 fs/proc: do_task_stat: Fix ESP not readable during coredump
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nam Cao <[email protected]>
commit ab251dacfbae28772c897f068a4184f478189ff2 upstream.
The field "eip" (instruction pointer) and "esp" (stack pointer) of a task can be read from /proc/PID/stat. These fields can be interesting for coredump.
However, these fields were disabled by commit 0a1eb2d474ed ("fs/proc: Stop reporting eip and esp in /proc/PID/stat"), because it is generally unsafe to do so. But it is safe for a coredumping process, and therefore exceptions were made:
- for a coredumping thread by commit fd7d56270b52 ("fs/proc: Report eip/esp in /prod/PID/stat for coredumping").
- for all other threads in a coredumping process by commit cb8f381f1613 ("fs/proc/array.c: allow reporting eip/esp for all coredumping threads").
The above two commits check the PF_DUMPCORE flag to determine a coredump thread and the PF_EXITING flag for the other threads.
Unfortunately, commit 92307383082d ("coredump: Don't perform any cleanups before dumping core") moved coredump to happen earlier and before PF_EXITING is set. Thus, checking PF_EXITING is no longer the correct way to determine threads in a coredumping process.
Instead of PF_EXITING, use PF_POSTCOREDUMP to determine the other threads.
Checking of PF_EXITING was added for coredumping, so it probably can now be removed. But it doesn't hurt to keep.
--- fs/proc/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/array.c +1 -1
@@ -500,7 +500,7 @@ static int do_task_stat(struct seq_file* a program is not able to use ptrace(2) in that case. It is * safe because the task has stopped executing permanently. */ -if (permitted && (task->flags & (PF_EXITING |PF_DUMPCORE ))) { +if (permitted && (task->flags & (PF_EXITING |PF_DUMPCORE |PF_POSTCOREDUMP ))) {if (try_get_task_stack (task)) { eip =KSTK_EIP (task); esp =KSTK_ESP (task);
Greg Kroah-Hartman
maintainerPATCH 90/273 binfmt_flat: Fix integer overflow bug on 32 bit systems
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 55cf2f4b945f6a6416cc2524ba740b83cc9af25a upstream.
Most of these sizes and counts are capped at 256MB so the math doesn't result in an integer overflow. The "relocs" count needs to be checked as well. Otherwise on 32bit systems the calculation of "full_data" could be wrong.
full_data = data_len + relocs * sizeof(unsigned long);
--- fs/binfmt_flat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_flat.c +1 -1
@@ -478,7 +478,7 @@ static int load_flat_file(struct linux_b* 28 bits (256 MB) is way more than reasonable in this case. * If some top bits are set we have probable binary corruption. */ -if ((text_len | data_len | bss_len | stack_len | full_data) >>28 ) { +if ((text_len | data_len | bss_len | stack_len | relocs | full_data) >>28 ) {pr_err ("bad header\n" ); ret = -ENOEXEC ; goto err;
Greg Kroah-Hartman
maintainerPATCH 91/273 KVM: arm64: timer: Always evaluate the need for a soft timer
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit b450dcce93bc2cf6d2bfaf5a0de88a94ebad8f89 upstream.
When updating the interrupt state for an emulated timer, we return early and skip the setup of a soft timer that runs in parallel with the guest.
While this is OK if we have set the interrupt pending, it is pretty wrong if the guest moved CVAL into the future. In that case, no timer is armed and the guest can wait for a very long time (it will take a full put/load cycle for the situation to resolve).
This is specially visible with EDK2 running at EL2, but still using the EL1 virtual timer, which in that case is fully emulated. Any key-press takes ages to be captured, as there is no UART interrupt and EDK2 relies on polling from a timer...
The fix is simply to drop the early return. If the timer interrupt is pending, we will still return early, and otherwise arm the soft timer.
--- arch/arm64/kvm/arch_timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm64/kvm/arch_timer.c +1 -3
@@ -467,10 +467,8 @@ static void timer_emulate(struct arch_titrace_kvm_timer_emulate (ctx, should_fire); -if (should_fire != ctx->irq.level) { +if (should_fire != ctx->irq.level)kvm_timer_update_irq (ctx->vcpu, should_fire, ctx); -return ; - }/* * If the timer can fire now, we don't need to have a soft timer
Greg Kroah-Hartman
maintainerPATCH 92/273 drm/rockchip: cdn-dp: Use drm_connector_helper_hpd_irq_event()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit 666e1960464140cc4bc9203c203097e70b54c95a upstream.
The code for detecting and updating the connector status in cdn_dp_pd_event_work() has a number of problems.
- It does not aquire the locks to call the detect helper and update the connector status. These are struct drm_mode_config.connection_mutex and struct drm_mode_config.mutex.
- It does not use drm_helper_probe_detect(), which helps with the details of locking and detection.
- It uses the connector's status field to determine a change to the connector status. The epoch_counter field is the correct one. The field signals a change even if the connector status' value did not change.
Replace the code with a call to drm_connector_helper_hpd_irq_event(), which fixes all these problems.
--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +1 -8
@@ -946,9 +946,6 @@ static void cdn_dp_pd_event_work(struct { struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, event_work); -struct drm_connector *connector = &dp->connector; -enum drm_connector_status old_status; -int ret;mutex_lock (&dp->lock);
@@ -1010,11 +1007,7 @@ static void cdn_dp_pd_event_work(struct out:mutex_unlock (&dp->lock); - - old_status = connector->status; - connector->status = connector->funcs->detect (connector, false); -if (old_status != connector->status) -drm_kms_helper_hotplug_event (dp->drm_dev); +drm_connector_helper_hpd_irq_event (&dp->connector); } static int cdn_dp_pd_event(struct notifier_block *nb,
Greg Kroah-Hartman
maintainerPATCH 93/273 arm64: dts: rockchip: increase gmac rx_delay on rk3399-puma
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakob Unterwurzacher <[email protected]>
commit 9d241b06802c6c2176ae7aa4f9f17f8a577ed337 upstream.
During mass manufacturing, we noticed the mmc_rx_crc_error counter, as reported by "ethtool -S eth0 | grep mmc_rx_crc_error", to increase above zero during nuttcp speedtests. Most of the time, this did not affect the achieved speed, but it prompted this investigation.
Cycling through the rx_delay range on six boards (see table below) of various ages shows that there is a large good region from 0x12 to 0x35 where we see zero crc errors on all tested boards.
The old rx_delay value (0x10) seems to have always been on the edge for the KSZ9031RNX that is usually placed on Puma.
Choose "rx_delay = 0x23" to put us smack in the middle of the good region. This works fine as well with the KSZ9131RNX PHY that was used for a small number of boards during the COVID chip shortages.
Board S/N PHY rx_delay good region --------- --- -------------------- Puma TT0069903 KSZ9031RNX 0x11 0x35 Puma TT0157733 KSZ9031RNX 0x11 0x35 Puma TT0681551 KSZ9031RNX 0x12 0x37 Puma TT0681156 KSZ9031RNX 0x10 0x38 Puma 17496030079 KSZ9031RNX 0x10 0x37 (Puma v1.2 from 2017) Puma TT0681720 KSZ9131RNX 0x02 0x39 (alternative PHY used in very few boards) Intersection of good regions = 0x12 0x35 Middle of good region = 0x23
--- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +1 -1
@@ -147,7 +147,7 @@ snps,reset-active-low; snps,reset-delays-us = <0 10000 50000>; tx_delay = <0x10>; - rx_delay = <0x10>; + rx_delay = <0x23>; status = "okay"; };
Greg Kroah-Hartman
maintainerPATCH 67/273 vmxnet3: Fix tx queue race condition with XDP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sankararaman Jayaraman <[email protected]>
[ Upstream commit 3f1baa91a1fdf3de9dbad4bd615b35fab347874b ]
If XDP traffic runs on a CPU which is greater than or equal to the number of the Tx queues of the NIC, then vmxnet3_xdp_get_tq() always picks up queue 0 for transmission as it uses reciprocal scale instead of simple modulo operation.
vmxnet3_xdp_xmit() and vmxnet3_xdp_xmit_frame() use the above returned queue without any locking which can lead to race conditions when multiple XDP xmits run in parallel on different CPU's.
This patch uses a simple module scheme when the current CPU equals or exceeds the number of Tx queues on the NIC. It also adds locking in vmxnet3_xdp_xmit() and vmxnet3_xdp_xmit_frame() functions.
--- drivers/net/vmxnet3/vmxnet3_xdp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/net/vmxnet3/vmxnet3_xdp.c +12 -2
@@ -28,7 +28,7 @@ vmxnet3_xdp_get_tq(struct vmxnet3_adapter *adapter)if (likely (cpu < tq_number)) tq = &adapter->tx_queue[cpu];else - tq = &adapter->tx_queue[reciprocal_scale (cpu, tq_number)]; + tq = &adapter->tx_queue[cpu % tq_number];return tq; }
@@ -124,6 +124,7 @@ vmxnet3_xdp_xmit_frame(struct vmxnet3_adapter *adapter,u32 buf_size;u32 dw2; +spin_lock_irq (&tq->tx_lock); dw2 = (tq->tx_ring.gen ^0x1 ) <<VMXNET3_TXD_GEN_SHIFT ; dw2 |= xdpf->len; ctx.sop_txd = tq->tx_ring.base + tq->tx_ring.next2fill;
@@ -134,6 +135,7 @@ vmxnet3_xdp_xmit_frame(struct vmxnet3_adapter *adapter,if (vmxnet3_cmd_ring_desc_avail (&tq->tx_ring) ==0 ) { tq->stats.tx_ring_full++; +spin_unlock_irq (&tq->tx_lock);return -ENOSPC ; }
@@ -142,8 +144,10 @@ vmxnet3_xdp_xmit_frame(struct vmxnet3_adapter *adapter, tbi->dma_addr =dma_map_single (&adapter->pdev->dev, xdpf->data, buf_size,DMA_TO_DEVICE ); -if (dma_mapping_error (&adapter->pdev->dev, tbi->dma_addr)) +if (dma_mapping_error (&adapter->pdev->dev, tbi->dma_addr)) { +spin_unlock_irq (&tq->tx_lock);return -EFAULT ; + } tbi->map_type |=VMXNET3_MAP_SINGLE ; }else {/* XDP buffer from page pool */ page =virt_to_page (xdpf->data);
@@ -182,6 +186,7 @@ vmxnet3_xdp_xmit_frame(struct vmxnet3_adapter *adapter,dma_wmb (); gdesc->dword[2 ] =cpu_to_le32 (le32_to_cpu (gdesc->dword[2 ]) ^VMXNET3_TXD_GEN ); +spin_unlock_irq (&tq->tx_lock);/* No need to handle the case when tx_num_deferred doesn't reach * threshold. Backend driver at hypervisor side will poll and reset
@@ -225,6 +230,7 @@ vmxnet3_xdp_xmit(struct net_device *dev, {struct vmxnet3_adapter *adapter =netdev_priv (dev);struct vmxnet3_tx_queue *tq; +struct netdev_queue *nq;int i;if (unlikely (test_bit (VMXNET3_STATE_BIT_QUIESCED , &adapter->state)))
@@ -236,6 +242,9 @@ vmxnet3_xdp_xmit(struct net_device *dev,if (tq->stopped)return -ENETDOWN ; + nq =netdev_get_tx_queue (adapter->netdev, tq->qid); + +__netif_tx_lock (nq,smp_processor_id ());for (i =0 ; i < n; i++) {if (vmxnet3_xdp_xmit_frame (adapter, frames[i], tq, true)) { tq->stats.xdp_xmit_err++;
@@ -243,6 +252,7 @@ vmxnet3_xdp_xmit(struct net_device *dev, } } tq->stats.xdp_xmit += i; +__netif_tx_unlock (nq);return i; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/273 KVM: Explicitly verify target vCPU is online in kvm_get_vcpu()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
commit 1e7381f3617d14b3c11da80ff5f8a93ab14cfc46 upstream.
Explicitly verify the target vCPU is fully online _prior_ to clamping the index in kvm_get_vcpu(). If the index is "bad", the nospec clamping will generate '0', i.e. KVM will return vCPU0 instead of NULL.
In practice, the bug is unlikely to cause problems, as it will only come into play if userspace or the guest is buggy or misbehaving, e.g. KVM may send interrupts to vCPU0 instead of dropping them on the floor.
However, returning vCPU0 when it shouldn't exist per online_vcpus is problematic now that KVM uses an xarray for the vCPUs array, as KVM needs to insert into the xarray before publishing the vCPU to userspace (see commit c5b077549136 ("KVM: Convert the kvm->vcpus array to a xarray")), i.e. before vCPU creation is guaranteed to succeed.
As a result, incorrectly providing access to vCPU0 will trigger a use-after-free if vCPU0 is dereferenced and kvm_vm_ioctl_create_vcpu() bails out of vCPU creation due to an error and frees vCPU0. Commit afb2acb2e3a3 ("KVM: Fix vcpu_array[0] races") papered over that issue, but in doing so introduced an unsolvable teardown conundrum. Preventing accesses to vCPU0 before it's fully online will allow reverting commit afb2acb2e3a3, without re-introducing the vcpu_array[0] UAF race.
--- include/linux/kvm_host.h | 9 +++++++++ 1 file changed, 9 insertions(+)
include/linux/kvm_host.h +9 -0
@@ -920,6 +920,15 @@ static inline struct kvm_io_bus *kvm_getstatic inline struct kvm_vcpu *kvm_get_vcpu (struct kvm *kvm,int i) {int num_vcpus =atomic_read (&kvm->online_vcpus); + +/* +* Explicitly verify the target vCPU is online, as the anti-speculation +* logic only limits the CPU's ability to speculate, e.g. given a "bad" +* index, clamping the index to 0 would return vCPU0, not NULL. +*/ +if (i >= num_vcpus) +return NULL ; + i =array_index_nospec (i, num_vcpus);/* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu. */
Greg Kroah-Hartman
maintainerPATCH 95/273 KVM: s390: vsie: fix some corner-cases when grabbing vsie pages
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <[email protected]>
commit 5f230f41fdd9e799f43a699348dc572bca7159aa upstream.
We try to reuse the same vsie page when re-executing the vsie with a given SCB address. The result is that we use the same shadow SCB -- residing in the vsie page -- and can avoid flushing the TLB when re-running the vsie on a CPU.
So, when we allocate a fresh vsie page, or when we reuse a vsie page for a different SCB address -- reusing the shadow SCB in different context -- we set ihcpu=0xffff to trigger the flush.
However, after we looked up the SCB address in the radix tree, but before we grabbed the vsie page by raising the refcount to 2, someone could reuse the vsie page for a different SCB address, adjusting page->index and the radix tree. In that case, we would be reusing the vsie page with a wrong page->index.
Another corner case is that we might set the SCB address for a vsie page, but fail the insertion into the radix tree. Whoever would reuse that page would remove the corresponding radix tree entry -- which might now be a valid entry pointing at another page, resulting in the wrong vsie page getting removed from the radix tree.
Let's handle such races better, by validating that the SCB address of a vsie page didn't change after we grabbed it (not reuse for a different SCB; the alternative would be performing another tree lookup), and by setting the SCB address to invalid until the insertion in the tree succeeded (SCB addresses are aligned to 512, so ULONG_MAX is invalid).
These scenarios are rare, the effects a bit unclear, and these issues were only found by code inspection. Let's CC stable to be safe.
Message-ID: <[email protected]>
--- arch/s390/kvm/vsie.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
arch/s390/kvm/vsie.c +19 -6
@@ -1335,8 +1335,14 @@ static struct vsie_page *get_vsie_page(s page =radix_tree_lookup (&kvm->arch.vsie.addr_to_page, addr >>9 );rcu_read_unlock ();if (page) { -if (page_ref_inc_return (page) ==2 ) -return page_to_virt (page); +if (page_ref_inc_return (page) ==2 ) { +if (page->index == addr) +return page_to_virt (page); +/* +* We raced with someone reusing + putting this vsie +* page before we grabbed it. +*/ + }page_ref_dec (page); }
@@ -1366,15 +1372,20 @@ static struct vsie_page *get_vsie_page(s kvm->arch.vsie.next++; kvm->arch.vsie.next %= nr_vcpus; } -radix_tree_delete (&kvm->arch.vsie.addr_to_page, page->index >>9 ); +if (page->index !=ULONG_MAX ) +radix_tree_delete (&kvm->arch.vsie.addr_to_page, + page->index >>9 ); } - page->index = addr; -/* double use of the same address */ +/* Mark it as invalid until it resides in the tree. */ + page->index =ULONG_MAX ; + +/* Double use of the same address or allocation failure. */ if (radix_tree_insert (&kvm->arch.vsie.addr_to_page, addr >>9 , page)) {page_ref_dec (page);mutex_unlock (&kvm->arch.vsie.mutex);return NULL ; } + page->index = addr;mutex_unlock (&kvm->arch.vsie.mutex); vsie_page =page_to_virt (page);
@@ -1467,7 +1478,9 @@ void kvm_s390_vsie_destroy(struct kvm *k vsie_page =page_to_virt (page);release_gmap_shadow (vsie_page);/* free the radix tree entry */ -radix_tree_delete (&kvm->arch.vsie.addr_to_page, page->index >>9 ); +if (page->index !=ULONG_MAX ) +radix_tree_delete (&kvm->arch.vsie.addr_to_page, + page->index >>9 );__free_page (page); } kvm->arch.vsie.page_count =0 ;
Greg Kroah-Hartman
maintainerPATCH 96/273 ksmbd: fix integer overflows on 32 bit systems
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit aab98e2dbd648510f8f51b83fbf4721206ccae45 upstream.
On 32bit systems the addition operations in ipc_msg_alloc() can potentially overflow leading to memory corruption.
Add bounds checking using KSMBD_IPC_MAX_PAYLOAD to avoid overflow.
--- fs/smb/server/transport_ipc.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/smb/server/transport_ipc.c +9 -0
@@ -570,6 +570,9 @@ ksmbd_ipc_spnego_authen_request(const chstruct ksmbd_spnego_authen_request *req;struct ksmbd_spnego_authen_response *resp; +if (blob_len >KSMBD_IPC_MAX_PAYLOAD ) +return NULL ; + msg =ipc_msg_alloc (sizeof (struct ksmbd_spnego_authen_request ) + blob_len +1 );if (!msg)
@@ -749,6 +752,9 @@ struct ksmbd_rpc_command *ksmbd_rpc_writstruct ksmbd_rpc_command *req;struct ksmbd_rpc_command *resp; +if (payload_sz >KSMBD_IPC_MAX_PAYLOAD ) +return NULL ; + msg =ipc_msg_alloc (sizeof (struct ksmbd_rpc_command ) + payload_sz +1 );if (!msg)return NULL ;
@@ -797,6 +803,9 @@ struct ksmbd_rpc_command *ksmbd_rpc_ioctstruct ksmbd_rpc_command *req;struct ksmbd_rpc_command *resp; +if (payload_sz >KSMBD_IPC_MAX_PAYLOAD ) +return NULL ; + msg =ipc_msg_alloc (sizeof (struct ksmbd_rpc_command ) + payload_sz +1 );if (!msg)return NULL ;
Greg Kroah-Hartman
maintainerPATCH 97/273 drm/amd/pm: Mark MM activity as unsupported
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit 819bf6662b93a5a8b0c396d2c7e7fab6264c9808 upstream.
Aldebaran doesn't support querying MM activity percentage. Keep the field as 0xFFs to mark it as unsupported.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0 -1
@@ -1752,7 +1752,6 @@ static ssize_t aldebaran_get_gpu_metrics gpu_metrics->average_gfx_activity = metrics.AverageGfxActivity; gpu_metrics->average_umc_activity = metrics.AverageUclkActivity; - gpu_metrics->average_mm_activity =0 ;/* Valid power data is available only from primary die */ if (aldebaran_is_primary (smu)) {
Greg Kroah-Hartman
maintainerPATCH 68/273 tg3: Disable tg3 PCIe AER on system reboot
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lenny Szubowicz <[email protected]>
[ Upstream commit e0efe83ed325277bb70f9435d4d9fc70bebdcca8 ]
Disable PCIe AER on the tg3 device on system reboot on a limited list of Dell PowerEdge systems. This prevents a fatal PCIe AER event on the tg3 device during the ACPI _PTS (prepare to sleep) method for S5 on those systems. The _PTS is invoked by acpi_enter_sleep_state_prep() as part of the kernel's reboot sequence as a result of commit 38f34dba806a ("PM: ACPI: reboot: Reinstate S5 for reboot").
There was an earlier fix for this problem by commit 2ca1c94ce0b6 ("tg3: Disable tg3 device on system reboot to avoid triggering AER"). But it was discovered that this earlier fix caused a reboot hang when some Dell PowerEdge servers were booted via ipxe. To address this reboot hang, the earlier fix was essentially reverted by commit 9fc3bc764334 ("tg3: power down device only on SYSTEM_POWER_OFF"). This re-exposed the tg3 PCIe AER on reboot problem.
This fix is not an ideal solution because the root cause of the AER is in system firmware. Instead, it's a targeted work-around in the tg3 driver.
Note also that the PCIe AER must be disabled on the tg3 device even if the system is configured to use "firmware first" error handling.
V3:
- Fix sparse warning on improper comparison of pdev->current_state
- Adhere to netdev comment style
--- drivers/net/ethernet/broadcom/tg3.c | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
drivers/net/ethernet/broadcom/tg3.c +58 -0
@@ -55,6 +55,7 @@#include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/crc32poly.h> +#include <linux/dmi.h> #include <net/checksum.h> #include <net/gso.h>
@@ -18106,6 +18107,50 @@ static int tg3_resume(struct device *device) static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume); +/* Systems where ACPI _PTS (Prepare To Sleep) S5 will result in a fatal +* PCIe AER event on the tg3 device if the tg3 device is not, or cannot +* be, powered down. +*/ +static const struct dmi_system_id tg3_restart_aer_quirk_table[] = { + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R440" ), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R540" ), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R640" ), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R650" ), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R740" ), + }, + }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge R750" ), + }, + }, + {} +}; +static void tg3_shutdown (struct pci_dev *pdev) {struct net_device *dev =pci_get_drvdata (pdev);
@@ -18122,6 +18167,19 @@ static void tg3_shutdown(struct pci_dev *pdev)if (system_state ==SYSTEM_POWER_OFF )tg3_power_down (tp); +else if (system_state ==SYSTEM_RESTART && +dmi_first_match (tg3_restart_aer_quirk_table) && + pdev->current_state != PCI_D3cold && + pdev->current_state !=PCI_UNKNOWN ) { +/* Disable PCIe AER on the tg3 to avoid a fatal +* error during this system restart. +*/ +pcie_capability_clear_word (pdev,PCI_EXP_DEVCTL , +PCI_EXP_DEVCTL_CERE | +PCI_EXP_DEVCTL_NFERE | +PCI_EXP_DEVCTL_FERE | +PCI_EXP_DEVCTL_URRE ); + }rtnl_unlock ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 69/273 udp: gso: do not drop small packets when PMTU reduces
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yan Zhai <[email protected]>
[ Upstream commit 235174b2bed88501fda689c113c55737f99332d8 ]
Commit 4094871db1d6 ("udp: only do GSO if # of segs > 1") avoided GSO for small packets. But the kernel currently dismisses GSO requests only after checking MTU/PMTU on gso_size. This means any packets, regardless of their payload sizes, could be dropped when PMTU becomes smaller than requested gso_size. We encountered this issue in production and it caused a reliability problem that new QUIC connection cannot be established before PMTU cache expired, while non GSO sockets still worked fine at the same time.
Ideally, do not check any GSO related constraints when payload size is smaller than requested gso_size, and return EMSGSIZE instead of EINVAL on MTU/PMTU check failure to be more specific on the error cause.
--- net/ipv4/udp.c | 4 ++-- net/ipv6/udp.c | 4 ++-- tools/testing/selftests/net/udpgso.c | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-)
net/ipv4/udp.c +2 -2
@@ -930,9 +930,9 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,const int hlen =skb_network_header_len (skb) +sizeof (struct udphdr ); -if (hlen + cork->gso_size > cork->fragsize) { +if (hlen +min (datalen, cork->gso_size) > cork->fragsize) {kfree_skb (skb); -return -EINVAL ; +return -EMSGSIZE ; }if (datalen > cork->gso_size *UDP_MAX_SEGMENTS ) {kfree_skb (skb);
net/ipv6/udp.c +2 -2
@@ -1246,9 +1246,9 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,const int hlen =skb_network_header_len (skb) +sizeof (struct udphdr ); -if (hlen + cork->gso_size > cork->fragsize) { +if (hlen +min (datalen, cork->gso_size) > cork->fragsize) {kfree_skb (skb); -return -EINVAL ; +return -EMSGSIZE ; }if (datalen > cork->gso_size *UDP_MAX_SEGMENTS ) {kfree_skb (skb);
tools/testing/selftests/net/udpgso.c +26 -0
@@ -94,6 +94,19 @@ struct testcase testcases_v4[] = { .gso_len = CONST_MSS_V4, .r_num_mss = 1, }, + { + /* datalen <= MSS < gso_len: will fall back to no GSO */ + .tlen = CONST_MSS_V4, + .gso_len = CONST_MSS_V4 + 1, + .r_num_mss = 0, + .r_len_last = CONST_MSS_V4, + }, + { + /* MSS < datalen < gso_len: fail */ + .tlen = CONST_MSS_V4 + 1, + .gso_len = CONST_MSS_V4 + 2, + .tfail = true, + }, { /* send a single MSS + 1B */ .tlen = CONST_MSS_V4 + 1,
@@ -197,6 +210,19 @@ struct testcase testcases_v6[] = { .gso_len = CONST_MSS_V6, .r_num_mss = 1, }, + { + /* datalen <= MSS < gso_len: will fall back to no GSO */ + .tlen = CONST_MSS_V6, + .gso_len = CONST_MSS_V6 + 1, + .r_num_mss = 0, + .r_len_last = CONST_MSS_V6, + }, + { + /* MSS < datalen < gso_len: fail */ + .tlen = CONST_MSS_V6 + 1, + .gso_len = CONST_MSS_V6 + 2, + .tfail = true + }, { /* send a single MSS + 1B */ .tlen = CONST_MSS_V6 + 1,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 70/273 rxrpc: Fix the rxrpc_connection attend queue handling
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 4241a702e0d0c2ca9364cfac08dbf134264962de ]
The rxrpc_connection attend queue is never used because conn::attend_link is never initialised and so is always NULL'd out and thus always appears to be busy. This requires the following fix:
(1) Fix this the attend queue problem by initialising conn::attend_link.
And, consequently, two further fixes for things masked by the above bug:
(2) Fix rxrpc_input_conn_event() to handle being invoked with a NULL sk_buff pointer - something that can now happen with the above change.
(3) Fix the RXRPC_SKB_MARK_SERVICE_CONN_SECURED message to carry a pointer to the connection and a ref on it.
--- include/trace/events/rxrpc.h | 1 + net/rxrpc/conn_event.c | 17 ++++++++++------- net/rxrpc/conn_object.c | 1 + 3 files changed, 12 insertions(+), 7 deletions(-)
include/trace/events/rxrpc.h +1 -0
@@ -214,6 +214,7 @@ EM(rxrpc_conn_get_conn_input, "GET inp-conn") \ EM(rxrpc_conn_get_idle, "GET idle ") \ EM(rxrpc_conn_get_poke_abort, "GET pk-abort") \ + EM(rxrpc_conn_get_poke_secured, "GET secured ") \ EM(rxrpc_conn_get_poke_timer, "GET poke ") \ EM(rxrpc_conn_get_service_conn, "GET svc-conn") \EM (rxrpc_conn_new_client,"NEW client " ) \
net/rxrpc/conn_event.c +10 -7
@@ -266,6 +266,7 @@ static int rxrpc_process_event(struct rxrpc_connection *conn,* we've already received the packet, put it on the * front of the queue. */ + sp->conn =rxrpc_get_connection (conn, rxrpc_conn_get_poke_secured); skb->mark =RXRPC_SKB_MARK_SERVICE_CONN_SECURED ;rxrpc_get_skb (skb, rxrpc_skb_get_conn_secured);skb_queue_head (&conn->local->rx_queue, skb);
@@ -431,14 +432,16 @@ void rxrpc_input_conn_event(struct rxrpc_connection *conn, struct sk_buff *skb)if (test_and_clear_bit (RXRPC_CONN_EV_ABORT_CALLS , &conn->events))rxrpc_abort_calls (conn); -switch (skb->mark) { -case RXRPC_SKB_MARK_SERVICE_CONN_SECURED : -if (conn->state !=RXRPC_CONN_SERVICE ) -break ; +if (skb) { +switch (skb->mark) { +case RXRPC_SKB_MARK_SERVICE_CONN_SECURED : +if (conn->state !=RXRPC_CONN_SERVICE ) +break ; -for (loop =0 ; loop <RXRPC_MAXCALLS ; loop++) -rxrpc_call_is_secure (conn->channels[loop].call); -break ; +for (loop =0 ; loop <RXRPC_MAXCALLS ; loop++) +rxrpc_call_is_secure (conn->channels[loop].call); +break ; + } }/* Process delayed ACKs whose time has come. */
net/rxrpc/conn_object.c +1 -0
@@ -67,6 +67,7 @@ struct rxrpc_connection *rxrpc_alloc_connection(struct rxrpc_net *rxnet,INIT_WORK (&conn->destructor, rxrpc_clean_up_connection);INIT_LIST_HEAD (&conn->proc_link);INIT_LIST_HEAD (&conn->link); +INIT_LIST_HEAD (&conn->attend_link);mutex_init (&conn->security_lock);skb_queue_head_init (&conn->rx_queue); conn->rxnet = rxnet;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 71/273 gpio: pca953x: Improve interrupt support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Tomlinson <[email protected]>
[ Upstream commit d6179f6c6204f9932aed3a7a2100b4a295dfed9d ]
The GPIO drivers with latch interrupt support (typically types starting with PCAL) have interrupt status registers to determine which particular inputs have caused an interrupt. Unfortunately there is no atomic operation to read these registers and clear the interrupt. Clearing the interrupt is done by reading the input registers.
The code was reading the interrupt status registers, and then reading the input registers. If an input changed between these two events it was lost.
The solution in this patch is to revert to the non-latch version of code, i.e. remembering the previous input status, and looking for the changes. This system results in no more I2C transfers, so is no slower. The latch property of the device still means interrupts will still be noticed if the input changes back to its initial state.
--- drivers/gpio/gpio-pca953x.c | 19 ------------------- 1 file changed, 19 deletions(-)
drivers/gpio/gpio-pca953x.c +0 -19
@@ -847,25 +847,6 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pendinDECLARE_BITMAP (trigger,MAX_LINE );int ret; -if (chip->driver_data &PCA_PCAL ) { -/* Read the current interrupt status from the device */ - ret =pca953x_read_regs (chip,PCAL953X_INT_STAT , trigger); -if (ret) -return false; - -/* Check latched inputs and clear interrupt status */ - ret =pca953x_read_regs (chip, chip->regs->input, cur_stat); -if (ret) -return false; - -/* Apply filter for rising/falling edge selection */ -bitmap_replace (new_stat, chip->irq_trig_fall, chip->irq_trig_raise, cur_stat, gc->ngpio); - -bitmap_and (pending, new_stat, trigger, gc->ngpio); - -return !bitmap_empty (pending, gc->ngpio); - } - ret =pca953x_read_regs (chip, chip->regs->input, cur_stat);if (ret)return false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 72/273 net: atlantic: fix warning during hot unplug
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <[email protected]>
[ Upstream commit 028676bb189ed6d1b550a0fc570a9d695b6acfd3 ]
Firmware deinitialization performs MMIO accesses which are not necessary if the device has already been removed. In some cases, these accesses happen via readx_poll_timeout_atomic which ends up timing out, resulting in a warning at hw_atl2_utils_fw.c:112:
[ 104.595913] Call Trace: [ 104.595915] <TASK> [ 104.595918] ? show_regs+0x6c/0x80 [ 104.595923] ? __warn+0x8d/0x150 [ 104.595925] ? aq_a2_fw_deinit+0xcf/0xe0 [atlantic] [ 104.595934] ? report_bug+0x182/0x1b0 [ 104.595938] ? handle_bug+0x6e/0xb0 [ 104.595940] ? exc_invalid_op+0x18/0x80 [ 104.595942] ? asm_exc_invalid_op+0x1b/0x20 [ 104.595944] ? aq_a2_fw_deinit+0xcf/0xe0 [atlantic] [ 104.595952] ? aq_a2_fw_deinit+0xcf/0xe0 [atlantic] [ 104.595959] aq_nic_deinit.part.0+0xbd/0xf0 [atlantic] [ 104.595964] aq_nic_deinit+0x17/0x30 [atlantic] [ 104.595970] aq_ndev_close+0x2b/0x40 [atlantic] [ 104.595975] __dev_close_many+0xad/0x160 [ 104.595978] dev_close_many+0x99/0x170 [ 104.595979] unregister_netdevice_many_notify+0x18b/0xb20 [ 104.595981] ? __call_rcu_common+0xcd/0x700 [ 104.595984] unregister_netdevice_queue+0xc6/0x110 [ 104.595986] unregister_netdev+0x1c/0x30 [ 104.595988] aq_pci_remove+0xb1/0xc0 [atlantic]
Fix this by skipping firmware deinitialization altogether if the PCI device is no longer present.
Tested with an AQC113 attached via Thunderbolt by performing repeated unplug cycles while traffic was running via iperf.
--- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +3 -1
@@ -1441,7 +1441,9 @@ void aq_nic_deinit(struct aq_nic_s *self, bool link_down)aq_ptp_ring_free (self);aq_ptp_free (self); -if (likely (self->aq_fw_ops->deinit) && link_down) { +/* May be invoked during hot unplug. */ +if (pci_device_is_present (self->pdev) && +likely (self->aq_fw_ops->deinit) && link_down) {mutex_lock (&self->fwreq_mutex); self->aq_fw_ops->deinit (self->aq_hw);mutex_unlock (&self->fwreq_mutex);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 73/273 net: rose: lock the socket in rose_bind()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit a1300691aed9ee852b0a9192e29e2bdc2411a7e6 ]
syzbot reported a soft lockup in rose_loopback_timer(), with a repro calling bind() from multiple threads.
rose_bind() must lock the socket to avoid this issue.
--- net/rose/af_rose.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
net/rose/af_rose.c +16 -8
@@ -701,11 +701,9 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)struct net_device *dev;ax25_address *source;ax25_uid_assoc *user; +int err = -EINVAL ;int n; -if (!sock_flag (sk,SOCK_ZAPPED )) -return -EINVAL ; -if (addr_len !=sizeof (struct sockaddr_rose ) && addr_len !=sizeof (struct full_sockaddr_rose ))return -EINVAL ;
@@ -718,8 +716,15 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)if ((unsigned int ) addr->srose_ndigis >ROSE_MAX_DIGIS )return -EINVAL ; -if ((dev =rose_dev_get (&addr->srose_addr)) ==NULL ) -return -EADDRNOTAVAIL ; +lock_sock (sk); + +if (!sock_flag (sk,SOCK_ZAPPED )) + goto out_release; + + err = -EADDRNOTAVAIL ; + dev =rose_dev_get (&addr->srose_addr); +if (!dev) + goto out_release; source = &addr->srose_call;
@@ -730,7 +735,8 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) }else {if (ax25_uid_policy && !capable (CAP_NET_BIND_SERVICE )) {dev_put (dev); -return -EACCES ; + err = -EACCES ; + goto out_release; } rose->source_call = *source; }
@@ -753,8 +759,10 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)rose_insert_socket (sk);sock_reset_flag (sk,SOCK_ZAPPED ); - -return 0 ; + err =0 ; +out_release: +release_sock (sk); +return err; }static int rose_connect (struct socket *sock,struct sockaddr *uaddr,int addr_len,int flags)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 64/273 nvme-fc: use ctrl state getter
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit c8ed6cb5d37bc09c7e25e49a670e9fd1a3bd1dfa ]
Do not access the state variable directly, instead use proper synchronization so not stale data is read.
--- drivers/nvme/host/fc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/nvme/host/fc.c +6 -3
@@ -2080,7 +2080,8 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)nvme_fc_complete_rq (rq); check_error: -if (terminate_assoc && ctrl->ctrl.state !=NVME_CTRL_RESETTING ) +if (terminate_assoc && +nvme_ctrl_state (&ctrl->ctrl) !=NVME_CTRL_RESETTING )queue_work (nvme_reset_wq, &ctrl->ioerr_work); }
@@ -2534,6 +2535,8 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)static void nvme_fc_error_recovery (struct nvme_fc_ctrl *ctrl,char *errmsg) { +enum nvme_ctrl_state state =nvme_ctrl_state (&ctrl->ctrl); +/* * if an error (io timeout, etc) while (re)connecting, the remote * port requested terminating of the association (disconnect_ls)
@@ -2541,7 +2544,7 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)* the controller. Abort any ios on the association and let the * create_association error path resolve things. */ -if (ctrl->ctrl.state ==NVME_CTRL_CONNECTING ) { +if (state ==NVME_CTRL_CONNECTING ) {__nvme_fc_abort_outstanding_ios (ctrl, true);set_bit (ASSOC_FAILED , &ctrl->flags); dev_warn(ctrl->ctrl.device,
@@ -2551,7 +2554,7 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) }/* Otherwise, only proceed if in LIVE state - e.g. on first error */ -if (ctrl->ctrl.state !=NVME_CTRL_LIVE ) +if (state !=NVME_CTRL_LIVE )return ; dev_warn(ctrl->ctrl.device,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 99/273 Revert "drm/amd/display: Use HW lock mgr for PSR1"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom Chung <[email protected]>
commit f245b400a223a71d6d5f4c72a2cb9b573a7fc2b6 upstream.
This reverts commita2b5a9956269 ("drm/amd/display: Use HW lock mgr for PSR1")
Because it may cause system hang while connect with two edp panel.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +1 -2
@@ -63,8 +63,7 @@ void dmub_hw_lock_mgr_inbox0_cmd(structbool should_use_dmub_lock (struct dc_link *link) { -if (link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 || - link->psr_settings.psr_version ==DC_PSR_VERSION_1 ) +if (link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 )return true;return false; }
Greg Kroah-Hartman
maintainerPATCH 108/273 clk: qcom: clk-alpha-pll: fix alpha mode configuration
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
commit 33f1722eb86e45320a3dd7b3d42f6593a1d595c2 upstream.
Commit c45ae598fc16 ("clk: qcom: support for alpha mode configuration") added support for configuring alpha mode, but it seems that the feature was never working in practice.
The value of the alpha_{en,mode}_mask members of the configuration gets added to the value parameter passed to the regmap_update_bits() function, however the same values are not getting applied to the bitmask. As the result, the respective bits in the USER_CTL register are never modifed which leads to improper configuration of several PLLs.
The following table shows the PLL configurations where the 'alpha_en_mask' member is set and which are passed as a parameter for the clk_alpha_pll_configure() function. In the table the 'expected rate' column shows the rate the PLL should run at with the given configuration, and the 'real rate' column shows the rate the PLL runs at actually. The real rates has been verified on hardwareOn IPQ* platforms, on other platforms, those are computed values only.
file pll expected rate real rate dispcc-qcm2290.c disp_cc_pll0 768.0 MHz 768.0 MHz dispcc-sm6115.c disp_cc_pll0 768.0 MHz 768.0 MHz gcc-ipq5018.c ubi32_pll 1000.0 MHz != 984.0 MHz gcc-ipq6018.c nss_crypto_pll 1200.0 MHz 1200.0 MHz gcc-ipq6018.c ubi32_pll 1497.6 MHz != 1488.0 MHz gcc-ipq8074.c nss_crypto_pll 1200.0 MHz != 1190.4 MHz gcc-qcm2290.c gpll11 532.0 MHz != 518.4 MHz gcc-qcm2290.c gpll8 533.2 MHz != 518.4 MHz gcc-qcs404.c gpll3 921.6 MHz 921.6 MHz gcc-sm6115.c gpll11 600.0 MHz != 595.2 MHz gcc-sm6115.c gpll8 800.0 MHz != 787.2 MHz gpucc-sdm660.c gpu_cc_pll0 800.0 MHz != 787.2 MHz gpucc-sdm660.c gpu_cc_pll1 740.0 MHz != 729.6 MHz gpucc-sm6115.c gpu_cc_pll0 1200.0 MHz != 1190.4 MHz gpucc-sm6115.c gpu_cc_pll1 640.0 MHz != 633.6 MHz gpucc-sm6125.c gpu_pll0 1020.0 MHz != 1017.6 MHz gpucc-sm6125.c gpu_pll1 930.0 MHz != 921.6 MHz mmcc-sdm660.c mmpll8 930.0 MHz != 921.6 MHz mmcc-sdm660.c mmpll5 825.0 MHz != 806.4 MHz
As it can be seen from the above, there are several PLLs which are configured incorrectly.
Change the code to apply both 'alpha_en_mask' and 'alpha_mode_mask' values to the bitmask in order to configure the alpha mode correctly.
Applying the 'alpha_en_mask' fixes the initial rate of the PLLs showed in the table above. Since the 'alpha_mode_mask' is not used by any driver currently, that part of the change causes no functional changes.
--- drivers/clk/qcom/clk-alpha-pll.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/clk-alpha-pll.c +2 -0
@@ -407,6 +407,8 @@ void clk_alpha_pll_configure(struct clk_ mask |= config->pre_div_mask; mask |= config->post_div_mask; mask |= config->vco_mask; + mask |= config->alpha_en_mask; + mask |= config->alpha_mode_mask;regmap_update_bits (regmap,PLL_USER_CTL (pll), mask, val);
Greg Kroah-Hartman
maintainerPATCH 109/273 clk: qcom: gcc-sm8550: Do not turn off PCIe GDSCs during gdsc_disable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
commit 967e011013eda287dbec9e8bd3a19ebe730b8a08 upstream.
With PWRSTS_OFF_ON, PCIe GDSCs are turned off during gdsc_disable(). This can happen during scenarios such as system suspend and breaks the resume of PCIe controllers from suspend.
So use PWRSTS_RET_ON to indicate the GDSC driver to not turn off the GDSCs during gdsc_disable() and allow the hardware to transition the GDSCs to retention when the parent domain enters low power state during system suspend.
--- drivers/clk/qcom/gcc-sm8550.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/qcom/gcc-sm8550.c +4 -4
@@ -3003,7 +3003,7 @@ static struct gdsc pcie_0_gdsc = { .pd = { .name = "pcie_0_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
@@ -3014,7 +3014,7 @@ static struct gdsc pcie_0_phy_gdsc = { .pd = { .name = "pcie_0_phy_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
@@ -3025,7 +3025,7 @@ static struct gdsc pcie_1_gdsc = { .pd = { .name = "pcie_1_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
@@ -3036,7 +3036,7 @@ static struct gdsc pcie_1_phy_gdsc = { .pd = { .name = "pcie_1_phy_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, };
Greg Kroah-Hartman
maintainerPATCH 110/273 clk: qcom: gcc-sm6350: Add missing parent_map for two clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Weiss <[email protected]>
commit 96fe1a7ee477d701cfc98ab9d3c730c35d966861 upstream.
If a clk_rcg2 has a parent, it should also have parent_map defined, otherwise we'll get a NULL pointer dereference when calling clk_set_rate like the following:
[ 3.388105] Call trace: [ 3.390664] qcom_find_src_index+0x3c/0x70 (P) [ 3.395301] qcom_find_src_index+0x1c/0x70 (L) [ 3.399934] _freq_tbl_determine_rate+0x48/0x100 [ 3.404753] clk_rcg2_determine_rate+0x1c/0x28 [ 3.409387] clk_core_determine_round_nolock+0x58/0xe4 [ 3.421414] clk_core_round_rate_nolock+0x48/0xfc [ 3.432974] clk_core_round_rate_nolock+0xd0/0xfc [ 3.444483] clk_core_set_rate_nolock+0x8c/0x300 [ 3.455886] clk_set_rate+0x38/0x14c
Add the parent_map property for two clocks where it's missing and also un-inline the parent_data as well to keep the matching parent_map and parent_data together.
--- drivers/clk/qcom/gcc-sm6350.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/clk/qcom/gcc-sm6350.c +14 -8
@@ -182,6 +182,14 @@ static const struct clk_parent_data gcc_ { .hw = &gpll0_out_odd.clkr.hw }, }; +static const struct parent_map gcc_parent_map_3[] = { + {P_BI_TCXO ,0 }, +}; + +static const struct clk_parent_data gcc_parent_data_3[] = { + { .fw_name ="bi_tcxo" }, +}; +static const struct parent_map gcc_parent_map_4[] = { {P_BI_TCXO ,0 }, {P_GPLL0_OUT_MAIN ,1 },
@@ -701,13 +709,12 @@ static struct clk_rcg2 gcc_ufs_phy_phy_a .cmd_rcgr = 0x3a0b0, .mnd_width = 0, .hid_width = 5, + .parent_map = gcc_parent_map_3, .freq_tbl = ftbl_gcc_ufs_phy_phy_aux_clk_src, .clkr.hw.init = &(struct clk_init_data ){ .name ="gcc_ufs_phy_phy_aux_clk_src" , - .parent_data = &(const struct clk_parent_data ){ - .fw_name ="bi_tcxo" , - }, - .num_parents =1 , + .parent_data = gcc_parent_data_3, + .num_parents =ARRAY_SIZE (gcc_parent_data_3), .ops = &clk_rcg2_ops, }, };
@@ -764,13 +771,12 @@ static struct clk_rcg2 gcc_usb30_prim_mo .cmd_rcgr = 0x1a034, .mnd_width = 0, .hid_width = 5, + .parent_map = gcc_parent_map_3, .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src, .clkr.hw.init = &(struct clk_init_data ){ .name ="gcc_usb30_prim_mock_utmi_clk_src" , - .parent_data = &(const struct clk_parent_data ){ - .fw_name ="bi_tcxo" , - }, - .num_parents =1 , + .parent_data = gcc_parent_data_3, + .num_parents =ARRAY_SIZE (gcc_parent_data_3), .ops = &clk_rcg2_ops, }, };
Greg Kroah-Hartman
maintainerPATCH 111/273 clk: qcom: dispcc-sm6350: Add missing parent_map for a clock
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Weiss <[email protected]>
commit d4cdb196f182d2fbe336c968228be00d8c3fed05 upstream.
If a clk_rcg2 has a parent, it should also have parent_map defined, otherwise we'll get a NULL pointer dereference when calling clk_set_rate like the following:
[ 3.388105] Call trace: [ 3.390664] qcom_find_src_index+0x3c/0x70 (P) [ 3.395301] qcom_find_src_index+0x1c/0x70 (L) [ 3.399934] _freq_tbl_determine_rate+0x48/0x100 [ 3.404753] clk_rcg2_determine_rate+0x1c/0x28 [ 3.409387] clk_core_determine_round_nolock+0x58/0xe4 [ 3.421414] clk_core_round_rate_nolock+0x48/0xfc [ 3.432974] clk_core_round_rate_nolock+0xd0/0xfc [ 3.444483] clk_core_set_rate_nolock+0x8c/0x300 [ 3.455886] clk_set_rate+0x38/0x14c
Add the parent_map property for the clock where it's missing and also un-inline the parent_data as well to keep the matching parent_map and parent_data together.
--- drivers/clk/qcom/dispcc-sm6350.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/clk/qcom/dispcc-sm6350.c +3 -4
@@ -187,13 +187,12 @@ static struct clk_rcg2 disp_cc_mdss_dp_a .cmd_rcgr = 0x1144, .mnd_width = 0, .hid_width = 5, + .parent_map = disp_cc_parent_map_6, .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src, .clkr.hw.init = &(struct clk_init_data ){ .name ="disp_cc_mdss_dp_aux_clk_src" , - .parent_data = &(const struct clk_parent_data ){ - .fw_name ="bi_tcxo" , - }, - .num_parents =1 , + .parent_data = disp_cc_parent_data_6, + .num_parents =ARRAY_SIZE (disp_cc_parent_data_6), .ops = &clk_rcg2_ops, }, };
Greg Kroah-Hartman
maintainerPATCH 112/273 clk: qcom: gcc-mdm9607: Fix cmd_rcgr offset for blsp1_uart6 rcg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Satya Priya Kakitapalli <[email protected]>
commit 88d9dca36aac9659446be1e569d8fbe3462b5741 upstream.
Fix cmd_rcgr offset for blsp1_uart6_apps_clk_src on mdm9607 platform.
--- drivers/clk/qcom/gcc-mdm9607.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/gcc-mdm9607.c +1 -1
@@ -535,7 +535,7 @@ static struct clk_rcg2 blsp1_uart5_apps_ };static struct clk_rcg2 blsp1_uart6_apps_clk_src = { - .cmd_rcgr =0x6044 , + .cmd_rcgr =0x7044 , .mnd_width =16 , .hid_width =5 , .parent_map = gcc_xo_gpll0_map,
Greg Kroah-Hartman
maintainerPATCH 113/273 clk: qcom: clk-rpmh: prevent integer overflow in recalc_rate
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anastasia Belova <[email protected]>
commit 89aa5925d201b90a48416784831916ca203658f9 upstream.
aggr_state and unit fields are u32. The result of their multiplication may not fit in this type.
Add explicit casting to prevent overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/clk/qcom/clk-rpmh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/clk-rpmh.c +1 -1
@@ -329,7 +329,7 @@ static unsigned long clk_rpmh_bcm_recalc {struct clk_rpmh *c =to_clk_rpmh (hw); -return c->aggr_state * c->unit; +return (unsigned long )c->aggr_state * c->unit; }static const struct clk_ops clk_rpmh_bcm_ops = {
Greg Kroah-Hartman
maintainerPATCH 114/273 clk: mediatek: mt2701-vdec: fix conversion to mtk_clk_simple_probe
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Golle <[email protected]>
commit 7c8746126a4e256fcf1af9174ee7d92cc3f3bc31 upstream.
Commit 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") broke DT bindings as the highest index was reduced by 1 because the id count starts from 1 and not from 0.
Fix this, like for other drivers which had the same issue, by adding a dummy clk at index 0.
--- drivers/clk/mediatek/clk-mt2701-vdec.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/mediatek/clk-mt2701-vdec.c +1 -0
@@ -31,6 +31,7 @@ static const struct mtk_gate_regs vdec1_ GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate vdec_clks[] = { +GATE_DUMMY (CLK_DUMMY ,"vdec_dummy" ),GATE_VDEC0 (CLK_VDEC_CKGEN ,"vdec_cken" ,"vdec_sel" ,0 ),GATE_VDEC1 (CLK_VDEC_LARB ,"vdec_larb_cken" ,"mm_sel" ,0 ), };
Greg Kroah-Hartman
maintainerPATCH 115/273 clk: mediatek: mt2701-aud: fix conversion to mtk_clk_simple_probe
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Golle <[email protected]>
commit 5fba40be5fbad563914e3ce9d5129a6baaea1ff5 upstream.
Some of the audio subsystem clocks defined in clk-mt2701.h aren't actually used by the driver. This broke conversion to mtk_clk_simple_probe which expects that the highest possible clk id is defined by the ARRAY_SIZE.
Add additional dummy clocks to fill the gaps and remain compatible with the existing DT bindings.
--- drivers/clk/mediatek/clk-mt2701-aud.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/clk/mediatek/clk-mt2701-aud.c +10 -0
@@ -55,10 +55,16 @@ static const struct mtk_gate audio_clks[GATE_DUMMY (CLK_DUMMY ,"aud_dummy" ),/* AUDIO0 */ GATE_AUDIO0 (CLK_AUD_AFE ,"audio_afe" ,"aud_intbus_sel" ,2 ), +GATE_DUMMY (CLK_AUD_LRCK_DETECT ,"audio_lrck_detect_dummy" ), +GATE_DUMMY (CLK_AUD_I2S ,"audio_i2c_dummy" ), +GATE_DUMMY (CLK_AUD_APLL_TUNER ,"audio_apll_tuner_dummy" ),GATE_AUDIO0 (CLK_AUD_HDMI ,"audio_hdmi" ,"audpll_sel" ,20 ),GATE_AUDIO0 (CLK_AUD_SPDF ,"audio_spdf" ,"audpll_sel" ,21 ),GATE_AUDIO0 (CLK_AUD_SPDF2 ,"audio_spdf2" ,"audpll_sel" ,22 ),GATE_AUDIO0 (CLK_AUD_APLL ,"audio_apll" ,"audpll_sel" ,23 ), +GATE_DUMMY (CLK_AUD_TML ,"audio_tml_dummy" ), +GATE_DUMMY (CLK_AUD_AHB_IDLE_EXT ,"audio_ahb_idle_ext_dummy" ), +GATE_DUMMY (CLK_AUD_AHB_IDLE_INT ,"audio_ahb_idle_int_dummy" ),/* AUDIO1 */ GATE_AUDIO1 (CLK_AUD_I2SIN1 ,"audio_i2sin1" ,"aud_mux1_sel" ,0 ), GATE_AUDIO1(CLK_AUD_I2SIN2, "audio_i2sin2", "aud_mux1_sel", 1),
@@ -76,10 +82,12 @@ static const struct mtk_gate audio_clks[GATE_AUDIO1 (CLK_AUD_ASRCI2 ,"audio_asrci2" ,"asm_h_sel" ,13 ),GATE_AUDIO1 (CLK_AUD_ASRCO1 ,"audio_asrco1" ,"asm_h_sel" ,14 ),GATE_AUDIO1 (CLK_AUD_ASRCO2 ,"audio_asrco2" ,"asm_h_sel" ,15 ), +GATE_DUMMY (CLK_AUD_HDMIRX ,"audio_hdmirx_dummy" ),GATE_AUDIO1 (CLK_AUD_INTDIR ,"audio_intdir" ,"intdir_sel" ,20 ),GATE_AUDIO1 (CLK_AUD_A1SYS ,"audio_a1sys" ,"aud_mux1_sel" ,21 ),GATE_AUDIO1 (CLK_AUD_A2SYS ,"audio_a2sys" ,"aud_mux2_sel" ,22 ),GATE_AUDIO1 (CLK_AUD_AFE_CONN ,"audio_afe_conn" ,"aud_mux1_sel" ,23 ), +GATE_DUMMY (CLK_AUD_AFE_PCMIF ,"audio_afe_pcmif_dummy" ),GATE_AUDIO1 (CLK_AUD_AFE_MRGIF ,"audio_afe_mrgif" ,"aud_mux1_sel" ,25 ),/* AUDIO2 */ GATE_AUDIO2(CLK_AUD_MMIF_UL1, "audio_ul1", "aud_mux1_sel", 0),
@@ -100,6 +108,8 @@ static const struct mtk_gate audio_clks[GATE_AUDIO2 (CLK_AUD_MMIF_AWB2 ,"audio_awb2" ,"aud_mux1_sel" ,15 ),GATE_AUDIO2 (CLK_AUD_MMIF_DAI ,"audio_dai" ,"aud_mux1_sel" ,16 ),/* AUDIO3 */ +GATE_DUMMY (CLK_AUD_DMIC1 ,"audio_dmic1_dummy" ), +GATE_DUMMY (CLK_AUD_DMIC2 ,"audio_dmic2_dummy" ),GATE_AUDIO3 (CLK_AUD_ASRCI3 ,"audio_asrci3" ,"asm_h_sel" ,2 ),GATE_AUDIO3 (CLK_AUD_ASRCI4 ,"audio_asrci4" ,"asm_h_sel" ,3 ), GATE_AUDIO3(CLK_AUD_ASRCI5, "audio_asrci5", "asm_h_sel", 4),
Greg Kroah-Hartman
maintainerPATCH 116/273 clk: mediatek: mt2701-bdp: add missing dummy clk
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Golle <[email protected]>
commit fd291adc5e9a4ee6cd91e57f148f3b427f80647b upstream.
Add dummy clk for index 0 which was missed during the conversion to mtk_clk_simple_probe().
--- drivers/clk/mediatek/clk-mt2701-bdp.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/mediatek/clk-mt2701-bdp.c +1 -0
@@ -31,6 +31,7 @@ static const struct mtk_gate_regs bdp1_c GATE_MTK(_id, _name, _parent, &bdp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate bdp_clks[] = { +GATE_DUMMY (CLK_DUMMY ,"bdp_dummy" ),GATE_BDP0 (CLK_BDP_BRG_BA ,"brg_baclk" ,"mm_sel" ,0 ),GATE_BDP0 (CLK_BDP_BRG_DRAM ,"brg_dram" ,"mm_sel" ,1 ),GATE_BDP0 (CLK_BDP_LARB_DRAM ,"larb_dram" ,"mm_sel" ,2 ),
Greg Kroah-Hartman
maintainerPATCH 117/273 clk: mediatek: mt2701-img: add missing dummy clk
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Golle <[email protected]>
commit 366640868ccb4a7991aebe8442b01340fab218e2 upstream.
Add dummy clk for index 0 which was missed during the conversion to mtk_clk_simple_probe().
--- drivers/clk/mediatek/clk-mt2701-img.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/mediatek/clk-mt2701-img.c +1 -0
@@ -22,6 +22,7 @@ static const struct mtk_gate_regs img_cg GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate img_clks[] = { +GATE_DUMMY (CLK_DUMMY ,"img_dummy" ),GATE_IMG (CLK_IMG_SMI_COMM ,"img_smi_comm" ,"mm_sel" ,0 ),GATE_IMG (CLK_IMG_RESZ ,"img_resz" ,"mm_sel" ,1 ),GATE_IMG (CLK_IMG_JPGDEC_SMI ,"img_jpgdec_smi" ,"mm_sel" ,5 ),
Greg Kroah-Hartman
maintainerPATCH 100/273 drm/i915/guc: Debug print LRC state entries only if the context is pinned
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Ceraolo Spurio <[email protected]>
commit 57965269896313e1629a518d3971ad55f599b792 upstream.
After the context is unpinned the backing memory can also be unpinned, so any accesses via the lrc_reg_state pointer can end up in unmapped memory. To avoid that, make sure to only access that memory if the context is pinned when printing its info.
v2: fix newline alignment
--- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +14 -6
@@ -5154,12 +5154,20 @@ static inline void guc_log_context(struc {drm_printf (p,"GuC lrc descriptor %u:\n" , ce->guc_id.id);drm_printf (p,"\tHW Context Desc: 0x%08x\n" , ce->lrc.lrca); -drm_printf (p,"\t\tLRC Head: Internal %u, Memory %u\n" , - ce->ring->head, - ce->lrc_reg_state[CTX_RING_HEAD ]); -drm_printf (p,"\t\tLRC Tail: Internal %u, Memory %u\n" , - ce->ring->tail, - ce->lrc_reg_state[CTX_RING_TAIL ]); +if (intel_context_pin_if_active (ce)) { +drm_printf (p,"\t\tLRC Head: Internal %u, Memory %u\n" , + ce->ring->head, + ce->lrc_reg_state[CTX_RING_HEAD ]); +drm_printf (p,"\t\tLRC Tail: Internal %u, Memory %u\n" , + ce->ring->tail, + ce->lrc_reg_state[CTX_RING_TAIL ]); +intel_context_unpin (ce); + }else { +drm_printf (p,"\t\tLRC Head: Internal %u, Memory not pinned\n" , + ce->ring->head); +drm_printf (p,"\t\tLRC Tail: Internal %u, Memory not pinned\n" , + ce->ring->tail); + }drm_printf (p,"\t\tContext Pin Count: %u\n" ,atomic_read (&ce->pin_count)); drm_printf(p, "\t\tGuC ID Ref Count: %u\n",
Greg Kroah-Hartman
maintainerPATCH 118/273 clk: mediatek: mt2701-mm: add missing dummy clk
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Golle <[email protected]>
commit 67aea188f23a5dde51c31a720ccf66aed0ce4187 upstream.
Add dummy clk which was missed during the conversion to mtk_clk_pdev_probe() and is required for the existing DT bindings to keep working.
--- drivers/clk/mediatek/clk-mt2701-mm.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/mediatek/clk-mt2701-mm.c +1 -0
@@ -31,6 +31,7 @@ static const struct mtk_gate_regs disp1_ GATE_MTK(_id, _name, _parent, &disp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mm_clks[] = { +GATE_DUMMY (CLK_DUMMY ,"mm_dummy" ),GATE_DISP0 (CLK_MM_SMI_COMMON ,"mm_smi_comm" ,"mm_sel" ,0 ),GATE_DISP0 (CLK_MM_SMI_LARB0 ,"mm_smi_larb0" ,"mm_sel" ,1 ),GATE_DISP0 (CLK_MM_CMDQ ,"mm_cmdq" ,"mm_sel" ,2 ),
Greg Kroah-Hartman
maintainerPATCH 119/273 blk-cgroup: Fix class @block_classs subsystem refcount leakage
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit d1248436cbef1f924c04255367ff4845ccd9025e upstream.
blkcg_fill_root_iostats() iterates over @block_class's devices by class_dev_iter_(init|next)(), but does not end iterating with class_dev_iter_exit(), so causes the class's subsystem refcount leakage.
Fix by ending the iterating with class_dev_iter_exit().
--- block/blk-cgroup.c | 1 + 1 file changed, 1 insertion(+)
block/blk-cgroup.c +1 -0
@@ -1139,6 +1139,7 @@ static void blkcg_fill_root_iostats(voidblkg_iostat_set (&blkg->iostat.cur, &tmp);u64_stats_update_end_irqrestore (&blkg->iostat.sync, flags); } +class_dev_iter_exit (&iter); }static void blkcg_print_one_stat (struct blkcg_gq *blkg,struct seq_file *s)
Greg Kroah-Hartman
maintainerPATCH 120/273 efi: libstub: Use -std=gnu11 to fix build with GCC 15
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 8ba14d9f490aef9fd535c04e9e62e1169eb7a055 upstream.
GCC 15 changed the default C standard version to C23, which should not have impacted the kernel because it requests the gnu11 standard via '-std=' in the main Makefile. However, the EFI libstub Makefile uses its own set of KBUILD_CFLAGS for x86 without a '-std=' value (i.e., using the default), resulting in errors from the kernel's definitions of bool, true, and false in stddef.h, which are reserved keywords under C23.
./include/linux/stddef.h:11:9: error: expected identifier before ‘false’
11 | false = 0,
./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
35 | typedef _Bool bool;
Set '-std=gnu11' in the x86 cflags to resolve the error and consistently use the same C standard version for the entire kernel. All other architectures reuse KBUILD_CFLAGS from the rest of the kernel, so this issue is not visible for them.
--- drivers/firmware/efi/libstub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/libstub/Makefile +1 -1
@@ -11,7 +11,7 @@ cflags-y := $(KBUILD_CFLAGS) cflags-$(CONFIG_X86_32) := -march=i386 cflags-$(CONFIG_X86_64) := -mcmodel=small -cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \ +cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -std=gnu11 \ -fPIC -fno-strict-aliasing -mno-red-zone \ -mno-mmx -mno-sse -fshort-wchar \ -Wno-pointer-sign \
Greg Kroah-Hartman
maintainerPATCH 121/273 perf bench: Fix undefined behavior in cmpworker()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuan-Wei Chiu <[email protected]>
commit 62892e77b8a64b9dc0e1da75980aa145347b6820 upstream.
The comparison function cmpworker() violates the C standard's requirements for qsort() comparison functions, which mandate symmetry and transitivity:
Symmetry: If x < y, then y > x.
Transitivity: If x < y and y < z, then x < z.
In its current implementation, cmpworker() incorrectly returns 0 when w1->tid < w2->tid, which breaks both symmetry and transitivity. This violation causes undefined behavior, potentially leading to issues such as memory corruption in glibc [1].
Fix the issue by returning -1 when w1->tid < w2->tid, ensuring compliance with the C standard and preventing undefined behavior.
--- tools/perf/bench/epoll-wait.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/perf/bench/epoll-wait.c +6 -1
@@ -420,7 +420,12 @@ static int cmpworker(const void *p1, construct worker *w1 = (struct worker *) p1;struct worker *w2 = (struct worker *) p2; -return w1->tid > w2->tid; + +if (w1->tid > w2->tid) +return 1 ; +if (w1->tid < w2->tid) +return -1 ; +return 0 ; }int bench_epoll_wait (int argc,const char **argv)
Greg Kroah-Hartman
maintainerPATCH 122/273 scsi: ufs: core: Fix the HIGH/LOW_TEMP Bit Definitions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bao D. Nguyen <[email protected]>
commit 1b3e2d4ec0c5848776cc56d2624998aa5b2f0d27 upstream.
According to the UFS Device Specification, the dExtendedUFSFeaturesSupport defines the support for TOO_HIGH_TEMPERATURE as bit[4] and the TOO_LOW_TEMPERATURE as bit[5]. Correct the code to match with the UFS device specification definition.
--- include/ufs/ufs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/ufs/ufs.h +2 -2
@@ -384,8 +384,8 @@ enum {/* Possible values for dExtendedUFSFeaturesSupport */ enum { -UFS_DEV_LOW_TEMP_NOTIF =BIT (4 ), -UFS_DEV_HIGH_TEMP_NOTIF =BIT (5 ), +UFS_DEV_HIGH_TEMP_NOTIF =BIT (4 ), +UFS_DEV_LOW_TEMP_NOTIF =BIT (5 ),UFS_DEV_EXT_TEMP_NOTIF =BIT (6 ),UFS_DEV_HPB_SUPPORT =BIT (7 ),UFS_DEV_WRITE_BOOSTER_SUP =BIT (8 ),
Greg Kroah-Hartman
maintainerPATCH 123/273 of: Correct child specifier used as input of the 2nd nexus node
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit e4c00c9b1f70cd11792ff5b825899a6ee0234a62 upstream.
API of_parse_phandle_with_args_map() will use wrong input for nexus node Nexus_2 as shown below:
Node_1 Nexus_1 Nexus_2
&Nexus_1,arg_1 -> arg_1,&Nexus_2,arg_2' -> &Nexus_2,arg_2 -> arg_2,...
map-pass-thru=<...>
Nexus_1's output arg_2 should be used as input of Nexus_2, but the API wrongly uses arg_2' instead which != arg_2 due to Nexus_1's map-pass-thru.
Fix by always making @match_array point to @initial_match_array into which to store nexus output.
--- drivers/of/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/base.c +1 -1
@@ -1453,7 +1453,6 @@ int of_parse_phandle_with_args_map(const* specifier into the out_args structure, keeping the * bits specified in <list>-map-pass-thru. */ - match_array = map - new_size;for (i =0 ; i < new_size; i++) {__be32 val = *(map - new_size + i);
@@ -1462,6 +1461,7 @@ int of_parse_phandle_with_args_map(const val |=cpu_to_be32 (out_args->args[i]) & pass[i]; } + initial_match_array[i] = val; out_args->args[i] =be32_to_cpu (val); } out_args->args_count = list_size = new_size;
Greg Kroah-Hartman
maintainerPATCH 124/273 of: Fix of_find_node_opts_by_path() handling of alias+path+options
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit b9e58c934c56aa35b0fb436d9afd86ef326bae0e upstream.
of_find_node_opts_by_path() fails to find OF device node when its @path parameter have pattern below:
"alias-name/node-name-1/.../node-name-N:options".
The reason is that alias name length calculated by the API is wrong, as explained by example below:
"testcase-alias/phandle-tests/consumer-a:testaliasoption".
^ ^ ^ 0 14 39
The right length of alias 'testcase-alias' is 14, but the result worked out by the API is 39 which is obvious wrong.
Fix by using index of either '/' or ':' as the length who comes earlier.
--- drivers/of/base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/of/base.c +3 -3
@@ -788,10 +788,10 @@ struct device_node *of_find_node_opts_by/* The path could begin with an alias */ if (*path !='/' ) {int len; -const char *p = separator; +const char *p =strchrnul (path,'/' ); -if (!p) - p =strchrnul (path,'/' ); +if (separator && separator < p) + p = separator; len = p - path;/* of_aliases must not be NULL */
Greg Kroah-Hartman
maintainerPATCH 125/273 of: reserved-memory: Fix using wrong number of cells to get property alignment
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit 267b21d0bef8e67dbe6c591c9991444e58237ec9 upstream.
According to DT spec, size of property 'alignment' is based on parent node’s #size-cells property.
But __reserved_mem_alloc_size() wrongly uses @dt_root_addr_cells to get the property obviously.
Fix by using @dt_root_size_cells instead of @dt_root_addr_cells.
--- drivers/of/of_reserved_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/of/of_reserved_mem.c +2 -2
@@ -156,12 +156,12 @@ static int __init __reserved_mem_alloc_s prop =of_get_flat_dt_prop (node,"alignment" , &len);if (prop) { -if (len != dt_root_addr_cells *sizeof (__be32)) { +if (len != dt_root_size_cells *sizeof (__be32)) {pr_err ("invalid alignment property in '%s' node.\n" , uname);return -EINVAL ; } - align =dt_mem_next_cell (dt_root_addr_cells, &prop); + align =dt_mem_next_cell (dt_root_size_cells, &prop); } nomap =of_get_flat_dt_prop (node,"no-map" ,NULL ) !=NULL ;
Greg Kroah-Hartman
maintainerPATCH 126/273 HID: hid-sensor-hub: dont use stale platform-data on remove
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <[email protected]>
commit 8a5b38c3fd709e8acd2bfdedf66c25e6af759576 upstream.
The hid-sensor-hub creates the individual device structs and transfers them to the created mfd platform-devices via the platform_data in the mfd_cell.
Before e651a1da442a ("HID: hid-sensor-hub: Allow parallel synchronous reads") the sensor-hub was managing access centrally, with one "completion" in the hub's data structure, which needed to be finished on removal at the latest.
The mentioned commit then moved this central management to each hid sensor device, resulting on a completion in each struct hid_sensor_hub_device. The remove procedure was adapted to go through all sensor devices and finish any pending "completion".
What this didn't take into account was, platform_device_add_data() that is used by mfd_add{_hotplug}_devices() does a kmemdup on the submitted platform-data. So the data the platform-device gets is a copy of the original data, meaning that the device worked on a different completion than what sensor_hub_remove() currently wants to access.
To fix that, use device_for_each_child() to go through each child-device similar to how mfd_remove_devices() unregisters the devices later and with that get the live platform_data to finalize the correct completion.
--- drivers/hid/hid-sensor-hub.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/hid/hid-sensor-hub.c +14 -7
@@ -730,23 +730,30 @@ err_stop_hw:return ret; } +static int sensor_hub_finalize_pending_fn (struct device *dev,void *data) +{ +struct hid_sensor_hub_device *hsdev = dev->platform_data; + +if (hsdev->pending.status) +complete (&hsdev->pending.ready); + +return 0 ; +} +static void sensor_hub_remove (struct hid_device *hdev) {struct sensor_hub_data *data =hid_get_drvdata (hdev);unsigned long flags; -int i;hid_dbg (hdev," hardware removed\n" );hid_hw_close (hdev);hid_hw_stop (hdev); +spin_lock_irqsave (&data->lock, flags); -for (i =0 ; i < data->hid_sensor_client_cnt; ++i) { -struct hid_sensor_hub_device *hsdev = - data->hid_sensor_hub_client_devs[i].platform_data; -if (hsdev->pending.status) -complete (&hsdev->pending.ready); - } +device_for_each_child (&hdev->dev,NULL , + sensor_hub_finalize_pending_fn);spin_unlock_irqrestore (&data->lock, flags); +mfd_remove_devices (&hdev->dev);mutex_destroy (&data->mutex); }
Greg Kroah-Hartman
maintainerPATCH 127/273 wifi: rtlwifi: rtl8821ae: Fix media status report
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
commit 66ef0289ac99e155d206ddaa0fdfad09ae3cd007 upstream.
RTL8821AE is stuck transmitting at the lowest rate allowed by the rate mask. This is because the firmware doesn't know the device is connected to a network.
Fix the macros SET_H2CCMD_MSRRPT_PARM_OPMODE and SET_H2CCMD_MSRRPT_PARM_MACID_IND to work on the first byte of __cmd, not the second. Now the firmware is correctly notified when the device is connected to a network and it activates the rate control.
Before (MCS3):
[ 5] 0.00-1.00 sec 12.5 MBytes 105 Mbits/sec 0 339 KBytes [ 5] 1.00-2.00 sec 10.6 MBytes 89.1 Mbits/sec 0 339 KBytes [ 5] 2.00-3.00 sec 10.6 MBytes 89.1 Mbits/sec 0 386 KBytes [ 5] 3.00-4.00 sec 10.6 MBytes 89.1 Mbits/sec 0 386 KBytes [ 5] 4.00-5.00 sec 10.2 MBytes 86.0 Mbits/sec 0 427 KBytes
After (MCS9):
[ 5] 0.00-1.00 sec 33.9 MBytes 284 Mbits/sec 0 771 KBytes [ 5] 1.00-2.00 sec 31.6 MBytes 265 Mbits/sec 0 865 KBytes [ 5] 2.00-3.00 sec 29.9 MBytes 251 Mbits/sec 0 963 KBytes [ 5] 3.00-4.00 sec 28.2 MBytes 237 Mbits/sec 0 963 KBytes [ 5] 4.00-5.00 sec 26.8 MBytes 224 Mbits/sec 0 963 KBytes
--- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h +2 -2
@@ -197,9 +197,9 @@ enum rtl8821a_h2c_cmd {/* _MEDIA_STATUS_RPT_PARM_CMD1 */ #define SET_H2CCMD_MSRRPT_PARM_OPMODE (__cmd, __value) \ - u8p_replace_bits(__cmd + 1, __value, BIT(0)) + u8p_replace_bits(__cmd, __value, BIT(0))#define SET_H2CCMD_MSRRPT_PARM_MACID_IND (__cmd, __value) \ - u8p_replace_bits(__cmd + 1, __value, BIT(1)) + u8p_replace_bits(__cmd, __value, BIT(1))/* AP_OFFLOAD */ #define SET_H2CCMD_AP_OFFLOAD_ON (__cmd, __value) \
Greg Kroah-Hartman
maintainerPATCH 101/273 drm/i915: Fix page cleanup on DMA remap failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Geffon <[email protected]>
commit fa6182c8b13ebfdc70ebdc09161a70dd8131f3b1 upstream.
When converting to folios the cleanup path of shmem_get_pages() was missed. When a DMA remap fails and the max segment size is greater than PAGE_SIZE it will attempt to retry the remap with a PAGE_SIZEd segment size. The cleanup code isn't properly using the folio apis and as a result isn't handling compound pages correctly.
v2 -> v3:
(Ville) Just use shmem_sg_free_table() as-is in the failure path of shmem_get_pages(). shmem_sg_free_table() will clear mapping unevictable but it will be reset when it retries in shmem_sg_alloc_table().
v1 -> v2:
(Ville) Fixed locations where we were not clearing mapping unevictable.
--- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +1 -5
@@ -209,8 +209,6 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)struct address_space *mapping = obj->base.filp->f_mapping;unsigned int max_segment =i915_sg_segment_size (i915->drm.dev);struct sg_table *st; -struct sgt_iter sgt_iter; -struct page *page;int ret;/*
@@ -239,9 +237,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)* for PAGE_SIZE chunks instead may be helpful. */ if (max_segment >PAGE_SIZE ) { -for_each_sgt_page (page, sgt_iter, st) -put_page (page); -sg_free_table (st); +shmem_sg_free_table (st, mapping, false, false);kfree (st); max_segment =PAGE_SIZE ;
Signature · 1 line
2.48.1
Greg Kroah-Hartman
maintainerPATCH 128/273 wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcel Hamer <[email protected]>
commit 68abd0c4ebf24cd499841a488b97a6873d5efabb upstream.
On removal of the device or unloading of the kernel module a potential NULL pointer dereference occurs.
The following sequence deletes the interface:
brcmf_detach()
brcmf_remove_interface()
brcmf_del_if()Inside the brcmf_del_if() function the drvr->if2bss[ifidx] is updated to BRCMF_BSSIDX_INVALID (-1) if the bsscfgidx matches.
After brcmf_remove_interface() call the brcmf_proto_detach() function is called providing the following sequence:
brcmf_detach()
brcmf_proto_detach()
brcmf_proto_msgbuf_detach()
brcmf_flowring_detach()
brcmf_msgbuf_delete_flowring()
brcmf_msgbuf_remove_flowring()
brcmf_flowring_delete()
brcmf_get_ifp()
brcmf_txfinalize()Since brcmf_get_ip() can and actually will return NULL in this case the call to brcmf_txfinalize() will result in a NULL pointer dereference inside brcmf_txfinalize() when trying to update ifp->ndev->stats.tx_errors.
This will only happen if a flowring still has an skb.
Although the NULL pointer dereference has only been seen when trying to update the tx statistic, all other uses of the ifp pointer have been guarded as well with an early return if ifp is NULL.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +5 -0
@@ -540,6 +540,11 @@ void brcmf_txfinalize(struct brcmf_if *istruct ethhdr *eh;u16 type; +if (!ifp) { +brcmu_pkt_buf_free_skb (txp); +return ; + } + eh = (struct ethhdr *)(txp->data); type =ntohs (eh->h_proto);
Greg Kroah-Hartman
maintainerPATCH 129/273 wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nick Morrow <[email protected]>
commit 47d9a8ba1d7f31c674b6936b3c34ee934aa9b420 upstream.
Add VID/PID 35bc/0107 for recently released TP-Link TXE50UH USB WiFi adapter.
--- drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/usb.c +3 -0
@@ -21,6 +21,9 @@ static const struct usb_device_id mt7921/* Netgear, Inc. [A8000,AXE3000] */ { USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9060, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM }, + /* TP-Link TXE50UH */ + { USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0107, 0xff, 0xff, 0xff), + .driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM }, { }, };
Greg Kroah-Hartman
maintainerPATCH 130/273 wifi: rtw88: sdio: Fix disconnection after beacon loss
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fiona Klute <[email protected]>
commit fb2fcfbe5eef9ae26b0425978435ae1308951e51 upstream.
This is the equivalent of commit 28818b4d871b ("wifi: rtw88: usb: Fix disconnection after beacon loss") for SDIO chips.
Tested on Pinephone (RTL8723CS), random disconnections became rare, instead of a frequent nuisance.
--- drivers/net/wireless/realtek/rtw88/sdio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/realtek/rtw88/sdio.c +2 -0
@@ -1191,6 +1191,8 @@ static void rtw_sdio_indicate_tx_status(struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb);struct ieee80211_hw *hw = rtwdev->hw; +skb_pull (skb, rtwdev->chip->tx_pkt_desc_sz); +/* enqueue to wait for tx report */ if (info->flags &IEEE80211_TX_CTL_REQ_TX_STATUS ) {rtw_tx_report_enqueue (rtwdev, skb, tx_data->sn);
Greg Kroah-Hartman
maintainerPATCH 131/273 wifi: mt76: mt7915: add module param to select 5 GHz or 6 GHz on MT7916
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shayne Chen <[email protected]>
commit 57af267d2b8f5d88485c6372761386d79c5e6a1a upstream.
Due to a limitation in available memory, the MT7916 firmware can only handle either 5 GHz or 6 GHz at a time. It does not support runtime switching without a full restart.
On older firmware, this accidentally worked to some degree due to missing checks, but couldn't be supported properly, because it left the 6 GHz channels uncalibrated.
Newer firmware refuses to start on either band if the passed EEPROM data indicates support for both.
Deal with this limitation by using a module parameter to specify the preferred band in case both are supported.
--- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 21 +++++++++++++++++++-- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 4 ++-- 2 files changed, 21 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +19 -2
@@ -2,9 +2,14 @@/* Copyright (C) 2020 MediaTek Inc. */ #include <linux/firmware.h> +#include <linux/moduleparam.h> #include "mt7915.h" #include "eeprom.h" +static bool enable_6ghz; +module_param (enable_6ghz, bool,0644 ); +MODULE_PARM_DESC (enable_6ghz,"Enable 6 GHz instead of 5 GHz on hardware that supports both" ); +static int mt7915_eeprom_load_precal (struct mt7915_dev *dev) {struct mt76_dev *mdev = &dev->mt76;
@@ -159,8 +164,20 @@ static void mt7915_eeprom_parse_band_con phy->mt76->cap.has_6ghz = true;return ;case MT_EE_V2_BAND_SEL_5GHZ_6GHZ : - phy->mt76->cap.has_5ghz = true; - phy->mt76->cap.has_6ghz = true; +if (enable_6ghz) { + phy->mt76->cap.has_6ghz = true; +u8p_replace_bits (&eeprom[MT_EE_WIFI_CONF + band], +MT_EE_V2_BAND_SEL_6GHZ , +MT_EE_WIFI_CONF0_BAND_SEL ); + }else { + phy->mt76->cap.has_5ghz = true; +u8p_replace_bits (&eeprom[MT_EE_WIFI_CONF + band], +MT_EE_V2_BAND_SEL_5GHZ , +MT_EE_WIFI_CONF0_BAND_SEL ); + } +/* force to buffer mode */ + dev->flash_mode = true; +return ;default : phy->mt76->cap.has_2ghz = true;
drivers/net/wireless/mediatek/mt76/mt7915/init.c +2 -2
@@ -1220,14 +1220,14 @@ int mt7915_register_device(struct mt7915if (ret) goto unreg_dev; -ieee80211_queue_work (mt76_hw (dev), &dev->init_work); -if (phy2) { ret =mt7915_register_ext_phy (dev, phy2);if (ret) goto unreg_thermal; } +ieee80211_queue_work (mt76_hw (dev), &dev->init_work); + dev->recovery.hw_init_done = true; ret =mt7915_init_debugfs (&dev->phy);
Greg Kroah-Hartman
maintainerPATCH 132/273 usb: gadget: f_tcm: Translate error to sense
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit 98fa00fd3ae43b857b4976984a135483d89d9281 upstream.
When respond with check_condition error status, clear from_transport input so the target layer can translate the sense reason reported by f_tcm.
--- drivers/usb/gadget/function/f_tcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_tcm.c +2 -2
@@ -1065,7 +1065,7 @@ static void usbg_cmd_work(struct work_st out:transport_send_check_condition_and_sense (se_cmd, -TCM_UNSUPPORTED_SCSI_OPCODE ,1 ); +TCM_UNSUPPORTED_SCSI_OPCODE ,0 ); } static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
@@ -1193,7 +1193,7 @@ static void bot_cmd_work(struct work_str out:transport_send_check_condition_and_sense (se_cmd, -TCM_UNSUPPORTED_SCSI_OPCODE ,1 ); +TCM_UNSUPPORTED_SCSI_OPCODE ,0 ); } static int bot_submit_command(struct f_uas *fu,
Greg Kroah-Hartman
maintainerPATCH 102/273 drm/komeda: Add check for komeda_get_layer_fourcc_list()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haoxiang Li <[email protected]>
commit 79fc672a092d93a7eac24fe20a571d4efd8fa5a4 upstream.
Add check for the return value of komeda_get_layer_fourcc_list() to catch the potential exception.
--- drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +4 -0
@@ -160,6 +160,10 @@ static int komeda_wb_connector_add(struc formats =komeda_get_layer_fourcc_list (&mdev->fmt_tbl, kwb_conn->wb_layer->layer_type, &n_formats); +if (!formats) { +kfree (kwb_conn); +return -ENOMEM ; + } err = drm_writeback_connector_init(&kms->base, wb_conn, &komeda_wb_connector_funcs,
Greg Kroah-Hartman
maintainerPATCH 103/273 drm/i915: Drop 64bpp YUV formats from ICL+ SDR planes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit c7b49506b3ba7a62335e6f666a43f67d5cd9fd1e upstream.
I'm seeing underruns with these 64bpp YUV formats on TGL.
The weird details:
- only happens on pipe B/C/D SDR planes, pipe A SDR planes seem fine, as do all HDR planes
- somehow CDCLK related, higher CDCLK allows for bigger plane with these formats without underruns. With 300MHz CDCLK I can only go up to 1200 pixels wide or so, with 650MHz even a 3840 pixel wide plane was OK
- ICL and ADL so far appear unaffected
So not really sure what's the deal with this, but bspec does state "64-bit formats supported only on the HDR planes" so let's just drop these formats from the SDR planes. We already disallow 64bpp RGB formats.
--- drivers/gpu/drm/i915/display/skl_universal_plane.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/display/skl_universal_plane.c +0 -4
@@ -102,8 +102,6 @@ static const u32 icl_sdr_y_plane_formatsDRM_FORMAT_Y216 ,DRM_FORMAT_XYUV8888 , DRM_FORMAT_XVYU2101010, -DRM_FORMAT_XVYU12_16161616 , - DRM_FORMAT_XVYU16161616, }; static const u32 icl_sdr_uv_plane_formats[] = {
@@ -130,8 +128,6 @@ static const u32 icl_sdr_uv_plane_formatDRM_FORMAT_Y216 ,DRM_FORMAT_XYUV8888 , DRM_FORMAT_XVYU2101010, -DRM_FORMAT_XVYU12_16161616 , - DRM_FORMAT_XVYU16161616, }; static const u32 icl_hdr_plane_formats[] = {
Greg Kroah-Hartman
maintainerPATCH 104/273 Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
commit 5f397409f8ee5bc82901eeaf799e1cbc4f8edcf1 upstream.
A NULL sock pointer is passed into l2cap_sock_alloc() when it is called from l2cap_sock_new_connection_cb() and the error handling paths should also be aware of it.
Seemingly a more elegant solution would be to swap bt_sock_alloc() and l2cap_chan_create() calls since they are not interdependent to that moment but then l2cap_chan_create() adds the soon to be deallocated and still dummy-initialized channel to the global list accessible by many L2CAP paths. The channel would be removed from the list in short period of time but be a bit more straight-forward here and just check for NULL instead of changing the order of function calls.
Found by Linux Verification Center (linuxtesting.org) with SVACE static analysis tool.
--- net/bluetooth/l2cap_sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_sock.c +2 -1
@@ -1885,7 +1885,8 @@ static struct sock *l2cap_sock_alloc(str chan =l2cap_chan_create ();if (!chan) {sk_free (sk); - sock->sk =NULL ; +if (sock) + sock->sk =NULL ;return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 105/273 Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
commit 5c61419e02033eaf01733d66e2fcd4044808f482 upstream.
One of the possible ways to enable the input MTU auto-selection for L2CAP connections is supposed to be through passing a special "0" value for it as a socket option. Commit [1] added one of those into avdtp. However, it simply wouldn't work because the kernel still treats the specified value as invalid and denies the setting attempt. Recorded BlueZ logs include the following:
bluetoothd[496]: profiles/audio/avdtp.c:l2cap_connect() setsockopt(L2CAP_OPTIONS): Invalid argument (22)
[1]: https://github.com/bluez/bluez/commit/ae5be371a9f53fed33d2b34748a95a5498fd4b77
Found by Linux Verification Center (linuxtesting.org).
--- net/bluetooth/l2cap_sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bluetooth/l2cap_sock.c +2 -2
@@ -709,12 +709,12 @@ static bool l2cap_valid_mtu(struct l2cap {switch (chan->scid) {case L2CAP_CID_ATT : -if (mtu <L2CAP_LE_MIN_MTU ) +if (mtu && mtu <L2CAP_LE_MIN_MTU )return false;break ;default : -if (mtu <L2CAP_DEFAULT_MIN_MTU ) +if (mtu && mtu <L2CAP_DEFAULT_MIN_MTU )return false; }
Greg Kroah-Hartman
maintainerPATCH 106/273 clk: sunxi-ng: a100: enable MMC clock reparenting
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cody Eksal <[email protected]>
commit 16414720045de30945b8d14b7907e0cbf81a4b49 upstream.
While testing the MMC nodes proposed in [1], it was noted that mmc0/1 would fail to initialize, with "mmc: fatal err update clk timeout" in the kernel logs. A closer look at the clock definitions showed that the MMC MPs had the "CLK_SET_RATE_NO_REPARENT" flag set. No reason was given for adding this flag in the first place, and its original purpose is unknown, but it doesn't seem to make sense and results in severe limitations to MMC speeds. Thus, remove this flag from the 3 MMC MPs.
[1] https://msgid.link/[email protected]
--- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/sunxi-ng/ccu-sun50i-a100.c +3 -3
@@ -436,7 +436,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDI24 ,2 ,/* mux */ BIT (31 ),/* gate */ 2 ,/* post-div */ - CLK_SET_RATE_NO_REPARENT); + 0); static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834, 0, 4, /* M */
@@ -444,7 +444,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDI24 ,2 ,/* mux */ BIT (31 ),/* gate */ 2 ,/* post-div */ - CLK_SET_RATE_NO_REPARENT); + 0); static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838, 0, 4, /* M */
@@ -452,7 +452,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDI24 ,2 ,/* mux */ BIT (31 ),/* gate */ 2 ,/* post-div */ - CLK_SET_RATE_NO_REPARENT); + 0); static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0); static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0);
Greg Kroah-Hartman
maintainerPATCH 107/273 media: i2c: ds90ub960: Fix UB9702 refclk register access
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
commit ba3bdb93947c90f098061de1fb2458e2ca040093 upstream.
UB9702 has the refclk freq register at a different offset than UB960, but the code uses the UB960's offset for both chips. Fix this.
The refclk freq is only used for a debug print, so there's no functional change here.
--- drivers/media/i2c/ds90ub960.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/i2c/ds90ub960.c +6 -1
@@ -352,6 +352,8 @@#define UB960_SR_I2C_RX_ID (n) (0xf8 + (n))/* < UB960_FPD_RX_NPORTS */ +#define UB9702_SR_REFCLK_FREQ 0x3d +/* Indirect register blocks */ #define UB960_IND_TARGET_PAT_GEN 0x00#define UB960_IND_TARGET_RX_ANA (n) (0x01 + (n))
@@ -3838,7 +3840,10 @@ static int ub960_enable_core_hw(struct uif (ret) goto err_pd_gpio; - ret =ub960_read (priv,UB960_XR_REFCLK_FREQ , &refclk_freq); +if (priv->hw_data->is_ub9702) + ret =ub960_read (priv,UB9702_SR_REFCLK_FREQ , &refclk_freq); +else + ret =ub960_read (priv,UB960_XR_REFCLK_FREQ , &refclk_freq);if (ret) goto err_pd_gpio;
Greg Kroah-Hartman
maintainerPATCH 98/273 drm/amdkfd: only flush the validate MES contex
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prike Liang <[email protected]>
commit 9078a5bfa21e78ae68b6d7c365d1b92f26720c55 upstream.
The following page fault was observed duringthe KFD process release. In this particular error case, the HIP test (./MemcpyPerformance -h) does not require the queue. As a result, the process_context_addr was not assigned when the KFD process was released, ultimately leading to this page fault during the execution of the function kfd_process_dequeue_from_all_devices().
[345962.294891] amdgpu 0000:03:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:153 vmid:0 pasid:0) [345962.295333] amdgpu 0000:03:00.0: amdgpu: in page starting at address 0x0000000000000000 from client 10 [345962.295775] amdgpu 0000:03:00.0: amdgpu: GCVM_L2_PROTECTION_FAULT_STATUS:0x00000B33 [345962.296097] amdgpu 0000:03:00.0: amdgpu: Faulty UTCL2 client ID: CPC (0x5) [345962.296394] amdgpu 0000:03:00.0: amdgpu: MORE_FAULTS: 0x1 [345962.296633] amdgpu 0000:03:00.0: amdgpu: WALKER_ERROR: 0x1 [345962.296876] amdgpu 0000:03:00.0: amdgpu: PERMISSION_FAULTS: 0x3 [345962.297135] amdgpu 0000:03:00.0: amdgpu: MAPPING_ERROR: 0x1 [345962.297377] amdgpu 0000:03:00.0: amdgpu: RW: 0x0 [345962.297682] amdgpu 0000:03:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:169 vmid:0 pasid:0)
--- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +5 -2
@@ -86,9 +86,12 @@ void kfd_process_dequeue_from_device(strif (pdd->already_dequeued)return ; - +/* The MES context flush needs to filter out the case which the +* KFD process is created without setting up the MES context and +* queue for creating a compute queue. +*/ dev->dqm->ops.process_termination (dev->dqm, &pdd->qpd); -if (dev->kfd->shared_resources.enable_mes && +if (dev->kfd->shared_resources.enable_mes && !!pdd->proc_ctx_gpu_addr &&down_read_trylock (&dev->adev->reset_domain->sem)) {amdgpu_mes_flush_shader_debugger (dev->adev, pdd->proc_ctx_gpu_addr);
Greg Kroah-Hartman
maintainerPATCH 134/273 usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit 25224c1f07d31c261d04dfbc705a7a0f314a825d upstream.
Match usb endpoint using fullspeed endpoint descriptor to make sure the wMaxPacketSize for fullspeed descriptors is automatically configured.
--- drivers/usb/gadget/function/f_tcm.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/usb/gadget/function/f_tcm.c +13 -17
@@ -1967,43 +1967,39 @@ static int tcm_bind(struct usb_configura bot_intf_desc.bInterfaceNumber = iface; uasp_intf_desc.bInterfaceNumber = iface; fu->iface = iface; - ep =usb_ep_autoconfig_ss (gadget, &uasp_ss_bi_desc, - &uasp_bi_ep_comp_desc); + ep =usb_ep_autoconfig (gadget, &uasp_fs_bi_desc);if (!ep) goto ep_fail; fu->ep_in = ep; - ep =usb_ep_autoconfig_ss (gadget, &uasp_ss_bo_desc, - &uasp_bo_ep_comp_desc); + ep =usb_ep_autoconfig (gadget, &uasp_fs_bo_desc);if (!ep) goto ep_fail; fu->ep_out = ep; - ep =usb_ep_autoconfig_ss (gadget, &uasp_ss_status_desc, - &uasp_status_in_ep_comp_desc); + ep =usb_ep_autoconfig (gadget, &uasp_fs_status_desc);if (!ep) goto ep_fail; fu->ep_status = ep; - ep =usb_ep_autoconfig_ss (gadget, &uasp_ss_cmd_desc, - &uasp_cmd_comp_desc); + ep =usb_ep_autoconfig (gadget, &uasp_fs_cmd_desc);if (!ep) goto ep_fail; fu->ep_cmd = ep;/* Assume endpoint addresses are the same for both speeds */ - uasp_bi_desc.bEndpointAddress = uasp_ss_bi_desc.bEndpointAddress; - uasp_bo_desc.bEndpointAddress = uasp_ss_bo_desc.bEndpointAddress; + uasp_bi_desc.bEndpointAddress = uasp_fs_bi_desc.bEndpointAddress; + uasp_bo_desc.bEndpointAddress = uasp_fs_bo_desc.bEndpointAddress; uasp_status_desc.bEndpointAddress = - uasp_ss_status_desc.bEndpointAddress; - uasp_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress; + uasp_fs_status_desc.bEndpointAddress; + uasp_cmd_desc.bEndpointAddress = uasp_fs_cmd_desc.bEndpointAddress; - uasp_fs_bi_desc.bEndpointAddress = uasp_ss_bi_desc.bEndpointAddress; - uasp_fs_bo_desc.bEndpointAddress = uasp_ss_bo_desc.bEndpointAddress; - uasp_fs_status_desc.bEndpointAddress = - uasp_ss_status_desc.bEndpointAddress; - uasp_fs_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress; + uasp_ss_bi_desc.bEndpointAddress = uasp_fs_bi_desc.bEndpointAddress; + uasp_ss_bo_desc.bEndpointAddress = uasp_fs_bo_desc.bEndpointAddress; + uasp_ss_status_desc.bEndpointAddress = + uasp_fs_status_desc.bEndpointAddress; + uasp_ss_cmd_desc.bEndpointAddress = uasp_fs_cmd_desc.bEndpointAddress; ret = usb_assign_descriptors(f, uasp_fs_function_desc, uasp_hs_function_desc, uasp_ss_function_desc,
Greg Kroah-Hartman
maintainerPATCH 143/273 ASoC: acp: Support microphone from Lenovo Go S
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit b9a8ea185f3f8024619b2e74b74375493c87df8c upstream.
On Lenovo Go S there is a DMIC connected to the ACP but the firmware has no AcpDmicConnected ACPI _DSD.
Add a DMI entry for all possible Lenovo Go S SKUs to enable DMIC.
--- sound/soc/amd/yc/acp6x-mach.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +28 -0
@@ -307,6 +307,34 @@ static const struct dmi_system_id yc_acp { .driver_data = &acp6x_card, .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "83L3"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "83N6"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "83Q2"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"), + } + }, + { + .driver_data = &acp6x_card, + .matches = {DMI_MATCH (DMI_BOARD_VENDOR ,"ASUSTeK COMPUTER INC." ), DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"), }
Greg Kroah-Hartman
maintainerPATCH 144/273 soc: qcom: socinfo: Avoid out of bounds read of serial number
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
commit 22cf4fae6660b6e1a583a41cbf84e3046ca9ccd0 upstream.
On MSM8916 devices, the serial number exposed in sysfs is constant and does not change across individual devices. It's always:
db410c:/sys/devices/soc0$ cat serial_number 2644893864
The firmware used on MSM8916 exposes SOCINFO_VERSION(0, 8), which does not have support for the serial_num field in the socinfo struct. There is an existing check to avoid exposing the serial number in that case, but it's not correct: When checking the item_size returned by SMEM, we need to make sure the *end* of the serial_num is within bounds, instead of comparing with the *start* offset. The serial_number currently exposed on MSM8916 devices is just an out of bounds read of whatever comes after the socinfo struct in SMEM.
Fix this by changing offsetof() to offsetofend(), so that the size of the field is also taken into account.
--- drivers/soc/qcom/socinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/socinfo.c +1 -1
@@ -760,7 +760,7 @@ static int qcom_socinfo_probe(struct plaif (!qs->attr.soc_id || !qs->attr.revision)return -ENOMEM ; -if (offsetof(struct socinfo , serial_num) <= item_size) { + if (offsetofend(struct socinfo, serial_num) <= item_size) { qs->attr.serial_number =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"%u" ,le32_to_cpu (info->serial_num));
Greg Kroah-Hartman
maintainerPATCH 145/273 serial: sh-sci: Drop __initdata macro for port_cfg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudiu Beznea <[email protected]>
commit eaeee4225dba30bef4d424bdf134a07b7f423e8b upstream.
The port_cfg object is used by serial_console_write(), which serves as the write function for the earlycon device. Marking port_cfg as __initdata causes it to be freed after kernel initialization, resulting in earlycon becoming unavailable thereafter. Remove the __initdata macro from port_cfg to resolve this issue.
--- drivers/tty/serial/sh-sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sh-sci.c +1 -1
@@ -3503,7 +3503,7 @@ sh_early_platform_init_buffer("earlyprin early_serial_buf, ARRAY_SIZE(early_serial_buf));#endif #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON -static struct plat_sci_port port_cfg__initdata ; +static struct plat_sci_port port_cfg;static int __init early_console_setup (struct earlycon_device *device,int type)
Greg Kroah-Hartman
maintainerPATCH 146/273 serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudiu Beznea <[email protected]>
commit 9f7dea875cc7f9c1a56a5c688290634a59cd1420 upstream.
In the sh-sci driver, sci_ports[0] is used by earlycon. If the earlycon is still active when sci_probe() is called and the new serial port is supposed to map to sci_ports[0], return -EBUSY to prevent breaking the earlycon.
This situation should occurs in debug scenarios, and users should be aware of the potential conflict.
--- drivers/tty/serial/sh-sci.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/tty/serial/sh-sci.c +23 -0
@@ -164,6 +164,7 @@ struct sci_port {static struct sci_port sci_ports[SCI_NPORTS ];static unsigned long sci_ports_in_use;static struct uart_driver sci_uart_driver; +static bool sci_uart_earlycon;static inline struct sci_port *to_sci_port (struct uart_port *uart)
@@ -3391,6 +3392,7 @@ static int sci_probe_single(struct platfstatic int sci_probe (struct platform_device *dev) {struct plat_sci_port *p; +struct resource *res;struct sci_port *sp;unsigned int dev_id;int ret;
@@ -3420,6 +3422,26 @@ static int sci_probe(struct platform_dev } sp = &sci_ports[dev_id]; + +/* +* In case: +* - the probed port alias is zero (as the one used by earlycon), and +* - the earlycon is still active (e.g., "earlycon keep_bootcon" in +* bootargs) +* +* defer the probe of this serial. This is a debug scenario and the user +* must be aware of it. +* +* Except when the probed port is the same as the earlycon port. +*/ + + res =platform_get_resource (dev,IORESOURCE_MEM ,0 ); +if (!res) +return -ENODEV ; + +if (sci_uart_earlycon && sp == &sci_ports[0 ] && sp->port.mapbase != res->start) +return dev_err_probe (&dev->dev, -EBUSY ,"sci_port[0] is used by earlycon!\n" ); +platform_set_drvdata (dev, sp); ret =sci_probe_single (dev, dev_id, p, sp);
@@ -3518,6 +3540,7 @@ static int __init early_console_setup(st port_cfg.type = type; sci_ports[0 ].cfg = &port_cfg; sci_ports[0 ].params =sci_probe_regmap (&port_cfg); + sci_uart_earlycon = true; port_cfg.scscr =sci_serial_in (&sci_ports[0 ].port,SCSCR );sci_serial_out (&sci_ports[0 ].port,SCSCR ,SCSCR_RE |SCSCR_TE | port_cfg.scscr);
Greg Kroah-Hartman
maintainerPATCH 147/273 MIPS: Loongson64: remove ROM Size unit in boardinfo
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kexy Biscuit <[email protected]>
commit bd2212d658d7659b9d83c7e2f3a06789d4db1e90 upstream.
Per Appendix A.7 in Q/LS 0013-2014 (龙芯CPU开发系统固件与内核接口规范 V2.2, lit. Loongson DevSys Firmware Kernel Interface Specification V2.2), interface_info.size is size of this interface, not size of the LEFI BIOS ROM.
In any case, the BIOS ROM Size just cannot be several kilobytes (KB) on Loongson64 LEFI platforms.
--- arch/mips/loongson64/boardinfo.c | 2 -- 1 file changed, 2 deletions(-)
arch/mips/loongson64/boardinfo.c +0 -2
@@ -21,13 +21,11 @@ static ssize_t boardinfo_show(struct kob"BIOS Info\n" "Vendor\t\t\t: %s\n" "Version\t\t\t: %s\n" -"ROM Size\t\t: %d KB\n" "Release Date\t\t: %s\n" ,strsep (&tmp_board_manufacturer,"-" ), eboard->name,strsep (&tmp_bios_vendor,"-" ), einter->description, - einter->size, especial->special_name); } static struct kobj_attribute boardinfo_attr = __ATTR(boardinfo, 0444,
Greg Kroah-Hartman
maintainerPATCH 148/273 LoongArch: Extend the maximum number of watchpoints
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <[email protected]>
commit 531936dee53e471a3ec668de3c94ca357f54b7e8 upstream.
The maximum number of load/store watchpoints and fetch instruction watchpoints is 14 each according to LoongArch Reference Manual, so extend the maximum number of watchpoints from 8 to 14 for ptrace.
By the way, just simply change 8 to 14 for the definition in struct user_watch_state at the beginning, but it may corrupt uapi, then add a new struct user_watch_state_v2 directly.
As far as I can tell, the only users for this struct in the userspace are GDB and LLDB, there are no any problems of software compatibility between the application and kernel according to the analysis.
The compatibility problem has been considered while developing and testing. When the applications in the userspace get watchpoint state, the length will be specified which is no bigger than the sizeof struct user_watch_state or user_watch_state_v2, the actual length is assigned as the minimal value of the application and kernel in the generic code of ptrace:
kernel/ptrace.c: ptrace_regset():
kiov->iov_len = min(kiov->iov_len, (__kernel_size_t) (regset->n * regset->size)); if (req == PTRACE_GETREGSET) return copy_regset_to_user(task, view, regset_no, 0, kiov->iov_len, kiov->iov_base); else return copy_regset_from_user(task, view, regset_no, 0, kiov->iov_len, kiov->iov_base);
For example, there are four kind of combinations, all of them work well.
(1) "older kernel + older gdb", the actual length is 8+(8+8+4+4)*8=200;
(2) "newer kernel + newer gdb", the actual length is 8+(8+8+4+4)*14=344;
(3) "older kernel + newer gdb", the actual length is 8+(8+8+4+4)*8=200;
(4) "newer kernel + older gdb", the actual length is 8+(8+8+4+4)*8=200.
--- arch/loongarch/include/uapi/asm/ptrace.h | 10 ++++++++++ arch/loongarch/kernel/ptrace.c | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-)
arch/loongarch/include/uapi/asm/ptrace.h +10 -0
@@ -72,6 +72,16 @@ struct user_watch_state { } dbg_regs[8 ]; }; +struct user_watch_state_v2 { +uint64_t dbg_info; +struct { +uint64_t addr; +uint64_t mask; +uint32_t ctrl; +uint32_t pad; + } dbg_regs[14 ]; +}; +#define PTRACE_SYSEMU 0x1f#define PTRACE_SYSEMU_SINGLESTEP 0x20
arch/loongarch/kernel/ptrace.c +3 -3
@@ -720,7 +720,7 @@ static int hw_break_set(struct task_struct *target,unsigned int note_type = regset->core_note_type;/* Resource info */ - offset = offsetof(struct user_watch_state , dbg_regs); + offset = offsetof(struct user_watch_state_v2 , dbg_regs);user_regset_copyin_ignore (&pos, &count, &kbuf, &ubuf,0 , offset);/* (address, mask, ctrl) registers */
@@ -920,7 +920,7 @@ static const struct user_regset loongarch64_regsets[] = { #ifdef CONFIG_HAVE_HW_BREAKPOINT [REGSET_HW_BREAK ] = { .core_note_type =NT_LOONGARCH_HW_BREAK , - .n =sizeof (struct user_watch_state ) /sizeof (u32), + .n =sizeof (struct user_watch_state_v2 ) /sizeof (u32), .size =sizeof (u32), .align =sizeof (u32), .regset_get = hw_break_get,
@@ -928,7 +928,7 @@ static const struct user_regset loongarch64_regsets[] = { }, [REGSET_HW_WATCH] = { .core_note_type = NT_LOONGARCH_HW_WATCH, - .n = sizeof(struct user_watch_state) / sizeof(u32), + .n = sizeof(struct user_watch_state_v2) / sizeof(u32), .size = sizeof(u32), .align = sizeof(u32), .regset_get = hw_break_get,
Signature · 1 line
2.48.1
Greg Kroah-Hartman
maintainerPATCH 149/273 powerpc/pseries/eeh: Fix get PE state translation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Narayana Murty N <[email protected]>
commit 11b93559000c686ad7e5ab0547e76f21cc143844 upstream.
The PE Reset State "0" returned by RTAS calls "ibm_read_slot_reset_[state|state2]" indicates that the reset is deactivated and the PE is in a state where MMIO and DMA are allowed. However, the current implementation of "pseries_eeh_get_state()" does not reflect this, causing drivers to incorrectly assume that MMIO and DMA operations cannot be resumed.
The userspace drivers as a part of EEH recovery using VFIO ioctls fail to detect when the recovery process is complete. The VFIO_EEH_PE_GET_STATE ioctl does not report the expected EEH_PE_STATE_NORMAL state, preventing userspace drivers from functioning properly on pseries systems.
The patch addresses this issue by updating 'pseries_eeh_get_state()' to include "EEH_STATE_MMIO_ENABLED" and "EEH_STATE_DMA_ENABLED" in the result mask for PE Reset State "0". This ensures correct state reporting to the callers, aligning the behavior with the PAPR specification and fixing the bug in EEH recovery for VFIO user workflows.
--- arch/powerpc/platforms/pseries/eeh_pseries.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/platforms/pseries/eeh_pseries.c +4 -2
@@ -580,8 +580,10 @@ static int pseries_eeh_get_state(structswitch (rets[0 ]) {case 0 : - result =EEH_STATE_MMIO_ACTIVE | -EEH_STATE_DMA_ACTIVE ; + result =EEH_STATE_MMIO_ACTIVE | +EEH_STATE_DMA_ACTIVE | +EEH_STATE_MMIO_ENABLED | +EEH_STATE_DMA_ENABLED ;break ;case 1 : result = EEH_STATE_RESET_ACTIVE |
Greg Kroah-Hartman
maintainerPATCH 150/273 dm-crypt: dont update io->sector after kcryptd_crypt_write_io_submit()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hou Tao <[email protected]>
commit 9fdbbdbbc92b1474a87b89f8b964892a63734492 upstream.
The updates of io->sector are the leftovers when dm-crypt allocated pages for partial write request. However, since commit cf2f1abfbd0db ("dm crypt: don't allocate pages for a partial request"), there is no partial request anymore.
After the introduction of write request rb-tree, the updates of io->sectors may interfere the insertion procedure, because ->sectors of these write requests which have already been added in the rb-tree may be changed during the insertion of new write request.
Fix it by removing these buggy updates of io->sectors. Considering these updates only effect the write request rb-tree, the commit which introduces the write request rb-tree is used as the fix tag.
--- drivers/md/dm-crypt.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/md/dm-crypt.c +3 -11
@@ -2068,7 +2068,6 @@ static void kcryptd_crypt_write_continuestruct crypt_config *cc = io->cc;struct convert_context *ctx = &io->ctx;int crypt_finished; -sector_t sector = io->sector;blk_status_t r;wait_for_completion (&ctx->restart);
@@ -2085,10 +2084,8 @@ static void kcryptd_crypt_write_continue }/* Encryption was already finished, submit io now */ -if (crypt_finished) { +if (crypt_finished)kcryptd_crypt_write_io_submit (io,0 ); - io->sector = sector; - }crypt_dec_pending (io); }
@@ -2099,14 +2096,13 @@ static void kcryptd_crypt_write_convert(struct convert_context *ctx = &io->ctx;struct bio *clone;int crypt_finished; -sector_t sector = io->sector;blk_status_t r;/* * Prevent io from disappearing until this function completes. */ crypt_inc_pending (io); -crypt_convert_init (cc, ctx,NULL , io->base_bio, sector); +crypt_convert_init (cc, ctx,NULL , io->base_bio, io->sector); clone =crypt_alloc_buffer (io, io->base_bio->bi_iter.bi_size);if (unlikely (!clone)) {
@@ -2123,8 +2119,6 @@ static void kcryptd_crypt_write_convert( io->ctx.iter_in = clone->bi_iter; } - sector +=bio_sectors (clone); -crypt_inc_pending (io); r =crypt_convert (cc, ctx,test_bit (DM_CRYPT_NO_WRITE_WORKQUEUE , &cc->flags), true);
@@ -2148,10 +2142,8 @@ static void kcryptd_crypt_write_convert( }/* Encryption was already finished, submit io now */ -if (crypt_finished) { +if (crypt_finished)kcryptd_crypt_write_io_submit (io,0 ); - io->sector = sector; - } dec:crypt_dec_pending (io);
Greg Kroah-Hartman
maintainerPATCH 151/273 dm-crypt: track tag_offset in convert_context
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hou Tao <[email protected]>
commit 8b8f8037765757861f899ed3a2bfb34525b5c065 upstream.
dm-crypt uses tag_offset to index the integrity metadata for each crypt sector. When the initial crypt_convert() returns BLK_STS_DEV_RESOURCE, dm-crypt will try to continue the crypt/decrypt procedure in a kworker. However, it resets tag_offset as zero instead of using the tag_offset related with current sector. It may return unexpected data when using random IV or return unexpected integrity related error.
Fix the problem by tracking tag_offset in per-IO convert_context. Therefore, when the crypt/decrypt procedure continues in a kworker, it could use the next tag_offset saved in convert_context.
--- drivers/md/dm-crypt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/md/dm-crypt.c +7 -6
@@ -57,6 +57,7 @@ struct convert_context {struct bio *bio_out;struct bvec_iter iter_out;atomic_t cc_pending; +unsigned int tag_offset;u64 cc_sector;union {struct skcipher_request *req;
@@ -1232,6 +1233,7 @@ static void crypt_convert_init(struct crif (bio_out) ctx->iter_out = bio_out->bi_iter; ctx->cc_sector = sector + cc->iv_offset; + ctx->tag_offset =0 ;init_completion (&ctx->restart); }
@@ -1564,7 +1566,6 @@ static void crypt_free_req(struct crypt_static blk_status_t crypt_convert (struct crypt_config *cc,struct convert_context *ctx,bool atomic,bool reset_pending) { -unsigned int tag_offset =0 ;unsigned int sector_step = cc->sector_size >>SECTOR_SHIFT ;int r;
@@ -1587,9 +1588,9 @@ static blk_status_t crypt_convert(structatomic_inc (&ctx->cc_pending);if (crypt_integrity_aead (cc)) - r =crypt_convert_block_aead (cc, ctx, ctx->r.req_aead, tag_offset); + r =crypt_convert_block_aead (cc, ctx, ctx->r.req_aead, ctx->tag_offset);else - r =crypt_convert_block_skcipher (cc, ctx, ctx->r.req, tag_offset); + r =crypt_convert_block_skcipher (cc, ctx, ctx->r.req, ctx->tag_offset);switch (r) {/*
@@ -1609,8 +1610,8 @@ static blk_status_t crypt_convert(struct* exit and continue processing in a workqueue */ ctx->r.req =NULL ; + ctx->tag_offset++; ctx->cc_sector += sector_step; - tag_offset++;return BLK_STS_DEV_RESOURCE ; } }else {
@@ -1624,8 +1625,8 @@ static blk_status_t crypt_convert(struct*/ case -EINPROGRESS : ctx->r.req =NULL ; + ctx->tag_offset++; ctx->cc_sector += sector_step; - tag_offset++;continue ;/* * The request was already processed (synchronously).
@@ -1633,7 +1634,7 @@ static blk_status_t crypt_convert(structcase 0 :atomic_dec (&ctx->cc_pending); ctx->cc_sector += sector_step; - tag_offset++; + ctx->tag_offset++;if (!atomic)cond_resched ();continue ;
Greg Kroah-Hartman
maintainerPATCH 152/273 mips/math-emu: fix emulation of the prefx instruction
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mateusz Jończyk <[email protected]>
commit 42a39e4aa59a10aa4afdc14194f3ee63d2db94e1 upstream.
Currently, installation of Debian 12.8 for mipsel fails on machines without an FPU [1]. This is caused by the fact that zstd (which is used for initramfs compression) executes the prefx instruction, which is not emulated properly by the kernel.
The prefx (Prefetch Indexed) instruction fetches data from memory into the cache without any side effects. Though functionally unrelated, it requires an FPU [2].
Bytecode format of this instruction ends on "001111" binary:
(prefx instruction format) & 0x0000003f = 0x0000000f
The code in fpux_emu() runs like so:
#define MIPSInst(x) x
#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000007)
#define MIPSInst_FUNC(x) (MIPSInst(x) & 0x0000003f)
enum cop1x_func { ..., pfetch_op = 0x0f, ... };
...
switch (MIPSInst_FMA_FFMT(ir)) {
...
case 0x3:
if (MIPSInst_FUNC(ir) != pfetch_op)
return SIGILL;
/* ignore prefx operation */
break;
default:
return SIGILL;
}That snippet above contains a logic error and the
if (MIPSInst_FUNC(ir) != pfetch_op)
comparison always fires.
When MIPSInst_FUNC(ir) is equal to pfetch_op, ir must end on 001111 binary. In this case, MIPSInst_FMA_FFMT(ir) must be equal to 0x7, which does not match that case label.
This causes emulation failure for the prefx instruction. Fix it.
This has been broken by
commit 919af8b96c89 ("MIPS: Make definitions of MIPSInst_FMA_{FUNC,FMTM} consistent with MIPS64 manual") which modified the MIPSInst_FMA_FFMT macro without updating the users.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1091858
[2] MIPS Architecture For Programmers Volume II-A: The MIPS32 Instruction Set
--- arch/mips/math-emu/cp1emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/math-emu/cp1emu.c +1 -1
@@ -1660,7 +1660,7 @@ static int fpux_emu(struct pt_regs *xcp,break ; } -case 0x3 : +case 0x7 :if (MIPSInst_FUNC (ir) != pfetch_op)return SIGILL ;
Greg Kroah-Hartman
maintainerPATCH 135/273 usb: gadget: f_tcm: Dont prepare BOT write request twice
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <[email protected]>
commit 94d9bf671ae314cacc2d7bf96bd233b4abc7cede upstream.
The duplicate kmalloc here is causing memory leak. The request preparation in bot_send_write_request is also done in usbg_prepare_w_request. Remove the duplicate work.
--- drivers/usb/gadget/function/f_tcm.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/usb/gadget/function/f_tcm.c +0 -17
@@ -245,7 +245,6 @@ static int bot_send_write_request(struct {struct f_uas *fu = cmd->fu;struct se_cmd *se_cmd = &cmd->se_cmd; -struct usb_gadget *gadget =fuas_to_gadget (fu);int ret;init_completion (&cmd->write_complete);
@@ -256,22 +255,6 @@ static int bot_send_write_request(structreturn -EINVAL ; } -if (!gadget->sg_supported) { - cmd->data_buf =kmalloc (se_cmd->data_length,GFP_KERNEL ); -if (!cmd->data_buf) -return -ENOMEM ; - - fu->bot_req_out->buf = cmd->data_buf; - }else { - fu->bot_req_out->buf =NULL ; - fu->bot_req_out->num_sgs = se_cmd->t_data_nents; - fu->bot_req_out->sg = se_cmd->t_data_sg; - } - - fu->bot_req_out->complete = usbg_data_write_cmpl; - fu->bot_req_out->length = se_cmd->data_length; - fu->bot_req_out->context = cmd; - ret =usbg_prepare_w_request (cmd, fu->bot_req_out);if (ret) goto cleanup;
Greg Kroah-Hartman
maintainerPATCH 153/273 block: dont revert iter for -EIOCBQUEUED
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit b13ee668e8280ca5b07f8ce2846b9957a8a10853 upstream.
blkdev_read_iter() has a few odd checks, like gating the position and count adjustment on whether or not the result is bigger-than-or-equal to zero (where bigger than makes more sense), and not checking the return value of blkdev_direct_IO() before doing an iov_iter_revert(). The latter can lead to attempting to revert with a negative value, which when passed to iov_iter_revert() as an unsigned value will lead to throwing a WARN_ON() because unroll is bigger than MAX_RW_COUNT.
Be sane and don't revert for -EIOCBQUEUED, like what is done in other spots.
--- block/fops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
block/fops.c +3 -2
@@ -718,11 +718,12 @@ static ssize_t blkdev_read_iter(struct kfile_accessed (iocb->ki_filp); ret =blkdev_direct_IO (iocb, to); -if (ret >=0 ) { +if (ret >0 ) { iocb->ki_pos += ret; count -= ret; } -iov_iter_revert (to, count -iov_iter_count (to)); +if (ret != -EIOCBQUEUED ) +iov_iter_revert (to, count -iov_iter_count (to));if (ret <0 || !count) goto reexpand; }
Greg Kroah-Hartman
maintainerPATCH 154/273 Revert "media: uvcvideo: Require entities to have a non-zero unique ID"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
commit 8004d635f27bbccaa5c083c50d4d5302a6ffa00e upstream.
This reverts commit 3dd075fe8ebbc6fcbf998f81a75b8c4b159a6195.
Tomasz has reported that his device, Generalplus Technology Inc. 808 Camera, with ID 1b3f:2002, stopped being detected:
$ ls -l /dev/video* zsh: no matches found: /dev/video* [ 7.230599] usb 3-2: Found multiple Units with ID 5
This particular device is non-compliant, having both the Output Terminal and Processing Unit with ID 5. uvc_scan_fallback, though, is able to build a chain. However, when media elements are added and uvc_mc_create_links call uvc_entity_by_id, it will get the incorrect entity, media_create_pad_link will WARN, and it will fail to register the entities.
In order to reinstate support for such devices in a timely fashion, reverting the fix for these warnings is appropriate. A proper fix that considers the existence of such non-compliant devices will be submitted in a later development cycle.
--- drivers/media/usb/uvc/uvc_driver.c | 70 ++++++++++++++----------------------- 1 file changed, 27 insertions(+), 43 deletions(-)
drivers/media/usb/uvc/uvc_driver.c +27 -43
@@ -775,27 +775,14 @@ static const u8 uvc_media_transport_inpuUVC_GUID_UVC_MEDIA_TRANSPORT_INPUT ;static const u8 uvc_processing_guid[16 ] =UVC_GUID_UVC_PROCESSING ; -static struct uvc_entity *uvc_alloc_new_entity (struct uvc_device *dev,u16 type, -u16 id,unsigned int num_pads, -unsigned int extra_size) +static struct uvc_entity *uvc_alloc_entity (u16 type,u16 id, +unsigned int num_pads,unsigned int extra_size) {struct uvc_entity *entity;unsigned int num_inputs;unsigned int size;unsigned int i; -/* Per UVC 1.1+ spec 3.7.2, the ID should be non-zero. */ -if (id ==0 ) { -dev_err (&dev->udev->dev,"Found Unit with invalid ID 0.\n" ); -return ERR_PTR (-EINVAL ); - } - -/* Per UVC 1.1+ spec 3.7.2, the ID is unique. */ -if (uvc_entity_by_id (dev, id)) { -dev_err (&dev->udev->dev,"Found multiple Units with ID %u\n" , id); -return ERR_PTR (-EINVAL ); - } - extra_size =roundup (extra_size,sizeof (*entity->pads));if (num_pads) num_inputs = type &UVC_TERM_OUTPUT ? num_pads : num_pads -1 ;
@@ -805,7 +792,7 @@ static struct uvc_entity *uvc_alloc_new_ + num_inputs; entity =kzalloc (size,GFP_KERNEL );if (entity ==NULL ) -return ERR_PTR (-ENOMEM ); +return NULL ; entity->id = id; entity->type = type;
@@ -917,10 +904,10 @@ static int uvc_parse_vendor_control(strubreak ; } - unit =uvc_alloc_new_entity (dev,UVC_VC_EXTENSION_UNIT , - buffer[3 ], p +1 ,2 * n); -if (IS_ERR (unit)) -return PTR_ERR (unit); + unit =uvc_alloc_entity (UVC_VC_EXTENSION_UNIT , buffer[3 ], + p +1 ,2 *n); +if (unit ==NULL ) +return -ENOMEM ;memcpy (unit->guid, &buffer[4 ],16 ); unit->extension.bNumControls = buffer[20 ];
@@ -1029,10 +1016,10 @@ static int uvc_parse_standard_control(streturn -EINVAL ; } - term =uvc_alloc_new_entity (dev, type |UVC_TERM_INPUT , - buffer[3 ],1 , n + p); -if (IS_ERR (term)) -return PTR_ERR (term); + term =uvc_alloc_entity (type |UVC_TERM_INPUT , buffer[3 ], +1 , n + p); +if (term ==NULL ) +return -ENOMEM ;if (UVC_ENTITY_TYPE (term) ==UVC_ITT_CAMERA ) { term->camera.bControlSize = n;
@@ -1088,10 +1075,10 @@ static int uvc_parse_standard_control(streturn 0 ; } - term =uvc_alloc_new_entity (dev, type |UVC_TERM_OUTPUT , - buffer[3 ],1 ,0 ); -if (IS_ERR (term)) -return PTR_ERR (term); + term =uvc_alloc_entity (type |UVC_TERM_OUTPUT , buffer[3 ], +1 ,0 ); +if (term ==NULL ) +return -ENOMEM ;memcpy (term->baSourceID, &buffer[7 ],1 );
@@ -1110,10 +1097,9 @@ static int uvc_parse_standard_control(streturn -EINVAL ; } - unit =uvc_alloc_new_entity (dev, buffer[2 ], buffer[3 ], - p +1 ,0 ); -if (IS_ERR (unit)) -return PTR_ERR (unit); + unit =uvc_alloc_entity (buffer[2 ], buffer[3 ], p +1 ,0 ); +if (unit ==NULL ) +return -ENOMEM ;memcpy (unit->baSourceID, &buffer[5 ], p);
@@ -1133,9 +1119,9 @@ static int uvc_parse_standard_control(streturn -EINVAL ; } - unit =uvc_alloc_new_entity (dev, buffer[2 ], buffer[3 ],2 , n); -if (IS_ERR (unit)) -return PTR_ERR (unit); + unit =uvc_alloc_entity (buffer[2 ], buffer[3 ],2 , n); +if (unit ==NULL ) +return -ENOMEM ;memcpy (unit->baSourceID, &buffer[4 ],1 ); unit->processing.wMaxMultiplier =
@@ -1162,10 +1148,9 @@ static int uvc_parse_standard_control(streturn -EINVAL ; } - unit =uvc_alloc_new_entity (dev, buffer[2 ], buffer[3 ], - p +1 , n); -if (IS_ERR (unit)) -return PTR_ERR (unit); + unit =uvc_alloc_entity (buffer[2 ], buffer[3 ], p +1 , n); +if (unit ==NULL ) +return -ENOMEM ;memcpy (unit->guid, &buffer[4 ],16 ); unit->extension.bNumControls = buffer[20 ];
@@ -1305,10 +1290,9 @@ static int uvc_gpio_parse(struct uvc_devreturn dev_err_probe (&dev->udev->dev, irq,"No IRQ for privacy GPIO\n" ); - unit =uvc_alloc_new_entity (dev,UVC_EXT_GPIO_UNIT , -UVC_EXT_GPIO_UNIT_ID ,0 ,1 ); -if (IS_ERR (unit)) -return PTR_ERR (unit); + unit =uvc_alloc_entity (UVC_EXT_GPIO_UNIT ,UVC_EXT_GPIO_UNIT_ID ,0 ,1 ); +if (!unit) +return -ENOMEM ; unit->gpio.gpio_privacy = gpio_privacy; unit->gpio.irq = irq;
Greg Kroah-Hartman
maintainerPATCH 155/273 ALSA: hda/realtek: Enable headset mic on Positivo C6400
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edson Juliano Drosdeck <[email protected]>
commit 1aec3ed2e3e1512aba15e7e790196a44efd5f0a7 upstream.
Positivo C6400 is equipped with ALC269VB, and it needs ALC269VB_FIXUP_ASUS_ZENBOOK quirk to make its headset mic work. Also must to limits the microphone boost.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10402,6 +10402,7 @@ static const struct hda_quirk alc269_fixSND_PCI_QUIRK (0x17aa ,0x511f ,"Thinkpad" ,ALC298_FIXUP_TPT470_DOCK ),SND_PCI_QUIRK (0x17aa ,0x9e54 ,"LENOVO NB" ,ALC269_FIXUP_LENOVO_EAPD ),SND_PCI_QUIRK (0x17aa ,0x9e56 ,"Lenovo ZhaoYang CF4620Z" ,ALC286_FIXUP_SONY_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1849 ,0x0269 ,"Positivo Master C6400" ,ALC269VB_FIXUP_ASUS_ZENBOOK ),SND_PCI_QUIRK (0x1849 ,0x1233 ,"ASRock NUC Box 1100" ,ALC233_FIXUP_NO_AUDIO_JACK ),SND_PCI_QUIRK (0x1849 ,0xa233 ,"Positivo Master C6300" ,ALC269_FIXUP_HEADSET_MIC ), SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
Greg Kroah-Hartman
maintainerPATCH 156/273 ALSA: hda: Fix headset detection failure due to unstable sort
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuan-Wei Chiu <[email protected]>
commit 3b4309546b48fc167aa615a2d881a09c0a97971f upstream.
The auto_parser assumed sort() was stable, but the kernel's sort() uses heapsort, which has never been stable. After commit 0e02ca29a563 ("lib/sort: optimize heapsort with double-pop variation"), the order of equal elements changed, causing the headset to fail to work.
Fix the issue by recording the original order of elements before sorting and using it as a tiebreaker for equal elements in the comparison function.
--- sound/pci/hda/hda_auto_parser.c | 8 +++++++- sound/pci/hda/hda_auto_parser.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-)
sound/pci/hda/hda_auto_parser.c +7 -1
@@ -80,7 +80,11 @@ static int compare_input_type(const void/* In case one has boost and the other one has not, pick the one with boost first. */ -return (int )(b->has_boost_on_pin - a->has_boost_on_pin); +if (a->has_boost_on_pin != b->has_boost_on_pin) +return (int )(b->has_boost_on_pin - a->has_boost_on_pin); + +/* Keep the original order */ +return a->order - b->order; }/* Reorder the surround channels
@@ -400,6 +404,8 @@ int snd_hda_parse_pin_defcfg(struct hda_reorder_outputs (cfg->speaker_outs, cfg->speaker_pins);/* sort inputs in the order of AUTO_PIN_* type */ +for (i =0 ; i < cfg->num_inputs; i++) + cfg->inputs[i].order = i;sort (cfg->inputs, cfg->num_inputs,sizeof (cfg->inputs[0 ]), compare_input_type,NULL );
sound/pci/hda/hda_auto_parser.h +1 -0
@@ -37,6 +37,7 @@ struct auto_pin_cfg_item { unsigned int is_headset_mic:1; unsigned int is_headphone_mic:1; /* Mic-only in headphone jack */ unsigned int has_boost_on_pin:1; +int order; };struct auto_pin_cfg ;
Greg Kroah-Hartman
maintainerPATCH 157/273 arm64: tegra: Fix Tegra234 PCIe interrupt-map
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brad Griffis <[email protected]>
commit b615fbd70fce8582d92b3bdbbf3c9b80cadcfb55 upstream.
For interrupt-map entries, the DTS specification requires that #address-cells is defined for both the child node and the interrupt parent. For the PCIe interrupt-map entries, the parent node ("gic") has not specified #address-cells. The existing layout of the PCIe interrupt-map entries indicates that it assumes that #address-cells is zero for this node.
Explicitly set #address-cells to zero for "gic" so that it complies with the device tree specification.
NVIDIA EDK2 works around this issue by assuming #address-cells is zero in this scenario, but that workaround is being removed and so this update is needed or else NVIDIA EDK2 cannot successfully parse the device tree and the board cannot boot.
--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +2 -0
@@ -1912,6 +1912,8 @@ #redistributor-regions = <1>; #interrupt-cells = <3>; interrupt-controller; + + #address-cells = <0>; }; smmu_iso: iommu@10000000 {
Greg Kroah-Hartman
maintainerPATCH 158/273 PCI: Avoid putting some root ports into D3 on TUXEDO Sirius Gen1
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Werner Sembach <[email protected]>
commit b1049f2d68693c80a576c4578d96774a68df2bad upstream.
commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend") sets the policy that all PCIe ports are allowed to use D3. When the system is suspended if the port is not power manageable by the platform and won't be used for wakeup via a PME this sets up the policy for these ports to go into D3hot.
This policy generally makes sense from an OSPM perspective but it leads to problems with wakeup from suspend on the TUXEDO Sirius 16 Gen 1 with a specific old BIOS. This manifests as a system hang.
On the affected Device + BIOS combination, add a quirk for the root port of the problematic controller to ensure that these root ports are not put into D3hot at suspend.
This patch is based on
https://lore.kernel.org/linux-pci/[email protected]
but with the added condition both in the documentation and in the code to apply only to the TUXEDO Sirius 16 Gen 1 with a specific old BIOS and only the affected root ports.
--- arch/x86/pci/fixup.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/x86/pci/fixup.c +30 -0
@@ -1010,4 +1010,34 @@ DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_DECLARE_PCI_FIXUP_RESUME (PCI_VENDOR_ID_AMD ,0x1668 , amd_rp_pme_resume);DECLARE_PCI_FIXUP_SUSPEND (PCI_VENDOR_ID_AMD ,0x1669 , amd_rp_pme_suspend);DECLARE_PCI_FIXUP_RESUME (PCI_VENDOR_ID_AMD ,0x1669 , amd_rp_pme_resume); + +/* +* Putting PCIe root ports on Ryzen SoCs with USB4 controllers into D3hot +* may cause problems when the system attempts wake up from s2idle. +* +* On the TUXEDO Sirius 16 Gen 1 with a specific old BIOS this manifests as +* a system hang. +*/ +static const struct dmi_system_id quirk_tuxeo_rp_d3_dmi_table[] = { + { + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"TUXEDO" ), +DMI_EXACT_MATCH (DMI_BOARD_NAME ,"APX958" ), +DMI_EXACT_MATCH (DMI_BIOS_VERSION ,"V1.00A00_20240108" ), + }, + }, + {} +}; + +static void quirk_tuxeo_rp_d3 (struct pci_dev *pdev) +{ +struct pci_dev *root_pdev; + +if (dmi_check_system (quirk_tuxeo_rp_d3_dmi_table)) { + root_pdev =pcie_find_root_port (pdev); +if (root_pdev) + root_pdev->dev_flags |=PCI_DEV_FLAGS_NO_D3 ; + } +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,0x1502 , quirk_tuxeo_rp_d3);#endif /* CONFIG_SUSPEND */
Greg Kroah-Hartman
maintainerPATCH 159/273 PCI: endpoint: Finish virtual EP removal in pci_epf_remove_vepf()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit 3b9f942eb21c92041905e3943a8d5177c9a9d89d upstream.
When removing a virtual Endpoint, pci_epf_remove_vepf() failed to clear epf_vf->epf_pf, which caused a subsequent pci_epf_add_vepf() to incorrectly return -EBUSY:
pci_epf_add_vepf(epf_pf, epf_vf) // add pci_epf_remove_vepf(epf_pf, epf_vf) // remove pci_epf_add_vepf(epf_pf, epf_vf) // add again, -EBUSY error
Fix by clearing epf_vf->epf_pf in pci_epf_remove_vepf().
--- drivers/pci/endpoint/pci-epf-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/endpoint/pci-epf-core.c +1 -0
@@ -202,6 +202,7 @@ void pci_epf_remove_vepf(struct pci_epfmutex_lock (&epf_pf->lock);clear_bit (epf_vf->vfunc_no, &epf_pf->vfunction_num_map); + epf_vf->epf_pf =NULL ;list_del (&epf_vf->list);mutex_unlock (&epf_pf->lock); }
Greg Kroah-Hartman
maintainerPATCH 160/273 nvme-pci: Add TUXEDO InfinityFlex to Samsung sleep quirk
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georg Gottleuber <[email protected]>
commit dbf2bb1a1319b7c7d8828905378a6696cca6b0f2 upstream.
On the TUXEDO InfinityFlex, a Samsung 990 Evo NVMe leads to a high power consumption in s2idle sleep (4 watts).
This patch applies 'Force No Simple Suspend' quirk to achieve a sleep with a lower power consumption, typically around 1.4 watts.
--- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -2949,7 +2949,8 @@ static unsigned long check_vendor_combin* because of high power consumption (> 2 Watt) in s2idle * sleep. Only some boards with Intel CPU are affected. */ -if (dmi_match (DMI_BOARD_NAME ,"GMxPXxx" ) || +if (dmi_match (DMI_BOARD_NAME ,"DN50Z-140HC-YD" ) || +dmi_match (DMI_BOARD_NAME ,"GMxPXxx" ) ||dmi_match (DMI_BOARD_NAME ,"PH4PG31" ) ||dmi_match (DMI_BOARD_NAME ,"PH4PRX1_PH6PRX1" ) ||dmi_match (DMI_BOARD_NAME ,"PH6PG01_PH6PG71" ))
Greg Kroah-Hartman
maintainerPATCH 161/273 nvme-pci: Add TUXEDO IBP Gen9 to Samsung sleep quirk
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georg Gottleuber <[email protected]>
commit 11cb3529d18514f7d28ad2190533192aedefd761 upstream.
On the TUXEDO InfinityBook Pro Gen9 Intel, a Samsung 990 Evo NVMe leads to a high power consumption in s2idle sleep (4 watts).
This patch applies 'Force No Simple Suspend' quirk to achieve a sleep with a lower power consumption, typically around 1.2 watts.
--- drivers/nvme/host/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
@@ -2951,6 +2951,7 @@ static unsigned long check_vendor_combin*/ if (dmi_match (DMI_BOARD_NAME ,"DN50Z-140HC-YD" ) ||dmi_match (DMI_BOARD_NAME ,"GMxPXxx" ) || +dmi_match (DMI_BOARD_NAME ,"GXxMRXx" ) ||dmi_match (DMI_BOARD_NAME ,"PH4PG31" ) ||dmi_match (DMI_BOARD_NAME ,"PH4PRX1_PH6PRX1" ) ||dmi_match (DMI_BOARD_NAME ,"PH6PG01_PH6PG71" ))
Greg Kroah-Hartman
maintainerPATCH 162/273 scsi: st: Dont set pos_unknown just after device recognition
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kai Mäkisara <[email protected]>
commit 98b37881b7492ae9048ad48260cc8a6ee9eb39fd upstream.
Commit 9604eea5bd3a ("scsi: st: Add third party poweron reset handling") in v6.6 added new code to handle the Power On/Reset Unit Attention (POR UA) sense data. This was in addition to the existing method. When this Unit Attention is received, the driver blocks attempts to read, write and some other operations because the reset may have rewinded the tape. Because of the added code, also the initial POR UA resulted in blocking operations, including those that are used to set the driver options after the device is recognized. Also, reading and writing are refused, whereas they succeeded before this commit.
Add code to not set pos_unknown to block operations if the POR UA is received from the first test_ready() call after the st device has been created. This restores the behavior before v6.6.
--- drivers/scsi/st.c | 6 ++++++ drivers/scsi/st.h | 1 + 2 files changed, 7 insertions(+)
drivers/scsi/st.c +6 -0
@@ -1028,6 +1028,11 @@ static int test_ready(struct scsi_tape * retval = new_session ?CHKRES_NEW_SESSION :CHKRES_READY ;break ; } +if (STp->first_tur) { +/* Don't set pos_unknown right after device recognition */ + STp->pos_unknown =0 ; + STp->first_tur =0 ; + }if (SRpnt !=NULL )st_release_request (SRpnt);
@@ -4326,6 +4331,7 @@ static int st_probe(struct device *dev)blk_queue_rq_timeout (tpnt->device->request_queue,ST_TIMEOUT ); tpnt->long_timeout =ST_LONG_TIMEOUT ; tpnt->try_dio = try_direct_io; + tpnt->first_tur =1 ;for (i =0 ; i <ST_NBR_MODES ; i++) { STm = &(tpnt->modes[i]);
drivers/scsi/st.h +1 -0
@@ -170,6 +170,7 @@ struct scsi_tape {unsigned char rew_at_close;/* rewind necessary at close */ unsigned char inited;unsigned char cleaning_req;/* cleaning requested? */ +unsigned char first_tur;/* first TEST UNIT READY */ int block_size;int min_block;int max_block;
Greg Kroah-Hartman
maintainerPATCH 136/273 usbnet: ipheth: fix possible overflow in DPE length check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Foster Snowhill <[email protected]>
commit c219427ed296f94bb4b91d08626776dc7719ee27 upstream.
Originally, it was possible for the DPE length check to overflow if wDatagramIndex + wDatagramLength > U16_MAX. This could lead to an OoB read.
Move the wDatagramIndex term to the other side of the inequality.
An existing condition ensures that wDatagramIndex < urb->actual_length.
--- drivers/net/usb/ipheth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/ipheth.c +2 -2
@@ -243,8 +243,8 @@ static int ipheth_rcvbulk_callback_ncm(struct urb *urb)while (le16_to_cpu (dpe->wDatagramIndex) !=0 &&le16_to_cpu (dpe->wDatagramLength) !=0 ) {if (le16_to_cpu (dpe->wDatagramIndex) >= urb->actual_length || -le16_to_cpu (dpe->wDatagramIndex) + -le16_to_cpu (dpe->wDatagramLength) > urb->actual_length) { +le16_to_cpu (dpe->wDatagramLength) > urb->actual_length - +le16_to_cpu (dpe->wDatagramIndex)) { dev->net->stats.rx_length_errors++;return retval; }
Signature · 1 line
2.48.1