5.15.99-rc1 review
Subsystems (10)
Greg Kroah-Hartman
maintainerPATCH 456/567 ocfs2: fix non-auto defrag path not working issue
In reply to Greg Kroah-HartmanFrom: Heming Zhao via Ocfs2-devel <[email protected]>
commit 236b9254f8d1edc273ad88b420aa85fbd84f492d upstream.
This fixes three issues on move extents ioctl without auto defrag:
a) In ocfs2_find_victim_alloc_group(), we have to convert bits to block first in case of global bitmap.
b) In ocfs2_probe_alloc_group(), when finding enough bits in block group bitmap, we have to back off move_len to start pos as well, otherwise it may corrupt filesystem.
c) In ocfs2_ioctl_move_extents(), set me_threshold both for non-auto and auto defrag paths. Otherwise it will set move_max_hop to 0 and finally cause unexpectedly ENOSPC error.
Currently there are no tools triggering the above issues since defragfs.ocfs2 enables auto defrag by default. Tested with manually changing defragfs.ocfs2 to run non auto defrag path.
--- fs/ocfs2/move_extents.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
fs/ocfs2/move_extents.c +13 -11
@@ -434,7 +434,7 @@ static int ocfs2_find_victim_alloc_group bg = (struct ocfs2_group_desc *)gd_bh->b_data;if (vict_blkno < (le64_to_cpu (bg->bg_blkno) + -le16_to_cpu (bg->bg_bits))) { + (le16_to_cpu (bg->bg_bits) << bits_per_unit))) { *ret_bh = gd_bh; *vict_bit = (vict_blkno - blkno) >>
@@ -549,6 +549,7 @@ static void ocfs2_probe_alloc_group(stru last_free_bits++;if (last_free_bits == move_len) { + i -= move_len; *goal_bit = i; *phys_cpos = base_cpos + i;break ;
@@ -1020,18 +1021,19 @@ int ocfs2_ioctl_move_extents(struct file context->range = ⦥ +/* +* ok, the default theshold for the defragmentation +* is 1M, since our maximum clustersize was 1M also. +* any thought? +*/ +if (!range.me_threshold) + range.me_threshold =1024 *1024 ; + +if (range.me_threshold >i_size_read (inode)) + range.me_threshold =i_size_read (inode); +if (range.me_flags &OCFS2_MOVE_EXT_FL_AUTO_DEFRAG ) { context->auto_defrag =1 ; -/* -* ok, the default theshold for the defragmentation -* is 1M, since our maximum clustersize was 1M also. -* any thought? -*/ -if (!range.me_threshold) - range.me_threshold =1024 *1024 ; - -if (range.me_threshold >i_size_read (inode)) - range.me_threshold =i_size_read (inode);if (range.me_flags &OCFS2_MOVE_EXT_FL_PART_DEFRAG ) context->partial =1 ;
Greg Kroah-Hartman
maintainerPATCH 457/567 selftests/landlock: Skip overlayfs tests when not supported
In reply to Greg Kroah-HartmanFrom: Jeff Xu <[email protected]>
commit 366617a69e60610912836570546f118006ebc7cb upstream.
overlayfs may be disabled in the kernel configuration, causing related tests to fail. Check that overlayfs is supported at runtime, so we can skip layout2_overlay.* accordingly.
--- tools/testing/selftests/landlock/fs_test.c | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
tools/testing/selftests/landlock/fs_test.c +47 -0
@@ -11,6 +11,7 @@#include <fcntl.h> #include <linux/landlock.h> #include <sched.h> +#include <stdio.h> #include <string.h> #include <sys/capability.h> #include <sys/mount.h>
@@ -87,6 +88,40 @@ static const char dir_s3d3[] = TMP_DIR "* └── s3d3 */ +static bool fgrep (FILE *const inf,const char *const str) +{ +char line[32 ]; +const int slen =strlen (str); + +while (!feof (inf)) { +if (!fgets (line,sizeof (line), inf)) +break ; +if (strncmp (line, str, slen)) +continue ; + +return true; + } + +return false; +} + +static bool supports_overlayfs (void ) +{ +bool res; +FILE *const inf =fopen ("/proc/filesystems" ,"r" ); + +/* +* Consider that the filesystem is supported if we cannot get the +* supported ones. +*/ +if (!inf) +return true; + + res =fgrep (inf,"nodev\toverlay\n" ); +fclose (inf); +return res; +} +static void mkdir_parents (struct __test_metadata *const _metadata,const char *const path) {
@@ -2650,6 +2685,9 @@ FIXTURE(layout2_overlay) {};FIXTURE_SETUP (layout2_overlay) { +if (!supports_overlayfs ()) +SKIP (return,"overlayfs is not supported" ); +prepare_layout (_metadata);create_directory (_metadata,LOWER_BASE );
@@ -2686,6 +2724,9 @@ FIXTURE_SETUP(layout2_overlay)FIXTURE_TEARDOWN (layout2_overlay) { +if (!supports_overlayfs ()) +SKIP (return,"overlayfs is not supported" ); +EXPECT_EQ (0 ,remove_path (lower_do1_fl3));EXPECT_EQ (0 ,remove_path (lower_dl1_fl2));EXPECT_EQ (0 ,remove_path (lower_fl1));
@@ -2717,6 +2758,9 @@ FIXTURE_TEARDOWN(layout2_overlay) TEST_F_FORK(layout2_overlay, no_restriction) { +if (!supports_overlayfs ()) +SKIP (return,"overlayfs is not supported" ); +ASSERT_EQ (0 ,test_open (lower_fl1,O_RDONLY ));ASSERT_EQ (0 ,test_open (lower_dl1,O_RDONLY ));ASSERT_EQ (0 ,test_open (lower_dl1_fl2,O_RDONLY ));
@@ -2880,6 +2924,9 @@ TEST_F_FORK(layout2_overlay, same_contensize_t i;const char *path_entry; +if (!supports_overlayfs ()) +SKIP (return,"overlayfs is not supported" ); +/* Sets rules on base directories (i.e. outside overlay scope). */ ruleset_fd =create_ruleset (_metadata,ACCESS_RW , layer1_base);ASSERT_LE (0 , ruleset_fd);
Greg Kroah-Hartman
maintainerPATCH 458/567 selftests/landlock: Test ptrace as much as possible with Yama
In reply to Greg Kroah-HartmanFrom: Jeff Xu <[email protected]>
commit 8677e555f17f51321d0730b945aeb7d4b95f998f upstream.
Update ptrace tests according to all potential Yama security policies. This is required to make such tests pass even if Yama is enabled.
Tests are not skipped but they now check both Landlock and Yama boundary restrictions at run time to keep a maximum test coverage (i.e. positive and negative testing).
[mic: Add curly braces around EXPECT_EQ() to make it build, and improve commit message]
--- tools/testing/selftests/landlock/ptrace_test.c | 113 +++++++++++++++++++++---- 1 file changed, 96 insertions(+), 17 deletions(-)
tools/testing/selftests/landlock/ptrace_test.c +96 -17
@@ -19,6 +19,12 @@#include "common.h" +/* Copied from security/yama/yama_lsm.c */ +#define YAMA_SCOPE_DISABLED 0 +#define YAMA_SCOPE_RELATIONAL 1 +#define YAMA_SCOPE_CAPABILITY 2 +#define YAMA_SCOPE_NO_ATTACH 3 +static void create_domain (struct __test_metadata *const _metadata) {int ruleset_fd;
@@ -60,6 +66,25 @@ static int test_ptrace_read(const pid_treturn 0 ; } +static int get_yama_ptrace_scope (void ) +{ +int ret; +char buf[2 ] = {}; +const int fd =open ("/proc/sys/kernel/yama/ptrace_scope" ,O_RDONLY ); + +if (fd <0 ) +return 0 ; + +if (read (fd, buf,1 ) <0 ) { +close (fd); +return -1 ; + } + + ret =atoi (buf); +close (fd); +return ret; +} +/* clang-format off */ FIXTURE (hierarchy) {};/* clang-format on */
@@ -232,8 +257,51 @@ TEST_F(hierarchy, trace)pid_t child, parent;int status, err_proc_read;int pipe_child[2 ], pipe_parent[2 ]; +int yama_ptrace_scope;char buf_parent;long ret; +bool can_read_child, can_trace_child, can_read_parent, can_trace_parent; + + yama_ptrace_scope =get_yama_ptrace_scope (); +ASSERT_LE (0 , yama_ptrace_scope); + +if (yama_ptrace_scope >YAMA_SCOPE_DISABLED ) +TH_LOG ("Incomplete tests due to Yama restrictions (scope %d)" , + yama_ptrace_scope); + +/* +* can_read_child is true if a parent process can read its child +* process, which is only the case when the parent process is not +* isolated from the child with a dedicated Landlock domain. +*/ + can_read_child = !variant->domain_parent; + +/* +* can_trace_child is true if a parent process can trace its child +* process. This depends on two conditions: +* - The parent process is not isolated from the child with a dedicated +* Landlock domain. +* - Yama allows tracing children (up to YAMA_SCOPE_RELATIONAL). +*/ + can_trace_child = can_read_child && + yama_ptrace_scope <=YAMA_SCOPE_RELATIONAL ; + +/* +* can_read_parent is true if a child process can read its parent +* process, which is only the case when the child process is not +* isolated from the parent with a dedicated Landlock domain. +*/ + can_read_parent = !variant->domain_child; + +/* +* can_trace_parent is true if a child process can trace its parent +* process. This depends on two conditions: +* - The child process is not isolated from the parent with a dedicated +* Landlock domain. +* - Yama is disabled (YAMA_SCOPE_DISABLED). +*/ + can_trace_parent = can_read_parent && + yama_ptrace_scope <=YAMA_SCOPE_DISABLED ;/* * Removes all effective and permitted capabilities to not interfere
@@ -264,16 +332,21 @@ TEST_F(hierarchy, trace)/* Waits for the parent to be in a domain, if any. */ ASSERT_EQ (1 ,read (pipe_parent[0 ], &buf_child,1 )); -/* Tests PTRACE_ATTACH and PTRACE_MODE_READ on the parent. */ +/* Tests PTRACE_MODE_READ on the parent. */ err_proc_read =test_ptrace_read (parent); +if (can_read_parent) { +EXPECT_EQ (0 , err_proc_read); + }else { +EXPECT_EQ (EACCES , err_proc_read); + } + +/* Tests PTRACE_ATTACH on the parent. */ ret =ptrace (PTRACE_ATTACH , parent,NULL ,0 ); -if (variant->domain_child) { +if (can_trace_parent) { +EXPECT_EQ (0 , ret); + }else {EXPECT_EQ (-1 , ret);EXPECT_EQ (EPERM , errno); -EXPECT_EQ (EACCES , err_proc_read); - }else { -EXPECT_EQ (0 , ret); -EXPECT_EQ (0 , err_proc_read); }if (ret ==0 ) {ASSERT_EQ (parent,waitpid (parent, &status,0 ));
@@ -283,11 +356,11 @@ TEST_F(hierarchy, trace)/* Tests child PTRACE_TRACEME. */ ret =ptrace (PTRACE_TRACEME ); -if (variant->domain_parent) { +if (can_trace_child) { +EXPECT_EQ (0 , ret); + }else {EXPECT_EQ (-1 , ret);EXPECT_EQ (EPERM , errno); - }else { -EXPECT_EQ (0 , ret); }/*
@@ -296,7 +369,7 @@ TEST_F(hierarchy, trace)*/ ASSERT_EQ (1 ,write (pipe_child[1 ],"." ,1 )); -if (!variant->domain_parent) { +if (can_trace_child) {ASSERT_EQ (0 ,raise (SIGSTOP )); }
@@ -321,7 +394,7 @@ TEST_F(hierarchy, trace)ASSERT_EQ (1 ,read (pipe_child[0 ], &buf_parent,1 ));/* Tests child PTRACE_TRACEME. */ -if (!variant->domain_parent) { +if (can_trace_child) {ASSERT_EQ (child,waitpid (child, &status,0 ));ASSERT_EQ (1 ,WIFSTOPPED (status));ASSERT_EQ (0 ,ptrace (PTRACE_DETACH , child,NULL ,0 ));
@@ -331,17 +404,23 @@ TEST_F(hierarchy, trace)EXPECT_EQ (ESRCH , errno); } -/* Tests PTRACE_ATTACH and PTRACE_MODE_READ on the child. */ +/* Tests PTRACE_MODE_READ on the child. */ err_proc_read =test_ptrace_read (child); +if (can_read_child) { +EXPECT_EQ (0 , err_proc_read); + }else { +EXPECT_EQ (EACCES , err_proc_read); + } + +/* Tests PTRACE_ATTACH on the child. */ ret =ptrace (PTRACE_ATTACH , child,NULL ,0 ); -if (variant->domain_parent) { +if (can_trace_child) { +EXPECT_EQ (0 , ret); + }else {EXPECT_EQ (-1 , ret);EXPECT_EQ (EPERM , errno); -EXPECT_EQ (EACCES , err_proc_read); - }else { -EXPECT_EQ (0 , ret); -EXPECT_EQ (0 , err_proc_read); } +if (ret ==0 ) {ASSERT_EQ (child,waitpid (child, &status,0 ));ASSERT_EQ (1 ,WIFSTOPPED (status));
Greg Kroah-Hartman
maintainerPATCH 459/567 udf: Truncate added extents on failed expansion
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 70bfb3a8d661d4fdc742afc061b88a7f3fc9f500 upstream.
When a file expansion failed because we didn't have enough space for indirect extents make sure we truncate extents created so far so that we don't leave extents beyond EOF.
--- fs/udf/inode.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
fs/udf/inode.c +11 -4
@@ -525,8 +525,10 @@ static int udf_do_extend_file(struct ino }if (fake) { -udf_add_aext (inode, last_pos, &last_ext->extLocation, - last_ext->extLength,1 ); + err =udf_add_aext (inode, last_pos, &last_ext->extLocation, + last_ext->extLength,1 ); +if (err <0 ) + goto out_err; count++; }else {struct kernel_lb_addr tmploc;
@@ -560,7 +562,7 @@ static int udf_do_extend_file(struct ino err =udf_add_aext (inode, last_pos, &last_ext->extLocation, last_ext->extLength,1 );if (err) -return err; + goto out_err; count++; }if (new_block_bytes) {
@@ -569,7 +571,7 @@ static int udf_do_extend_file(struct ino err =udf_add_aext (inode, last_pos, &last_ext->extLocation, last_ext->extLength,1 );if (err) -return err; + goto out_err; count++; }
@@ -583,6 +585,11 @@ out:return -EIO ;return count; +out_err: +/* Remove extents we've created so far */ +udf_clear_extent_cache (inode); +udf_truncate_extents (inode); +return err; }/* Extend the final block of the file to final_block_len bytes */
Greg Kroah-Hartman
maintainerPATCH 460/567 udf: Do not bother merging very long extents
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 53cafe1d6d8ef9f93318e5bfccc0d24f27d41ced upstream.
When merging very long extents we try to push as much length as possible to the first extent. However this is unnecessarily complicated and not really worth the trouble. Furthermore there was a bug in the logic resulting in corrupting extents in the file as syzbot reproducer shows. So just don't bother with the merging of extents that are too long together.
--- fs/udf/inode.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
fs/udf/inode.c +2 -17
@@ -1093,23 +1093,8 @@ static void udf_merge_extents(struct ino blocksize - 1) >> blocksize_bits)))) {if (((li->extLength &UDF_EXTENT_LENGTH_MASK ) + - (lip1->extLength &UDF_EXTENT_LENGTH_MASK ) + - blocksize -1 ) & ~UDF_EXTENT_LENGTH_MASK ) { - lip1->extLength = (lip1->extLength - - (li->extLength & -UDF_EXTENT_LENGTH_MASK ) + -UDF_EXTENT_LENGTH_MASK ) & - ~(blocksize -1 ); - li->extLength = (li->extLength & -UDF_EXTENT_FLAG_MASK ) + - (UDF_EXTENT_LENGTH_MASK +1 ) - - blocksize; - lip1->extLocation.logicalBlockNum = - li->extLocation.logicalBlockNum + - ((li->extLength & -UDF_EXTENT_LENGTH_MASK ) >> - blocksize_bits); - }else { + (lip1->extLength &UDF_EXTENT_LENGTH_MASK ) + + blocksize -1 ) <=UDF_EXTENT_LENGTH_MASK ) { li->extLength = lip1->extLength + (((li->extLength & UDF_EXTENT_LENGTH_MASK) +
Greg Kroah-Hartman
maintainerPATCH 461/567 udf: Do not update file length for failed writes to inline files
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 256fe4162f8b5a1625b8603ca5f7ff79725bfb47 upstream.
When write to inline file fails (or happens only partly), we still updated length of inline data as if the whole write succeeded. Fix the update of length of inline data to happen only if the write succeeds.
--- fs/udf/file.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
fs/udf/file.c +12 -14
@@ -148,26 +148,24 @@ static ssize_t udf_file_write_iter(struc goto out;down_write (&iinfo->i_data_sem); -if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB ) { -loff_t end = iocb->ki_pos +iov_iter_count (from); - -if (inode->i_sb->s_blocksize < - (udf_file_entry_alloc_offset (inode) + end)) { - err =udf_expand_file_adinicb (inode); -if (err) { -inode_unlock (inode); -udf_debug ("udf_expand_adinicb: err=%d\n" , err); -return err; - } - }else { - iinfo->i_lenAlloc =max (end, inode->i_size); -up_write (&iinfo->i_data_sem); +if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB && + inode->i_sb->s_blocksize < (udf_file_entry_alloc_offset (inode) + + iocb->ki_pos +iov_iter_count (from))) { + err =udf_expand_file_adinicb (inode); +if (err) { +inode_unlock (inode); +udf_debug ("udf_expand_adinicb: err=%d\n" , err); +return err; } }else up_write (&iinfo->i_data_sem); retval =__generic_file_write_iter (iocb, from); out: +down_write (&iinfo->i_data_sem); +if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB && retval >0 ) + iinfo->i_lenAlloc = inode->i_size; +up_write (&iinfo->i_data_sem);inode_unlock (inode);if (retval >0 ) {
Greg Kroah-Hartman
maintainerPATCH 462/567 udf: Preserve link count of system files
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit fc8033a34a3ca7d23353e645e6dde5d364ac5f12 upstream.
System files in UDF filesystem have link count 0. To not confuse VFS we fudge the link count to be 1 when reading such inodes however we forget to restore the link count of 0 when writing such inodes. Fix that.
--- fs/udf/inode.c | 9 +++++++-- fs/udf/super.c | 1 + fs/udf/udf_i.h | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-)
fs/udf/inode.c +7 -2
@@ -1385,6 +1385,7 @@ reread: ret = -EIO ; goto out; } + iinfo->i_hidden = hidden_inode; iinfo->i_unique =0 ; iinfo->i_lenEAttr =0 ; iinfo->i_lenExtents =0 ;
@@ -1720,8 +1721,12 @@ static int udf_update_inode(struct inodeif (S_ISDIR (inode->i_mode) && inode->i_nlink >0 ) fe->fileLinkCount =cpu_to_le16 (inode->i_nlink -1 ); -else - fe->fileLinkCount =cpu_to_le16 (inode->i_nlink); +else { +if (iinfo->i_hidden) + fe->fileLinkCount =cpu_to_le16 (0 ); +else + fe->fileLinkCount =cpu_to_le16 (inode->i_nlink); + } fe->informationLength =cpu_to_le64 (inode->i_size);
fs/udf/super.c +1 -0
@@ -147,6 +147,7 @@ static struct inode *udf_alloc_inode(str ei->i_next_alloc_goal =0 ; ei->i_strat4096 =0 ; ei->i_streamdir =0 ; + ei->i_hidden =0 ;init_rwsem (&ei->i_data_sem); ei->cached_extent.lstart =-1 ;spin_lock_init (&ei->i_extent_cache_lock);
fs/udf/udf_i.h +2 -1
@@ -44,7 +44,8 @@ struct udf_inode_info { unsigned i_use : 1; /* unallocSpaceEntry */ unsigned i_strat4096 : 1; unsigned i_streamdir : 1; - unsigned reserved : 25; + unsigned i_hidden : 1; /* hidden system inode */ + unsigned reserved : 24;__u8 *i_data;struct kernel_lb_addr i_locStreamdir;__u64 i_lenStreams;
Greg Kroah-Hartman
maintainerPATCH 463/567 udf: Detect system inodes linked into directory hierarchy
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 85a37983ec69cc9fcd188bc37c4de15ee326355a upstream.
When UDF filesystem is corrupted, hidden system inodes can be linked into directory hierarchy which is an avenue for further serious corruption of the filesystem and kernel confusion as noticed by syzbot fuzzed images. Refuse to access system inodes linked into directory hierarchy and vice versa.
--- fs/udf/inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/udf/inode.c +6 -1
@@ -1897,8 +1897,13 @@ struct inode *__udf_iget(struct super_blif (!inode)return ERR_PTR (-ENOMEM ); -if (!(inode->i_state &I_NEW )) +if (!(inode->i_state &I_NEW )) { +if (UDF_I (inode)->i_hidden != hidden_inode) { +iput (inode); +return ERR_PTR (-EFSCORRUPTED ); + }return inode; + }memcpy (&UDF_I (inode)->i_location, ino,sizeof (struct kernel_lb_addr )); err =udf_read_inode (inode, hidden_inode);
Greg Kroah-Hartman
maintainerPATCH 464/567 udf: Fix file corruption when appending just after end of preallocated extent
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 36ec52ea038b18a53e198116ef7d7e70c87db046 upstream.
When we append new block just after the end of preallocated extent, the code in inode_getblk() wrongly determined we're going to use the preallocated extent which resulted in adding block into a wrong logical offset in the file. Sequence like this manifests it:
xfs_io -f -c "pwrite 0x2cacf 0xd122" -c "truncate 0x2dd6f" \
-c "pwrite 0x27fd9 0x69a9" -c "pwrite 0x32981 0x7244" <file>
The code that determined the use of preallocated extent is actually stale because udf_do_extend_file() does not create preallocation anymore so after calling that function we are sure there's no usable preallocation. Just remove the faulty condition.
--- fs/udf/inode.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-)
fs/udf/inode.c +11 -13
@@ -804,19 +804,17 @@ static sector_t inode_getblk(struct inod c =0 ; offset =0 ; count += ret; -/* We are not covered by a preallocated extent? */ -if ((laarr[0 ].extLength &UDF_EXTENT_FLAG_MASK ) != -EXT_NOT_RECORDED_ALLOCATED ) { -/* Is there any real extent? - otherwise we overwrite -* the fake one... */ -if (count) - c = !c; - laarr[c].extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | - inode->i_sb->s_blocksize; -memset (&laarr[c].extLocation,0x00 , -sizeof (struct kernel_lb_addr )); - count++; - } +/* +* Is there any real extent? - otherwise we overwrite the fake +* one... +*/ +if (count) + c = !c; + laarr[c].extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | + inode->i_sb->s_blocksize; +memset (&laarr[c].extLocation,0x00 , +sizeof (struct kernel_lb_addr )); + count++; endnum = c +1 ; lastblock =1 ; }else {
Greg Kroah-Hartman
maintainerPATCH 465/567 RDMA/siw: Fix user page pinning accounting
In reply to Greg Kroah-HartmanFrom: Bernard Metzler <[email protected]>
[ Upstream commit 65a8fc30fb6722fc25adec6d7dd5b53b0bb85820 ]
To avoid racing with other user memory reservations, immediately account full amount of pages to be pinned.
--- drivers/infiniband/sw/siw/siw_mem.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/infiniband/sw/siw/siw_mem.c +12 -11
@@ -398,7 +398,7 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable) mlock_limit =rlimit (RLIMIT_MEMLOCK ) >>PAGE_SHIFT ; -if (num_pages +atomic64_read (&mm_s->pinned_vm) > mlock_limit) { +if (atomic64_add_return (num_pages, &mm_s->pinned_vm) > mlock_limit) { rv = -ENOMEM ; goto out_sem_up; }
@@ -411,18 +411,16 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable) goto out_sem_up; }for (i =0 ; num_pages; i++) { -int got, nents =min_t (int, num_pages,PAGES_PER_CHUNK ); - - umem->page_chunk[i].plist = +int nents =min_t (int, num_pages,PAGES_PER_CHUNK ); +struct page **plist =kcalloc (nents,sizeof (struct page *),GFP_KERNEL ); -if (!umem->page_chunk[i].plist) { + +if (!plist) { rv = -ENOMEM ; goto out_sem_up; } - got =0 ; + umem->page_chunk[i].plist = plist;while (nents) { -struct page **plist = &umem->page_chunk[i].plist[got]; - rv =pin_user_pages (first_page_va, nents, foll_flags |FOLL_LONGTERM , plist,NULL );
@@ -430,12 +428,11 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable) goto out_sem_up; umem->num_pages += rv; -atomic64_add (rv, &mm_s->pinned_vm); first_page_va += rv *PAGE_SIZE ; + plist += rv; nents -= rv; - got += rv; + num_pages -= rv; } - num_pages -= got; } out_sem_up:mmap_read_unlock (mm_s);
@@ -443,6 +440,10 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable)if (rv >0 )return umem; +/* Adjust accounting for pages not pinned */ +if (num_pages) +atomic64_sub (num_pages, &mm_s->pinned_vm); +siw_umem_release (umem, false);return ERR_PTR (rv);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 466/567 KVM: Destroy target device if coalesced MMIO unregistration fails
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit b1cb1fac22abf102ffeb29dd3eeca208a3869d54 upstream.
Destroy and free the target coalesced MMIO device if unregistering said device fails. As clearly noted in the code, kvm_io_bus_unregister_dev() does not destroy the target device.
BUG: memory leak
unreferenced object 0xffff888112a54880 (size 64):
comm "syz-executor.2", pid 5258, jiffies 4297861402 (age 14.129s)
hex dump (first 32 bytes):
38 c7 67 15 00 c9 ff ff 38 c7 67 15 00 c9 ff ff 8.g.....8.g.....
e0 c7 e1 83 ff ff ff ff 00 30 67 15 00 c9 ff ff .........0g.....
backtrace:
[<0000000006995a8a>] kmalloc include/linux/slab.h:556 [inline]
[<0000000006995a8a>] kzalloc include/linux/slab.h:690 [inline]
[<0000000006995a8a>] kvm_vm_ioctl_register_coalesced_mmio+0x8e/0x3d0 arch/x86/kvm/../../../virt/kvm/coalesced_mmio.c:150
[<00000000022550c2>] kvm_vm_ioctl+0x47d/0x1600 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3323
[<000000008a75102f>] vfs_ioctl fs/ioctl.c:46 [inline]
[<000000008a75102f>] file_ioctl fs/ioctl.c:509 [inline]
[<000000008a75102f>] do_vfs_ioctl+0xbab/0x1160 fs/ioctl.c:696
[<0000000080e3f669>] ksys_ioctl+0x76/0xa0 fs/ioctl.c:713
[<0000000059ef4888>] __do_sys_ioctl fs/ioctl.c:720 [inline]
[<0000000059ef4888>] __se_sys_ioctl fs/ioctl.c:718 [inline]
[<0000000059ef4888>] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:718
[<000000006444fa05>] do_syscall_64+0x9f/0x4e0 arch/x86/entry/common.c:290
[<000000009a4ed50b>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
BUG: leak checking failed--- virt/kvm/coalesced_mmio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
virt/kvm/coalesced_mmio.c +5 -3
@@ -187,15 +187,17 @@ int kvm_vm_ioctl_unregister_coalesced_mm r =kvm_io_bus_unregister_dev (kvm, zone->pio ?KVM_PIO_BUS :KVM_MMIO_BUS , &dev->dev); +kvm_iodevice_destructor (&dev->dev); +/* * On failure, unregister destroys all devices on the * bus _except_ the target device, i.e. coalesced_zones -* has been modified. No need to restart the walk as -* there aren't any zones left. +* has been modified. Bail after destroying the target +* device, there's no need to restart the walk as there +* aren't any zones left. */ if (r)break ; -kvm_iodevice_destructor (&dev->dev); } }
Greg Kroah-Hartman
maintainerPATCH 467/567 KVM: x86: Inject #GP if WRMSR sets reserved bits in APIC Self-IPI
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit ba5838abb05334e4abfdff1490585c7f365e0424 upstream.
Inject a #GP if the guest attempts to set reserved bits in the x2APIC-only Self-IPI register. Bits 7:0 hold the vector, all other bits are reserved.
--- arch/x86/kvm/lapic.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
arch/x86/kvm/lapic.c +7 -3
@@ -2127,10 +2127,14 @@ int kvm_lapic_reg_write(struct kvm_lapicbreak ;case APIC_SELF_IPI : -if (apic_x2apic_mode (apic)) -kvm_apic_send_ipi (apic,APIC_DEST_SELF | (val &APIC_VECTOR_MASK ),0 ); -else +/* +* Self-IPI exists only when x2APIC is enabled. Bits 7:0 hold +* the vector, everything else is reserved. +*/ +if (!apic_x2apic_mode (apic) || (val & ~APIC_VECTOR_MASK )) ret =1 ; +else +kvm_apic_send_ipi (apic,APIC_DEST_SELF | val,0 );break ;default : ret =1 ;
Greg Kroah-Hartman
maintainerPATCH 468/567 KVM: SVM: Fix potential overflow in SEVs send|receive_update_data()
In reply to Greg Kroah-HartmanFrom: Peter Gonda <[email protected]>
commit f94f053aa3a5d6ff17951870483d9eb9e13de2e2 upstream.
KVM_SEV_SEND_UPDATE_DATA and KVM_SEV_RECEIVE_UPDATE_DATA have an integer overflow issue. Params.guest_len and offset are both 32 bits wide, with a large params.guest_len the check to confirm a page boundary is not crossed can falsely pass:
/* Check if we are crossing the page boundary *
offset = params.guest_uaddr & (PAGE_SIZE - 1);
if ((params.guest_len + offset > PAGE_SIZE))Add an additional check to confirm that params.guest_len itself is not greater than PAGE_SIZE.
Note, this isn't a security concern as overflow can happen if and only if params.guest_len is greater than 0xfffff000, and the FW spec says these commands fail with lengths greater than 16KB, i.e. the PSP will detect KVM's goof.
--- arch/x86/kvm/svm/sev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/sev.c +2 -2
@@ -1277,7 +1277,7 @@ static int sev_send_update_data(struct k/* Check if we are crossing the page boundary */ offset = params.guest_uaddr & (PAGE_SIZE -1 ); -if ((params.guest_len + offset >PAGE_SIZE )) +if (params.guest_len >PAGE_SIZE || (params.guest_len + offset) >PAGE_SIZE )return -EINVAL ;/* Pin guest memory */
@@ -1457,7 +1457,7 @@ static int sev_receive_update_data(struc/* Check if we are crossing the page boundary */ offset = params.guest_uaddr & (PAGE_SIZE -1 ); -if ((params.guest_len + offset >PAGE_SIZE )) +if (params.guest_len >PAGE_SIZE || (params.guest_len + offset) >PAGE_SIZE )return -EINVAL ; hdr =psp_copy_user_blob (params.hdr_uaddr, params.hdr_len);
Greg Kroah-Hartman
maintainerPATCH 469/567 KVM: SVM: hyper-v: placate modpost section mismatch error
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
commit 45dd9bc75d9adc9483f0c7d662ba6e73ed698a0b upstream.
modpost reports section mismatch errors/warnings:
WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data)
WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data)
WARNING: modpost: vmlinux.o: section mismatch in reference: svm_hv_hardware_setup (section: .text) -> (unknown) (section: .init.data)
This "(unknown) (section: .init.data)" all refer to svm_x86_ops.
Tag svm_hv_hardware_setup() with __init to fix a modpost warning as the non-stub implementation accesses __initdata (svm_x86_ops), i.e. would generate a use-after-free if svm_hv_hardware_setup() were actually invoked post-init. The helper is only called from svm_hardware_setup(), which is also __init, i.e. lack of __init is benign other than the modpost warning.
Message-Id: <[email protected]>
--- arch/x86/kvm/svm/svm_onhyperv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/svm_onhyperv.h +2 -2
@@ -48,7 +48,7 @@ static inline void svm_hv_init_vmcb(stru hve->hv_enlightenments_control.enlightened_npt_tlb =1 ; } -static inline void svm_hv_hardware_setup (void ) +static inline __init void svm_hv_hardware_setup (void ) {if (npt_enabled && ms_hyperv.nested_features &HV_X64_NESTED_ENLIGHTENED_TLB ) {
@@ -112,7 +112,7 @@ static inline void svm_hv_init_vmcb(stru { } -static inline void svm_hv_hardware_setup (void ) +static inline __init void svm_hv_hardware_setup (void ) { }
Greg Kroah-Hartman
maintainerPATCH 470/567 KVM: s390: disable migration mode when dirty tracking is disabled
In reply to Greg Kroah-HartmanFrom: Nico Boehr <[email protected]>
commit f2d3155e2a6bac44d16f04415a321e8707d895c6 upstream.
Migration mode is a VM attribute which enables tracking of changes in storage attributes (PGSTE). It assumes dirty tracking is enabled on all memslots to keep a dirty bitmap of pages with changed storage attributes.
When enabling migration mode, we currently check that dirty tracking is enabled for all memslots. However, userspace can disable dirty tracking without disabling migration mode.
Since migration mode is pointless with dirty tracking disabled, disable migration mode whenever userspace disables dirty tracking on any slot.
Also update the documentation to clarify that dirty tracking must be enabled when enabling migration mode, which is already enforced by the code in kvm_s390_vm_start_migration().
Also highlight in the documentation for KVM_S390_GET_CMMA_BITS that it can now fail with -EINVAL when dirty tracking is disabled while migration mode is on. Move all the error codes to a table so this stays readable.
To disable migration mode, slots_lock should be held, which is taken in kvm_set_memory_region() and thus held in kvm_arch_prepare_memory_region().
Restructure the prepare code a bit so all the sanity checking is done before disabling migration mode. This ensures migration mode isn't disabled when some sanity check fails.
Message-Id: <[email protected]>
--- Documentation/virt/kvm/api.rst | 18 ++++++++++++------ Documentation/virt/kvm/devices/vm.rst | 4 ++++ arch/s390/kvm/kvm-s390.c | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-)
Documentation/virt/kvm/api.rst +12 -6
@@ -4117,6 +4117,18 @@ not holding a previously reported uncorr :Parameters: struct kvm_s390_cmma_log (in, out) :Returns: 0 on success, a negative value on error +Errors: + + ====== ============================================================= + ENOMEM not enough memory can be allocated to complete the task + ENXIO if CMMA is not enabled + EINVAL if KVM_S390_CMMA_PEEK is not set but migration mode was not enabled + EINVAL if KVM_S390_CMMA_PEEK is not set but dirty tracking has been + disabled (and thus migration mode was automatically disabled) + EFAULT if the userspace address is invalid or if no page table is + present for the addresses (e.g. when using hugepages). + ====== ============================================================= + This ioctl is used to get the values of the CMMA bits on the s390 architecture. It is meant to be used in two scenarios:
@@ -4197,12 +4209,6 @@ mask is unused. values points to the userspace buffer where the result will be stored. -This ioctl can fail with -ENOMEM if not enough memory can be allocated to -complete the task, with -ENXIO if CMMA is not enabled, with -EINVAL if -KVM_S390_CMMA_PEEK is not set but migration mode was not enabled, with --EFAULT if the userspace address is invalid or if no page table is -present for the addresses (e.g. when using hugepages). - 4.108 KVM_S390_SET_CMMA_BITS ----------------------------
Documentation/virt/kvm/devices/vm.rst +4 -0
@@ -302,6 +302,10 @@ Allows userspace to start migration mode Setting this attribute when migration mode is already active will have no effects. +Dirty tracking must be enabled on all memslots, else -EINVAL is returned. When +dirty tracking is disabled on any memslot, migration mode is automatically +stopped. + :Parameters: none :Returns: -ENOMEM if there is not enough free memory to start migration mode; -EINVAL if the state of the VM is invalid (e.g. no memory defined);
arch/s390/kvm/kvm-s390.c +17 -0
@@ -5066,6 +5066,23 @@ int kvm_arch_prepare_memory_region(struc/* When we are protected, we should not change the memory slots */ if (kvm_s390_pv_get_handle (kvm))return -EINVAL ; + +if (!kvm->arch.migration_mode) +return 0 ; + +/* +* Turn off migration mode when: +* - userspace creates a new memslot with dirty logging off, +* - userspace modifies an existing memslot (MOVE or FLAGS_ONLY) and +* dirty logging is turned off. +* Migration mode expects dirty page logging being enabled to store +* its dirty bitmap. +*/ +if (change !=KVM_MR_DELETE && + !(mem->flags &KVM_MEM_LOG_DIRTY_PAGES )) +WARN (kvm_s390_vm_stop_migration (kvm), +"Failed to stop migration mode" ); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 471/567 x86/virt: Force GIF=1 prior to disabling SVM (for reboot flows)
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit 6a3236580b0b1accc3976345e723104f74f6f8e6 upstream.
Set GIF=1 prior to disabling SVM to ensure that INIT is recognized if the kernel is disabling SVM in an emergency, e.g. if the kernel is about to jump into a crash kernel or may reboot without doing a full CPU RESET. If GIF is left cleared, the new kernel (or firmware) will be unabled to awaken APs. Eat faults on STGI (due to EFER.SVME=0) as it's possible that SVM could be disabled via NMI shootdown between reading EFER.SVME and executing STGI.
--- arch/x86/include/asm/virtext.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
arch/x86/include/asm/virtext.h +15 -1
@@ -126,7 +126,21 @@ static inline void cpu_svm_disable(void)wrmsrl (MSR_VM_HSAVE_PA ,0 );rdmsrl (MSR_EFER , efer); -wrmsrl (MSR_EFER , efer & ~EFER_SVME ); +if (efer &EFER_SVME ) { +/* +* Force GIF=1 prior to disabling SVM to ensure INIT and NMI +* aren't blocked, e.g. if a fatal error occurred between CLGI +* and STGI. Note, STGI may #UD if SVM is disabled from NMI +* context between reading EFER and executing STGI. In that +* case, GIF must already be set, otherwise the NMI would have +* been blocked, so just eat the fault. +*/ + asm_volatile_goto("1: stgi\n\t" + _ASM_EXTABLE(1b, %l[fault]) + ::: "memory" : fault); +fault: + wrmsrl(MSR_EFER, efer & ~EFER_SVME); + } }/** Makes sure SVM is disabled, if it is supported on the CPU
Greg Kroah-Hartman
maintainerPATCH 472/567 x86/crash: Disable virt in core NMI crash handler to avoid double shootdown
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit 26044aff37a5455b19a91785086914fd33053ef4 upstream.
Disable virtualization in crash_nmi_callback() and rework the emergency_vmx_disable_all() path to do an NMI shootdown if and only if a
shootdown has not already occurred. NMI crash shootdown fundamentally
can't support multiple invocations as responding CPUs are deliberately put into halt state without unblocking NMIs. But, the emergency reboot path doesn't have any work of its own, it simply cares about disabling virtualization, i.e. so long as a shootdown occurred, emergency reboot doesn't care who initiated the shootdown, or when.
If "crash_kexec_post_notifiers" is specified on the kernel command line, panic() will invoke crash_smp_send_stop() and result in a second call to nmi_shootdown_cpus() during native_machine_emergency_restart().
Invoke the callback _before_ disabling virtualization, as the current VMCS needs to be cleared before doing VMXOFF. Note, this results in a subtle change in ordering between disabling virtualization and stopping Intel PT on the responding CPUs. While VMX and Intel PT do interact, VMXOFF and writes to MSR_IA32_RTIT_CTL do not induce faults between one another, which is all that matters when panicking.
Harden nmi_shootdown_cpus() against multiple invocations to try and capture any such kernel bugs via a WARN instead of hanging the system during a crash/dump, e.g. prior to the recent hardening of register_nmi_handler(), re-registering the NMI handler would trigger a double list_add() and hang the system if CONFIG_BUG_ON_DATA_CORRUPTION=y.
list_add double add: new=ffffffff82220800, prev=ffffffff8221cfe8, next=ffffffff82220800.
WARNING: CPU: 2 PID: 1319 at lib/list_debug.c:29 __list_add_valid+0x67/0x70 Call Trace: __register_nmi_handler+0xcf/0x130 nmi_shootdown_cpus+0x39/0x90 native_machine_emergency_restart+0x1c9/0x1d0 panic+0x237/0x29b
Extract the disabling logic to a common helper to deduplicate code, and to prepare for doing the shootdown in the emergency reboot path if SVM is supported.
Note, prior to commit ed72736183c4 ("x86/reboot: Force all cpus to exit VMX root if VMX is supported"), nmi_shootdown_cpus() was subtly protected against a second invocation by a cpu_vmx_enabled() check as the kdump handler would disable VMX if it ran first.
--- arch/x86/include/asm/reboot.h | 2 + arch/x86/kernel/crash.c | 17 ---------- arch/x86/kernel/reboot.c | 65 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 56 insertions(+), 28 deletions(-)
arch/x86/include/asm/reboot.h +2 -0
@@ -25,6 +25,8 @@ void __noreturn machine_real_restart(uns#define MRR_BIOS 0#define MRR_APM 1 +void cpu_emergency_disable_virtualization (void ); +typedef void (*nmi_shootdown_cb )(int ,struct pt_regs *);void nmi_panic_self_stop (struct pt_regs *regs);void nmi_shootdown_cpus (nmi_shootdown_cb callback);
arch/x86/kernel/crash.c +1 -16
@@ -37,7 +37,6 @@#include <linux/kdebug.h> #include <asm/cpu.h> #include <asm/reboot.h> -#include <asm/virtext.h> #include <asm/intel_pt.h> #include <asm/crash.h> #include <asm/cmdline.h>
@@ -81,15 +80,6 @@ static void kdump_nmi_callback(int cpu,*/ cpu_crash_vmclear_loaded_vmcss (); -/* Disable VMX or SVM if needed. -* -* We need to disable virtualization on all CPUs. -* Having VMX or SVM enabled on any CPU may break rebooting -* after the kdump kernel has finished its task. -*/ -cpu_emergency_vmxoff (); -cpu_emergency_svm_disable (); -/* * Disable Intel PT to stop its logging */
@@ -148,12 +138,7 @@ void native_machine_crash_shutdown(struc*/ cpu_crash_vmclear_loaded_vmcss (); -/* Booting kdump kernel with VMX or SVM enabled won't work, -* because (among other limitations) we can't disable paging -* with the virt flags. -*/ -cpu_emergency_vmxoff (); -cpu_emergency_svm_disable (); +cpu_emergency_disable_virtualization ();/* * Disable Intel PT to stop its logging
arch/x86/kernel/reboot.c +53 -12
114 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 473/567 x86/reboot: Disable virtualization in an emergency if SVM is supported
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit d81f952aa657b76cea381384bef1fea35c5fd266 upstream.
Disable SVM on all CPUs via NMI shootdown during an emergency reboot. Like VMX, SVM can block INIT, e.g. if the emergency reboot is triggered between CLGI and STGI, and thus can prevent bringing up other CPUs via INIT-SIPI-SIPI.
--- arch/x86/kernel/reboot.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
arch/x86/kernel/reboot.c +11 -12
@@ -530,27 +530,26 @@ static inline void kb_wait(void)static inline void nmi_shootdown_cpus_on_restart (void ); -/* Use NMIs as IPIs to tell all CPUs to disable virtualization */ -static void emergency_vmx_disable_all (void ) +static void emergency_reboot_disable_virtualization (void ) {/* Just make sure we won't change CPUs while doing this */ local_irq_disable ();/* -* Disable VMX on all CPUs before rebooting, otherwise we risk hanging -* the machine, because the CPU blocks INIT when it's in VMX root. +* Disable virtualization on all CPUs before rebooting to avoid hanging +* the system, as VMX and SVM block INIT when running in the host. * * We can't take any locks and we may be on an inconsistent state, so -* use NMIs as IPIs to tell the other CPUs to exit VMX root and halt. +* use NMIs as IPIs to tell the other CPUs to disable VMX/SVM and halt. * -* Do the NMI shootdown even if VMX if off on _this_ CPU, as that -* doesn't prevent a different CPU from being in VMX root operation. +* Do the NMI shootdown even if virtualization is off on _this_ CPU, as +* other CPUs may have virtualization enabled. */ -if (cpu_has_vmx ()) { -/* Safely force _this_ CPU out of VMX root operation. */ -__cpu_emergency_vmxoff (); +if (cpu_has_vmx () ||cpu_has_svm (NULL )) { +/* Safely force _this_ CPU out of VMX/SVM operation. */ +cpu_emergency_disable_virtualization (); -/* Halt and exit VMX root operation on the other CPUs. */ +/* Disable VMX/SVM and halt on other CPUs. */ nmi_shootdown_cpus_on_restart (); } }
@@ -587,7 +586,7 @@ static void native_machine_emergency_resunsigned short mode;if (reboot_emergency) -emergency_vmx_disable_all (); +emergency_reboot_disable_virtualization ();tboot_shutdown (TB_SHUTDOWN_REBOOT );
Greg Kroah-Hartman
maintainerPATCH 474/567 x86/reboot: Disable SVM, not just VMX, when stopping CPUs
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit a2b07fa7b93321c059af0c6d492cc9a4f1e390aa upstream.
Disable SVM and more importantly force GIF=1 when halting a CPU or rebooting the machine. Similar to VMX, SVM allows software to block INITs via CLGI, and thus can be problematic for a crash/reboot. The window for failure is smaller with SVM as INIT is only blocked while GIF=0, i.e. between CLGI and STGI, but the window does exist.
--- arch/x86/kernel/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/smp.c +3 -3
@@ -32,7 +32,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> -#include <asm/virtext.h> +#include <asm/reboot.h> /* * Some notes on x86 processor bugs affecting SMP operation:
@@ -122,7 +122,7 @@ static int smp_stop_nmi_callback(unsigneif (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; -cpu_emergency_vmxoff (); +cpu_emergency_disable_virtualization ();stop_this_cpu (NULL );return NMI_HANDLED ;
@@ -134,7 +134,7 @@ static int smp_stop_nmi_callback(unsigneDEFINE_IDTENTRY_SYSVEC (sysvec_reboot) {ack_APIC_irq (); -cpu_emergency_vmxoff (); +cpu_emergency_disable_virtualization ();stop_this_cpu (NULL ); }
Greg Kroah-Hartman
maintainerPATCH 475/567 x86/kprobes: Fix __recover_optprobed_insn check optimizing logic
In reply to Greg Kroah-HartmanFrom: Yang Jihong <[email protected]>
commit 868a6fc0ca2407622d2833adefe1c4d284766c4c upstream.
Since the following commit:
commit f66c0447cca1 ("kprobes: Set unoptimized flag after unoptimizing code")
modified the update timing of the KPROBE_FLAG_OPTIMIZED, a optimized_kprobe may be in the optimizing or unoptimizing state when op.kp->flags has KPROBE_FLAG_OPTIMIZED and op->list is not empty.
The __recover_optprobed_insn check logic is incorrect, a kprobe in the unoptimizing state may be incorrectly determined as unoptimizing. As a result, incorrect instructions are copied.
The optprobe_queued_unopt function needs to be exported for invoking in arch directory.
--- arch/x86/kernel/kprobes/opt.c | 4 ++-- include/linux/kprobes.h | 1 + kernel/kprobes.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
arch/x86/kernel/kprobes/opt.c +2 -2
@@ -46,8 +46,8 @@ unsigned long __recover_optprobed_insn(k/* This function only handles jump-optimized kprobe */ if (kp &&kprobe_optimized (kp)) { op = container_of(kp, struct optimized_kprobe, kp); -/* If op->list is not empty, op is under optimizing */ -if (list_empty (&op->list)) +/* If op is optimized or under unoptimizing */ +if (list_empty (&op->list) ||optprobe_queued_unopt (op)) goto found; } }
include/linux/kprobes.h +1 -0
@@ -349,6 +349,7 @@ extern int proc_kprobes_optimization_han size_t *length, loff_t *ppos);#endif extern void wait_for_kprobe_optimizer (void ); +bool optprobe_queued_unopt (struct optimized_kprobe *op);#else static inline void wait_for_kprobe_optimizer (void ) { }#endif /* CONFIG_OPTPROBES */
kernel/kprobes.c +1 -1
@@ -656,7 +656,7 @@ void wait_for_kprobe_optimizer(void)mutex_unlock (&kprobe_mutex); } -static bool optprobe_queued_unopt (struct optimized_kprobe *op) +bool optprobe_queued_unopt (struct optimized_kprobe *op) {struct optimized_kprobe *_op;
Greg Kroah-Hartman
maintainerPATCH 476/567 x86/kprobes: Fix arch_check_optimized_kprobe check within optimized_kprobe range
In reply to Greg Kroah-HartmanFrom: Yang Jihong <[email protected]>
commit f1c97a1b4ef709e3f066f82e3ba3108c3b133ae6 upstream.
When arch_prepare_optimized_kprobe calculating jump destination address, it copies original instructions from jmp-optimized kprobe (see __recover_optprobed_insn), and calculated based on length of original instruction.
arch_check_optimized_kprobe does not check KPROBE_FLAG_OPTIMATED when checking whether jmp-optimized kprobe exists.
As a result, setup_detour_execution may jump to a range that has been overwritten by jump destination address, resulting in an inval opcode error.
For example, assume that register two kprobes whose addresses are <func+9> and <func+11> in "func" function.
The original code of "func" function is as follows:
0xffffffff816cb5e9 <+9>: push %r12 0xffffffff816cb5eb <+11>: xor %r12d,%r12d 0xffffffff816cb5ee <+14>: test %rdi,%rdi 0xffffffff816cb5f1 <+17>: setne %r12b 0xffffffff816cb5f5 <+21>: push %rbp
1.Register the kprobe for <func+11>, assume that is kp1, corresponding optimized_kprobe is op1.
After the optimization, "func" code changes to:
0xffffffff816cc079 <+9>: push %r12 0xffffffff816cc07b <+11>: jmp 0xffffffffa0210000 0xffffffff816cc080 <+16>: incl 0xf(%rcx) 0xffffffff816cc083 <+19>: xchg %eax,%ebp 0xffffffff816cc084 <+20>: (bad) 0xffffffff816cc085 <+21>: push %rbp
Now op1->flags == KPROBE_FLAG_OPTIMATED;
2. Register the kprobe for <func+9>, assume that is kp2, corresponding optimized_kprobe is op2.
register_kprobe(kp2)
register_aggr_kprobe
alloc_aggr_kprobe
__prepare_optimized_kprobe
arch_prepare_optimized_kprobe
__recover_optprobed_insn // copy original bytes from kp1->optinsn.copied_insn,
// jump address = <func+14>3. disable kp1:
disable_kprobe(kp1)
__disable_kprobe
...
if (p == orig_p || aggr_kprobe_disabled(orig_p)) {
ret = disarm_kprobe(orig_p, true) // add op1 in unoptimizing_list, not unoptimized
orig_p->flags |= KPROBE_FLAG_DISABLED; // op1->flags == KPROBE_FLAG_OPTIMATED | KPROBE_FLAG_DISABLED
...4. unregister kp2__unregister_kprobe_top
...
if (!kprobe_disabled(ap) && !kprobes_all_disarmed) {
optimize_kprobe(op)
...
if (arch_check_optimized_kprobe(op) < 0) // because op1 has KPROBE_FLAG_DISABLED, here not return
return;
p->kp.flags |= KPROBE_FLAG_OPTIMIZED; // now op2 has KPROBE_FLAG_OPTIMIZED}
"func" code now is:
0xffffffff816cc079 <+9>: int3 0xffffffff816cc07a <+10>: push %rsp 0xffffffff816cc07b <+11>: jmp 0xffffffffa0210000 0xffffffff816cc080 <+16>: incl 0xf(%rcx) 0xffffffff816cc083 <+19>: xchg %eax,%ebp 0xffffffff816cc084 <+20>: (bad) 0xffffffff816cc085 <+21>: push %rbp
5. if call "func", int3 handler call setup_detour_execution:
if (p->flags & KPROBE_FLAG_OPTIMIZED) {
...
regs->ip = (unsigned long)op->optinsn.insn + TMPL_END_IDX;
...
}The code for the destination address is
0xffffffffa021072c: push %r12 0xffffffffa021072e: xor %r12d,%r12d 0xffffffffa0210731: jmp 0xffffffff816cb5ee <func+14>
However, <func+14> is not a valid start instruction address. As a result, an error occurs.
--- arch/x86/kernel/kprobes/opt.c | 2 +- include/linux/kprobes.h | 1 + kernel/kprobes.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-)
arch/x86/kernel/kprobes/opt.c +1 -1
@@ -346,7 +346,7 @@ int arch_check_optimized_kprobe(struct ofor (i =1 ; i < op->optinsn.size; i++) { p =get_kprobe (op->kp.addr + i); -if (p && !kprobe_disabled (p)) +if (p && !kprobe_disarmed (p))return -EEXIST ; }
include/linux/kprobes.h +1 -0
@@ -350,6 +350,7 @@ extern int proc_kprobes_optimization_han#endif extern void wait_for_kprobe_optimizer (void );bool optprobe_queued_unopt (struct optimized_kprobe *op); +bool kprobe_disarmed (struct kprobe *p);#else static inline void wait_for_kprobe_optimizer (void ) { }#endif /* CONFIG_OPTPROBES */
kernel/kprobes.c +2 -2
@@ -451,8 +451,8 @@ static inline int kprobe_optready(structreturn 0 ; } -/* Return true(!0) if the kprobe is disarmed. Note: p must be on hash list */ -static inline int kprobe_disarmed (struct kprobe *p) +/* Return true if the kprobe is disarmed. Note: p must be on hash list */ +bool kprobe_disarmed (struct kprobe *p) {struct optimized_kprobe *op;
Greg Kroah-Hartman
maintainerPATCH 477/567 x86/microcode/amd: Remove load_microcode_amd()s bsp parameter
In reply to Greg Kroah-HartmanFrom: Borislav Petkov (AMD) <[email protected]>
commit 2355370cd941cbb20882cc3f34460f9f2b8f9a18 upstream.
It is always the BSP.
No functional changes.
--- arch/x86/kernel/cpu/microcode/amd.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +5 -12
@@ -547,8 +547,7 @@ void load_ucode_amd_ap(unsigned int cpuiapply_microcode_early_amd (cpuid_1_eax, cp.data, cp.size, false); } -static enum ucode_state -load_microcode_amd (bool save,u8 family,const u8 *data,size_t size); +static enum ucode_state load_microcode_amd (u8 family,const u8 *data,size_t size);int __init save_microcode_in_initrd_amd (unsigned int cpuid_1_eax) {
@@ -566,7 +565,7 @@ int __init save_microcode_in_initrd_amd(if (!desc.mc)return -EINVAL ; - ret =load_microcode_amd (true,x86_family (cpuid_1_eax), desc.data, desc.size); + ret =load_microcode_amd (x86_family (cpuid_1_eax), desc.data, desc.size);if (ret >UCODE_UPDATED )return -EINVAL ;
@@ -844,8 +843,7 @@ static enum ucode_state __load_microcodereturn UCODE_OK ; } -static enum ucode_state -load_microcode_amd (bool save,u8 family,const u8 *data,size_t size) +static enum ucode_state load_microcode_amd (u8 family,const u8 *data,size_t size) {struct ucode_patch *p;enum ucode_state ret;
@@ -869,10 +867,6 @@ load_microcode_amd(bool save, u8 family, ret =UCODE_NEW ; } -/* save BSP's matching patch for early load */ -if (!save) -return ret; -memset (amd_ucode_patch,0 ,PATCH_MAX_SIZE );memcpy (amd_ucode_patch, p->data,min_t (u32, p->size,PATCH_MAX_SIZE ));
@@ -900,12 +894,11 @@ static enum ucode_state request_microcod {char fw_name[36 ] ="amd-ucode/microcode_amd.bin" ;struct cpuinfo_x86 *c = &cpu_data (cpu); -bool bsp = c->cpu_index == boot_cpu_data.cpu_index;enum ucode_state ret =UCODE_NFOUND ;const struct firmware *fw;/* reload ucode container only on the boot cpu */ -if (!refresh_fw || !bsp) +if (!refresh_fw)return UCODE_OK ;if (c->x86 >=0x15 )
@@ -920,7 +913,7 @@ static enum ucode_state request_microcodif (!verify_container (fw->data, fw->size, false)) goto fw_release; - ret =load_microcode_amd (bsp, c->x86, fw->data, fw->size); + ret =load_microcode_amd (c->x86, fw->data, fw->size); fw_release:release_firmware (fw);
Greg Kroah-Hartman
maintainerPATCH 478/567 x86/microcode/AMD: Add a @cpu parameter to the reloading functions
In reply to Greg Kroah-HartmanFrom: Borislav Petkov (AMD) <[email protected]>
commit a5ad92134bd153a9ccdcddf09a95b088f36c3cce upstream.
Will be used in a subsequent change.
--- arch/x86/include/asm/microcode.h | 4 ++-- arch/x86/include/asm/microcode_amd.h | 4 ++-- arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/microcode/core.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-)
arch/x86/include/asm/microcode.h +2 -2
@@ -130,14 +130,14 @@ static inline unsigned int x86_cpuid_fam#ifdef CONFIG_MICROCODE extern void __init load_ucode_bsp (void );extern void load_ucode_ap (void ); -void reload_early_microcode (void ); +void reload_early_microcode (unsigned int cpu);extern bool get_builtin_firmware (struct cpio_data *cd,const char *name);extern bool initrd_gone;void microcode_bsp_resume (void );#else static inline void __init load_ucode_bsp (void ) { }static inline void load_ucode_ap (void ) { } -static inline void reload_early_microcode (void ) { } +static inline void reload_early_microcode (unsigned int cpu) { }static inline void microcode_bsp_resume (void ) { }static inline bool get_builtin_firmware (struct cpio_data *cd,const char *name) {return false; }
arch/x86/include/asm/microcode_amd.h +2 -2
@@ -47,12 +47,12 @@ struct microcode_amd {extern void __init load_ucode_amd_bsp (unsigned int family);extern void load_ucode_amd_ap (unsigned int family);extern int __init save_microcode_in_initrd_amd (unsigned int family); -void reload_ucode_amd (void ); +void reload_ucode_amd (unsigned int cpu);#else static inline void __init load_ucode_amd_bsp (unsigned int family) {}static inline void load_ucode_amd_ap (unsigned int family) {}static inline int __init save_microcode_in_initrd_amd (unsigned int family) {return -EINVAL ; } -static inline void reload_ucode_amd (void ) {} +static inline void reload_ucode_amd (unsigned int cpu) {}#endif #endif /* _ASM_X86_MICROCODE_AMD_H */
arch/x86/kernel/cpu/microcode/amd.c +1 -1
@@ -572,7 +572,7 @@ int __init save_microcode_in_initrd_amd(return 0 ; } -void reload_ucode_amd (void ) +void reload_ucode_amd (unsigned int cpu) {struct microcode_amd *mc;u32 rev, dummy__always_unused ;
arch/x86/kernel/cpu/microcode/core.c +3 -3
@@ -315,7 +315,7 @@ struct cpio_data find_microcode_in_initr#endif } -void reload_early_microcode (void ) +void reload_early_microcode (unsigned int cpu) {int vendor, family;
@@ -329,7 +329,7 @@ void reload_early_microcode(void)break ;case X86_VENDOR_AMD :if (family >=0x10 ) -reload_ucode_amd (); +reload_ucode_amd (cpu);break ;default :break ;
@@ -707,7 +707,7 @@ void microcode_bsp_resume(void)if (uci->valid && uci->mc) microcode_ops->apply_microcode (cpu);else if (!uci->mc) -reload_early_microcode (); +reload_early_microcode (cpu); }static struct syscore_ops mc_syscore_ops = {
Greg Kroah-Hartman
maintainerPATCH 479/567 x86/microcode/AMD: Fix mixed steppings support
In reply to Greg Kroah-HartmanFrom: Borislav Petkov (AMD) <[email protected]>
commit 7ff6edf4fef38ab404ee7861f257e28eaaeed35f upstream.
The AMD side of the loader has always claimed to support mixed steppings. But somewhere along the way, it broke that by assuming that the cached patch blob is a single one instead of it being one per *node*.
So turn it into a per-node one so that each node can stash the blob relevant for it.
[ NB: Fixes tag is not really the exactly correct one but it is good
enough. ]
--- arch/x86/kernel/cpu/microcode/amd.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +21 -13
@@ -55,7 +55,9 @@ struct cont_desc { };static u32 ucode_new_rev; -static u8 amd_ucode_patch[PATCH_MAX_SIZE ]; + +/* One blob per node. */ +static u8 amd_ucode_patch[MAX_NUMNODES ][PATCH_MAX_SIZE ];/* * Microcode patch container file is prepended to the initrd in cpio
@@ -428,7 +430,7 @@ apply_microcode_early_amd(u32 cpuid_1_ea patch = (u8 (*)[PATCH_MAX_SIZE ])__pa_nodebug (&amd_ucode_patch);#else new_rev = &ucode_new_rev; - patch = &amd_ucode_patch; + patch = &amd_ucode_patch[0 ];#endif desc.cpuid_1_eax = cpuid_1_eax;
@@ -574,10 +576,10 @@ int __init save_microcode_in_initrd_amd(void reload_ucode_amd (unsigned int cpu) { -struct microcode_amd *mc;u32 rev, dummy__always_unused ; +struct microcode_amd *mc; - mc = (struct microcode_amd *)amd_ucode_patch; + mc = (struct microcode_amd *)amd_ucode_patch[cpu_to_node (cpu)];rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy);
@@ -845,6 +847,8 @@ static enum ucode_state __load_microcodestatic enum ucode_state load_microcode_amd (u8 family,const u8 *data,size_t size) { +struct cpuinfo_x86 *c; +unsigned int nid, cpu;struct ucode_patch *p;enum ucode_state ret;
@@ -857,18 +861,22 @@ static enum ucode_state load_microcode_areturn ret; } - p =find_patch (0 ); -if (!p) { -return ret; - }else { -if (boot_cpu_data.microcode >= p->patch_id) -return ret; +for_each_node (nid) { + cpu =cpumask_first (cpumask_of_node (nid)); + c = &cpu_data (cpu); + + p =find_patch (cpu); +if (!p) +continue ; + +if (c->microcode >= p->patch_id) +continue ; ret =UCODE_NEW ; - } -memset (amd_ucode_patch,0 ,PATCH_MAX_SIZE ); -memcpy (amd_ucode_patch, p->data,min_t (u32, p->size,PATCH_MAX_SIZE )); +memset (&amd_ucode_patch[nid],0 ,PATCH_MAX_SIZE ); +memcpy (&amd_ucode_patch[nid], p->data,min_t (u32, p->size,PATCH_MAX_SIZE )); + }return ret; }
Greg Kroah-Hartman
maintainerPATCH 480/567 x86/speculation: Allow enabling STIBP with legacy IBRS
In reply to Greg Kroah-HartmanFrom: KP Singh <[email protected]>
commit 6921ed9049bc7457f66c1596c5b78aec0dae4a9d upstream.
When plain IBRS is enabled (not enhanced IBRS), the logic in spectre_v2_user_select_mitigation() determines that STIBP is not needed.
The IBRS bit implicitly protects against cross-thread branch target injection. However, with legacy IBRS, the IBRS bit is cleared on returning to userspace for performance reasons which leaves userspace threads vulnerable to cross-thread branch target injection against which STIBP protects.
Exclude IBRS from the spectre_v2_in_ibrs_mode() check to allow for enabling STIBP (through seccomp/prctl() by default or always-on, if selected by spectre_v2_user kernel cmdline parameter).
[ bp: Massage. ]
--- arch/x86/kernel/cpu/bugs.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/bugs.c +18 -7
@@ -1103,14 +1103,18 @@ spectre_v2_parse_user_cmdline(void)return SPECTRE_V2_USER_CMD_AUTO ; } -static inline bool spectre_v2_in_ibrs_mode (enum spectre_v2_mitigation mode) +static inline bool spectre_v2_in_eibrs_mode (enum spectre_v2_mitigation mode) { -return mode ==SPECTRE_V2_IBRS || - mode ==SPECTRE_V2_EIBRS || +return mode ==SPECTRE_V2_EIBRS || mode ==SPECTRE_V2_EIBRS_RETPOLINE || mode ==SPECTRE_V2_EIBRS_LFENCE ; } +static inline bool spectre_v2_in_ibrs_mode (enum spectre_v2_mitigation mode) +{ +return spectre_v2_in_eibrs_mode (mode) || mode ==SPECTRE_V2_IBRS ; +} +static void __init spectre_v2_user_select_mitigation (void ) {
@@ -1173,12 +1177,19 @@ spectre_v2_user_select_mitigation(void) }/* -* If no STIBP, IBRS or enhanced IBRS is enabled, or SMT impossible, -* STIBP is not required. +* If no STIBP, enhanced IBRS is enabled, or SMT impossible, STIBP +* is not required. +* +* Enhanced IBRS also protects against cross-thread branch target +* injection in user-mode as the IBRS bit remains always set which +* implicitly enables cross-thread protections. However, in legacy IBRS +* mode, the IBRS bit is set only on kernel entry and cleared on return +* to userspace. This disables the implicit cross-thread protection, +* so allow for STIBP to be selected in that case. */ if (!boot_cpu_has (X86_FEATURE_STIBP ) || !smt_possible || -spectre_v2_in_ibrs_mode (spectre_v2_enabled)) +spectre_v2_in_eibrs_mode (spectre_v2_enabled))return ;/*
@@ -2305,7 +2316,7 @@ static ssize_t mmio_stale_data_show_statstatic char *stibp_state (void ) { -if (spectre_v2_in_ibrs_mode (spectre_v2_enabled)) +if (spectre_v2_in_eibrs_mode (spectre_v2_enabled))return "" ;switch (spectre_v2_user_stibp) {
Greg Kroah-Hartman
maintainerPATCH 481/567 Documentation/hw-vuln: Document the interaction between IBRS and STIBP
In reply to Greg Kroah-HartmanFrom: KP Singh <[email protected]>
commit e02b50ca442e88122e1302d4dbc1b71a4808c13f upstream.
Explain why STIBP is needed with legacy IBRS as currently implemented (KERNEL_IBRS) and why STIBP is not needed when enhanced IBRS is enabled.
--- Documentation/admin-guide/hw-vuln/spectre.rst | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
Documentation/admin-guide/hw-vuln/spectre.rst +16 -5
@@ -479,8 +479,16 @@ Spectre variant 2 On Intel Skylake-era systems the mitigation covers most, but not all, cases. See :ref:`[3] <spec_ref3>` for more details. - On CPUs with hardware mitigation for Spectre variant 2 (e.g. Enhanced - IBRS on x86), retpoline is automatically disabled at run time. + On CPUs with hardware mitigation for Spectre variant 2 (e.g. IBRS + or enhanced IBRS on x86), retpoline is automatically disabled at run time. + + Systems which support enhanced IBRS (eIBRS) enable IBRS protection once at + boot, by setting the IBRS bit, and they're automatically protected against + Spectre v2 variant attacks, including cross-thread branch target injections + on SMT systems (STIBP). In other words, eIBRS enables STIBP too. + + Legacy IBRS systems clear the IBRS bit on exit to userspace and + therefore explicitly enable STIBP for that The retpoline mitigation is turned on by default on vulnerable CPUs. It can be forced on or off by the administrator
@@ -504,9 +512,12 @@ Spectre variant 2 For Spectre variant 2 mitigation, individual user programs can be compiled with return trampolines for indirect branches. This protects them from consuming poisoned entries in the branch - target buffer left by malicious software. Alternatively, the - programs can disable their indirect branch speculation via prctl() - (See :ref:`Documentation/userspace-api/spec_ctrl.rst <set_spec_ctrl>`). + target buffer left by malicious software. + + On legacy IBRS systems, at return to userspace, implicit STIBP is disabled + because the kernel clears the IBRS bit. In this case, the userspace programs + can disable indirect branch speculation via prctl() (See + :ref:`Documentation/userspace-api/spec_ctrl.rst <set_spec_ctrl>`). On x86, this will turn on STIBP to guard against attacks from the sibling thread when the user program is running, and use IBPB to flush the branch target buffer when switching to/from the program.
Greg Kroah-Hartman
maintainerPATCH 482/567 brd: return 0/-error from brd_insert_page()
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit db0ccc44a20b4bb3039c0f6885a1f9c3323c7673 upstream.
It currently returns a page, but callers just check for NULL/page to gauge success. Clean this up and return the appropriate error directly instead.
--- drivers/block/brd.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/block/brd.c +12 -14
@@ -78,11 +78,9 @@ static struct page *brd_lookup_page(stru }/* -* Look up and return a brd's page for a given sector. -* If one does not exist, allocate an empty page, and insert that. Then -* return it. +* Insert a new page for a given sector, if one does not already exist. */ -static struct page *brd_insert_page (struct brd_device *brd,sector_t sector) +static int brd_insert_page (struct brd_device *brd,sector_t sector) {pgoff_t idx;struct page *page;
@@ -90,7 +88,7 @@ static struct page *brd_insert_page(stru page =brd_lookup_page (brd, sector);if (page) -return page; +return 0 ;/* * Must use NOIO because we don't want to recurse back into the
@@ -99,11 +97,11 @@ static struct page *brd_insert_page(stru gfp_flags =GFP_NOIO | __GFP_ZERO | __GFP_HIGHMEM; page =alloc_page (gfp_flags);if (!page) -return NULL ; +return -ENOMEM ;if (radix_tree_preload (GFP_NOIO )) {__free_page (page); -return NULL ; +return -ENOMEM ; }spin_lock (&brd->brd_lock);
@@ -120,8 +118,7 @@ static struct page *brd_insert_page(struspin_unlock (&brd->brd_lock);radix_tree_preload_end (); - -return page; +return 0 ; }/*
@@ -174,16 +171,17 @@ static int copy_to_brd_setup(struct brd_ {unsigned int offset = (sector & (PAGE_SECTORS -1 )) <<SECTOR_SHIFT ;size_t copy; +int ret; copy =min_t (size_t, n,PAGE_SIZE - offset); -if (!brd_insert_page (brd, sector)) -return -ENOSPC ; + ret =brd_insert_page (brd, sector); +if (ret) +return ret;if (copy < n) { sector += copy >>SECTOR_SHIFT ; -if (!brd_insert_page (brd, sector)) -return -ENOSPC ; + ret =brd_insert_page (brd, sector); } -return 0 ; +return ret; }/*
Greg Kroah-Hartman
maintainerPATCH 483/567 ima: Align ima_file_mmap() parameters with mmap_file LSM hook
In reply to Greg Kroah-HartmanFrom: Roberto Sassu <[email protected]>
commit 4971c268b85e1c7a734a61622fc0813c86e2362e upstream.
Commit 98de59bfe4b2f ("take calculation of final prot in security_mmap_file() into a helper") moved the code to update prot, to be the actual protections applied to the kernel, to a new helper called mmap_prot().
However, while without the helper ima_file_mmap() was getting the updated prot, with the helper ima_file_mmap() gets the original prot, which contains the protections requested by the application.
A possible consequence of this change is that, if an application calls mmap() with only PROT_READ, and the kernel applies PROT_EXEC in addition, that application would have access to executable memory without having this event recorded in the IMA measurement list. This situation would occur for example if the application, before mmap(), calls the personality() system call with READ_IMPLIES_EXEC as the first argument.
Align ima_file_mmap() parameters with those of the mmap_file LSM hook, so that IMA can receive both the requested prot and the final prot. Since the requested protections are stored in a new variable, and the final protections are stored in the existing variable, this effectively restores the original behavior of the MMAP_CHECK hook.
--- include/linux/ima.h | 6 ++++-- security/integrity/ima/ima_main.c | 7 +++++-- security/security.c | 7 ++++--- 3 files changed, 13 insertions(+), 7 deletions(-)
include/linux/ima.h +4 -2
@@ -21,7 +21,8 @@ extern int ima_file_check(struct file *fextern void ima_post_create_tmpfile (struct user_namespace *mnt_userns,struct inode *inode);extern void ima_file_free (struct file *file); -extern int ima_file_mmap (struct file *file,unsigned long prot); +extern int ima_file_mmap (struct file *file,unsigned long reqprot, +unsigned long prot,unsigned long flags);extern int ima_file_mprotect (struct vm_area_struct *vma,unsigned long prot);extern int ima_load_data (enum kernel_load_data_id id,bool contents); extern int ima_post_load_data(char *buf, loff_t size,
@@ -91,7 +92,8 @@ static inline void ima_file_free(structreturn ; } -static inline int ima_file_mmap (struct file *file,unsigned long prot) +static inline int ima_file_mmap (struct file *file,unsigned long reqprot, +unsigned long prot,unsigned long flags) {return 0 ; }
security/integrity/ima/ima_main.c +5 -2
@@ -395,7 +395,9 @@ out:/** * ima_file_mmap - based on policy, collect/store measurement. * @file: pointer to the file to be measured (May be NULL) -* @prot: contains the protection that will be applied by the kernel. +* @reqprot: protection requested by the application +* @prot: protection that will be applied by the kernel +* @flags: operational flags * * Measure files being mmapped executable based on the ima_must_measure() * policy decision.
@@ -403,7 +405,8 @@ out:* On success return 0. On integrity appraisal error, assuming the file * is in policy and IMA-appraisal is in enforcing mode, return -EACCES. */ -int ima_file_mmap (struct file *file,unsigned long prot) +int ima_file_mmap (struct file *file,unsigned long reqprot, +unsigned long prot,unsigned long flags) {u32 secid;
security/security.c +4 -3
@@ -1592,12 +1592,13 @@ static inline unsigned long mmap_prot(stint security_mmap_file (struct file *file,unsigned long prot,unsigned long flags) { +unsigned long prot_adj =mmap_prot (file, prot);int ret; - ret =call_int_hook (mmap_file,0 , file, prot, -mmap_prot (file, prot), flags); + + ret =call_int_hook (mmap_file,0 , file, prot, prot_adj, flags);if (ret)return ret; -return ima_file_mmap (file, prot); +return ima_file_mmap (file, prot, prot_adj, flags); }int security_mmap_addr (unsigned long addr)
Greg Kroah-Hartman
maintainerPATCH 484/567 irqdomain: Fix association race
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit b06730a571a9ff1ba5bd6b20bf9e50e5a12f1ec6 upstream.
The sanity check for an already mapped virq is done outside of the irq_domain_mutex-protected section which means that an (unlikely) racing association may not be detected.
Fix this by factoring out the association implementation, which will also be used in a follow-on change to fix a shared-interrupt mapping race.
--- kernel/irq/irqdomain.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
kernel/irq/irqdomain.c +14 -5
@@ -559,8 +559,8 @@ static void irq_domain_disassociate(struirq_domain_clear_mapping (domain, hwirq); } -int irq_domain_associate (struct irq_domain *domain,unsigned int virq, -irq_hw_number_t hwirq) +static int irq_domain_associate_locked (struct irq_domain *domain,unsigned int virq, +irq_hw_number_t hwirq) {struct irq_data *irq_data =irq_get_irq_data (virq);int ret;
@@ -573,7 +573,6 @@ int irq_domain_associate(struct irq_domaif (WARN (irq_data->domain,"error: virq%i is already associated" , virq))return -EINVAL ; -mutex_lock (&irq_domain_mutex); irq_data->hwirq = hwirq; irq_data->domain = domain;if (domain->ops->map) {
@@ -590,7 +589,6 @@ int irq_domain_associate(struct irq_doma } irq_data->domain =NULL ; irq_data->hwirq =0 ; -mutex_unlock (&irq_domain_mutex);return ret; }
@@ -601,12 +599,23 @@ int irq_domain_associate(struct irq_doma domain->mapcount++;irq_domain_set_mapping (domain, hwirq, irq_data); -mutex_unlock (&irq_domain_mutex);irq_clear_status_flags (virq,IRQ_NOREQUEST );return 0 ; } + +int irq_domain_associate (struct irq_domain *domain,unsigned int virq, +irq_hw_number_t hwirq) +{ +int ret; + +mutex_lock (&irq_domain_mutex); + ret =irq_domain_associate_locked (domain, virq, hwirq); +mutex_unlock (&irq_domain_mutex); + +return ret; +}EXPORT_SYMBOL_GPL (irq_domain_associate); void irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base,
Greg Kroah-Hartman
maintainerPATCH 485/567 irqdomain: Fix disassociation race
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 3f883c38f5628f46b30bccf090faec054088e262 upstream.
The global irq_domain_mutex is held when mapping interrupts from non-hierarchical domains but currently not when disposing them.
This specifically means that updates of the domain mapcount is racy (currently only used for statistics in debugfs).
Make sure to hold the global irq_domain_mutex also when disposing mappings from non-hierarchical domains.
--- kernel/irq/irqdomain.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/irq/irqdomain.c +5 -0
@@ -538,6 +538,9 @@ static void irq_domain_disassociate(strureturn ; hwirq = irq_data->hwirq; + +mutex_lock (&irq_domain_mutex); +irq_set_status_flags (irq,IRQ_NOREQUEST );/* remove chip and handler */
@@ -557,6 +560,8 @@ static void irq_domain_disassociate(stru/* Clear reverse map for this hwirq */ irq_domain_clear_mapping (domain, hwirq); + +mutex_unlock (&irq_domain_mutex); } static int irq_domain_associate_locked(struct irq_domain *domain, unsigned int virq,
Greg Kroah-Hartman
maintainerPATCH 486/567 irqdomain: Look for existing mapping only once
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 6e6f75c9c98d2d246d90411ff2b6f0cd271f4cba upstream.
Avoid looking for an existing mapping twice when creating a new mapping using irq_create_fwspec_mapping() by factoring out the actual allocation which is shared with irq_create_mapping_affinity().
The new helper function will also be used to fix a shared-interrupt mapping race, hence the Fixes tag.
--- kernel/irq/irqdomain.c | 60 ++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 27 deletions(-)
kernel/irq/irqdomain.c +33 -27
@@ -682,6 +682,34 @@ unsigned int irq_create_direct_mapping(sEXPORT_SYMBOL_GPL (irq_create_direct_mapping);#endif +static unsigned int __irq_create_mapping_affinity (struct irq_domain *domain, +irq_hw_number_t hwirq, +const struct irq_affinity_desc *affinity) +{ +struct device_node *of_node =irq_domain_get_of_node (domain); +int virq; + +pr_debug ("irq_create_mapping(0x%p, 0x%lx)\n" , domain, hwirq); + +/* Allocate a virtual interrupt number */ + virq =irq_domain_alloc_descs (-1 ,1 , hwirq,of_node_to_nid (of_node), + affinity); +if (virq <=0 ) { +pr_debug ("-> virq allocation failed\n" ); +return 0 ; + } + +if (irq_domain_associate (domain, virq, hwirq)) { +irq_free_desc (virq); +return 0 ; + } + +pr_debug ("irq %lu on domain %s mapped to virtual irq %u\n" , + hwirq,of_node_full_name (of_node), virq); + +return virq; +} +/** * irq_create_mapping_affinity() - Map a hardware interrupt into linux irq space * @domain: domain owning this hardware interrupt or NULL for default domain
@@ -694,14 +722,11 @@ EXPORT_SYMBOL_GPL(irq_create_direct_mapp* on the number returned from that call. */ unsigned int irq_create_mapping_affinity (struct irq_domain *domain, -irq_hw_number_t hwirq, -const struct irq_affinity_desc *affinity) +irq_hw_number_t hwirq, +const struct irq_affinity_desc *affinity) { -struct device_node *of_node;int virq; -pr_debug ("irq_create_mapping(0x%p, 0x%lx)\n" , domain, hwirq); -/* Look for default domain if necessary */ if (domain ==NULL ) domain = irq_default_domain;
@@ -709,34 +734,15 @@ unsigned int irq_create_mapping_affinityWARN (1 ,"%s(, %lx) called with NULL domain\n" , __func__, hwirq);return 0 ; } -pr_debug ("-> using domain @%p\n" , domain); - - of_node =irq_domain_get_of_node (domain);/* Check if mapping already exists */ virq =irq_find_mapping (domain, hwirq);if (virq) { -pr_debug ("-> existing mapping on virq %d\n" , virq); +pr_debug ("existing mapping on virq %d\n" , virq);return virq; } -/* Allocate a virtual interrupt number */ - virq =irq_domain_alloc_descs (-1 ,1 , hwirq,of_node_to_nid (of_node), - affinity); -if (virq <=0 ) { -pr_debug ("-> virq allocation failed\n" ); -return 0 ; - } - -if (irq_domain_associate (domain, virq, hwirq)) { -irq_free_desc (virq); -return 0 ; - } - -pr_debug ("irq %lu on domain %s mapped to virtual irq %u\n" , - hwirq,of_node_full_name (of_node), virq); - -return virq; +return __irq_create_mapping_affinity (domain, hwirq, affinity); }EXPORT_SYMBOL_GPL (irq_create_mapping_affinity);
@@ -841,7 +847,7 @@ unsigned int irq_create_fwspec_mapping(sreturn 0 ; }else {/* Create mapping */ - virq =irq_create_mapping (domain, hwirq); + virq =__irq_create_mapping_affinity (domain, hwirq,NULL );if (!virq)return virq; }
Greg Kroah-Hartman
maintainerPATCH 487/567 irqdomain: Drop bogus fwspec-mapping error handling
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit e3b7ab025e931accdc2c12acf9b75c6197f1c062 upstream.
In case a newly allocated IRQ ever ends up not having any associated struct irq_data it would not even be possible to dispose the mapping.
Replace the bogus disposal with a WARN_ON().
This will also be used to fix a shared-interrupt mapping race, hence the CC-stable tag.
--- kernel/irq/irqdomain.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
kernel/irq/irqdomain.c +1 -6
@@ -853,13 +853,8 @@ unsigned int irq_create_fwspec_mapping(s } irq_data =irq_get_irq_data (virq); -if (!irq_data) { -if (irq_domain_is_hierarchy (domain)) -irq_domain_free_irqs (virq,1 ); -else -irq_dispose_mapping (virq); +if (WARN_ON (!irq_data))return 0 ; - }/* Store trigger type */ irqd_set_trigger_type (irq_data, type);
Greg Kroah-Hartman
maintainerPATCH 488/567 irqdomain: Fix domain registration race
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit 8932c32c3053accd50702b36e944ac2016cd103c upstream.
Hierarchical domains created using irq_domain_create_hierarchy() are currently added to the domain list before having been fully initialised.
This specifically means that a racing allocation request might fail to allocate irq data for the inner domains of a hierarchy in case the parent domain pointer has not yet been set up.
Note that this is not really any issue for irqchip drivers that are registered early (e.g. via IRQCHIP_DECLARE() or IRQCHIP_ACPI_DECLARE()) but could potentially cause trouble with drivers that are registered later (e.g. modular drivers using IRQCHIP_PLATFORM_DRIVER_BEGIN(), gpiochip drivers, etc.).
--- kernel/irq/irqdomain.c | 62 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 19 deletions(-)
kernel/irq/irqdomain.c +43 -19
@@ -123,23 +123,12 @@ void irq_domain_free_fwnode(struct fwnod }EXPORT_SYMBOL_GPL (irq_domain_free_fwnode); -/** -* __irq_domain_add() - Allocate a new irq_domain data structure -* @fwnode: firmware node for the interrupt controller -* @size: Size of linear map; 0 for radix mapping only -* @hwirq_max: Maximum number of interrupts supported by controller -* @direct_max: Maximum value of direct maps; Use ~0 for no limit; 0 for no -* direct mapping -* @ops: domain callbacks -* @host_data: Controller private data pointer -* -* Allocates and initializes an irq_domain structure. -* Returns pointer to IRQ domain, or NULL on failure. -*/ -struct irq_domain *__irq_domain_add (struct fwnode_handle *fwnode,unsigned int size, -irq_hw_number_t hwirq_max,int direct_max, -const struct irq_domain_ops *ops, -void *host_data) +static struct irq_domain *__irq_domain_create (struct fwnode_handle *fwnode, +unsigned int size, +irq_hw_number_t hwirq_max, +int direct_max, +const struct irq_domain_ops *ops, +void *host_data) {struct irqchip_fwid *fwid;struct irq_domain *domain;
@@ -227,12 +216,44 @@ struct irq_domain *__irq_domain_add(struirq_domain_check_hierarchy (domain); +return domain; +} + +static void __irq_domain_publish (struct irq_domain *domain) +{mutex_lock (&irq_domain_mutex);debugfs_add_domain_dir (domain);list_add (&domain->link, &irq_domain_list);mutex_unlock (&irq_domain_mutex);pr_debug ("Added domain %s\n" , domain->name); +} + +/** +* __irq_domain_add() - Allocate a new irq_domain data structure +* @fwnode: firmware node for the interrupt controller +* @size: Size of linear map; 0 for radix mapping only +* @hwirq_max: Maximum number of interrupts supported by controller +* @direct_max: Maximum value of direct maps; Use ~0 for no limit; 0 for no +* direct mapping +* @ops: domain callbacks +* @host_data: Controller private data pointer +* +* Allocates and initializes an irq_domain structure. +* Returns pointer to IRQ domain, or NULL on failure. +*/ +struct irq_domain *__irq_domain_add (struct fwnode_handle *fwnode,unsigned int size, +irq_hw_number_t hwirq_max,int direct_max, +const struct irq_domain_ops *ops, +void *host_data) +{ +struct irq_domain *domain; + + domain =__irq_domain_create (fwnode, size, hwirq_max, direct_max, + ops, host_data); +if (domain) +__irq_domain_publish (domain); +return domain; }EXPORT_SYMBOL_GPL (__irq_domain_add);
@@ -1117,12 +1138,15 @@ struct irq_domain *irq_domain_create_hiestruct irq_domain *domain;if (size) - domain =irq_domain_create_linear (fwnode, size, ops, host_data); + domain =__irq_domain_create (fwnode, size, size,0 , ops, host_data);else - domain =irq_domain_create_tree (fwnode, ops, host_data); + domain =__irq_domain_create (fwnode,0 , ~0 ,0 , ops, host_data); +if (domain) { domain->parent = parent; domain->flags |= flags; + +__irq_domain_publish (domain); }return domain;
Greg Kroah-Hartman
maintainerPATCH 489/567 crypto: qat - fix out-of-bounds read
In reply to Greg Kroah-HartmanFrom: Giovanni Cabiddu <[email protected]>
commit f6044cc3030e139f60c281386f28bda6e3049d66 upstream.
When preparing an AER-CTR request, the driver copies the key provided by the user into a data structure that is accessible by the firmware. If the target device is QAT GEN4, the key size is rounded up by 16 since a rounded up size is expected by the device.
If the key size is rounded up before the copy, the size used for copying the key might be bigger than the size of the region containing the key, causing an out-of-bounds read.
Fix by doing the copy first and then update the keylen.
This is to fix the following warning reported by KASAN:
[ 138.150574] BUG: KASAN: global-out-of-bounds in qat_alg_skcipher_init_com.isra.0+0x197/0x250 [intel_qat] [ 138.150641] Read of size 32 at addr ffffffff88c402c0 by task cryptomgr_test/2340
[ 138.150651] CPU: 15 PID: 2340 Comm: cryptomgr_test Not tainted 6.2.0-rc1+ #45 [ 138.150659] Hardware name: Intel Corporation ArcherCity/ArcherCity, BIOS EGSDCRB1.86B.0087.D13.2208261706 08/26/2022 [ 138.150663] Call Trace: [ 138.150668] <TASK> [ 138.150922] kasan_check_range+0x13a/0x1c0 [ 138.150931] memcpy+0x1f/0x60 [ 138.150940] qat_alg_skcipher_init_com.isra.0+0x197/0x250 [intel_qat] [ 138.151006] qat_alg_skcipher_init_sessions+0xc1/0x240 [intel_qat] [ 138.151073] crypto_skcipher_setkey+0x82/0x160 [ 138.151085] ? prepare_keybuf+0xa2/0xd0 [ 138.151095] test_skcipher_vec_cfg+0x2b8/0x800
--- drivers/crypto/qat/qat_common/qat_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/qat/qat_common/qat_algs.c +1 -1
@@ -434,8 +434,8 @@ static void qat_alg_skcipher_init_com(st }else if (aes_v2_capable && mode ==ICP_QAT_HW_CIPHER_CTR_MODE ) {ICP_QAT_FW_LA_SLICE_TYPE_SET (header->serv_specif_flags,ICP_QAT_FW_LA_USE_UCS_SLICE_TYPE ); - keylen =round_up (keylen,16 );memcpy (cd->ucs_aes.key, key, keylen); + keylen =round_up (keylen,16 ); }else {memcpy (cd->aes.key, key, keylen); }
Greg Kroah-Hartman
maintainerPATCH 490/567 io_uring: handle TIF_NOTIFY_RESUME when checking for task_work
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit b5d3ae202fbfe055aa2a8ae8524531ee1dcab717 upstream.
If TIF_NOTIFY_RESUME is set, then we need to call resume_user_mode_work() for PF_IO_WORKER threads. They never return to usermode, hence never get a chance to process any items that are marked by this flag. Most notably this includes the final put of files, but also any throttling markers set by block cgroups.
--- io_uring/io_uring.c | 7 +++++++ 1 file changed, 7 insertions(+)
io_uring/io_uring.c +7 -0
@@ -2463,6 +2463,13 @@ static inline unsigned int io_put_rw_kbustatic inline bool io_run_task_work (void ) { +/* +* PF_IO_WORKER never returns to userspace, so check here if we have +* notify work that needs processing. +*/ +if (current->flags &PF_IO_WORKER && +test_thread_flag (TIF_NOTIFY_RESUME )) +tracehook_notify_resume (NULL );if (test_thread_flag (TIF_NOTIFY_SIGNAL ) || current->task_works) {__set_current_state (TASK_RUNNING );tracehook_notify_signal ();
Greg Kroah-Hartman
maintainerPATCH 491/567 io_uring: mark task TASK_RUNNING before handling resume/task work
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit 2f2bb1ffc9983e227424d0787289da5483b0c74f upstream.
Just like for task_work, set the task mode to TASK_RUNNING before doing potential resume work. We're not holding any locks at this point, but we may have already set the task state to TASK_INTERRUPTIBLE in preparation for going to sleep waiting for events. Ensure that we set it back to TASK_RUNNING if we have work to process, to avoid warnings on calling blocking operations with !TASK_RUNNING.
--- io_uring/io_uring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/io_uring.c +3 -1
@@ -2468,8 +2468,10 @@ static inline bool io_run_task_work(void* notify work that needs processing. */ if (current->flags &PF_IO_WORKER && -test_thread_flag (TIF_NOTIFY_RESUME )) +test_thread_flag (TIF_NOTIFY_RESUME )) { +__set_current_state (TASK_RUNNING );tracehook_notify_resume (NULL ); + }if (test_thread_flag (TIF_NOTIFY_SIGNAL ) || current->task_works) {__set_current_state (TASK_RUNNING );tracehook_notify_signal ();
Greg Kroah-Hartman
maintainerPATCH 492/567 io_uring: add a conditional reschedule to the IOPOLL cancelation loop
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit fcc926bb857949dbfa51a7d95f3f5ebc657f198c upstream.
If the kernel is configured with CONFIG_PREEMPT_NONE, we could be sitting in a tight loop reaping events but not giving them a chance to finish. This results in a trace ala:
rcu: INFO: rcu_sched self-detected stall on CPU
rcu: 2-...!: (5249 ticks this GP) idle=935c/1/0x4000000000000000 softirq=4265/4274 fqs=1
(t=5251 jiffies g=465 q=4135 ncpus=4)rcu: rcu_sched kthread starved for 5249 jiffies! g465 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=0
rcu: Unless rcu_sched kthread gets sufficient CPU time, OOM is now expected behavior.
rcu: RCU grace-period kthread stack dump:
task:rcu_sched state:R running task stack:0 pid:12 ppid:2 flags:0x00000008
Call trace: __switch_to+0xb0/0xc8 __schedule+0x43c/0x520 schedule+0x4c/0x98 schedule_timeout+0xbc/0xdc rcu_gp_fqs_loop+0x308/0x344 rcu_gp_kthread+0xd8/0xf0 kthread+0xb8/0xc8 ret_from_fork+0x10/0x20 rcu: Stack dump where RCU GP kthread last ran: Task dump for CPU 0: task:kworker/u8:10 state:R running task stack:0 pid:89 ppid:2 flags:0x0000000a Workqueue: events_unbound io_ring_exit_work Call trace: __switch_to+0xb0/0xc8 0xffff0000c8fefd28 CPU: 2 PID: 95 Comm: kworker/u8:13 Not tainted 6.2.0-rc5-00042-g40316e337c80-dirty #2759 Hardware name: linux,dummy-virt (DT) Workqueue: events_unbound io_ring_exit_work pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) pc : io_do_iopoll+0x344/0x360 lr : io_do_iopoll+0xb8/0x360
sp : ffff800009bebc60
x29: ffff800009bebc60 x28: 0000000000000000 x27: 0000000000000000
x26: ffff0000c0f67d48 x25: ffff0000c0f67840 x24: ffff800008950024
x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000c27d3200
x20: ffff0000c0f67840 x19: ffff0000c0f67800 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000001 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000179 x10: 0000000000000870 x9 : ffff800009bebd60 x8 : ffff0000c27d3ad0 x7 : fefefefefefefeff x6 : 0000646e756f626e x5 : ffff0000c0f67840 x4 : 0000000000000000 x3 : ffff0000c2398000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
Call trace: io_do_iopoll+0x344/0x360 io_uring_try_cancel_requests+0x21c/0x334 io_ring_exit_work+0x90/0x40c process_one_work+0x1a4/0x254 worker_thread+0x1ec/0x258 kthread+0xb8/0xc8 ret_from_fork+0x10/0x20
Add a cond_resched() in the cancelation IOPOLL loop to fix this.
--- io_uring/io_uring.c | 1 + 1 file changed, 1 insertion(+)
io_uring/io_uring.c +1 -0
@@ -9861,6 +9861,7 @@ static void io_uring_try_cancel_requestswhile (!list_empty_careful (&ctx->iopoll_list)) {io_iopoll_try_reap_events (ctx); ret = true; +cond_resched (); } }
Greg Kroah-Hartman
maintainerPATCH 493/567 io_uring/rsrc: disallow multi-source reg buffers
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit edd478269640b360c6f301f2baa04abdda563ef3 upstream.
If two or more mappings go back to back to each other they can be passed into io_uring to be registered as a single registered buffer. That would even work if mappings came from different sources, e.g. it's possible to mix in this way anon pages and pages from shmem or hugetlb. That is not a problem but it'd rather be less prone if we forbid such mixing.
--- io_uring/io_uring.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
io_uring/io_uring.c +8 -5
@@ -9228,14 +9228,17 @@ static int io_sqe_buffer_register(struct pret =pin_user_pages (ubuf, nr_pages,FOLL_WRITE |FOLL_LONGTERM , pages, vmas);if (pret == nr_pages) { +struct file *file = vmas[0 ]->vm_file; +/* don't support file backed memory */ for (i =0 ; i < nr_pages; i++) { -struct vm_area_struct *vma = vmas[i]; - -if (vma_is_shmem (vma)) +if (vmas[i]->vm_file != file) { + ret = -EINVAL ; +break ; + } +if (!file)continue ; -if (vma->vm_file && - !is_file_hugepages (vma->vm_file)) { +if (!vma_is_shmem (vmas[i]) && !is_file_hugepages (file)) { ret = -EOPNOTSUPP ;break ; }
Greg Kroah-Hartman
maintainerPATCH 494/567 io_uring: remove MSG_NOSIGNAL from recvmsg
In reply to Greg Kroah-HartmanFrom: David Lamparter <[email protected]>
commit 7605c43d67face310b4b87dee1a28bc0c8cd8c0f upstream.
MSG_NOSIGNAL is not applicable for the receiving side, SIGPIPE is generated when trying to write to a "broken pipe". AF_PACKET's packet_recvmsg() does enforce this, giving back EINVAL when MSG_NOSIGNAL is set - making it unuseable in io_uring's recvmsg.
Remove MSG_NOSIGNAL from io_recvmsg_prep().
--- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
@@ -5141,7 +5141,7 @@ static int io_recvmsg_prep(struct io_kio sr->umsg =u64_to_user_ptr (READ_ONCE (sqe->addr)); sr->len =READ_ONCE (sqe->len); sr->bgid =READ_ONCE (sqe->buf_group); - sr->msg_flags =READ_ONCE (sqe->msg_flags) |MSG_NOSIGNAL ; + sr->msg_flags =READ_ONCE (sqe->msg_flags);if (sr->msg_flags &MSG_DONTWAIT ) req->flags |=REQ_F_NOWAIT ;
Greg Kroah-Hartman
maintainerPATCH 495/567 io_uring/poll: allow some retries for poll triggering spuriously
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit c16bda37594f83147b167d381d54c010024efecf upstream.
If we get woken spuriously when polling and fail the operation with -EAGAIN again, then we generally only allow polling again if data had been transferred at some point. This is indicated with REQ_F_PARTIAL_IO. However, if the spurious poll triggers when the socket was originally empty, then we haven't transferred data yet and we will fail the poll re-arm. This either punts the socket to io-wq if it's blocking, or it fails the request with -EAGAIN if not. Neither condition is desirable, as the former will slow things down, while the latter will make the application confused.
We want to ensure that a repeated poll trigger doesn't lead to infinite work making no progress, that's what the REQ_F_PARTIAL_IO check was for. But it doesn't protect against a loop post the first receive, and it's unnecessarily strict if we started out with an empty socket.
Add a somewhat random retry count, just to put an upper limit on the potential number of retries that will be done. This should be high enough that we won't really hit it in practice, unless something needs to be aborted anyway.
--- io_uring/io_uring.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
io_uring/io_uring.c +14 -2
@@ -486,6 +486,7 @@ struct io_poll_iocb {struct file *file;struct wait_queue_head *head;__poll_t events; +int retries;struct wait_queue_entry wait; };
@@ -5894,6 +5895,14 @@ enum { IO_APOLL_READY }; +/* +* We can't reliably detect loops in repeated poll triggers and issue +* subsequently failing. But rather than fail these immediately, allow a +* certain amount of retries before we give up. Given that this condition +* should _rarely_ trigger even once, we should be fine with a larger value. +*/ +#define APOLL_MAX_RETRY 128 +static int io_arm_poll_handler (struct io_kiocb *req) {const struct io_op_def *def = &io_op_defs[req->opcode];
@@ -5905,8 +5914,6 @@ static int io_arm_poll_handler(struct ioif (!req->file || !file_can_poll (req->file))return IO_APOLL_ABORTED ; -if ((req->flags & (REQ_F_POLLED |REQ_F_PARTIAL_IO )) ==REQ_F_POLLED ) -return IO_APOLL_ABORTED ;if (!def->pollin && !def->pollout)return IO_APOLL_ABORTED ;
@@ -5924,8 +5931,13 @@ static int io_arm_poll_handler(struct ioif (req->flags &REQ_F_POLLED ) { apoll = req->apoll;kfree (apoll->double_poll); +if (unlikely (!--apoll->poll.retries)) { + apoll->double_poll =NULL ; +return IO_APOLL_ABORTED ; + } }else { apoll =kmalloc (sizeof (*apoll),GFP_ATOMIC ); + apoll->poll.retries =APOLL_MAX_RETRY ; }if (unlikely (!apoll))return IO_APOLL_ABORTED ;
Greg Kroah-Hartman
maintainerPATCH 496/567 ALSA: ice1712: Do not left ice->gpio_mutex locked in aureon_add_controls()
In reply to Greg Kroah-HartmanFrom: Dmitry Fomin <[email protected]>
commit 951606a14a8901e3551fe4d8d3cedd73fe954ce1 upstream.
If snd_ctl_add() fails in aureon_add_controls(), it immediately returns and leaves ice->gpio_mutex locked. ice->gpio_mutex locks in snd_ice1712_save_gpio_status and unlocks in snd_ice1712_restore_gpio_status(ice).
It seems that the mutex is required only for aureon_cs8415_get(), so snd_ice1712_restore_gpio_status(ice) can be placed just after that. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- sound/pci/ice1712/aureon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ice1712/aureon.c +1 -1
@@ -1892,6 +1892,7 @@ static int aureon_add_controls(struct snunsigned char id;snd_ice1712_save_gpio_status (ice); id =aureon_cs8415_get (ice,CS8415_ID ); +snd_ice1712_restore_gpio_status (ice);if (id !=0x41 )dev_info (ice->card->dev,"No CS8415 chip. Skipping CS8415 controls.\n" );
@@ -1909,7 +1910,6 @@ static int aureon_add_controls(struct sn kctl->id.device = ice->pcm->device; } } -snd_ice1712_restore_gpio_status (ice); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 497/567 ALSA: hda/realtek: Add quirk for HP EliteDesk 800 G6 Tower PC
In reply to Greg Kroah-HartmanFrom: Łukasz Stelmach <[email protected]>
commit ea24b9953bcd3889f77a66e7f1d7e86e995dd9c3 upstream.
HP EliteDesk 800 G6 Tower PC (103c:870c) requires a quirk for enabling headset-mic.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -11236,6 +11236,7 @@ static const struct snd_pci_quirk alc662SND_PCI_QUIRK (0x1028 ,0x0698 ,"Dell" ,ALC668_FIXUP_DELL_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x069f ,"Dell" ,ALC668_FIXUP_DELL_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x1632 ,"HP RP5800" ,ALC662_FIXUP_HP_RP5800 ), +SND_PCI_QUIRK (0x103c ,0x870c ,"HP" ,ALC897_FIXUP_HP_HSMIC_VERB ),SND_PCI_QUIRK (0x103c ,0x8719 ,"HP" ,ALC897_FIXUP_HP_HSMIC_VERB ),SND_PCI_QUIRK (0x103c ,0x873e ,"HP" ,ALC671_FIXUP_HP_HEADSET_MIC2 ), SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
Greg Kroah-Hartman
maintainerPATCH 498/567 jbd2: fix data missing when reusing bh which is ready to be checkpointed
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit e6b9bd7290d334451ce054e98e752abc055e0034 upstream.
Following process will make data lost and could lead to a filesystem corrupted problem:
1. jh(bh) is inserted into T1->t_checkpoint_list, bh is dirty, and jh->b_transaction = NULL
2. T1 is added into journal->j_checkpoint_transactions.
3. Get bh prepare to write while doing checkpoing:
PA PB
do_get_write_access jbd2_log_do_checkpoint
spin_lock(&jh->b_state_lock)
if (buffer_dirty(bh))
clear_buffer_dirty(bh) // clear buffer dirty
set_buffer_jbddirty(bh)
transaction =
journal->j_checkpoint_transactions
jh = transaction->t_checkpoint_list
if (!buffer_dirty(bh))
__jbd2_journal_remove_checkpoint(jh)
// bh won't be flushed
jbd2_cleanup_journal_tail
__jbd2_journal_file_buffer(jh, transaction, BJ_Reserved)4. Aborting journal/Power-cut before writing latest bh on journal area.
In this way we get a corrupted filesystem with bh's data lost.
Fix it by moving the clearing of buffer_dirty bit just before the call to __jbd2_journal_file_buffer(), both bit clearing and jh->b_transaction assignment are under journal->j_list_lock locked, so that jbd2_log_do_checkpoint() will wait until jh's new transaction fininshed even bh is currently not dirty. And journal_shrink_one_cp_list() won't remove jh from checkpoint list if the buffer head is reused in do_get_write_access().
Fetch a reproducer in [Link].
--- fs/jbd2/transaction.c | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-)
fs/jbd2/transaction.c +29 -21
@@ -1001,36 +1001,28 @@ repeat:* ie. locked but not dirty) or tune2fs (which may actually have * the buffer dirtied, ugh.) */ -if (buffer_dirty (bh)) { +if (buffer_dirty (bh) && jh->b_transaction) { +warn_dirty_buffer (bh);/* -* First question: is this buffer already part of the current -* transaction or the existing committing transaction? -*/ -if (jh->b_transaction) { -J_ASSERT_JH (jh, - jh->b_transaction == transaction || - jh->b_transaction == - journal->j_committing_transaction); -if (jh->b_next_transaction) -J_ASSERT_JH (jh, jh->b_next_transaction == - transaction); -warn_dirty_buffer (bh); - } -/* -* In any case we need to clean the dirty flag and we must -* do it under the buffer lock to be sure we don't race -* with running write-out. +* We need to clean the dirty flag and we must do it under the +* buffer lock to be sure we don't race with running write-out. */ JBUFFER_TRACE (jh,"Journalling dirty buffer" );clear_buffer_dirty (bh); +/* +* The buffer is going to be added to BJ_Reserved list now and +* nothing guarantees jbd2_journal_dirty_metadata() will be +* ever called for it. So we need to set jbddirty bit here to +* make sure the buffer is dirtied and written out when the +* journaling machinery is done with it. +*/ set_buffer_jbddirty (bh); } -unlock_buffer (bh); - error = -EROFS ;if (is_handle_aborted (handle)) {spin_unlock (&jh->b_state_lock); +unlock_buffer (bh); goto out; } error =0 ;
@@ -1040,8 +1032,10 @@ repeat:* b_next_transaction points to it */ if (jh->b_transaction == transaction || - jh->b_next_transaction == transaction) + jh->b_next_transaction == transaction) { +unlock_buffer (bh); goto done; + }/* * this is the first time this transaction is touching this buffer,
@@ -1065,10 +1059,24 @@ repeat:*/ smp_wmb ();spin_lock (&journal->j_list_lock); +if (test_clear_buffer_dirty (bh)) { +/* +* Execute buffer dirty clearing and jh->b_transaction +* assignment under journal->j_list_lock locked to +* prevent bh being removed from checkpoint list if +* the buffer is in an intermediate state (not dirty +* and jh->b_transaction is NULL). +*/ +JBUFFER_TRACE (jh,"Journalling dirty buffer" ); +set_buffer_jbddirty (bh); + }__jbd2_journal_file_buffer (jh, transaction, BJ_Reserved);spin_unlock (&journal->j_list_lock); +unlock_buffer (bh); goto done; } +unlock_buffer (bh); +/* * If there is already a copy-out version of this buffer, then we don't * need to make another one
Greg Kroah-Hartman
maintainerPATCH 499/567 ext4: optimize ea_inode block expansion
In reply to Greg Kroah-HartmanFrom: Jun Nie <[email protected]>
commit 1e9d62d252812575ded7c620d8fc67c32ff06c16 upstream.
Copy ea data from inode entry when expanding ea block if possible. Then remove the ea entry if expansion success. Thus memcpy to a temporary buffer may be avoided.
If the expansion fails, we do not need to recovery the removed ea entry neither in this way.
--- fs/ext4/xattr.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)
fs/ext4/xattr.c +17 -11
@@ -2549,9 +2549,8 @@ static int ext4_xattr_move_to_block(hand is =kzalloc (sizeof (struct ext4_xattr_ibody_find ),GFP_NOFS ); bs =kzalloc (sizeof (struct ext4_xattr_block_find ),GFP_NOFS ); - buffer =kvmalloc (value_size,GFP_NOFS ); b_entry_name =kmalloc (entry->e_name_len +1 ,GFP_NOFS ); -if (!is || !bs || !buffer || !b_entry_name) { +if (!is || !bs || !b_entry_name) { error = -ENOMEM ; goto out; }
@@ -2563,12 +2562,18 @@ static int ext4_xattr_move_to_block(hand/* Save the entry name and the entry value */ if (entry->e_value_inum) { + buffer =kvmalloc (value_size,GFP_NOFS ); +if (!buffer) { + error = -ENOMEM ; + goto out; + } + error =ext4_xattr_inode_get (inode, entry, buffer, value_size);if (error) goto out; }else {size_t value_offs =le16_to_cpu (entry->e_value_offs); -memcpy (buffer, (void *)IFIRST (header) + value_offs, value_size); + buffer = (void *)IFIRST (header) + value_offs; }memcpy (b_entry_name, entry->e_name, entry->e_name_len);
@@ -2583,25 +2588,26 @@ static int ext4_xattr_move_to_block(handif (error) goto out; -/* Remove the chosen entry from the inode */ - error =ext4_xattr_ibody_set (handle, inode, &i, is); -if (error) - goto out; - i.value = buffer; i.value_len = value_size; error =ext4_xattr_block_find (inode, &i, bs);if (error) goto out; -/* Add entry which was removed from the inode into the block */ +/* Move ea entry from the inode into the block */ error =ext4_xattr_block_set (handle, inode, &i, bs);if (error) goto out; - error =0 ; + +/* Remove the chosen entry from the inode */ + i.value =NULL ; + i.value_len =0 ; + error =ext4_xattr_ibody_set (handle, inode, &i, is); + out:kfree (b_entry_name); -kvfree (buffer); +if (entry->e_value_inum && buffer) +kvfree (buffer);if (is)brelse (is->iloc.bh);if (bs)
Greg Kroah-Hartman
maintainerPATCH 500/567 ext4: refuse to create ea block when umounted
In reply to Greg Kroah-HartmanFrom: Jun Nie <[email protected]>
commit f31173c19901a96bb2ebf6bcfec8a08df7095c91 upstream.
The ea block expansion need to access s_root while it is already set as NULL when umount is triggered. Refuse this request to avoid panic.
--- fs/ext4/xattr.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/ext4/xattr.c +7 -0
@@ -1422,6 +1422,13 @@ static struct inode *ext4_xattr_inode_cruid_t owner[2 ] = {i_uid_read (inode),i_gid_read (inode) };int err; +if (inode->i_sb->s_root ==NULL ) { +ext4_warning (inode->i_sb, +"refuse to create EA inode when umounting" ); +WARN_ON (1 ); +return ERR_PTR (-EINVAL ); + } +/* * Let the next inode be the goal, so we try and allocate the EA inode * in the same group, or nearby one.
Greg Kroah-Hartman
maintainerPATCH 501/567 ext4: Fix possible corruption when moving a directory
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 0813299c586b175d7edb25f56412c54b812d0379 upstream.
When we are renaming a directory to a different directory, we need to update '..' entry in the moved directory. However nothing prevents moved directory from being modified and even converted from the inline format to the normal format. When such race happens the rename code gets confused and we crash. Fix the problem by locking the moved directory.
--- fs/ext4/namei.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/ext4/namei.c +10 -1
@@ -3886,9 +3886,16 @@ static int ext4_rename(struct user_namesif (new.dir != old.dir &&EXT4_DIR_LINK_MAX (new.dir)) goto end_rename; } +/* +* We need to protect against old.inode directory getting +* converted from inline directory format into a normal one. +*/ +inode_lock_nested (old.inode,I_MUTEX_NONDIR2 ); retval =ext4_rename_dir_prepare (handle, &old); -if (retval) +if (retval) { +inode_unlock (old.inode); goto end_rename; + } }/* * If we're renaming a file within an inline_data dir and adding or
@@ -4013,6 +4020,8 @@ end_rename: }else {ext4_journal_stop (handle); } +if (old.dir_bh) +inode_unlock (old.inode); release_bh:brelse (old.dir_bh);brelse (old.bh);
Greg Kroah-Hartman
maintainerPATCH 502/567 mtd: spi-nor: sfdp: Fix index value for SCCR dwords
In reply to Greg Kroah-HartmanFrom: Takahiro Kuwano <[email protected]>
commit ad9679f3811899fd1c21dc7bdd715e8e1cfb46b9 upstream.
Array index for SCCR 22th DOWRD should be 21.
--- drivers/mtd/spi-nor/sfdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/sfdp.c +1 -1
@@ -1220,7 +1220,7 @@ static int spi_nor_parse_sccr(struct spile32_to_cpu_array (dwords, sccr_header->length); -if (FIELD_GET (SCCR_DWORD22_OCTAL_DTR_EN_VOLATILE , dwords[22 ])) +if (FIELD_GET (SCCR_DWORD22_OCTAL_DTR_EN_VOLATILE , dwords[21 ])) nor->flags |=SNOR_F_IO_MODE_EN_VOLATILE ; out:
Greg Kroah-Hartman
maintainerPATCH 503/567 mtd: spi-nor: spansion: Consider reserved bits in CFR5 register
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 3f592a869f87723314f0cb1ac232bd3bf8245be8 upstream.
CFR5[6] is reserved bit and must be always 1. Set it to comply with flash requirements. While fixing SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_{EN, DS} definition, stop using magic numbers and describe the missing bit fields in CFR5 register. This is useful for both readability and future possible addition of Octal STR mode support.
--- drivers/mtd/spi-nor/spansion.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mtd/spi-nor/spansion.c +7 -2
@@ -15,8 +15,13 @@#define SPINOR_REG_CYPRESS_CFR3V 0x00800004#define SPINOR_REG_CYPRESS_CFR3V_PGSZ BIT(4)/* Page size. */ #define SPINOR_REG_CYPRESS_CFR5V 0x00800006 -#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN 0x3 -#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_DS 0 +#define SPINOR_REG_CYPRESS_CFR5_BIT6 BIT(6) +#define SPINOR_REG_CYPRESS_CFR5_DDR BIT(1) +#define SPINOR_REG_CYPRESS_CFR5_OPI BIT(0) +#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN \ + (SPINOR_REG_CYPRESS_CFR5_BIT6 | SPINOR_REG_CYPRESS_CFR5_DDR | \ + SPINOR_REG_CYPRESS_CFR5_OPI) +#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_DS SPINOR_REG_CYPRESS_CFR5_BIT6#define SPINOR_OP_CYPRESS_RD_FAST 0xee/**
Greg Kroah-Hartman
maintainerPATCH 504/567 mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type
In reply to Greg Kroah-HartmanFrom: Louis Rannou <[email protected]>
commit f0f0cfdc3a024e21161714f2e05f0df3b84d42ad upstream.
spi_nor_set_erase_type() was used either to set or to mask out an erase type. When we used it to mask out an erase type a shift-out-of-bounds was hit:
UBSAN: shift-out-of-bounds in drivers/mtd/spi-nor/core.c:2237:24
shift exponent 4294967295 is too large for 32-bit type 'int'
The setting of the size_{shift, mask} and of the opcode are unnecessary when the erase size is zero, as throughout the code just the erase size is considered to determine whether an erase type is supported or not. Setting the opcode to 0xFF was wrong too as nobody guarantees that 0xFF is an unused opcode. Thus when masking out an erase type, just set the erase size to zero. This will fix the shift-out-of-bounds.
--- drivers/mtd/spi-nor/core.c | 9 +++++++++ drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/sfdp.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/mtd/spi-nor/core.c +9 -0
@@ -2247,6 +2247,15 @@ void spi_nor_set_erase_type(struct spi_n }/** +* spi_nor_mask_erase_type() - mask out a SPI NOR erase type +* @erase: pointer to a structure that describes a SPI NOR erase type +*/ +void spi_nor_mask_erase_type (struct spi_nor_erase_type *erase) +{ + erase->size =0 ; +} + +/** * spi_nor_init_uniform_erase_map() - Initialize uniform erase map * @map: the erase map of the SPI NOR * @erase_mask: bitmask encoding erase types that can erase the entire
drivers/mtd/spi-nor/core.h +1 -0
@@ -538,6 +538,7 @@ void spi_nor_set_pp_settings(struct spi_void spi_nor_set_erase_type (struct spi_nor_erase_type *erase,u32 size,u8 opcode); +void spi_nor_mask_erase_type (struct spi_nor_erase_type *erase);struct spi_nor_erase_region *spi_nor_region_next (struct spi_nor_erase_region *region); void spi_nor_init_uniform_erase_map(struct spi_nor_erase_map *map,
drivers/mtd/spi-nor/sfdp.c +2 -2
@@ -874,7 +874,7 @@ static int spi_nor_init_non_uniform_eras*/ for (i =0 ; i <SNOR_ERASE_TYPE_MAX ; i++)if (!(regions_erase_type &BIT (erase[i].idx))) -spi_nor_set_erase_type (&erase[i],0 ,0xFF ); +spi_nor_mask_erase_type (&erase[i]);return 0 ; }
@@ -1088,7 +1088,7 @@ static int spi_nor_parse_4bait(struct sp erase_type[i].opcode = (dwords[1 ] >> erase_type[i].idx *8 ) &0xFF ; else - spi_nor_set_erase_type(&erase_type[i], 0u, 0xFF); + spi_nor_mask_erase_type(&erase_type[i]); }/*
Greg Kroah-Hartman
maintainerPATCH 505/567 dm: send just one event on resize, not two
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit 7533afa1d27ba1234146d31d2402c195cf195962 upstream.
Device mapper sends an uevent when the device is suspended, using the function set_capacity_and_notify. However, this causes a race condition with udev.
Udev skips scanning dm devices that are suspended. If we send an uevent while we are suspended, udev will be racing with device mapper resume code. If the device mapper resume code wins the race, udev will process the uevent after the device is resumed and it will properly scan the device.
However, if udev wins the race, it will receive the uevent, find out that the dm device is suspended and skip scanning the device. This causes bugs such as systemd unmounting the device - see
https://bugzilla.redhat.com/show_bug.cgi?id=2158628
This commit fixes this race.
We replace the function set_capacity_and_notify with set_capacity, so that the uevent is not sent at this point. In do_resume, we detect if the capacity has changed and we pass a boolean variable need_resize_uevent to dm_kobject_uevent. dm_kobject_uevent adds "RESIZE=1" to the uevent if need_resize_uevent is set.
--- drivers/md/dm-ioctl.c | 13 ++++++++++--- drivers/md/dm.c | 27 +++++++++++++-------------- drivers/md/dm.h | 2 +- 3 files changed, 24 insertions(+), 18 deletions(-)
drivers/md/dm-ioctl.c +10 -3
@@ -482,7 +482,7 @@ static struct mapped_device *dm_hash_rendm_table_event (table);dm_put_live_table (hc->md, srcu_idx); -if (!dm_kobject_uevent (hc->md,KOBJ_CHANGE , param->event_nr)) +if (!dm_kobject_uevent (hc->md,KOBJ_CHANGE , param->event_nr, false)) param->flags |=DM_UEVENT_GENERATED_FLAG ; md = hc->md;
@@ -989,7 +989,7 @@ static int dev_remove(struct file *filp,dm_ima_measure_on_device_remove (md, false); -if (!dm_kobject_uevent (md,KOBJ_REMOVE , param->event_nr)) +if (!dm_kobject_uevent (md,KOBJ_REMOVE , param->event_nr, false)) param->flags |=DM_UEVENT_GENERATED_FLAG ;dm_put (md);
@@ -1123,6 +1123,7 @@ static int do_resume(struct dm_ioctl *pastruct hash_cell *hc;struct mapped_device *md;struct dm_table *new_map, *old_map =NULL ; +bool need_resize_uevent = false;down_write (&_hash_lock);
@@ -1143,6 +1144,8 @@ static int do_resume(struct dm_ioctl *pa/* Do we need to load a new map ? */ if (new_map) { +sector_t old_size, new_size; +/* Suspend if it isn't already suspended */ if (param->flags &DM_SKIP_LOCKFS_FLAG ) suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG ;
@@ -1151,6 +1154,7 @@ static int do_resume(struct dm_ioctl *paif (!dm_suspended_md (md))dm_suspend (md, suspend_flags); + old_size =dm_get_size (md); old_map =dm_swap_table (md, new_map);if (IS_ERR (old_map)) {dm_sync_table (md);
@@ -1158,6 +1162,9 @@ static int do_resume(struct dm_ioctl *padm_put (md);return PTR_ERR (old_map); } + new_size =dm_get_size (md); +if (old_size && new_size && old_size != new_size) + need_resize_uevent = true;if (dm_table_get_mode (new_map) &FMODE_WRITE )set_disk_ro (dm_disk (md),0 );
@@ -1170,7 +1177,7 @@ static int do_resume(struct dm_ioctl *paif (!r) {dm_ima_measure_on_device_resume (md, new_map ? true : false); -if (!dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr)) +if (!dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr, need_resize_uevent)) param->flags |=DM_UEVENT_GENERATED_FLAG ; } }
drivers/md/dm.c +13 -14
@@ -1942,10 +1942,7 @@ static struct dm_table *__bind(struct maif (size !=dm_get_size (md))memset (&md->geometry,0 ,sizeof (md->geometry)); -if (!get_capacity (md->disk)) -set_capacity (md->disk, size); -else -set_capacity_and_notify (md->disk, size); +set_capacity (md->disk, size);dm_table_event_callback (t, event_callback, md);
@@ -2707,23 +2704,25 @@ EXPORT_SYMBOL_GPL(dm_internal_resume_fas* Event notification. *---------------------------------------------------------------*/ int dm_kobject_uevent (struct mapped_device *md,enum kobject_action action, -unsigned cookie) +unsigned cookie,bool need_resize_uevent) {int r;unsigned noio_flag;char udev_cookie[DM_COOKIE_LENGTH ]; -char *envp[] = { udev_cookie,NULL }; - - noio_flag =memalloc_noio_save (); - -if (!cookie) - r =kobject_uevent (&disk_to_dev (md->disk)->kobj, action); -else { +char *envp[3 ] = {NULL ,NULL ,NULL }; +char **envpp = envp; +if (cookie) {snprintf (udev_cookie,DM_COOKIE_LENGTH ,"%s=%u" ,DM_COOKIE_ENV_VAR_NAME , cookie); - r =kobject_uevent_env (&disk_to_dev (md->disk)->kobj, - action, envp); + *envpp++ = udev_cookie; } +if (need_resize_uevent) { + *envpp++ ="RESIZE=1" ; + } + + noio_flag =memalloc_noio_save (); + + r =kobject_uevent_env (&disk_to_dev (md->disk)->kobj, action, envp);memalloc_noio_restore (noio_flag);
drivers/md/dm.h +1 -1
@@ -210,7 +210,7 @@ int dm_get_table_device(struct mapped_devoid dm_put_table_device (struct mapped_device *md,struct dm_dev *d);int dm_kobject_uevent (struct mapped_device *md,enum kobject_action action, -unsigned cookie); +unsigned cookie,bool need_resize_uevent);void dm_internal_suspend (struct mapped_device *md);void dm_internal_resume (struct mapped_device *md);
Greg Kroah-Hartman
maintainerPATCH 506/567 dm: add cond_resched() to dm_wq_work()
In reply to Greg Kroah-HartmanFrom: Pingfan Liu <[email protected]>
commit 0ca44fcef241768fd25ee763b3d203b9852f269b upstream.
Otherwise the while() loop in dm_wq_work() can result in a "dead loop" on systems that have preemption disabled. This is particularly problematic on single cpu systems.
--- drivers/md/dm.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/dm.c +1 -0
@@ -2305,6 +2305,7 @@ static void dm_wq_work(struct work_strucbreak ;submit_bio_noacct (bio); +cond_resched (); } }
Greg Kroah-Hartman
maintainerPATCH 507/567 wifi: rtl8xxxu: Use a longer retry limit of 48
In reply to Greg Kroah-HartmanFrom: Bitterblue Smith <[email protected]>
commit 2a86aa9a1892d60ef2e3f310f5b42b8b05546d65 upstream.
The Realtek rate control algorithm goes back and forth a lot between the highest and the lowest rate it's allowed to use. This is due to a lot of frames being dropped because the retry limits set by IEEE80211_CONF_CHANGE_RETRY_LIMITS are too low. (Experimentally, they are 4 for long frames and 7 for short frames.)
The vendor drivers hardcode the value 48 for both retry limits (for station mode), which makes dropped frames very rare and thus the rate control is more stable.
Because most Realtek chips handle the rate control in the firmware, which can't be modified, ignore the limits set by IEEE80211_CONF_CHANGE_RETRY_LIMITS and use the value 48 (set during chip initialisation), same as the vendor drivers.
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +0 -9
@@ -5909,7 +5909,6 @@ static int rtl8xxxu_config(struct ieee80 {struct rtl8xxxu_priv *priv = hw->priv;struct device *dev = &priv->udev->dev; -u16 val16;int ret =0 , channel;bool ht40;
@@ -5919,14 +5918,6 @@ static int rtl8xxxu_config(struct ieee80 __func__, hw->conf.chandef.chan->hw_value, changed, hw->conf.chandef.width); -if (changed &IEEE80211_CONF_CHANGE_RETRY_LIMITS ) { - val16 = ((hw->conf.long_frame_max_tx_count << -RETRY_LIMIT_LONG_SHIFT ) &RETRY_LIMIT_LONG_MASK ) | - ((hw->conf.short_frame_max_tx_count << -RETRY_LIMIT_SHORT_SHIFT ) &RETRY_LIMIT_SHORT_MASK ); -rtl8xxxu_write16 (priv,REG_RETRY_LIMIT , val16); - } -if (changed &IEEE80211_CONF_CHANGE_CHANNEL ) {switch (hw->conf.chandef.width) {case NL80211_CHAN_WIDTH_20_NOHT :
Greg Kroah-Hartman
maintainerPATCH 508/567 wifi: ath11k: allow system suspend to survive ath11k
In reply to Greg Kroah-HartmanFrom: Len Brown <[email protected]>
commit 7c15430822e71e90203d87e6d0cfe83fa058b0dc upstream.
When ath11k runs into internal errors upon suspend, it returns an error code to pci_pm_suspend, which aborts the entire system suspend.
The driver should not abort system suspend, but should keep its internal errors to itself, and allow the system to suspend. Otherwise, a user can suspend a laptop by closing the lid and sealing it into a case, assuming that is will suspend, rather than heating up and draining the battery when in transit.
In practice, the ath11k device seems to have plenty of transient errors, and subsequent suspend cycles after this failure often succeed.
https://bugzilla.kernel.org/show_bug.cgi?id=216968
--- drivers/net/wireless/ath/ath11k/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/pci.c +1 -1
@@ -1395,7 +1395,7 @@ static __maybe_unused int ath11k_pci_pm_if (ret)ath11k_warn (ab,"failed to suspend core: %d\n" , ret); -return ret; +return 0 ; }static __maybe_unused int ath11k_pci_pm_resume (struct device *dev)
Greg Kroah-Hartman
maintainerPATCH 509/567 wifi: cfg80211: Fix use after free for wext
In reply to Greg Kroah-HartmanFrom: Alexander Wetzel <[email protected]>
commit 015b8cc5e7c4d7bb671f1984d7b7338c310b185b upstream.
Key information in wext.connect is not reset on (re)connect and can hold data from a previous connection.
Reset key data to avoid that drivers or mac80211 incorrectly detect a WEP connection request and access the freed or already reused memory.
Additionally optimize cfg80211_sme_connect() and avoid an useless schedule of conn_work.
--- net/wireless/sme.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
net/wireless/sme.c +26 -5
@@ -268,6 +268,15 @@ void cfg80211_conn_work(struct work_struwiphy_unlock (&rdev->wiphy); } +static void cfg80211_step_auth_next (struct cfg80211_conn *conn, +struct cfg80211_bss *bss) +{ +memcpy (conn->bssid, bss->bssid,ETH_ALEN ); + conn->params.bssid = conn->bssid; + conn->params.channel = bss->channel; + conn->state =CFG80211_CONN_AUTHENTICATE_NEXT ; +} +/* Returned bss is reference counted and must be cleaned up appropriately. */ static struct cfg80211_bss *cfg80211_get_conn_bss (struct wireless_dev *wdev) {
@@ -285,10 +294,7 @@ static struct cfg80211_bss *cfg80211_getif (!bss)return NULL ; -memcpy (wdev->conn->bssid, bss->bssid,ETH_ALEN ); - wdev->conn->params.bssid = wdev->conn->bssid; - wdev->conn->params.channel = bss->channel; - wdev->conn->state =CFG80211_CONN_AUTHENTICATE_NEXT ; +cfg80211_step_auth_next (wdev->conn, bss);schedule_work (&rdev->conn_work);return bss;
@@ -567,7 +573,12 @@ static int cfg80211_sme_connect(struct w wdev->conn->params.ssid_len = wdev->ssid_len;/* see if we have the bss already */ - bss =cfg80211_get_conn_bss (wdev); + bss =cfg80211_get_bss (wdev->wiphy, wdev->conn->params.channel, + wdev->conn->params.bssid, + wdev->conn->params.ssid, + wdev->conn->params.ssid_len, + wdev->conn_bss_type, +IEEE80211_PRIVACY (wdev->conn->params.privacy));if (prev_bssid) {memcpy (wdev->conn->prev_bssid, prev_bssid,ETH_ALEN );
@@ -578,6 +589,7 @@ static int cfg80211_sme_connect(struct wif (bss) {enum nl80211_timeout_reason treason; +cfg80211_step_auth_next (wdev->conn, bss); err =cfg80211_conn_do_work (wdev, &treason);cfg80211_put_bss (wdev->wiphy, bss); }else {
@@ -1244,6 +1256,15 @@ int cfg80211_connect(struct cfg80211_reg }else {if (WARN_ON (connkeys))return -EINVAL ; + +/* connect can point to wdev->wext.connect which +* can hold key data from a previous connection +*/ + connect->key =NULL ; + connect->key_len =0 ; + connect->key_idx =0 ; + connect->crypto.cipher_group =0 ; + connect->crypto.n_ciphers_pairwise =0 ; } wdev->connect_keys = connkeys;
Greg Kroah-Hartman
maintainerPATCH 510/567 qede: fix interrupt coalescing configuration
In reply to Greg Kroah-HartmanFrom: Manish Chopra <[email protected]>
commit 908d4bb7c54caa58253a363d63e797a468eaf321 upstream.
On default driver load device gets configured with unexpected higher interrupt coalescing values instead of default expected values as memory allocated from krealloc() is not supposed to be zeroed out and may contain garbage values.
Fix this by allocating the memory of required size first with kcalloc() and then use krealloc() to resize and preserve the contents across down/up of the interface.
--- drivers/net/ethernet/qlogic/qede/qede_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qede/qede_main.c +9 -2
@@ -909,8 +909,15 @@ static int qede_alloc_fp_array(struct qe goto err; } - mem =krealloc (edev->coal_entry,QEDE_QUEUE_CNT (edev) * -sizeof (*edev->coal_entry),GFP_KERNEL ); +if (!edev->coal_entry) { + mem =kcalloc (QEDE_MAX_RSS_CNT (edev), +sizeof (*edev->coal_entry),GFP_KERNEL ); + }else { + mem =krealloc (edev->coal_entry, +QEDE_QUEUE_CNT (edev) *sizeof (*edev->coal_entry), +GFP_KERNEL ); + } +if (!mem) {DP_ERR (edev,"coalesce entry allocation failed\n" );kfree (edev->coal_entry);
Greg Kroah-Hartman
maintainerPATCH 511/567 thermal: intel: powerclamp: Fix cur_state for multi package system
In reply to Greg Kroah-HartmanFrom: Srinivas Pandruvada <[email protected]>
commit 8e47363588377e1bdb65e2b020b409cfb44dd260 upstream.
The powerclamp cooling device cur_state shows actual idle observed by package C-state idle counters. But the implementation is not sufficient for multi package or multi die system. The cur_state value is incorrect. On these systems, these counters must be read from each package/die and somehow aggregate them. But there is no good method for aggregation.
It was not a problem when explicit CPU model addition was required to enable intel powerclamp. In this way certain CPU models could have been avoided. But with the removal of CPU model check with the availability of Package C-state counters, the driver is loaded on most of the recent systems.
For multi package/die systems, just show the actual target idle state, the system is trying to achieve. In powerclamp this is the user set state minus one.
Also there is no use of starting a worker thread for polling package C-state counters and applying any compensation for multiple package or multiple die systems.
--- drivers/thermal/intel/intel_powerclamp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/thermal/intel/intel_powerclamp.c +16 -4
@@ -57,6 +57,7 @@static unsigned int target_mwait;static struct dentry *debug_dir; +static bool poll_pkg_cstate_enable;/* user selected target */ static unsigned int set_target_ratio;
@@ -262,6 +263,9 @@ static unsigned int get_compensation(int {unsigned int comp =0 ; +if (!poll_pkg_cstate_enable) +return 0 ; +/* we only use compensation if all adjacent ones are good */ if (ratio == 1 && cal_data[ratio].confidence >= CONFIDENCE_OK &&
@@ -534,7 +538,8 @@ static int start_power_clamp(void) control_cpu =cpumask_first (cpu_online_mask); clamping = true; -schedule_delayed_work (&poll_pkg_cstate_work,0 ); +if (poll_pkg_cstate_enable) +schedule_delayed_work (&poll_pkg_cstate_work,0 );/* start one kthread worker per online cpu */ for_each_online_cpu (cpu) {
@@ -603,11 +608,15 @@ static int powerclamp_get_max_state(strustatic int powerclamp_get_cur_state (struct thermal_cooling_device *cdev,unsigned long *state) { -if (true == clamping) - *state = pkg_cstate_ratio_cur; -else +if (clamping) { +if (poll_pkg_cstate_enable) + *state = pkg_cstate_ratio_cur; +else + *state = set_target_ratio; + }else {/* to save power, do not poll idle ratio while not clamping */ *state =-1 ;/* indicates invalid state */ + }return 0 ; }
@@ -732,6 +741,9 @@ static int __init powerclamp_init(void) goto exit_unregister; } +if (topology_max_packages () ==1 &&topology_max_die_per_package () ==1 ) + poll_pkg_cstate_enable = true; + cooling_dev =thermal_cooling_device_register ("intel_powerclamp" ,NULL , &powerclamp_cooling_ops);if (IS_ERR (cooling_dev)) {
Greg Kroah-Hartman
maintainerPATCH 512/567 dm flakey: fix logic when corrupting a bio
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit aa56b9b75996ff4c76a0a4181c2fa0206c3d91cc upstream.
If "corrupt_bio_byte" is set to corrupt reads and corrupt_bio_flags is used, dm-flakey would erroneously return all writes as errors. Likewise, if "corrupt_bio_byte" is set to corrupt writes, dm-flakey would return errors for all reads.
Fix the logic so that if fc->corrupt_bio_byte is non-zero, dm-flakey will not abort reads on writes with an error.
--- drivers/md/dm-flakey.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/md/dm-flakey.c +13 -10
@@ -359,9 +359,11 @@ static int flakey_map(struct dm_target */* * Corrupt matching writes. */ -if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw ==WRITE )) { -if (all_corrupt_bio_flags_match (bio, fc)) -corrupt_bio_data (bio, fc); +if (fc->corrupt_bio_byte) { +if (fc->corrupt_bio_rw ==WRITE ) { +if (all_corrupt_bio_flags_match (bio, fc)) +corrupt_bio_data (bio, fc); + } goto map_bio; }
@@ -387,13 +389,14 @@ static int flakey_end_io(struct dm_targereturn DM_ENDIO_DONE ;if (!*error && pb->bio_submitted && (bio_data_dir (bio) ==READ )) { -if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw ==READ ) && -all_corrupt_bio_flags_match (bio, fc)) { -/* -* Corrupt successful matching READs while in down state. -*/ -corrupt_bio_data (bio, fc); - +if (fc->corrupt_bio_byte) { +if ((fc->corrupt_bio_rw ==READ ) && +all_corrupt_bio_flags_match (bio, fc)) { +/* +* Corrupt successful matching READs while in down state. +*/ +corrupt_bio_data (bio, fc); + } }else if (!test_bit (DROP_WRITES , &fc->flags) && !test_bit (ERROR_WRITES , &fc->flags)) {/*
Greg Kroah-Hartman
maintainerPATCH 513/567 dm flakey: dont corrupt the zero page
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit f50714b57aecb6b3dc81d578e295f86d9c73f078 upstream.
When we need to zero some range on a block device, the function __blkdev_issue_zero_pages submits a write bio with the bio vector pointing to the zero page. If we use dm-flakey with corrupt bio writes option, it will corrupt the content of the zero page which results in crashes of various userspace programs. Glibc assumes that memory returned by mmap is zeroed and it uses it for calloc implementation; if the newly mapped memory is not zeroed, calloc will return non-zeroed memory.
Fix this bug by testing if the page is equal to ZERO_PAGE(0) and avoiding the corruption in this case.
--- drivers/md/dm-flakey.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/md/dm-flakey.c +5 -2
@@ -301,8 +301,11 @@ static void corrupt_bio_data(struct bio*/ bio_for_each_segment (bvec, bio, iter) {if (bio_iter_len (bio, iter) > corrupt_bio_byte) { -char *segment = (page_address (bio_iter_page (bio, iter)) - +bio_iter_offset (bio, iter)); +char *segment; +struct page *page =bio_iter_page (bio, iter); +if (unlikely (page ==ZERO_PAGE (0 ))) +break ; + segment = (page_address (page) +bio_iter_offset (bio, iter)); segment[corrupt_bio_byte] = fc->corrupt_bio_value; DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " "(rw=%c bi_opf=%u bi_sector=%llu size=%u)\n",
Greg Kroah-Hartman
maintainerPATCH 514/567 dm flakey: fix a bug with 32-bit highmem systems
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit 8eb29c4fbf9661e6bd4dd86197a37ffe0ecc9d50 upstream.
The function page_address does not work with 32-bit systems with high memory. Use bvec_kmap_local/kunmap_local instead.
--- drivers/md/dm-flakey.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/dm-flakey.c +2 -1
@@ -305,8 +305,9 @@ static void corrupt_bio_data(struct biostruct page *page =bio_iter_page (bio, iter);if (unlikely (page ==ZERO_PAGE (0 )))break ; - segment = (page_address (page) +bio_iter_offset (bio, iter)); + segment =bvec_kmap_local (&bvec); segment[corrupt_bio_byte] = fc->corrupt_bio_value; +kunmap_local (segment); DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " "(rw=%c bi_opf=%u bi_sector=%llu size=%u)\n", bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,
Greg Kroah-Hartman
maintainerPATCH 515/567 ARM: dts: qcom: sdx55: Add Qcom SMMU-500 as the fallback for IOMMU node
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
commit af4ab377543853b690cc85b4c46cf976ab560dc2 upstream.
SDX55 uses the Qcom version of the SMMU-500 IP. So use "qcom,smmu-500" compatible as the fallback to the SoC specific compatible.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +1 -1
@@ -502,7 +502,7 @@ }; apps_smmu: iommu@15000000 { - compatible = "qcom,sdx55-smmu-500", "arm,mmu-500"; + compatible = "qcom,sdx55-smmu-500", "qcom,smmu-500", "arm,mmu-500"; reg = <0x15000000 0x20000>; #iommu-cells = <2>; #global-interrupts = <1>;
Greg Kroah-Hartman
maintainerPATCH 516/567 ARM: dts: exynos: correct TMU phandle in Exynos4210
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 408ab6786dbf6dd696488054c9559681112ef994 upstream.
TMU node uses 0 as thermal-sensor-cells, thus thermal zone referencing it must not have an argument to phandle. Since thermal-sensors property is already defined in included exynos4-cpu-thermal.dtsi, drop it from exynos4210.dtsi to fix the error and remoev redundancy.
--- arch/arm/boot/dts/exynos4210.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm/boot/dts/exynos4210.dtsi +0 -1
@@ -393,7 +393,6 @@ &cpu_thermal { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&tmu 0>; }; &gic {
Greg Kroah-Hartman
maintainerPATCH 517/567 ARM: dts: exynos: correct TMU phandle in Exynos4
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 8e4505e617a80f601e2f53a917611777f128f925 upstream.
TMU node uses 0 as thermal-sensor-cells, thus thermal zone referencing it must not have an argument to phandle.
--- arch/arm/boot/dts/exynos4-cpu-thermal.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos4-cpu-thermal.dtsi +1 -1
@@ -10,7 +10,7 @@ / { thermal-zones { cpu_thermal: cpu-thermal { - thermal-sensors = <&tmu 0>; + thermal-sensors = <&tmu>; polling-delay-passive = <0>; polling-delay = <0>; trips {
Greg Kroah-Hartman
maintainerPATCH 518/567 ARM: dts: exynos: correct TMU phandle in Odroid XU3 family
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit a3583e92d188ec6c58c7f603ac5e72dd8a11c21a upstream.
TMU node uses 0 as thermal-sensor-cells, thus thermal zone referencing it must not have an argument to phandle. This was not critical before, but since rework of thermal Devicetree initialization in the commit 3fd6d6e2b4e8 ("thermal/of: Rework the thermal device tree initialization"), this leads to errors registering thermal zones other than first one:
thermal_sys: cpu0-thermal: Failed to read thermal-sensors cells: -2
thermal_sys: Failed to find thermal zone for tmu id=0 exynos-tmu 10064000.tmu: Failed to register sensor: -2
exynos-tmu: probe of 10064000.tmu failed with error -2
--- arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +5 -5
@@ -50,7 +50,7 @@ thermal-zones { cpu0_thermal: cpu0-thermal { - thermal-sensors = <&tmu_cpu0 0>; + thermal-sensors = <&tmu_cpu0>; polling-delay-passive = <250>; polling-delay = <0>; trips {
@@ -139,7 +139,7 @@ }; }; cpu1_thermal: cpu1-thermal { - thermal-sensors = <&tmu_cpu1 0>; + thermal-sensors = <&tmu_cpu1>; polling-delay-passive = <250>; polling-delay = <0>; trips {
@@ -212,7 +212,7 @@ }; }; cpu2_thermal: cpu2-thermal { - thermal-sensors = <&tmu_cpu2 0>; + thermal-sensors = <&tmu_cpu2>; polling-delay-passive = <250>; polling-delay = <0>; trips {
@@ -285,7 +285,7 @@ }; }; cpu3_thermal: cpu3-thermal { - thermal-sensors = <&tmu_cpu3 0>; + thermal-sensors = <&tmu_cpu3>; polling-delay-passive = <250>; polling-delay = <0>; trips {
@@ -358,7 +358,7 @@ }; }; gpu_thermal: gpu-thermal { - thermal-sensors = <&tmu_gpu 0>; + thermal-sensors = <&tmu_gpu>; polling-delay-passive = <250>; polling-delay = <0>; trips {
Greg Kroah-Hartman
maintainerPATCH 519/567 ARM: dts: exynos: correct TMU phandle in Exynos5250
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 33e2c595e2e4016991ead44933a29d1ef93d5f26 upstream.
TMU node uses 0 as thermal-sensor-cells, thus thermal zone referencing it must not have an argument to phandle.
--- arch/arm/boot/dts/exynos5250.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos5250.dtsi +1 -1
@@ -1119,7 +1119,7 @@ &cpu_thermal { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&tmu 0>; + thermal-sensors = <&tmu>; cooling-maps { map0 {
Greg Kroah-Hartman
maintainerPATCH 520/567 ARM: dts: exynos: correct TMU phandle in Odroid XU
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 9372eca505e7a19934d750b4b4c89a3652738e66 upstream.
TMU node uses 0 as thermal-sensor-cells, thus thermal zone referencing it must not have an argument to phandle. Since thermal-sensors property is already defined in included exynosi5410.dtsi, drop it from exynos5410-odroidxu.dts to fix the error and remoev redundancy.
--- arch/arm/boot/dts/exynos5410-odroidxu.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm/boot/dts/exynos5410-odroidxu.dts +0 -1
@@ -120,7 +120,6 @@ }; &cpu0_thermal { - thermal-sensors = <&tmu_cpu0 0>; polling-delay-passive = <0>; polling-delay = <0>;
Greg Kroah-Hartman
maintainerPATCH 521/567 ARM: dts: exynos: correct TMU phandle in Odroid HC1
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 2e3d0e20d8456f876607a8af61fdb83dfbf98cb6 upstream.
TMU node uses 0 as thermal-sensor-cells, thus thermal zone referencing it must not have an argument to phandle. This was not critical before, but since rework of thermal Devicetree initialization in the commit 3fd6d6e2b4e8 ("thermal/of: Rework the thermal device tree initialization"), this leads to errors registering thermal zones other than first one:
thermal_sys: cpu0-thermal: Failed to read thermal-sensors cells: -2
thermal_sys: Failed to find thermal zone for tmu id=0 exynos-tmu 10064000.tmu: Failed to register sensor: -2
exynos-tmu: probe of 10064000.tmu failed with error -2
--- arch/arm/boot/dts/exynos5422-odroidhc1.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/exynos5422-odroidhc1.dts +5 -5
@@ -29,7 +29,7 @@ thermal-zones { cpu0_thermal: cpu0-thermal { - thermal-sensors = <&tmu_cpu0 0>; + thermal-sensors = <&tmu_cpu0>; trips { cpu0_alert0: cpu-alert-0 { temperature = <70000>; /* millicelsius */
@@ -84,7 +84,7 @@ }; }; cpu1_thermal: cpu1-thermal { - thermal-sensors = <&tmu_cpu1 0>; + thermal-sensors = <&tmu_cpu1>; trips { cpu1_alert0: cpu-alert-0 { temperature = <70000>;
@@ -128,7 +128,7 @@ }; }; cpu2_thermal: cpu2-thermal { - thermal-sensors = <&tmu_cpu2 0>; + thermal-sensors = <&tmu_cpu2>; trips { cpu2_alert0: cpu-alert-0 { temperature = <70000>;
@@ -172,7 +172,7 @@ }; }; cpu3_thermal: cpu3-thermal { - thermal-sensors = <&tmu_cpu3 0>; + thermal-sensors = <&tmu_cpu3>; trips { cpu3_alert0: cpu-alert-0 { temperature = <70000>;
@@ -216,7 +216,7 @@ }; }; gpu_thermal: gpu-thermal { - thermal-sensors = <&tmu_gpu 0>; + thermal-sensors = <&tmu_gpu>; trips { gpu_alert0: gpu-alert-0 { temperature = <70000>;
Greg Kroah-Hartman
maintainerPATCH 522/567 fuse: add inode/permission checks to fileattr_get/fileattr_set
In reply to Greg Kroah-HartmanFrom: Alexander Mikhalitsyn <[email protected]>
commit 1cc4606d19e3710bfab3f6704b87ff9580493c69 upstream.
It looks like these checks were accidentally lost during the conversion to fileattr API.
--- fs/fuse/ioctl.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/fuse/ioctl.c +6 -0
@@ -419,6 +419,12 @@ static struct fuse_file *fuse_priv_ioctlstruct fuse_mount *fm =get_fuse_mount (inode);bool isdir =S_ISDIR (inode->i_mode); +if (!fuse_allow_current_process (fm->fc)) +return ERR_PTR (-EACCES ); + +if (fuse_is_bad (inode)) +return ERR_PTR (-EIO ); +if (!S_ISREG (inode->i_mode) && !isdir)return ERR_PTR (-ENOTTY );
Greg Kroah-Hartman
maintainerPATCH 523/567 rbd: avoid use-after-free in do_rbd_add() when rbd_dev_create() fails
In reply to Greg Kroah-HartmanFrom: Ilya Dryomov <[email protected]>
commit f7c4d9b133c7a04ca619355574e96b6abf209fba upstream.
If getting an ID or setting up a work queue in rbd_dev_create() fails, use-after-free on rbd_dev->rbd_client, rbd_dev->spec and rbd_dev->opts is triggered in do_rbd_add(). The root cause is that the ownership of these structures is transfered to rbd_dev prematurely and they all end up getting freed when rbd_dev_create() calls rbd_dev_free() prior to returning to do_rbd_add().
Found by Linux Verification Center (linuxtesting.org) with SVACE, an incomplete patch submitted by Natalia Petrova <[email protected]>.
--- drivers/block/rbd.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/block/rbd.c +9 -11
@@ -5296,8 +5296,7 @@ static void rbd_dev_release(struct devicmodule_put (THIS_MODULE ); } -static struct rbd_device *__rbd_dev_create (struct rbd_client *rbdc, -struct rbd_spec *spec) +static struct rbd_device *__rbd_dev_create (struct rbd_spec *spec) {struct rbd_device *rbd_dev;
@@ -5342,9 +5341,6 @@ static struct rbd_device *__rbd_dev_crea rbd_dev->dev.parent = &rbd_root_dev;device_initialize (&rbd_dev->dev); - rbd_dev->rbd_client = rbdc; - rbd_dev->spec = spec; -return rbd_dev; }
@@ -5357,12 +5353,10 @@ static struct rbd_device *rbd_dev_create {struct rbd_device *rbd_dev; - rbd_dev =__rbd_dev_create (rbdc, spec); + rbd_dev =__rbd_dev_create (spec);if (!rbd_dev)return NULL ; - rbd_dev->opts = opts; -/* get an id and fill in device name */ rbd_dev->dev_id = ida_simple_get(&rbd_dev_id_ida, 0, minor_to_rbd_dev_id(1 << MINORBITS),
@@ -5379,6 +5373,10 @@ static struct rbd_device *rbd_dev_create/* we have a ref from do_rbd_add() */ __module_get (THIS_MODULE ); + rbd_dev->rbd_client = rbdc; + rbd_dev->spec = spec; + rbd_dev->opts = opts; +dout ("%s rbd_dev %p dev_id %d\n" , __func__, rbd_dev, rbd_dev->dev_id);return rbd_dev;
@@ -6739,7 +6737,7 @@ static int rbd_dev_probe_parent(struct r goto out_err; } - parent =__rbd_dev_create (rbd_dev->rbd_client, rbd_dev->parent_spec); + parent =__rbd_dev_create (rbd_dev->parent_spec);if (!parent) { ret = -ENOMEM ; goto out_err;
@@ -6749,8 +6747,8 @@ static int rbd_dev_probe_parent(struct r* Images related by parent/child relationships always share * rbd_client and spec/parent_spec, so bump their refcounts. */ -__rbd_get_client (rbd_dev->rbd_client); -rbd_spec_get (rbd_dev->parent_spec); + parent->rbd_client =__rbd_get_client (rbd_dev->rbd_client); + parent->spec =rbd_spec_get (rbd_dev->parent_spec);__set_bit (RBD_DEV_FLAG_READONLY , &parent->flags);
Greg Kroah-Hartman
maintainerPATCH 524/567 ceph: update the time stamps and try to drop the suid/sgid
In reply to Greg Kroah-HartmanFrom: Xiubo Li <[email protected]>
commit e027253c4b77d395798600a90b6a96fe4adf4d5e upstream.
The fallocate will try to clear the suid/sgid if a unprevileged user changed the file.
There is no POSIX item requires that we should clear the suid/sgid in fallocate code path but this is the default behaviour for most of the filesystems and the VFS layer. And also the same for the write code path, which have already support it.
And also we need to update the time stamps since the fallocate will change the file contents.
--- fs/ceph/file.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ceph/file.c +8 -0
@@ -2084,6 +2084,9 @@ static long ceph_fallocate(struct file *loff_t endoff =0 ;loff_t size; +dout ("%s %p %llx.%llx mode %x, offset %llu length %llu\n" , __func__, + inode,ceph_vinop (inode), mode, offset, length); +if (mode != (FALLOC_FL_KEEP_SIZE |FALLOC_FL_PUNCH_HOLE ))return -EOPNOTSUPP ;
@@ -2124,6 +2127,10 @@ static long ceph_fallocate(struct file *if (ret <0 ) goto unlock; + ret =file_modified (file); +if (ret) + goto put_caps; +filemap_invalidate_lock (inode->i_mapping);ceph_zero_pagecache_range (inode, offset, length); ret =ceph_zero_objects (inode, offset, length);
@@ -2139,6 +2146,7 @@ static long ceph_fallocate(struct file * }filemap_invalidate_unlock (inode->i_mapping); +put_caps:ceph_put_cap_refs (ci, got); unlock:inode_unlock (inode);
Greg Kroah-Hartman
maintainerPATCH 525/567 alpha: fix FEN fault handling
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
commit 977a3009547dad4a5bc95d91be4a58c9f7eedac0 upstream.
Type 3 instruction fault (FPU insn with FPU disabled) is handled by quietly enabling FPU and returning. Which is fine, except that we need to do that both for fault in userland and in the kernel; the latter *can* legitimately happen - all it takes is this:
.global _start_start:
call_pal 0xae lda $0, 0 ldq $0, 0($0)
- call_pal CLRFEN to clear "FPU enabled" flag and arrange for a signal delivery (SIGSEGV in this case).
Fixed by moving the handling of type 3 into the common part of do_entIF(), before we check for kernel vs. user mode.
Incidentally, the check for kernel mode is unidiomatic; the normal way to do that is !user_mode(regs). The difference is that the open-coded variant treats any of bits 63..3 of regs->ps being set as "it's user mode" while the normal approach is to check just the bit 3. PS is a 4-bit register and regs->ps always will have bits 63..4 clear, so the open-coded variant here is actually equivalent to !user_mode(regs). Harder to follow, though...
--- arch/alpha/kernel/traps.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
arch/alpha/kernel/traps.c +15 -15
@@ -235,7 +235,21 @@ do_entIF(unsigned long type, struct pt_r {int signo, code; -if ((regs->ps & ~IPL_MAX ) ==0 ) { +if (type ==3 ) {/* FEN fault */ +/* Irritating users can call PAL_clrfen to disable the +FPU for the process. The kernel will then trap in +do_switch_stack and undo_switch_stack when we try +to save and restore the FP registers. + +Given that GCC by default generates code that uses the +FP registers, PAL_clrfen is not useful except for DoS +attacks. So turn the bleeding FPU back on and be done +with it. */ +current_thread_info ()->pcb.flags |=1 ; +__reload_thread (¤t_thread_info ()->pcb); +return ; + } +if (!user_mode (regs)) {if (type ==1 ) {const unsigned int *data = (const unsigned int *) regs->pc;
@@ -368,20 +382,6 @@ do_entIF(unsigned long type, struct pt_r }break ; -case 3 :/* FEN fault */ -/* Irritating users can call PAL_clrfen to disable the -FPU for the process. The kernel will then trap in -do_switch_stack and undo_switch_stack when we try -to save and restore the FP registers. - -Given that GCC by default generates code that uses the -FP registers, PAL_clrfen is not useful except for DoS -attacks. So turn the bleeding FPU back on and be done -with it. */ -current_thread_info ()->pcb.flags |=1 ; -__reload_thread (¤t_thread_info ()->pcb); -return ; -case 5 :/* illoc */ default :/* unexpected instruction-fault type */ ;
Greg Kroah-Hartman
maintainerPATCH 526/567 dax/kmem: Fix leak of memory-hotplug resources
In reply to Greg Kroah-HartmanFrom: Dan Williams <[email protected]>
commit e686c32590f40bffc45f105c04c836ffad3e531a upstream.
While experimenting with CXL region removal the following corruption of /proc/iomem appeared.
Before:
f010000000-f04fffffff : CXL Window 0
f010000000-f02fffffff : region4
f010000000-f02fffffff : dax4.0
f010000000-f02fffffff : System RAM (kmem)After (modprobe -r cxl_test):
f010000000-f02fffffff : **redacted binary garbage**
f010000000-f02fffffff : System RAM (kmem)
...and testing further the same is visible with persistent memory assigned to kmem:
Before:
480000000-243fffffff : Persistent Memory
480000000-57e1fffff : namespace3.0
580000000-243fffffff : dax3.0
580000000-243fffffff : System RAM (kmem)
After (ndctl disable-region all):
480000000-243fffffff : Persistent Memory
580000000-243fffffff : ***redacted binary garbage***
580000000-243fffffff : System RAM (kmem)
The corrupted data is from a use-after-free of the "dax4.0" and "dax3.0" resources, and it also shows that the "System RAM (kmem)" resource is not being removed. The bug does not appear after "modprobe -r kmem", it requires the parent of "dax4.0" and "dax3.0" to be removed which re-parents the leaked "System RAM (kmem)" instances. Those in turn reference the freed resource as a parent.
First up for the fix is release_mem_region_adjustable() needs to reliably delete the resource inserted by add_memory_driver_managed(). That is thwarted by a check for IORESOURCE_SYSRAM that predates the dax/kmem driver, from commit:
65c78784135f ("kernel, resource: check for IORESOURCE_SYSRAM in release_mem_region_adjustable")
That appears to be working around the behavior of HMM's "MEMORY_DEVICE_PUBLIC" facility that has since been deleted. With that check removed the "System RAM (kmem)" resource gets removed, but corruption still occurs occasionally because the "dax" resource is not reliably removed.
The dax range information is freed before the device is unregistered, so the driver can not reliably recall (another use after free) what it is meant to release. Lastly if that use after free got lucky, the driver was covering up the leak of "System RAM (kmem)" due to its use of release_resource() which detaches, but does not free, child resources. The switch to remove_resource() forces remove_memory() to be responsible for the deletion of the resource added by add_memory_driver_managed().
--- drivers/dax/bus.c | 2 +- drivers/dax/kmem.c | 4 ++-- kernel/resource.c | 14 -------------- 3 files changed, 3 insertions(+), 17 deletions(-)
drivers/dax/bus.c +1 -1
@@ -397,8 +397,8 @@ static void unregister_dev_dax(void *devdev_dbg (dev,"%s\n" , __func__);kill_dev_dax (dev_dax); -free_dev_dax_ranges (dev_dax);device_del (dev); +free_dev_dax_ranges (dev_dax);put_device (dev); }
drivers/dax/kmem.c +2 -2
@@ -135,7 +135,7 @@ static int dev_dax_kmem_probe(struct devif (rc) {dev_warn (dev,"mapping%d: %#llx-%#llx memory add failed\n" , i, range.start, range.end); -release_resource (res); +remove_resource (res);kfree (res); data->res[i] =NULL ;if (mapped)
@@ -181,7 +181,7 @@ static void dev_dax_kmem_remove(struct d rc =remove_memory (range.start,range_len (&range));if (rc ==0 ) { -release_resource (data->res[i]); +remove_resource (data->res[i]);kfree (data->res[i]); data->res[i] =NULL ; success++;
kernel/resource.c +0 -14
@@ -1325,20 +1325,6 @@ retry:continue ; } -/* -* All memory regions added from memory-hotplug path have the -* flag IORESOURCE_SYSTEM_RAM. If the resource does not have -* this flag, we know that we are dealing with a resource coming -* from HMM/devm. HMM/devm use another mechanism to add/release -* a resource. This goes via devm_request_mem_region and -* devm_release_mem_region. -* HMM/devm take care to release their resources when they want, -* so if we are dealing with them, let us just back off here. -*/ -if (!(res->flags &IORESOURCE_SYSRAM )) { -break ; - } -if (!(res->flags &IORESOURCE_MEM ))break ;
Greg Kroah-Hartman
maintainerPATCH 527/567 mips: fix syscall_get_nr
In reply to Greg Kroah-HartmanFrom: Elvira Khabirova <[email protected]>
commit 85cc91e2ba4262a602ec65e2b76c4391a9e60d3d upstream.
The implementation of syscall_get_nr on mips used to ignore the task argument and return the syscall number of the calling thread instead of the target thread.
The bug was exposed to user space by commit 201766a20e30f ("ptrace: add PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite.
--- arch/mips/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/syscall.h +1 -1
@@ -38,7 +38,7 @@ static inline bool mips_syscall_is_indirstatic inline long syscall_get_nr (struct task_struct *task,struct pt_regs *regs) { -return current_thread_info ()->syscall; +return task_thread_info (task)->syscall; } static inline void mips_syscall_update_nr(struct task_struct *task,
Greg Kroah-Hartman
maintainerPATCH 528/567 media: ipu3-cio2: Fix PM runtime usage_count in driver unbind
In reply to Greg Kroah-HartmanFrom: Sakari Ailus <[email protected]>
commit 909d3096ac99fa2289f9b8945a3eab2269947a0a upstream.
Get the PM runtime usage_count and forbid PM runtime at driver unbind. The opposite is being done in probe() already.
--- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +3 -0
@@ -1851,6 +1851,9 @@ static void cio2_pci_remove(struct pci_dv4l2_device_unregister (&cio2->v4l2_dev);media_device_cleanup (&cio2->media_dev);mutex_destroy (&cio2->lock); + +pm_runtime_forbid (&pci_dev->dev); +pm_runtime_get_noresume (&pci_dev->dev); }static int __maybe_unused cio2_runtime_suspend (struct device *dev)
Greg Kroah-Hartman
maintainerPATCH 529/567 remoteproc/mtk_scp: Move clk ops outside send_lock
In reply to Greg Kroah-HartmanFrom: Chen-Yu Tsai <[email protected]>
commit e46ceea3148163166ef9b7bcac578e72dd30c064 upstream.
Clocks are properly reference counted and do not need to be inside the lock range.
Right now this triggers a false-positive lockdep warning on MT8192 based Chromebooks, through a combination of mtk-scp that has a cros-ec-rpmsg sub-device, the (actual) cros-ec I2C adapter registration, I2C client (not on cros-ec) probe doing i2c transfers and enabling clocks.
This is a false positive because the cros-ec-rpmsg under mtk-scp does not have an I2C adapter, and also each I2C adapter and cros-ec instance have their own mutex.
Move the clk operations outside of the send_lock range.
--- drivers/remoteproc/mtk_scp_ipi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/remoteproc/mtk_scp_ipi.c +5 -6
@@ -164,21 +164,21 @@ int scp_ipi_send(struct mtk_scp *scp, u3 WARN_ON(len > sizeof(send_obj->share_buf)) || WARN_ON(!buf))return -EINVAL ; -mutex_lock (&scp->send_lock); - ret =clk_prepare_enable (scp->clk);if (ret) {dev_err (scp->dev,"failed to enable clock\n" ); - goto unlock_mutex; +return ret; } +mutex_lock (&scp->send_lock); +/* Wait until SCP receives the last command */ timeout = jiffies +msecs_to_jiffies (2000 );do {if (time_after (jiffies, timeout)) {dev_err (scp->dev,"%s: IPI timeout!\n" , __func__); ret = -ETIMEDOUT ; - goto clock_disable; + goto unlock_mutex; } }while (readl (scp->reg_base + scp->data->host_to_scp_reg));
@@ -205,10 +205,9 @@ int scp_ipi_send(struct mtk_scp *scp, u3 ret =0 ; } -clock_disable: -clk_disable_unprepare (scp->clk); unlock_mutex:mutex_unlock (&scp->send_lock); +clk_disable_unprepare (scp->clk);return ret; }
Greg Kroah-Hartman
maintainerPATCH 530/567 docs: gdbmacros: print newest record
In reply to Greg Kroah-HartmanFrom: John Ogness <[email protected]>
commit f2e4cca2f670c8e52fbb551a295f2afc9aa2bd72 upstream.
@head_id points to the newest record, but the printing loop exits when it increments to this value (before printing).
Exit the printing loop after the newest record has been printed.
The python-based function in scripts/gdb/linux/dmesg.py already does this correctly.
--- Documentation/admin-guide/kdump/gdbmacros.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/admin-guide/kdump/gdbmacros.txt +1 -1
@@ -312,10 +312,10 @@ define dmesg set var $prev_flags = $info->flags end - set var $id = ($id + 1) & $id_mask if ($id == $end_id) loop_break end + set var $id = ($id + 1) & $id_mask end end document dmesg
Greg Kroah-Hartman
maintainerPATCH 531/567 mm: memcontrol: deprecate charge moving
In reply to Greg Kroah-HartmanFrom: Johannes Weiner <[email protected]>
commit da34a8484d162585e22ed8c1e4114aa2f60e3567 upstream.
Charge moving mode in cgroup1 allows memory to follow tasks as they migrate between cgroups. This is, and always has been, a questionable thing to do - for several reasons.
First, it's expensive. Pages need to be identified, locked and isolated from various MM operations, and reassigned, one by one.
Second, it's unreliable. Once pages are charged to a cgroup, there isn't always a clear owner task anymore. Cache isn't moved at all, for example. Mapped memory is moved - but if trylocking or isolating a page fails, it's arbitrarily left behind. Frequent moving between domains may leave a task's memory scattered all over the place.
Third, it isn't really needed. Launcher tasks can kick off workload tasks directly in their target cgroup. Using dedicated per-workload groups allows fine-grained policy adjustments - no need to move tasks and their physical pages between control domains. The feature was never forward-ported to cgroup2, and it hasn't been missed.
Despite it being a niche usecase, the maintenance overhead of supporting it is enormous. Because pages are moved while they are live and subject to various MM operations, the synchronization rules are complicated. There are lock_page_memcg() in MM and FS code, which non-cgroup people don't understand. In some cases we've been able to shift code and cgroup API calls around such that we can rely on native locking as much as possible. But that's fragile, and sometimes we need to hold MM locks for longer than we otherwise would (pte lock e.g.).
Mark the feature deprecated. Hopefully we can remove it soon.
And backport into -stable kernels so that people who develop against earlier kernels are warned about this deprecation as early as possible.
--- Documentation/admin-guide/cgroup-v1/memory.rst | 13 +++++++++++-- mm/memcontrol.c | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-)
Documentation/admin-guide/cgroup-v1/memory.rst +11 -2
@@ -84,6 +84,8 @@ Brief summary of control files. memory.swappiness set/show swappiness parameter of vmscan (See sysctl's vm.swappiness) memory.move_charge_at_immigrate set/show controls of moving charges + This knob is deprecated and shouldn't be + used. memory.oom_control set/show oom controls. memory.numa_stat show the number of memory usage per numa node
@@ -723,8 +725,15 @@ NOTE2: It is recommended to set the soft limit always below the hard limit, otherwise the hard limit will take precedence. -8. Move charges at task migration -================================= +8. Move charges at task migration (DEPRECATED!) +=============================================== + +THIS IS DEPRECATED! + +It's expensive and unreliable! It's better practice to launch workload +tasks directly from inside their target cgroup. Use dedicated workload +cgroups to allow fine-grained policy adjustments without having to +move physical pages between control domains. Users can move charges associated with a task along with task migration, that is, uncharge task's pages from the old cgroup and charge them to the new cgroup.
mm/memcontrol.c +4 -0
@@ -3872,6 +3872,10 @@ static int mem_cgroup_move_charge_write( {struct mem_cgroup *memcg =mem_cgroup_from_css (css); +pr_warn_once ("Cgroup memory moving (move_charge_at_immigrate) is deprecated. " +"Please report your usecase to [email protected] if you " +"depend on this functionality.\n" ); +if (val & ~MOVE_MASK )return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 532/567 mm/thp: check and bail out if page in deferred queue already
In reply to Greg Kroah-HartmanFrom: Yin Fengwei <[email protected]>
commit 81e506bec9be1eceaf5a2c654e28ba5176ef48d8 upstream.
Kernel build regression with LLVM was reported here:
https://lore.kernel.org/all/Y1GCYXGtEVZbcv%[email protected]/ with commit f35b5d7d676e ("mm: align larger anonymous mappings on THP boundaries"). And the commit f35b5d7d676e was reverted.
It turned out the regression is related with madvise(MADV_DONTNEED) was used by ld.lld. But with none PMD_SIZE aligned parameter len. trace-bpfcc captured:
531607 531732 ld.lld do_madvise.part.0 start: 0x7feca9000000, len: 0x7fb000, behavior: 0x4 531607 531793 ld.lld do_madvise.part.0 start: 0x7fec86a00000, len: 0x7fb000, behavior: 0x4
If the underneath physical page is THP, the madvise(MADV_DONTNEED) can trigger split_queue_lock contention raised significantly. perf showed following data:
14.85% 0.00% ld.lld [kernel.kallsyms] [k]
entry_SYSCALL_64_after_hwframe
11.52%
entry_SYSCALL_64_after_hwframe
do_syscall_64
__x64_sys_madvise
do_madvise.part.0
zap_page_range
unmap_single_vma
unmap_page_range
page_remove_rmap
deferred_split_huge_page
__lock_text_start
native_queued_spin_lock_slowpathIf THP can't be removed from rmap as whole THP, partial THP will be removed from rmap by removing sub-pages from rmap. Even the THP head page is added to deferred queue already, the split_queue_lock will be acquired and check whether the THP head page is in the queue already. Thus, the contention of split_queue_lock is raised.
Before acquire split_queue_lock, check and bail out early if the THP head page is in the queue already. The checking without holding split_queue_lock could race with deferred_split_scan, but it doesn't impact the correctness here.
Test result of building kernel with ld.lld:
commit 7b5a0b664ebe (parent commit of f35b5d7d676e):
time -f "\t%E real,\t%U user,\t%S sys" make LD=ld.lld -skj96 allmodconfig all
6:07.99 real, 26367.77 user, 5063.35 sys
commit f35b5d7d676e:
time -f "\t%E real,\t%U user,\t%S sys" make LD=ld.lld -skj96 allmodconfig all
7:22.15 real, 26235.03 user, 12504.55 sys
commit f35b5d7d676e with the fixing patch:
time -f "\t%E real,\t%U user,\t%S sys" make LD=ld.lld -skj96 allmodconfig all
6:08.49 real, 26520.15 user, 5047.91 sys
--- mm/huge_memory.c | 3 +++ 1 file changed, 3 insertions(+)
mm/huge_memory.c +3 -0
@@ -2778,6 +2778,9 @@ void deferred_split_huge_page(struct pagif (PageSwapCache (page))return ; +if (!list_empty (page_deferred_list (page))) +return ; +spin_lock_irqsave (&ds_queue->split_queue_lock, flags);if (list_empty (page_deferred_list (page))) {count_vm_event (THP_DEFERRED_SPLIT_PAGE );
Greg Kroah-Hartman
maintainerPATCH 533/567 ktest.pl: Give back console on Ctrt^C on monitor
In reply to Greg Kroah-HartmanFrom: Steven Rostedt <[email protected]>
commit 83d29d439cd3ef23041570d55841f814af2ecac0 upstream.
When monitoring the console output, the stdout is being redirected to do so. If Ctrl^C is hit during this mode, the stdout is not back to the console, the user does not see anything they type (no echo).
Add "end_monitor" to the SIGINT interrupt handler to give back the console on Ctrl^C.
--- tools/testing/ktest/ktest.pl | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/ktest/ktest.pl +3 -0
@@ -4193,6 +4193,9 @@ sub send_email { } sub cancel_test { + if ($monitor_cnt) { + end_monitor; + } if ($email_when_canceled) { my $name = get_test_name; send_email("KTEST: Your [$name] test was cancelled",
Greg Kroah-Hartman
maintainerPATCH 534/567 ktest.pl: Fix missing "end_monitor" when machine check fails
In reply to Greg Kroah-HartmanFrom: Steven Rostedt <[email protected]>
commit e8bf9b98d40dbdf4e39362e3b85a70c61da68cb7 upstream.
In the "reboot" command, it does a check of the machine to see if it is still alive with a simple "ssh echo" command. If it fails, it will assume that a normal "ssh reboot" is not possible and force a power cycle.
In this case, the "start_monitor" is executed, but the "end_monitor" is not, and this causes the screen will not be given back to the console. That is, after the test, a "reset" command needs to be performed, as "echo" is turned off.
--- tools/testing/ktest/ktest.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +2 -1
@@ -1488,7 +1488,8 @@ sub reboot { # Still need to wait for the reboot to finish wait_for_monitor($time, $reboot_success_line); - + } + if ($powercycle || $time) { end_monitor; } }
Greg Kroah-Hartman
maintainerPATCH 535/567 ktest.pl: Add RUN_TIMEOUT option with default unlimited
In reply to Greg Kroah-HartmanFrom: Steven Rostedt <[email protected]>
commit 4e7d2a8f0b52abf23b1dc13b3d88bc0923383cd5 upstream.
There is a disconnect between the run_command function and the wait_for_input. The wait_for_input has a default timeout of 2 minutes. But if that happens, the run_command loop will exit out to the waitpid() of the executing command. This fails in that it no longer monitors the command, and also, the ssh to the test box can hang when its finished, as it's waiting for the pipe it's writing to to flush, but the loop that reads that pipe has already exited, leaving the command stuck, and the test hangs.
Instead, make the default "wait_for_input" of the run_command infinite, and allow the user to override it if they want with a default timeout option "RUN_TIMEOUT".
But this fixes the hang that happens when the pipe is full and the ssh session never exits.
--- tools/testing/ktest/ktest.pl | 20 ++++++++++++++++---- tools/testing/ktest/sample.conf | 5 +++++ 2 files changed, 21 insertions(+), 4 deletions(-)
tools/testing/ktest/ktest.pl +16 -4
@@ -178,6 +178,7 @@ my $store_failures; my $store_successes; my $test_name; my $timeout; +my $run_timeout; my $connect_timeout; my $config_bisect_exec; my $booted_timeout;
@@ -340,6 +341,7 @@ my %option_map = ( "STORE_SUCCESSES" => \$store_successes, "TEST_NAME" => \$test_name, "TIMEOUT" => \$timeout, + "RUN_TIMEOUT" => \$run_timeout, "CONNECT_TIMEOUT" => \$connect_timeout, "CONFIG_BISECT_EXEC" => \$config_bisect_exec, "BOOTED_TIMEOUT" => \$booted_timeout,
@@ -1851,6 +1853,14 @@ sub run_command { $command =~ s/\$SSH_USER/$ssh_user/g; $command =~ s/\$MACHINE/$machine/g; + if (!defined($timeout)) { + $timeout = $run_timeout; + } + + if (!defined($timeout)) { + $timeout = -1; # tell wait_for_input to wait indefinitely + } + doprint("$command ... "); $start_time = time;
@@ -1877,13 +1887,10 @@ sub run_command { while (1) { my $fp = \*CMD; - if (defined($timeout)) { - doprint "timeout = $timeout\n"; - } my $line = wait_for_input($fp, $timeout); if (!defined($line)) { my $now = time; - if (defined($timeout) && (($now - $start_time) >= $timeout)) { + if ($timeout >= 0 && (($now - $start_time) >= $timeout)) { doprint "Hit timeout of $timeout, killing process\n"; $hit_timeout = 1; kill 9, $pid;
@@ -2055,6 +2062,11 @@ sub wait_for_input { $time = $timeout; } + if ($time < 0) { + # Negative number means wait indefinitely + undef $time; + } + $rin = ''; vec($rin, fileno($fp), 1) = 1; vec($rin, fileno(\*STDIN), 1) = 1;
tools/testing/ktest/sample.conf +5 -0
@@ -809,6 +809,11 @@ # is issued instead of a reboot. # CONNECT_TIMEOUT = 25 +# The timeout in seconds for how long to wait for any running command +# to timeout. If not defined, it will let it go indefinitely. +# (default undefined) +#RUN_TIMEOUT = 600 + # In between tests, a reboot of the box may occur, and this # is the time to wait for the console after it stops producing # output. Some machines may not produce a large lag on reboot
Greg Kroah-Hartman
maintainerPATCH 536/567 ring-buffer: Handle race between rb_move_tail and rb_check_pages
In reply to Greg Kroah-HartmanFrom: Mukesh Ojha <[email protected]>
commit 8843e06f67b14f71c044bf6267b2387784c7e198 upstream.
It seems a data race between ring_buffer writing and integrity check. That is, RB_FLAG of head_page is been updating, while at same time RB_FLAG was cleared when doing integrity check rb_check_pages():
rb_check_pages() rb_handle_head_page():
-------- --------
rb_head_page_deactivate()
rb_head_page_set_normal()
rb_head_page_activate()
We do intergrity test of the list to check if the list is corrupted and it is still worth doing it. So, let's refactor rb_check_pages() such that we no longer clear and set flag during the list sanity checking.
[1] and [2] are the test to reproduce and the crash report respectively.
1:
``` read_trace.sh
while true;
do
# the "trace" file is closed after read
head -1 /sys/kernel/tracing/trace > /dev/null
done
```
``` repro.sh
sysctl -w kernel.panic_on_warn=1
# function tracer will writing enough data into ring_buffer
echo function > /sys/kernel/tracing/current_tracer
./read_trace.sh &
./read_trace.sh &
./read_trace.sh &
./read_trace.sh &
./read_trace.sh &
./read_trace.sh &
./read_trace.sh &
./read_trace.sh &
```2:
------------[ cut here ]------------ WARNING: CPU: 9 PID: 62 at kernel/trace/ring_buffer.c:2653 rb_move_tail+0x450/0x470 Modules linked in: CPU: 9 PID: 62 Comm: ksoftirqd/9 Tainted: G W 6.2.0-rc6+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 RIP: 0010:rb_move_tail+0x450/0x470 Code: ff ff 4c 89 c8 f0 4d 0f b1 02 48 89 c2 48 83 e2 fc 49 39 d0 75 24 83 e0 03 83 f8 02 0f 84 e1 fb ff ff 48 8b 57 10 f0 ff 42 08 <0f> 0b 83 f8 02 0f 84 ce fb ff ff e9 db RSP: 0018:ffffb5564089bd00 EFLAGS: 00000203 RAX: 0000000000000000 RBX: ffff9db385a2bf81 RCX: ffffb5564089bd18 RDX: ffff9db281110100 RSI: 0000000000000fe4 RDI: ffff9db380145400 RBP: ffff9db385a2bf80 R08: ffff9db385a2bfc0 R09: ffff9db385a2bfc2 R10: ffff9db385a6c000 R11: ffff9db385a2bf80 R12: 0000000000000000 R13: 00000000000003e8 R14: ffff9db281110100 R15: ffffffffbb006108 FS: 0000000000000000(0000) GS:ffff9db3bdcc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005602323024c8 CR3: 0000000022e0c000 CR4: 00000000000006e0 Call Trace: <TASK> ring_buffer_lock_reserve+0x136/0x360 ? __do_softirq+0x287/0x2df ? __pfx_rcu_softirq_qs+0x10/0x10 trace_function+0x21/0x110 ? __pfx_rcu_softirq_qs+0x10/0x10 ? __do_softirq+0x287/0x2df function_trace_call+0xf6/0x120 0xffffffffc038f097 ? rcu_softirq_qs+0x5/0x140 rcu_softirq_qs+0x5/0x140 __do_softirq+0x287/0x2df run_ksoftirqd+0x2a/0x30 smpboot_thread_fn+0x188/0x220 ? __pfx_smpboot_thread_fn+0x10/0x10 kthread+0xe7/0x110 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2c/0x50 </TASK> ---[ end trace 0000000000000000 ]---
[ crash report and test reproducer credit goes to Zheng Yejian]
--- kernel/trace/ring_buffer.c | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-)
kernel/trace/ring_buffer.c +10 -32
@@ -1545,19 +1545,6 @@ static int rb_check_bpage(struct ring_bu }/** -* rb_check_list - make sure a pointer to a list has the last bits zero -*/ -static int rb_check_list (struct ring_buffer_per_cpu *cpu_buffer, -struct list_head *list) -{ -if (RB_WARN_ON (cpu_buffer,rb_list_head (list->prev) != list->prev)) -return 1 ; -if (RB_WARN_ON (cpu_buffer,rb_list_head (list->next) != list->next)) -return 1 ; -return 0 ; -} - -/** * rb_check_pages - integrity check of buffer pages * @cpu_buffer: CPU buffer with pages to test *
@@ -1566,36 +1553,27 @@ static int rb_check_list(struct ring_buf*/ static int rb_check_pages (struct ring_buffer_per_cpu *cpu_buffer) { -struct list_head *head = cpu_buffer->pages; -struct buffer_page *bpage, *tmp; +struct list_head *head =rb_list_head (cpu_buffer->pages); +struct list_head *tmp; -/* Reset the head page if it exists */ -if (cpu_buffer->head_page) -rb_set_head_page (cpu_buffer); - -rb_head_page_deactivate (cpu_buffer); - -if (RB_WARN_ON (cpu_buffer, head->next->prev != head)) -return -1 ; -if (RB_WARN_ON (cpu_buffer, head->prev->next != head)) +if (RB_WARN_ON (cpu_buffer, +rb_list_head (rb_list_head (head->next)->prev) != head))return -1 ; -if (rb_check_list (cpu_buffer, head)) +if (RB_WARN_ON (cpu_buffer, +rb_list_head (rb_list_head (head->prev)->next) != head))return -1 ; -list_for_each_entry_safe (bpage, tmp, head, list) { +for (tmp =rb_list_head (head->next); tmp != head; tmp =rb_list_head (tmp->next)) {if (RB_WARN_ON (cpu_buffer, - bpage->list.next->prev != &bpage->list)) +rb_list_head (rb_list_head (tmp->next)->prev) != tmp))return -1 ; +if (RB_WARN_ON (cpu_buffer, - bpage->list.prev->next != &bpage->list)) -return -1 ; -if (rb_check_list (cpu_buffer, &bpage->list)) +rb_list_head (rb_list_head (tmp->prev)->next) != tmp))return -1 ; } -rb_head_page_activate (cpu_buffer); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 537/567 tools/bootconfig: fix single & used for logical condition
In reply to Greg Kroah-HartmanFrom: Antonio Alvarez Feijoo <[email protected]>
commit cf8c59a3756b2735c409a9b3ac1e4ec556546a7a upstream.
A single & will create a background process and return true, so the grep command will run even if the file checked in the first condition does not exist.
--- tools/bootconfig/scripts/ftrace2bconf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bootconfig/scripts/ftrace2bconf.sh +1 -1
@@ -93,7 +93,7 @@ referred_vars() { } event_is_enabled() { # enable-file - test -f $1 & grep -q "1" $1 + test -f $1 && grep -q "1" $1 } per_event_options() { # event-dir
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 538/567 scsi: core: Remove the /proc/scsi/${proc_name} directory earlier
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit fc663711b94468f4e1427ebe289c9f05669699c9 upstream.
Remove the /proc/scsi/${proc_name} directory earlier to fix a race condition between unloading and reloading kernel modules. This fixes a bug introduced in 2009 by commit 77c019768f06 ("[SCSI] fix /proc memory leak in the SCSI core").
Fix the following kernel warning:
proc_dir_entry 'scsi/scsi_debug' already registered
WARNING: CPU: 19 PID: 27986 at fs/proc/generic.c:376 proc_register+0x27d/0x2e0 Call Trace: proc_mkdir+0xb5/0xe0 scsi_proc_hostdir_add+0xb5/0x170 scsi_host_alloc+0x683/0x6c0 sdebug_driver_probe+0x6b/0x2d0 [scsi_debug] really_probe+0x159/0x540 __driver_probe_device+0xdc/0x230 driver_probe_device+0x4f/0x120 __device_attach_driver+0xef/0x180 bus_for_each_drv+0xe5/0x130 __device_attach+0x127/0x290 device_initial_probe+0x17/0x20 bus_probe_device+0x110/0x130 device_add+0x673/0xc80 device_register+0x1e/0x30 sdebug_add_host_helper+0x1a7/0x3b0 [scsi_debug] scsi_debug_init+0x64f/0x1000 [scsi_debug] do_one_initcall+0xd7/0x470 do_init_module+0xe7/0x330 load_module+0x122a/0x12c0 __do_sys_finit_module+0x124/0x1a0 __x64_sys_finit_module+0x46/0x50 do_syscall_64+0x38/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0
--- drivers/scsi/hosts.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/hosts.c +2 -0
@@ -180,6 +180,7 @@ void scsi_remove_host(struct Scsi_Host *scsi_forget_host (shost);mutex_unlock (&shost->scan_mutex);scsi_proc_host_rm (shost); +scsi_proc_hostdir_rm (shost->hostt);spin_lock_irqsave (shost->host_lock, flags);if (scsi_host_set_state (shost,SHOST_DEL ))
@@ -321,6 +322,7 @@ static void scsi_host_dev_release(structstruct Scsi_Host *shost =dev_to_shost (dev);struct device *parent = dev->parent; +/* In case scsi_remove_host() has not been called. */ scsi_proc_hostdir_rm (shost->hostt);/* Wait for functions invoked through call_rcu(&scmd->rcu, ...) */
Greg Kroah-Hartman
maintainerPATCH 539/567 scsi: qla2xxx: Fix link failure in NPIV environment
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
commit b1ae65c082f74536ec292b15766f2846f0238373 upstream.
User experienced symptoms of adapter failure in NPIV environment. NPIV hosts were allowed to trigger chip reset back to back due to NPIV link state being slow to come online.
Fix link failure in NPIV environment by removing NPIV host from directly being able to perform chip reset.
kernel: qla2xxx [0000:04:00.1]-6009:261: Loop down - aborting ISP.
kernel: qla2xxx [0000:04:00.1]-6009:262: Loop down - aborting ISP.
kernel: qla2xxx [0000:04:00.1]-6009:281: Loop down - aborting ISP.
kernel: qla2xxx [0000:04:00.1]-6009:285: Loop down - aborting ISP
--- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -7422,7 +7422,7 @@ qla2x00_timer(struct timer_list *t)/* if the loop has been down for 4 minutes, reinit adapter */ if (atomic_dec_and_test (&vha->loop_down_timer) !=0 ) { -if (!(vha->device_flags &DFLG_NO_CABLE )) { +if (!(vha->device_flags &DFLG_NO_CABLE ) && !vha->vp_idx) {ql_log (ql_log_warn, vha,0x6009 ,"Loop down - aborting ISP.\n" );
Greg Kroah-Hartman
maintainerPATCH 540/567 scsi: qla2xxx: Check if port is online before sending ELS
In reply to Greg Kroah-HartmanFrom: Shreyas Deodhar <[email protected]>
commit 0c227dc22ca18856055983f27594feb2e0149965 upstream.
CT Ping and ELS cmds fail for NVMe targets. Check if port is online before sending ELS instead of sending login.
--- drivers/scsi/qla2xxx/qla_bsg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_bsg.c +5 -4
@@ -278,8 +278,8 @@ qla2x00_process_els(struct bsg_job *bsg_const char *type;int req_sg_cnt, rsp_sg_cnt;int rval = (DID_ERROR <<16 ); -uint16_t nextlid =0 ;uint32_t els_cmd =0 ; +int qla_port_allocated =0 ;if (bsg_request->msgcode ==FC_BSG_RPT_ELS ) { rport =fc_bsg_to_rport (bsg_job);
@@ -329,9 +329,9 @@ qla2x00_process_els(struct bsg_job *bsg_/* make sure the rport is logged in, * if not perform fabric login */ -if (qla2x00_fabric_login (vha, fcport, &nextlid)) { +if (atomic_read (&fcport->state) !=FCS_ONLINE ) {ql_dbg (ql_dbg_user, vha,0x7003 , -"Failed to login port %06X for ELS passthru.\n" , +"Port %06X is not online for ELS passthru.\n" , fcport->d_id.b24); rval = -EIO ; goto done;
@@ -348,6 +348,7 @@ qla2x00_process_els(struct bsg_job *bsg_ goto done; } + qla_port_allocated =1 ;/* Initialize all required fields of fcport */ fcport->vha = vha; fcport->d_id.b.al_pa =
@@ -432,7 +433,7 @@ done_unmap_sg: goto done_free_fcport; done_free_fcport: -if (bsg_request->msgcode !=FC_BSG_RPT_ELS ) +if (qla_port_allocated)qla2x00_free_fcport (fcport); done:return rval;
Greg Kroah-Hartman
maintainerPATCH 541/567 scsi: qla2xxx: Fix DMA-API call trace on NVMe LS requests
In reply to Greg Kroah-HartmanFrom: Arun Easi <[email protected]>
commit c75e6aef5039830cce5d4cf764dd204522f89e6b upstream.
The following message and call trace was seen with debug kernels:
DMA-API: qla2xxx 0000:41:00.0: device driver failed to check map error [device address=0x00000002a3ff38d8] [size=1024 bytes] [mapped as single]
WARNING: CPU: 0 PID: 2930 at kernel/dma/debug.c:1017 check_unmap+0xf42/0x1990 Call Trace: debug_dma_unmap_page+0xc9/0x100 qla_nvme_ls_unmap+0x141/0x210 [qla2xxx]
Remove DMA mapping from the driver altogether, as it is already done by FC layer. This prevents the warning.
--- drivers/scsi/qla2xxx/qla_nvme.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/scsi/qla2xxx/qla_nvme.c +1 -18
@@ -165,18 +165,6 @@ out:qla2xxx_rel_qpair_sp (sp->qpair, sp); } -static void qla_nvme_ls_unmap (struct srb *sp,struct nvmefc_ls_req *fd) -{ -if (sp->flags &SRB_DMA_VALID ) { -struct srb_iocb *nvme = &sp->u.iocb_cmd; -struct qla_hw_data *ha = sp->fcport->vha->hw; - -dma_unmap_single (&ha->pdev->dev, nvme->u.nvme.cmd_dma, - fd->rqstlen,DMA_TO_DEVICE ); - sp->flags &= ~SRB_DMA_VALID ; - } -} -static void qla_nvme_release_ls_cmd_kref (struct kref *kref) { struct srb *sp = container_of(kref, struct srb, cmd_kref);
@@ -194,7 +182,6 @@ static void qla_nvme_release_ls_cmd_kref fd = priv->fd; -qla_nvme_ls_unmap (sp, fd); fd->done (fd, priv->comp_status); out:qla2x00_rel_sp (sp);
@@ -360,13 +347,10 @@ static int qla_nvme_ls_req(struct nvme_f nvme->u.nvme.rsp_len = fd->rsplen; nvme->u.nvme.rsp_dma = fd->rspdma; nvme->u.nvme.timeout_sec = fd->timeout; - nvme->u.nvme.cmd_dma =dma_map_single (&ha->pdev->dev, fd->rqstaddr, - fd->rqstlen,DMA_TO_DEVICE ); + nvme->u.nvme.cmd_dma = fd->rqstdma;dma_sync_single_for_device (&ha->pdev->dev, nvme->u.nvme.cmd_dma, fd->rqstlen,DMA_TO_DEVICE ); - sp->flags |=SRB_DMA_VALID ; - rval =qla2x00_start_sp (sp);if (rval !=QLA_SUCCESS ) { ql_log(ql_log_warn, vha, 0x700e,
@@ -374,7 +358,6 @@ static int qla_nvme_ls_req(struct nvme_fwake_up (&sp->nvme_ls_waitq); sp->priv =NULL ; priv->sp =NULL ; -qla_nvme_ls_unmap (sp, fd);qla2x00_rel_sp (sp);return rval; }
Greg Kroah-Hartman
maintainerPATCH 542/567 scsi: qla2xxx: Remove unintended flag clearing
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
commit 7e8a936a2d0f98dd6e5d05d4838affabe606cabc upstream.
FCF_ASYNC_SENT flag is used in session management. This flag is cleared in task management path by accident. Remove unintended flag clearing.
--- drivers/scsi/qla2xxx/qla_init.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/qla2xxx/qla_init.c +0 -1
@@ -2078,7 +2078,6 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, done_free_sp:/* ref: INIT */ kref_put (&sp->cmd_kref, qla2x00_sp_release); - fcport->flags &= ~FCF_ASYNC_SENT ; done:return rval; }
Greg Kroah-Hartman
maintainerPATCH 543/567 scsi: qla2xxx: Fix erroneous link down
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
commit 3fbc74feb642deb688cc97f76d40b7287ddd4cb1 upstream.
If after an adapter reset the appearance of link is not recovered, the devices are not rediscovered. This is result of a race condition between adapter reset (abort_isp) and the topology scan. During adapter reset, the ABORT_ISP_ACTIVE flag is set. Topology scan usually occurred after adapter reset. In this case, the topology scan came earlier than usual where it ran into problem due to ABORT_ISP_ACTIVE flag was still set.
kernel: qla2xxx [0000:13:00.0]-1005:1: Cmd 0x6a aborted with timeout since ISP Abort is pending
kernel: qla2xxx [0000:13:00.0]-28a0:1: MBX_GET_PORT_NAME failed, No FL Port.
kernel: qla2xxx [0000:13:00.0]-286b:1: qla2x00_configure_loop: exiting normally. local port wwpn 51402ec0123d9a80 id 012300)
kernel: qla2xxx [0000:13:00.0]-8017:1: ADAPTER RESET SUCCEEDED nexus=1:0:15.
Allow adapter reset to complete before any scan can start.
--- drivers/scsi/qla2xxx/qla_os.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +5 -2
@@ -7069,9 +7069,12 @@ qla2x00_do_dpc(void *data) } } loop_resync_check: -if (test_and_clear_bit (LOOP_RESYNC_NEEDED , +if (!qla2x00_reset_active (base_vha) && +test_and_clear_bit (LOOP_RESYNC_NEEDED , &base_vha->dpc_flags)) { - +/* +* Allow abort_isp to complete before moving on to scanning. +*/ ql_dbg (ql_dbg_dpc, base_vha,0x400f ,"Loop resync scheduled.\n" );
Greg Kroah-Hartman
maintainerPATCH 544/567 scsi: qla2xxx: Remove increment of interface err cnt
In reply to Greg Kroah-HartmanFrom: Saurav Kashyap <[email protected]>
commit d676a9e3d9efb7e93df460bcf4c445496c16314f upstream.
Residual underrun is not an interface error, hence no need to increment that count.
--- drivers/scsi/qla2xxx/qla_isr.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/qla2xxx/qla_isr.c +0 -2
@@ -3350,8 +3350,6 @@ qla2x00_status_entry(scsi_qla_host_t *vh"Dropped frame(s) detected (0x%x of 0x%x bytes).\n" , resid, scsi_bufflen(cp)); - vha->interface_err_cnt++; - res =DID_ERROR <<16 | lscsi_status; goto check_scsi_status; }
Greg Kroah-Hartman
maintainerPATCH 545/567 scsi: ses: Dont attach if enclosure has no components
In reply to Greg Kroah-HartmanFrom: James Bottomley <[email protected]>
commit 3fe97ff3d94934649abb0652028dd7296170c8d0 upstream.
An enclosure with no components can't usefully be operated by the driver (since effectively it has nothing to manage), so report the problem and don't attach. Not attaching also fixes an oops which could occur if the driver tries to manage a zero component enclosure.
[mkp: Switched to KERN_WARNING since this scenario is common]
--- drivers/scsi/ses.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/scsi/ses.c +6 -0
@@ -704,6 +704,12 @@ static int ses_intf_add(struct device *c type_ptr[0] == ENCLOSURE_COMPONENT_ARRAY_DEVICE) components += type_ptr[1 ]; } + +if (components ==0 ) { +sdev_printk (KERN_WARNING , sdev,"enclosure has no enumerated components\n" ); + goto err_free; + } + ses_dev->page1 = buf; ses_dev->page1_len = len; buf =NULL ;
Greg Kroah-Hartman
maintainerPATCH 546/567 scsi: ses: Fix slab-out-of-bounds in ses_enclosure_data_process()
In reply to Greg Kroah-HartmanFrom: Tomas Henzl <[email protected]>
commit 9b4f5028e493cb353a5c8f5c45073eeea0303abd upstream.
A fix for:
BUG: KASAN: slab-out-of-bounds in ses_enclosure_data_process+0x949/0xe30 [ses] Read of size 1 at addr ffff88a1b043a451 by task systemd-udevd/3271
Checking after (and before in next loop) addl_desc_ptr[1] is sufficient, we expect the size to be sanitized before first access to addl_desc_ptr[1]. Make sure we don't walk beyond end of page.
--- drivers/scsi/ses.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/ses.c +4 -2
@@ -603,9 +603,11 @@ static void ses_enclosure_data_process(s/* these elements are optional */ type_ptr[0] == ENCLOSURE_COMPONENT_SCSI_TARGET_PORT || type_ptr[0] == ENCLOSURE_COMPONENT_SCSI_INITIATOR_PORT || - type_ptr[0] == ENCLOSURE_COMPONENT_CONTROLLER_ELECTRONICS)) + type_ptr[0] == ENCLOSURE_COMPONENT_CONTROLLER_ELECTRONICS)) { addl_desc_ptr += addl_desc_ptr[1 ] +2 ; - +if (addl_desc_ptr +1 >= ses_dev->page10 + ses_dev->page10_len) + addl_desc_ptr =NULL ; + } } }kfree (buf);
Greg Kroah-Hartman
maintainerPATCH 547/567 scsi: ses: Fix possible addl_desc_ptr out-of-bounds accesses
In reply to Greg Kroah-HartmanFrom: Tomas Henzl <[email protected]>
commit db95d4df71cb55506425b6e4a5f8d68e3a765b63 upstream.
Sanitize possible addl_desc_ptr out-of-bounds accesses in ses_enclosure_data_process().
--- drivers/scsi/ses.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-)
drivers/scsi/ses.c +26 -9
@@ -433,8 +433,8 @@ int ses_match_host(struct enclosure_devi }#endif /* 0 */ -static void ses_process_descriptor (struct enclosure_component *ecomp, -unsigned char *desc) +static int ses_process_descriptor (struct enclosure_component *ecomp, +unsigned char *desc,int max_desc_len) {int eip = desc[0 ] &0x10 ;int invalid = desc[0 ] &0x80 ;
@@ -445,22 +445,32 @@ static void ses_process_descriptor(strucunsigned char *d;if (invalid) -return ; +return 0 ;switch (proto) {case SCSI_PROTOCOL_FCP :if (eip) { +if (max_desc_len <=7 ) +return 1 ; d = desc +4 ; slot = d[3 ]; }break ;case SCSI_PROTOCOL_SAS : +if (eip) { +if (max_desc_len <=27 ) +return 1 ; d = desc +4 ; slot = d[3 ]; d = desc +8 ; - }else + }else { +if (max_desc_len <=23 ) +return 1 ; d = desc +4 ; + } + +/* only take the phy0 addr */ addr = (u64 )d[12 ] <<56 | (u64)d[13] << 48 |
@@ -477,6 +487,8 @@ static void ses_process_descriptor(struc } ecomp->slot = slot; scomp->addr = addr; + +return 0 ; }struct efd {
@@ -549,7 +561,7 @@ static void ses_enclosure_data_process(s/* skip past overall descriptor */ desc_ptr += len +4 ; } -if (ses_dev->page10) +if (ses_dev->page10 && ses_dev->page10_len >9 ) addl_desc_ptr = ses_dev->page10 +8 ; type_ptr = ses_dev->page1_types; components =0 ;
@@ -557,6 +569,7 @@ static void ses_enclosure_data_process(sfor (j =0 ; j < type_ptr[1 ]; j++) {char *name =NULL ;struct enclosure_component *ecomp; +int max_desc_len;if (desc_ptr) {if (desc_ptr >= buf + page7_len) {
@@ -583,10 +596,14 @@ static void ses_enclosure_data_process(s ecomp = &edev->component[components++];if (!IS_ERR (ecomp)) { -if (addl_desc_ptr) -ses_process_descriptor ( - ecomp, - addl_desc_ptr); +if (addl_desc_ptr) { + max_desc_len = ses_dev->page10_len - + (addl_desc_ptr - ses_dev->page10); +if (ses_process_descriptor (ecomp, + addl_desc_ptr, + max_desc_len)) + addl_desc_ptr =NULL ; + }if (create)enclosure_component_register ( ecomp);
Greg Kroah-Hartman
maintainerPATCH 548/567 scsi: ses: Fix possible desc_ptr out-of-bounds accesses
In reply to Greg Kroah-HartmanFrom: Tomas Henzl <[email protected]>
commit 801ab13d50cf3d26170ee073ea8bb4eececb76ab upstream.
Sanitize possible desc_ptr out-of-bounds accesses in ses_enclosure_data_process().
--- drivers/scsi/ses.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/scsi/ses.c +9 -5
@@ -572,15 +572,19 @@ static void ses_enclosure_data_process(sint max_desc_len;if (desc_ptr) { -if (desc_ptr >= buf + page7_len) { +if (desc_ptr +3 >= buf + page7_len) { desc_ptr =NULL ; }else { len = (desc_ptr[2 ] <<8 ) + desc_ptr[3 ]; desc_ptr +=4 ; -/* Add trailing zero - pushes into -* reserved space */ - desc_ptr[len] ='\0' ; - name = desc_ptr; +if (desc_ptr + len > buf + page7_len) + desc_ptr =NULL ; +else { +/* Add trailing zero - pushes into +* reserved space */ + desc_ptr[len] ='\0' ; + name = desc_ptr; + } } } if (type_ptr[0] == ENCLOSURE_COMPONENT_DEVICE ||
Greg Kroah-Hartman
maintainerPATCH 549/567 scsi: ses: Fix slab-out-of-bounds in ses_intf_remove()
In reply to Greg Kroah-HartmanFrom: Tomas Henzl <[email protected]>
commit 578797f0c8cbc2e3ec5fc0dab87087b4c7073686 upstream.
A fix for:
BUG: KASAN: slab-out-of-bounds in ses_intf_remove+0x23f/0x270 [ses] Read of size 8 at addr ffff88a10d32e5d8 by task rmmod/12013
When edev->components is zero, accessing edev->component[0] members is wrong.
--- drivers/scsi/ses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/ses.c +2 -1
@@ -856,7 +856,8 @@ static void ses_intf_remove_enclosure(stkfree (ses_dev->page2);kfree (ses_dev); -kfree (edev->component[0 ].scratch); +if (edev->components) +kfree (edev->component[0 ].scratch);put_device (&edev->edev);enclosure_unregister (edev);
Greg Kroah-Hartman
maintainerPATCH 550/567 RISC-V: add a spin_shadow_stack declaration
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
commit eb9be8310c58c166f9fae3b71c0ad9d6741b4897 upstream.
The patchwork automation reported a sparse complaint thatspin_shadow_stack was not declared and should be static:../arch/riscv/kernel/traps.c:335:15: warning: symbol 'spin_shadow_stack' was not declared. Should it be static?
However, this is used in entry.S and therefore shouldn't be static. The same applies to the shadow_stack that this pseudo spinlock is trying to protect, so do like its charge and add a declaration to thread_info.h
--- arch/riscv/include/asm/thread_info.h | 1 + 1 file changed, 1 insertion(+)
arch/riscv/include/asm/thread_info.h +1 -0
@@ -43,6 +43,7 @@#ifndef __ASSEMBLY__extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE /sizeof (long )]; +extern unsigned long spin_shadow_stack;#include <asm/processor.h> #include <asm/csr.h>
Greg Kroah-Hartman
maintainerPATCH 551/567 riscv: mm: fix regression due to update_mmu_cache change
In reply to Greg Kroah-HartmanFrom: Sergey Matyukevich <[email protected]>
commit b49f700668fff7565b945dce823def79bff59bb0 upstream.
This is a partial revert of the commit 4bd1d80efb5a ("riscv: mm: notify remote harts about mmu cache updates"). Original commit included two loosely related changes serving the same purpose of fixing stale TLB entries causing user-space application crash:
- introduce deferred per-ASID TLB flush for CPUs not running the task
- switch to per-ASID TLB flush on all CPUs running the task in update_mmu_cache
According to report and discussion in [1], the second part caused a regression on Renesas RZ/Five SoC. For now restore the old behavior of the update_mmu_cache.
[1] https://lore.kernel.org/linux-riscv/[email protected]/
--- arch/riscv/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/pgtable.h +1 -1
@@ -386,7 +386,7 @@ static inline void update_mmu_cache(stru* Relying on flush_tlb_fix_spurious_fault would suffice, but * the extra traps reduce performance. So, eagerly SFENCE.VMA. */ -flush_tlb_page (vma, address); +local_flush_tlb_page (address); } static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
Greg Kroah-Hartman
maintainerPATCH 552/567 riscv: jump_label: Fixup unaligned arch_static_branch function
In reply to Greg Kroah-HartmanFrom: Andy Chiu <[email protected]>
commit 9ddfc3cd806081ce1f6c9c2f988cbb031f35d28f upstream.
Runtime code patching must be done at a naturally aligned address, or we may execute on a partial instruction.
We have encountered problems traced back to static jump functions during the test. We switched the tracer randomly for every 1~5 seconds on a dual-core QEMU setup and found the kernel sucking at a static branch where it jumps to itself.
The reason is that the static branch was 2-byte but not 4-byte aligned. Then, the kernel would patch the instruction, either J or NOP, with two half-word stores if the machine does not have efficient unaligned accesses. Thus, moments exist where half of the NOP mixes with the other half of the J when transitioning the branch. In our particular case, on a little-endian machine, the upper half of the NOP was mixed with the lower part of the J when enabling the branch, resulting in a jump that jumped to itself. Conversely, it would result in a HINT instruction when disabling the branch, but it might not be observable.
ARM64 does not have this problem since all instructions must be 4-byte aligned.
--- arch/riscv/include/asm/jump_label.h | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/include/asm/jump_label.h +2 -0
@@ -18,6 +18,7 @@ static __always_inline bool arch_static_ bool branch) {asm_volatile_goto ( +" .align 2 \n\t" " .option push \n\t" " .option norelax \n\t" " .option norvc \n\t"
@@ -39,6 +40,7 @@ static __always_inline bool arch_static_ bool branch) {asm_volatile_goto ( +" .align 2 \n\t" " .option push \n\t" " .option norelax \n\t" " .option norvc \n\t"
Greg Kroah-Hartman
maintainerPATCH 553/567 riscv, mm: Perform BPF exhandler fixup on page fault
In reply to Greg Kroah-HartmanFrom: Björn Töpel <[email protected]>
commit 416721ff05fddc58ca531b6f069de250301de6e5 upstream.
Commit 21855cac82d3 ("riscv/mm: Prevent kernel module to access user memory without uaccess routines") added early exits/deaths for page faults stemming from accesses to user-space without using proper uaccess routines (where sstatus.SUM is set).
Unfortunatly, this is too strict for some BPF programs, which relies on BPF exhandler fixups. These BPF programs loads "BTF pointers". A BTF pointers could either be a valid kernel pointer or NULL, but not a userspace address.
Resolve the problem by calling the fixup handler in the early exit path.
--- arch/riscv/mm/fault.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/riscv/mm/fault.c +6 -4
@@ -271,10 +271,12 @@ asmlinkage void do_page_fault(struct pt_if (user_mode (regs)) flags |=FAULT_FLAG_USER ; -if (!user_mode (regs) && addr <TASK_SIZE && -unlikely (!(regs->status &SR_SUM ))) -die_kernel_fault ("access to user memory without uaccess routines" , - addr, regs); +if (!user_mode (regs) && addr <TASK_SIZE &&unlikely (!(regs->status &SR_SUM ))) { +if (fixup_exception (regs)) +return ; + +die_kernel_fault ("access to user memory without uaccess routines" , addr, regs); + }perf_sw_event (PERF_COUNT_SW_PAGE_FAULTS ,1 , regs, addr);
Greg Kroah-Hartman
maintainerPATCH 554/567 riscv: ftrace: Remove wasted nops for !RISCV_ISA_C
In reply to Greg Kroah-HartmanFrom: Guo Ren <[email protected]>
commit 409c8fb20c66df7150e592747412438c04aeb11f upstream.
When CONFIG_RISCV_ISA_C=n, -fpatchable-function-entry=8 would generate more nops than we expect. Because it treat nop opcode as 0x00000013 instead of 0x0001.
Dump of assembler code for function dw_pcie_free_msi:
0xffffffff806fce94 <+0>: sd ra,-8(sp) 0xffffffff806fce98 <+4>: auipc ra,0xff90f 0xffffffff806fce9c <+8>: jalr -684(ra) # 0xffffffff8000bbec <ftrace_caller> 0xffffffff806fcea0 <+12>: ld ra,-8(sp) 0xffffffff806fcea4 <+16>: nop /* wasted */ 0xffffffff806fcea8 <+20>: nop /* wasted */ 0xffffffff806fceac <+24>: nop /* wasted */ 0xffffffff806fceb0 <+28>: nop /* wasted */ 0xffffffff806fceb4 <+0>: addi sp,sp,-48 0xffffffff806fceb8 <+4>: sd s0,32(sp) 0xffffffff806fcebc <+8>: sd s1,24(sp) 0xffffffff806fcec0 <+12>: sd s2,16(sp) 0xffffffff806fcec4 <+16>: sd s3,8(sp) 0xffffffff806fcec8 <+20>: sd ra,40(sp) 0xffffffff806fcecc <+24>: addi s0,sp,48
--- arch/riscv/Makefile | 4 ++++ 1 file changed, 4 insertions(+)
arch/riscv/Makefile +4 -0
@@ -13,7 +13,11 @@ LDFLAGS_vmlinux := ifeq ($(CONFIG_DYNAMIC_FTRACE),y) LDFLAGS_vmlinux := --no-relax KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY +ifeq ($(CONFIG_RISCV_ISA_C),y) CC_FLAGS_FTRACE := -fpatchable-function-entry=8 +else + CC_FLAGS_FTRACE := -fpatchable-function-entry=4 +endif endif ifeq ($(CONFIG_CMODEL_MEDLOW),y)
Greg Kroah-Hartman
maintainerPATCH 555/567 riscv: ftrace: Reduce the detour code size to half
In reply to Greg Kroah-HartmanFrom: Guo Ren <[email protected]>
commit 6724a76cff85ee271bbbff42ac527e4643b2ec52 upstream.
Use a temporary register to reduce the size of detour code from 16 bytes to 8 bytes. The previous implementation is from 'commit afc76b8b8011 ("riscv:
Using PATCHABLE_FUNCTION_ENTRY instead of MCOUNT")'.
Before the patch:
<func_prolog>:
0: REG_S ra, -SZREG(sp) 4: auipc ra, ? 8: jalr ?(ra) 12: REG_L ra, -SZREG(sp)
(func_boddy)
After the patch:
<func_prolog>:
0: auipc t0, ?
4: jalr t0, ?(t0)
(func_boddy)
This patch not just reduces the size of detour code, but also fixes an important issue:
An Ftrace callback registered with FTRACE_OPS_FL_IPMODIFY flag can actually change the instruction pointer, e.g. to "replace" the given kernel function with a new one, which is needed for livepatching, etc.
In this case, the trampoline (ftrace_regs_caller) would not return to <func_prolog+12> but would rather jump to the new function. So, "REG_L ra, -SZREG(sp)" would not run and the original return address would not be restored. The kernel is likely to hang or crash as a result.
This can be easily demonstrated if one tries to "replace", say, cmdline_proc_show() with a new function with the same signature using instruction_pointer_set(&fregs->regs, new_func_addr) in the Ftrace callback.
--- arch/riscv/Makefile | 4 +- arch/riscv/include/asm/ftrace.h | 50 +++++++++++++++++++++++------- arch/riscv/kernel/ftrace.c | 65 +++++++++++----------------------------- arch/riscv/kernel/mcount-dyn.S | 42 +++++++++---------------- 4 files changed, 75 insertions(+), 86 deletions(-)
arch/riscv/Makefile +2 -2
@@ -14,9 +14,9 @@ ifeq ($(CONFIG_DYNAMIC_FTRACE),y) LDFLAGS_vmlinux := --no-relax KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY ifeq ($(CONFIG_RISCV_ISA_C),y) - CC_FLAGS_FTRACE := -fpatchable-function-entry=8 -else CC_FLAGS_FTRACE := -fpatchable-function-entry=4 +else + CC_FLAGS_FTRACE := -fpatchable-function-entry=2 endif endif
arch/riscv/include/asm/ftrace.h +38 -12
69 lines not on this page · raw message
arch/riscv/kernel/ftrace.c +19 -46
138 lines not on this page · raw message
arch/riscv/kernel/mcount-dyn.S +16 -26
127 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 556/567 MIPS: DTS: CI20: fix otg power gpio
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
commit 0cb4228f6cc9ed0ca2be0d9ddf29168a8e3a3905 upstream.
According to schematics it is PF15 and not PF14 (MIC_SW_EN). Seems as if it was hidden and not noticed during testing since there is no sound DT node.
--- arch/mips/boot/dts/ingenic/ci20.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/boot/dts/ingenic/ci20.dts +1 -1
@@ -99,7 +99,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpf 14 GPIO_ACTIVE_LOW>; + gpio = <&gpf 15 GPIO_ACTIVE_LOW>; enable-active-high; }; };
Greg Kroah-Hartman
maintainerPATCH 557/567 PCI/PM: Observe reset delay irrespective of bridge_d3
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit 8ef0217227b42e2c34a18de316cee3da16c9bf1e upstream.
If a PCI bridge is suspended to D3cold upon entering system sleep, resuming it entails a Fundamental Reset per PCIe r6.0 sec 5.8.
The delay prescribed after a Fundamental Reset in PCIe r6.0 sec 6.6.1 is sought to be observed by:
pci_pm_resume_noirq()
pci_pm_bridge_power_up_actions()
pci_bridge_wait_for_secondary_bus()
However, pci_bridge_wait_for_secondary_bus() bails out if the bridge_d3 flag is not set. That flag indicates whether a bridge is allowed to suspend to D3cold at *runtime*.
Hence *no* delay is observed on resume from system sleep if runtime D3cold is forbidden. That doesn't make any sense, so drop the bridge_d3 check from pci_bridge_wait_for_secondary_bus().
The purpose of the bridge_d3 check was probably to avoid delays if a bridge remained in D0 during suspend. However the sole caller of pci_bridge_wait_for_secondary_bus(), pci_pm_bridge_power_up_actions(), is only invoked if the previous power state was D3cold. Hence the additional bridge_d3 check seems superfluous.
--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
@@ -4902,7 +4902,7 @@ void pci_bridge_wait_for_secondary_bus(sif (pci_dev_is_disconnected (dev))return ; -if (!pci_is_bridge (dev) || !dev->bridge_d3) +if (!pci_is_bridge (dev))return ;down_read (&pci_bus_sem);
Greg Kroah-Hartman
maintainerPATCH 558/567 PCI: hotplug: Allow marking devices as disconnected during bind/unbind
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit 74ff8864cc842be994853095dba6db48e716400a upstream.
On surprise removal, pciehp_unconfigure_device() and acpiphp's trim_stale_devices() call pci_dev_set_disconnected() to mark removed devices as permanently offline. Thereby, the PCI core and drivers know to skip device accesses.
However pci_dev_set_disconnected() takes the device_lock and thus waits for a concurrent driver bind or unbind to complete. As a result, the driver's ->probe and ->remove hooks have no chance to learn that the device is gone.
That doesn't make any sense, so drop the device_lock and instead use atomic xchg() and cmpxchg() operations to update the device state.
As a byproduct, an AB-BA deadlock reported by Anatoli is fixed which occurs on surprise removal with AER concurrently performing a bus reset.
AER bus reset:
INFO: task irq/26-aerdrv:95 blocked for more than 120 seconds. Tainted: G W 6.2.0-rc3-custom-norework-jan11+ schedule rwsem_down_write_slowpath down_write_nested pciehp_reset_slot # acquires reset_lock pci_reset_hotplug_slot pci_slot_reset # acquires device_lock pci_bus_error_reset aer_root_reset pcie_do_recovery aer_process_err_devices aer_isr
pciehp surprise removal:
INFO: task irq/26-pciehp:96 blocked for more than 120 seconds. Tainted: G W 6.2.0-rc3-custom-norework-jan11+ schedule_preempt_disabled __mutex_lock mutex_lock_nested pci_dev_set_disconnected # acquires device_lock pci_walk_bus pciehp_unconfigure_device pciehp_disable_slot pciehp_handle_presence_or_link_change pciehp_ist # acquires reset_lock
--- drivers/pci/pci.h | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-)
drivers/pci/pci.h +13 -30
@@ -347,53 +347,36 @@ struct pci_sriov {* @dev: PCI device to set new error_state * @new: the state we want dev to be in * -* Must be called with device_lock held. +* If the device is experiencing perm_failure, it has to remain in that state. +* Any other transition is allowed. * * Returns true if state has been changed to the requested state. */ static inline bool pci_dev_set_io_state (struct pci_dev *dev,pci_channel_state_t new) { -bool changed = false; +pci_channel_state_t old; -device_lock_assert (&dev->dev);switch (new) {case pci_channel_io_perm_failure: -switch (dev->error_state) { -case pci_channel_io_frozen: -case pci_channel_io_normal: -case pci_channel_io_perm_failure: - changed = true; -break ; - } -break ; +xchg (&dev->error_state, pci_channel_io_perm_failure); +return true;case pci_channel_io_frozen: -switch (dev->error_state) { -case pci_channel_io_frozen: -case pci_channel_io_normal: - changed = true; -break ; - } -break ; + old =cmpxchg (&dev->error_state, pci_channel_io_normal, + pci_channel_io_frozen); +return old != pci_channel_io_perm_failure;case pci_channel_io_normal: -switch (dev->error_state) { -case pci_channel_io_frozen: -case pci_channel_io_normal: - changed = true; -break ; - } -break ; + old =cmpxchg (&dev->error_state, pci_channel_io_frozen, + pci_channel_io_normal); +return old != pci_channel_io_perm_failure; +default : +return false; } -if (changed) - dev->error_state = new; -return changed; }static inline int pci_dev_set_disconnected (struct pci_dev *dev,void *unused) { -device_lock (&dev->dev);pci_dev_set_io_state (dev, pci_channel_io_perm_failure); -device_unlock (&dev->dev);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 559/567 PCI: Avoid FLR for AMD FCH AHCI adapters
In reply to Greg Kroah-HartmanFrom: Damien Le Moal <[email protected]>
commit 63ba51db24ed1b8f8088a897290eb6c036c5435d upstream.
PCI passthrough to VMs does not work with AMD FCH AHCI adapters: the guest OS fails to correctly probe devices attached to the controller due to FIS communication failures:
ata4: softreset failed (1st FIS failed)
...
ata4.00: qc timeout after 5000 msecs (cmd 0xec) ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
Forcing the "bus" reset method before unbinding & binding the adapter to the vfio-pci driver solves this issue, e.g.:
echo "bus" > /sys/bus/pci/devices/<ID>/reset_method
gives a working guest OS, indicating that the default FLR reset method doesn't work correctly.
Apply quirk_no_flr() to AMD FCH AHCI devices to work around this issue.
--- drivers/pci/quirks.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/quirks.c +1 -0
@@ -5328,6 +5328,7 @@ static void quirk_no_flr(struct pci_devDECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x1487 , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x148c , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x149c , quirk_no_flr); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x7901 , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x1502 , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x1503 , quirk_no_flr);
Greg Kroah-Hartman
maintainerPATCH 560/567 iommu/vt-d: Avoid superfluous IOTLB tracking in lazy mode
In reply to Greg Kroah-HartmanFrom: Jacob Pan <[email protected]>
commit 16a75bbe480c3598b3af57a2504ea89b1e32c3ac upstream.
Intel IOMMU driver implements IOTLB flush queue with domain selective or PASID selective invalidations. In this case there's no need to track IOVA page range and sync IOTLBs, which may cause significant performance hit.
This patch adds a check to avoid IOVA gather page and IOTLB sync for the lazy path.
The performance difference on Sapphire Rapids 100Gb NIC is improved by the following (as measured by iperf send):
w/o this fix~48 Gbits/s. with this fix ~54 Gbits/s
--- drivers/iommu/intel/iommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +6 -1
@@ -5140,7 +5140,12 @@ static size_t intel_iommu_unmap(struct iif (dmar_domain->max_addr == iova + size) dmar_domain->max_addr = iova; -iommu_iotlb_gather_add_page (domain, gather, iova, size); +/* +* We do not use page-selective IOTLB invalidation in flush queue, +* so there is no need to track page and sync iotlb. +*/ +if (!iommu_iotlb_gather_queued (gather)) +iommu_iotlb_gather_add_page (domain, gather, iova, size);return size; }
Greg Kroah-Hartman
maintainerPATCH 561/567 vfio/type1: prevent underflow of locked_vm via exec()
In reply to Greg Kroah-HartmanFrom: Steve Sistare <[email protected]>
commit 046eca5018f8a5dd1dc2cedf87fb5843b9ea3026 upstream.
When a vfio container is preserved across exec, the task does not change, but it gets a new mm with locked_vm=0, and loses the count from existing dma mappings. If the user later unmaps a dma mapping, locked_vm underflows to a large unsigned value, and a subsequent dma map request fails with ENOMEM in __account_locked_vm.
To avoid underflow, grab and save the mm at the time a dma is mapped. Use that mm when adjusting locked_vm, rather than re-acquiring the saved task's mm, which may have changed. If the saved mm is dead, do nothing.
locked_vm is incremented for existing mappings in a subsequent patch.
--- drivers/vfio/vfio_iommu_type1.c | 41 +++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-)
drivers/vfio/vfio_iommu_type1.c +14 -27
@@ -100,6 +100,7 @@ struct vfio_dma {struct task_struct *task;struct rb_root pfn_list;/* Ex-user pinned pfn list */ unsigned long *bitmap; +struct mm_struct *mm; };struct vfio_batch {
@@ -424,8 +425,8 @@ static int vfio_lock_acct(struct vfio_dmif (!npage)return 0 ; - mm = async ?get_task_mm (dma->task) : dma->task->mm; -if (!mm) + mm = dma->mm; +if (async && !mmget_not_zero (mm))return -ESRCH ;/* process exited */ ret =mmap_write_lock_killable (mm);
@@ -798,8 +799,8 @@ static int vfio_pin_page_external(structstruct mm_struct *mm;int ret; - mm =get_task_mm (dma->task); -if (!mm) + mm = dma->mm; +if (!mmget_not_zero (mm))return -ENODEV ; ret =vaddr_get_pfns (mm, vaddr,1 , dma->prot, pfn_base, pages);
@@ -809,7 +810,7 @@ static int vfio_pin_page_external(struct ret =0 ;if (do_accounting && !is_invalid_reserved_pfn (*pfn_base)) { - ret =vfio_lock_acct (dma,1 , true); + ret =vfio_lock_acct (dma,1 , false);if (ret) {put_pfn (*pfn_base, dma->prot);if (ret == -ENOMEM )
@@ -1179,6 +1180,7 @@ static void vfio_remove_dma(struct vfio_vfio_unmap_unpin (iommu, dma, true);vfio_unlink_dma (iommu, dma);put_task_struct (dma->task); +mmdrop (dma->mm);vfio_dma_bitmap_free (dma);if (dma->vaddr_invalid) { iommu->vaddr_invalid_count--;
@@ -1649,29 +1651,15 @@ static int vfio_dma_do_map(struct vfio_i* against the locked memory limit and we need to be able to do both * outside of this call path as pinning can be asynchronous via the * external interfaces for mdev devices. RLIMIT_MEMLOCK requires a -* task_struct and VM locked pages requires an mm_struct, however -* holding an indefinite mm reference is not recommended, therefore we -* only hold a reference to a task. We could hold a reference to -* current, however QEMU uses this call path through vCPU threads, -* which can be killed resulting in a NULL mm and failure in the unmap -* path when called via a different thread. Avoid this problem by -* using the group_leader as threads within the same group require -* both CLONE_THREAD and CLONE_VM and will therefore use the same -* mm_struct. -* -* Previously we also used the task for testing CAP_IPC_LOCK at the -* time of pinning and accounting, however has_capability() makes use -* of real_cred, a copy-on-write field, so we can't guarantee that it -* matches group_leader, or in fact that it might not change by the -* time it's evaluated. If a process were to call MAP_DMA with -* CAP_IPC_LOCK but later drop it, it doesn't make sense that they -* possibly see different results for an iommu_mapped vfio_dma vs -* externally mapped. Therefore track CAP_IPC_LOCK in vfio_dma at the -* time of calling MAP_DMA. +* task_struct. Save the group_leader so that all DMA tracking uses +* the same task, to make debugging easier. VM locked pages requires +* an mm_struct, so grab the mm in case the task dies. */ get_task_struct (current->group_leader); dma->task = current->group_leader; dma->lock_cap =capable (CAP_IPC_LOCK ); + dma->mm = current->mm; +mmgrab (dma->mm); dma->pfn_list =RB_ROOT ;
@@ -3168,9 +3156,8 @@ static int vfio_iommu_type1_dma_rw_chunk !(dma->prot & IOMMU_READ))return -EPERM ; - mm =get_task_mm (dma->task); - -if (!mm) + mm = dma->mm; +if (!mmget_not_zero (mm))return -EPERM ;if (kthread)
Greg Kroah-Hartman
maintainerPATCH 562/567 vfio/type1: track locked_vm per dma
In reply to Greg Kroah-HartmanFrom: Steve Sistare <[email protected]>
commit 18e292705ba21cc9b3227b9ad5b1c28973605ee5 upstream.
Track locked_vm per dma struct, and create a new subroutine, both for use in a subsequent patch. No functional change.
--- drivers/vfio/vfio_iommu_type1.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/vfio/vfio_iommu_type1.c +17 -6
@@ -101,6 +101,7 @@ struct vfio_dma {struct rb_root pfn_list;/* Ex-user pinned pfn list */ unsigned long *bitmap;struct mm_struct *mm; +size_t locked_vm; };struct vfio_batch {
@@ -417,6 +418,19 @@ static int vfio_iova_put_vfio_pfn(structreturn ret; } +static int mm_lock_acct (struct task_struct *task,struct mm_struct *mm, +bool lock_cap,long npage) +{ +int ret =mmap_write_lock_killable (mm); + +if (ret) +return ret; + + ret =__account_locked_vm (mm,abs (npage), npage >0 , task, lock_cap); +mmap_write_unlock (mm); +return ret; +} +static int vfio_lock_acct (struct vfio_dma *dma,long npage,bool async) {struct mm_struct *mm;
@@ -429,12 +443,9 @@ static int vfio_lock_acct(struct vfio_dmif (async && !mmget_not_zero (mm))return -ESRCH ;/* process exited */ - ret =mmap_write_lock_killable (mm); -if (!ret) { - ret =__account_locked_vm (mm,abs (npage), npage >0 , dma->task, - dma->lock_cap); -mmap_write_unlock (mm); - } + ret =mm_lock_acct (dma->task, mm, dma->lock_cap, npage); +if (!ret) + dma->locked_vm += npage;if (async)mmput (mm);
Greg Kroah-Hartman
maintainerPATCH 563/567 vfio/type1: restore locked_vm
In reply to Greg Kroah-HartmanFrom: Steve Sistare <[email protected]>
commit 90fdd158a695d70403163f9a0e4efc5b20f3fd3e upstream.
When a vfio container is preserved across exec or fork-exec, the new task's mm has a locked_vm count of 0. After a dma vaddr is updated using VFIO_DMA_MAP_FLAG_VADDR, locked_vm remains 0, and the pinned memory does not count against the task's RLIMIT_MEMLOCK.
To restore the correct locked_vm count, when VFIO_DMA_MAP_FLAG_VADDR is used and the dma's mm has changed, add the dma's locked_vm count to the new mm->locked_vm, subject to the rlimit, and subtract it from the old mm->locked_vm.
--- drivers/vfio/vfio_iommu_type1.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/vfio/vfio_iommu_type1.c +35 -0
@@ -1576,6 +1576,38 @@ static bool vfio_iommu_iova_dma_valid(streturn list_empty (iova); } +static int vfio_change_dma_owner (struct vfio_dma *dma) +{ +struct task_struct *task = current->group_leader; +struct mm_struct *mm = current->mm; +long npage = dma->locked_vm; +bool lock_cap; +int ret; + +if (mm == dma->mm) +return 0 ; + + lock_cap =capable (CAP_IPC_LOCK ); + ret =mm_lock_acct (task, mm, lock_cap, npage); +if (ret) +return ret; + +if (mmget_not_zero (dma->mm)) { +mm_lock_acct (dma->task, dma->mm, dma->lock_cap, -npage); +mmput (dma->mm); + } + +if (dma->task != task) { +put_task_struct (dma->task); + dma->task =get_task_struct (task); + } +mmdrop (dma->mm); + dma->mm = mm; +mmgrab (dma->mm); + dma->lock_cap = lock_cap; +return 0 ; +} +static int vfio_dma_do_map (struct vfio_iommu *iommu,struct vfio_iommu_type1_dma_map *map) {
@@ -1625,6 +1657,9 @@ static int vfio_dma_do_map(struct vfio_i dma->size != size) { ret = -EINVAL; } else { + ret =vfio_change_dma_owner (dma); +if (ret) + goto out_unlock; dma->vaddr = vaddr; dma->vaddr_invalid = false; iommu->vaddr_invalid_count--;
Greg Kroah-Hartman
maintainerPATCH 564/567 drm/i915/quirks: Add inverted backlight quirk for HP 14-r206nv
In reply to Greg Kroah-HartmanFrom: Mavroudis Chatzilaridis <[email protected]>
commit 5e438bf7f9a1705ebcae5fa89cdbfbc6932a7871 upstream.
This laptop uses inverted backlight PWM. Thus, without this quirk, backlight brightness decreases as the brightness value increases and vice versa.
--- drivers/gpu/drm/i915/display/intel_quirks.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/display/intel_quirks.c +2 -0
@@ -193,6 +193,8 @@ static struct intel_quirk intel_quirks[]/* ECS Liva Q2 */ { 0x3185, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time }, { 0x3184, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time }, +/* HP Notebook - 14-r206nv */ + { 0x0f31, 0x103c, 0x220f, quirk_invert_brightness }, };void intel_init_quirks (struct drm_i915_private *i915)
Greg Kroah-Hartman
maintainerPATCH 565/567 drm/radeon: Fix eDP for single-display iMac11,2
In reply to Greg Kroah-HartmanFrom: Mark Hawrylak <[email protected]>
commit 05eacc198c68cbb35a7281ce4011f8899ee1cfb8 upstream.
Apple iMac11,2 (mid 2010) also with Radeon HD-4670 that has the same issue as iMac10,1 (late 2009) where the internal eDP panel stays dark on driver load. This patch treats iMac11,2 the same as iMac10,1, so the eDP panel stays active.
Additional steps:
Kernel boot parameter radeon.nomodeset=0 required to keep the eDP panel active.
This patch is an extension of
commit 564d8a2cf3ab ("drm/radeon: Fix eDP for single-display iMac10,1 (v2)")
--- drivers/gpu/drm/radeon/atombios_encoders.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/atombios_encoders.c +3 -2
@@ -2188,11 +2188,12 @@ int radeon_atom_pick_dig_encoder(struct/* * On DCE32 any encoder can drive any block so usually just use crtc id, -* but Apple thinks different at least on iMac10,1, so there use linkb, +* but Apple thinks different at least on iMac10,1 and iMac11,2, so there use linkb, * otherwise the internal eDP panel will stay dark. */ if (ASIC_IS_DCE32 (rdev)) { -if (dmi_match (DMI_PRODUCT_NAME ,"iMac10,1" )) +if (dmi_match (DMI_PRODUCT_NAME ,"iMac10,1" ) || +dmi_match (DMI_PRODUCT_NAME ,"iMac11,2" )) enc_idx = (dig->linkb) ?1 :0 ;else enc_idx = radeon_crtc->crtc_id;
Greg Kroah-Hartman
maintainerPATCH 566/567 drm/i915: Dont use BAR mappings for ring buffers with LLC
In reply to Greg Kroah-HartmanFrom: John Harrison <[email protected]>
commit 85636167e3206c3fbd52254fc432991cc4e90194 upstream.
Direction from hardware is that ring buffers should never be mapped via the BAR on systems with LLC. There are too many caching pitfalls due to the way BAR accesses are routed. So it is safest to just not use it.
--- drivers/gpu/drm/i915/gt/intel_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_ring.c +2 -2
@@ -51,7 +51,7 @@ int intel_ring_pin(struct intel_ring *riif (unlikely (ret)) goto err_unpin; -if (i915_vma_is_map_and_fenceable (vma)) { +if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915)) { addr = (void __force *)i915_vma_pin_iomap (vma); }else {int type =i915_coherent_map_type (vma->vm->i915, vma->obj, false);
@@ -96,7 +96,7 @@ void intel_ring_unpin(struct intel_ringreturn ;i915_vma_unset_ggtt_write (vma); -if (i915_vma_is_map_and_fenceable (vma)) +if (i915_vma_is_map_and_fenceable (vma) && !HAS_LLC (vma->vm->i915))i915_vma_unpin_iomap (vma);else i915_gem_object_unpin_map (vma->obj);
Greg Kroah-Hartman
maintainerPATCH 567/567 drm/edid: fix AVI infoframe aspect ratio handling
In reply to Greg Kroah-HartmanFrom: Jani Nikula <[email protected]>
commit 1cbc1f0d324ba6c4d1b10ac6362b5e0b029f63d5 upstream.
We try to avoid sending VICs defined in the later specs in AVI infoframes to sinks that conform to the earlier specs, to not upset them, and use 0 for the VIC instead. However, we do this detection and conversion to 0 too early, as we'll need the actual VIC to figure out the aspect ratio.
In particular, for a mode with 64:27 aspect ratio, 0 for VIC fails the AVI infoframe generation altogether with -EINVAL.
Separate the VIC lookup from the "filtering", and postpone the filtering, to use the proper VIC for aspect ratio handling, and the 0 VIC for the infoframe video code as needed.
--- drivers/gpu/drm/drm_edid.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_edid.c +12 -9
@@ -5598,8 +5598,6 @@ static u8 drm_mode_hdmi_vic(const structstatic u8 drm_mode_cea_vic (const struct drm_connector *connector,const struct drm_display_mode *mode) { -u8 vic; -/* * HDMI spec says if a mode is found in HDMI 1.4b 4K modes * we should send its VIC in vendor infoframes, else send the
@@ -5609,13 +5607,18 @@ static u8 drm_mode_cea_vic(const structif (drm_mode_hdmi_vic (connector, mode))return 0 ; - vic =drm_match_cea_mode (mode); +return drm_match_cea_mode (mode); +} -/* -* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but -* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we -* have to make sure we dont break HDMI 1.4 sinks. -*/ +/* +* Avoid sending VICs defined in HDMI 2.0 in AVI infoframes to sinks that +* conform to HDMI 1.4. +* +* HDMI 1.4 (CTA-861-D) VIC range: [1..64] +* HDMI 2.0 (CTA-861-F) VIC range: [1..107] +*/ +static u8 vic_for_avi_infoframe (const struct drm_connector *connector,u8 vic) +{if (!is_hdmi2_sink (connector) && vic >64 )return 0 ;
@@ -5691,7 +5694,7 @@ drm_hdmi_avi_infoframe_from_display_mode picture_aspect =HDMI_PICTURE_ASPECT_NONE ; } - frame->video_code = vic; + frame->video_code =vic_for_avi_infoframe (connector, vic); frame->picture_aspect = picture_aspect; frame->active_aspect =HDMI_ACTIVE_ASPECT_PICTURE ; frame->scan_mode =HDMI_SCAN_MODE_UNDERSCAN ;
Hi Greg,
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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.
While trying to build 5.15.99-rc1 with
* make -C tools/perf all
The following build errors are seen.
util/intel-pt-decoder/intel-pt-decoder.c: In function 'intel_pt_eptw_lookahead_cb':util/intel-pt-decoder/intel-pt-decoder.c:1445:14: error: 'INTEL_PT_CFE' undeclared (first use in this function); did you mean 'INTEL_PT_CBR'?
1445 | case INTEL_PT_CFE:
| ^~~~~~~~~~~~
| INTEL_PT_CBR
util/intel-pt-decoder/intel-pt-decoder.c:1445:14: note: each undeclared identifier is reported only once for each function it appears in
util/intel-pt-decoder/intel-pt-decoder.c:1446:14: error: 'INTEL_PT_CFE_IP' undeclared (first use in this function); did you mean 'INTEL_PT_BEP_IP'?
1446 | case INTEL_PT_CFE_IP:
| ^~~~~~~~~~~~~~~
| INTEL_PT_BEP_IP
util/intel-pt-decoder/intel-pt-decoder.c:1447:14: error: 'INTEL_PT_EVD' undeclared (first use in this function); did you mean 'INTEL_PT_OVF'?
1447 | case INTEL_PT_EVD:
| ^~~~~~~~~~~~
| INTEL_PT_OVF[PATCH 5.15 264/567] perf intel-pt: Add support for emulated ptwrite is causing this error.
Thanks,
Harshit
Quoted 2,249 lines
Responses should be made by Thu, 09 Mar 2023 16:57:34 +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/v5.x/stable-review/patch-5.15.99-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 5.15.99-rc1Jani Nikula <[email protected]>
drm/edid: fix AVI infoframe aspect ratio handlingJohn Harrison <[email protected]>
drm/i915: Don't use BAR mappings for ring buffers with LLCMark Hawrylak <[email protected]>
drm/radeon: Fix eDP for single-display iMac11,2Mavroudis Chatzilaridis <[email protected]>
drm/i915/quirks: Add inverted backlight quirk for HP 14-r206nvSteve Sistare <[email protected]>
vfio/type1: restorelocked_vmSteve Sistare <[email protected]>
vfio/type1: tracklocked_vmper dmaSteve Sistare <[email protected]>
vfio/type1: prevent underflow oflocked_vmviaexec()Jacob Pan <[email protected]>
iommu/vt-d: Avoid superfluous IOTLB tracking in lazy modeDamien Le Moal <[email protected]>
PCI: Avoid FLR for AMD FCH AHCI adaptersLukas Wunner <[email protected]>
PCI: hotplug: Allow marking devices as disconnected during bind/unbindLukas Wunner <[email protected]>
PCI/PM: Observe reset delay irrespective ofbridge_d3H. Nikolaus Schaller <[email protected]>
MIPS: DTS: CI20: fix otg power gpioGuo Ren <[email protected]>
riscv: ftrace: Reduce the detour code size to halfGuo Ren <[email protected]>
riscv: ftrace: Remove wasted nops for !RISCV_ISA_CBjörn Töpel <[email protected]>
riscv, mm: Perform BPF exhandler fixup on page faultAndy Chiu <[email protected]>
riscv:jump_label: Fixup unalignedarch_static_branchfunctionSergey Matyukevich <[email protected]>
riscv: mm: fix regression due toupdate_mmu_cachechangeConor Dooley <[email protected]>
RISC-V: add aspin_shadow_stackdeclarationTomas Henzl <[email protected]>
scsi: ses: Fix slab-out-of-bounds inses_intf_remove()Tomas Henzl <[email protected]>
scsi: ses: Fix possibledesc_ptrout-of-bounds accessesTomas Henzl <[email protected]>
scsi: ses: Fix possibleaddl_desc_ptrout-of-bounds accessesTomas Henzl <[email protected]>
scsi: ses: Fix slab-out-of-bounds inses_enclosure_data_process()James Bottomley <[email protected]>
scsi: ses: Don't attach if enclosure has no componentsSaurav Kashyap <[email protected]>
scsi: qla2xxx: Remove increment of interface err cntQuinn Tran <[email protected]>
scsi: qla2xxx: Fix erroneous link downQuinn Tran <[email protected]>
scsi: qla2xxx: Remove unintended flag clearingArun Easi <[email protected]>
scsi: qla2xxx: Fix DMA-API call trace on NVMe LS requestsShreyas Deodhar <[email protected]>
scsi: qla2xxx: Check if port is online before sending ELSQuinn Tran <[email protected]>
scsi: qla2xxx: Fix link failure in NPIV environmentBart Van Assche <[email protected]>
scsi: core: Remove the /proc/scsi/${proc_name} directory earlierAntonio Alvarez Feijoo <[email protected]>
tools/bootconfig: fix single & used for logical conditionMukesh Ojha <[email protected]>
ring-buffer: Handle race betweenrb_move_tailandrb_check_pagesSteven Rostedt <[email protected]>
ktest.pl: AddRUN_TIMEOUToption with default unlimitedSteven Rostedt <[email protected]>
ktest.pl: Fix missing "end_monitor" when machine check failsSteven Rostedt <[email protected]>
ktest.pl: Give back console on Ctrt^C on monitorYin Fengwei <[email protected]>
mm/thp: check and bail out if page in deferred queue alreadyJohannes Weiner <[email protected]>
mm: memcontrol: deprecate charge movingJohn Ogness <[email protected]>
docs: gdbmacros: print newest recordChen-Yu Tsai <[email protected]>
remoteproc/mtk_scp: Move clk ops outsidesend_lockSakari Ailus <[email protected]>
media: ipu3-cio2: Fix PM runtimeusage_countin driver unbindElvira Khabirova <[email protected]>
mips: fixsyscall_get_nrDan Williams <[email protected]>
dax/kmem: Fix leak of memory-hotplug resourcesAl Viro <[email protected]>
alpha: fix FEN fault handlingXiubo Li <[email protected]>
ceph: update the time stamps and try to drop the suid/sgidIlya Dryomov <[email protected]>
rbd: avoid use-after-free indo_rbd_add()whenrbd_dev_create()failsAlexander Mikhalitsyn <[email protected]>
fuse: add inode/permission checks to fileattr_get/fileattr_setKrzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct TMU phandle in Odroid HC1Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct TMU phandle in Odroid XUKrzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct TMU phandle in Exynos5250Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct TMU phandle in Odroid XU3 familyKrzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct TMU phandle in Exynos4Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct TMU phandle in Exynos4210Manivannan Sadhasivam <[email protected]>
ARM: dts: qcom: sdx55: Add Qcom SMMU-500 as the fallback for IOMMU nodeMikulas Patocka <[email protected]>
dm flakey: fix a bug with 32-bit highmem systemsMikulas Patocka <[email protected]>
dm flakey: don't corrupt the zero pageMikulas Patocka <[email protected]>
dm flakey: fix logic when corrupting a bioSrinivas Pandruvada <[email protected]>
thermal: intel: powerclamp: Fixcur_statefor multi package systemManish Chopra <[email protected]>
qede: fix interrupt coalescing configurationAlexander Wetzel <[email protected]>
wifi: cfg80211: Fix use after free for wextLen Brown <[email protected]>
wifi: ath11k: allow system suspend to survive ath11kBitterblue Smith <[email protected]>
wifi: rtl8xxxu: Use a longer retry limit of 48Pingfan Liu <[email protected]>
dm: addcond_resched()todm_wq_work()Mikulas Patocka <[email protected]>
dm: send just one event on resize, not twoLouis Rannou <[email protected]>
mtd: spi-nor: Fix shift-out-of-bounds inspi_nor_set_erase_typeTudor Ambarus <[email protected]>
mtd: spi-nor: spansion: Consider reserved bits in CFR5 registerTakahiro Kuwano <[email protected]>
mtd: spi-nor: sfdp: Fix index value for SCCR dwordsJan Kara <[email protected]>
ext4: Fix possible corruption when moving a directoryJun Nie <[email protected]>
ext4: refuse to create ea block when umountedJun Nie <[email protected]>
ext4: optimizeea_inodeblock expansionZhihao Cheng <[email protected]>
jbd2: fix data missing when reusing bh which is ready to be checkpointedŁukasz Stelmach <[email protected]>
ALSA: hda/realtek: Add quirk for HP EliteDesk 800 G6 Tower PCDmitry Fomin <[email protected]>
ALSA: ice1712: Do not left ice->gpio_mutex locked in aureon_add_controls()Jens Axboe <[email protected]>
io_uring/poll: allow some retries for poll triggering spuriouslyDavid Lamparter <[email protected]>
io_uring: removeMSG_NOSIGNALfrom recvmsgPavel Begunkov <[email protected]>
io_uring/rsrc: disallow multi-source reg buffersJens Axboe <[email protected]>
io_uring: add a conditional reschedule to the IOPOLL cancelation loopJens Axboe <[email protected]>
io_uring: mark taskTASK_RUNNINGbefore handling resume/task workJens Axboe <[email protected]>
io_uring: handleTIF_NOTIFY_RESUMEwhen checking fortask_workGiovanni Cabiddu <[email protected]>
crypto: qat - fix out-of-bounds readMarc Zyngier <[email protected]>
irqdomain: Fix domain registration raceJohan Hovold <[email protected]>
irqdomain: Drop bogus fwspec-mapping error handlingJohan Hovold <[email protected]>
irqdomain: Look for existing mapping only onceJohan Hovold <[email protected]>
irqdomain: Fix disassociation raceJohan Hovold <[email protected]>
irqdomain: Fix association raceRoberto Sassu <[email protected]>
ima: Alignima_file_mmap()parameters withmmap_fileLSM hookJens Axboe <[email protected]>
brd: return 0/-error frombrd_insert_page()KP Singh <[email protected]>
Documentation/hw-vuln: Document the interaction between IBRS and STIBPKP Singh <[email protected]>
x86/speculation: Allow enabling STIBP with legacy IBRSBorislav Petkov (AMD) <[email protected]>
x86/microcode/AMD: Fix mixed steppings supportBorislav Petkov (AMD) <[email protected]>
x86/microcode/AMD: Add a @cpu parameter to the reloading functionsBorislav Petkov (AMD) <[email protected]>
x86/microcode/amd: Remove load_microcode_amd()'s bsp parameterYang Jihong <[email protected]>
x86/kprobes: Fixarch_check_optimized_kprobecheck withinoptimized_kproberangeYang Jihong <[email protected]>
x86/kprobes: Fix__recover_optprobed_insncheck optimizing logicSean Christopherson <[email protected]>
x86/reboot: Disable SVM, not just VMX, when stopping CPUsSean Christopherson <[email protected]>
x86/reboot: Disable virtualization in an emergency if SVM is supportedSean Christopherson <[email protected]>
x86/crash: Disable virt in core NMI crash handler to avoid double shootdownSean Christopherson <[email protected]>
x86/virt: Force GIF=1 prior to disabling SVM (for reboot flows)Nico Boehr <[email protected]>
KVM: s390: disable migration mode when dirty tracking is disabledRandy Dunlap <[email protected]>
KVM: SVM: hyper-v: placate modpost section mismatch errorPeter Gonda <[email protected]>
KVM: SVM: Fix potential overflow in SEV's send|receive_update_data()Sean Christopherson <[email protected]>
KVM: x86: Inject #GP if WRMSR sets reserved bits in APIC Self-IPISean Christopherson <[email protected]>
KVM: Destroy target device if coalesced MMIO unregistration failsBernard Metzler <[email protected]>
RDMA/siw: Fix user page pinning accountingJan Kara <[email protected]>
udf: Fix file corruption when appending just after end of preallocated extentJan Kara <[email protected]>
udf: Detect system inodes linked into directory hierarchyJan Kara <[email protected]>
udf: Preserve link count of system filesJan Kara <[email protected]>
udf: Do not update file length for failed writes to inline filesJan Kara <[email protected]>
udf: Do not bother merging very long extentsJan Kara <[email protected]>
udf: Truncate added extents on failed expansionJeff Xu <[email protected]>
selftests/landlock: Test ptrace as much as possible with YamaJeff Xu <[email protected]>
selftests/landlock: Skip overlayfs tests when not supportedHeming Zhao via Ocfs2-devel <[email protected]>
ocfs2: fix non-auto defrag path not working issueHeming Zhao via Ocfs2-devel <[email protected]>
ocfs2: fix defrag path triggering jbd2 ASSERTEric Biggers <[email protected]>
f2fs: fix cgroup writeback accounting with fs-layer encryptionEric Biggers <[email protected]>
f2fs: fix information leak inf2fs_move_inline_dirents()Alexander Aring <[email protected]>
fs: dlm: send FIN ack back in right casesAlexander Aring <[email protected]>
fs: dlm: move sending fin message into state change handlingAlexander Aring <[email protected]>
fs: dlm: don't set stop rx flag after node resetYuezhang Mo <[email protected]>
exfat: fix inode->i_blocks for non-512 byte sector size deviceSungjong Seo <[email protected]>
exfat: redefineDIR_DELETEDas the bad cluster numberYuezhang Mo <[email protected]>
exfat: fix unexpected EOF while reading dirYuezhang Mo <[email protected]>
exfat: fix reporting fs error when reading dir beyond EOFDongliang Mu <[email protected]>
fs: hfsplus: fix UAF issue inhfsplus_put_superLiu Shixin <[email protected]>
hfs: fix missinghfs_bnode_get()in__hfs_bnode_createKrzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct HDMI phy compatible in Exynos4Namjae Jeon <[email protected]>
ksmbd: do not allow the actual frame length to be smaller than the rfc1002 lengthNamjae Jeon <[email protected]>
ksmbd: fix wrong data area length for smb2 lock requestWaiman Long <[email protected]>
locking/rwsem: Prevent non-first waiter from spinning indown_write()slowpathBoris Burkov <[email protected]>
btrfs: hold block group refcount during async discardVolker Lendecke <[email protected]>
cifs: Fix uninitialized memory read insmb3_qfs_tcon()Vasily Gorbik <[email protected]>
s390/kprobes: fixcurrent_kprobenever cleared after kprobes reenterVasily Gorbik <[email protected]>
s390/kprobes: fix irq mask clobbering on kprobe reenter frompost_handlerIlya Leoshkevich <[email protected]>
s390: discard .interp sectionGerald Schaefer <[email protected]>
s390/extmem: return correct segment type in__segment_load()Corey Minyard <[email protected]>
ipmi_ssif: Rename idle state and checkCorey Minyard <[email protected]>
ipmi:ssif:resend_msg()cannot failJohan Hovold <[email protected]>
rtc: pm8xxx: fix set-alarm raceJens Axboe <[email protected]>
block: don't allow multiple bios forIOCB_NOWAITissueAlper Nebi Yasak <[email protected]>
firmware: coreboot: framebuffer: Ignore reserved pixel color bitsJun ASAKA <[email protected]>
wifi: rtl8xxxu: fixing transmisison failure for rtl8192euAsahi Lina <[email protected]>
drm/shmem-helper: Revert accidental non-GPL exportJeff Layton <[email protected]>
nfsd: zero out pointers after puttingnfsd_fileson COPY setup errorMike Snitzer <[email protected]>
dm cache: addcond_resched()to various workqueue loopsMike Snitzer <[email protected]>
dm thin: addcond_resched()to various workqueue loopsDarrell Kavanagh <[email protected]>
drm: panel-orientation-quirks: Add quirk for Lenovo IdeaPad Duet 3 10IGL5Bastien Nocera <[email protected]>
HID: logitech-hidpp: Don't restart communication if not necessaryGreg Kroah-Hartman <[email protected]>
scsi: snic: Fix memory leak with usingdebugfs_lookup()Claudiu Beznea <[email protected]>
pinctrl: at91: usedevm_kasprintf()to avoid potential leaksRobin Murphy <[email protected]>
hwmon: (coretemp) Simplify platform device handlingAndreas Gruenbacher <[email protected]>
gfs2: Improvegfs2_make_fs_rwerror handlingKees Cook <[email protected]>
regulator: s5m8767: Bounds check id indexing into arraysKees Cook <[email protected]>
regulator: max77802: Bounds check regulator id against opmodeKees Cook <[email protected]>
ASoC: kirkwood: Iterate over array indexes instead of using pointer math강신형 <[email protected]>
ASoC: soc-compress: Reposition and addpcm_mutexJakob Koschel <[email protected]>
docs/scripts/gdb: add necessary makescripts_gdbstepJiasheng Jiang <[email protected]>
drm/msm/dsi: Add missing check foralloc_ordered_workqueueKonstantin Meskhidze <[email protected]>
drm: amd: display: Fix memory leakageThomas Zimmermann <[email protected]>
Revert "fbcon: don't lose the console font across generic->chip driver switch"Justin Tee <[email protected]>
scsi: lpfc: Fix use-after-free KFENCE violation during sysfs firmware writeLiwei Song <[email protected]>
drm/radeon: free iio for atombios when driver shutdownCarlo Caione <[email protected]>
drm/tiny: ili9486: Do not assume 8-bit only SPI controllersJingyuan Liang <[email protected]>
HID: Add Mapping for System Microphone MuteTomi Valkeinen <[email protected]>
drm/omap: dsi: Fix excessive stack usageRoman Li <[email protected]>
drm/amd/display: Fix potential null-deref indm_resumeIan Chen <[email protected]>
drm/amd/display: Revert Reduce delay when sink device not able to ACK 00340h writeEric Dumazet <[email protected]>
scm: add user copy checks toput_cmsg()Michael Kelley <[email protected]>
hv_netvsc: Check status inSEND_RNDIS_PKTcompletion messageMoises Cardona <[email protected]>
Bluetooth: btusb: Add VID:PID 13d3:3529 for Realtek RTL8821CEGreg Kroah-Hartman <[email protected]>
PM: EM: fix memory leak with usingdebugfs_lookup()Greg Kroah-Hartman <[email protected]>
PM: domains: fix memory leak with usingdebugfs_lookup()Greg Kroah-Hartman <[email protected]>
time/debug: Fix memory leak with usingdebugfs_lookup()Heiko Carstens <[email protected]>
s390/idle: markarch_cpu_idle()noinstrKees Cook <[email protected]>
uaccess: Add minimum bounds check on kernel buffer sizeKees Cook <[email protected]>
coda: Avoid partial allocation ofsig_inputArgsShay Drory <[email protected]>
net/mlx5:fw_tracer: Fix debug printHans de Goede <[email protected]>
ACPI: video: Fix Lenovo Ideapad Z570 DMI matchLorenzo Bianconi <[email protected]>
wifi: mt76: dma: freerx_headinmt76_dma_rx_cleanupZhang Rui <[email protected]>
tools/power/x86/intel-speed-select: Add Emerald Rapid quirkAlok Tiwari <[email protected]>
netfilter:nf_tables: NULL pointer dereference innf_tables_updobj()Michael Schmitz <[email protected]>
m68k: Checksyscall_trace_enter()return codeFlorian Fainelli <[email protected]>
net: bcmgenet: Add a check for oversized packetsKees Cook <[email protected]>
crypto: hisilicon: Wipe entire pool on errorFeng Tang <[email protected]>
clocksource: Suspend the watchdog temporarily when high read latency detectedTim Zimmermann <[email protected]>
thermal: intel:intel_pch: Add support for Wellsburg PCHMark Rutland <[email protected]>
ACPI: Don't build ACPICA with '-Os'Jesse Brandeburg <[email protected]>
ice: add missing checks for PF vsi typeSiddaraju DH <[email protected]>
ice: restrict PTP HW clock freq adjustments to 100, 000, 000 PPBPietro Borrello <[email protected]>
inet: fix fast path in__inet_hash_connect()Jisoo Jang <[email protected]>
wifi: mt7601u: fix an integer underflowJisoo Jang <[email protected]>
wifi: brcmfmac: ensure CLM version is null-terminated to prevent stack-out-of-boundsBreno Leitao <[email protected]>
x86/bugs: Reset speculation control settings on initJann Horn <[email protected]>
timers: Prevent union confusion from unexpectedrestart_syscall()Yang Li <[email protected]>
thermal: intel: Fix unsigned comparison with less than zeroKalle Valo <[email protected]>
wifi: ath11k: debugfs: fix to work with multiple PCI devicesZqiang <[email protected]>
rcu-tasks: Make rude RCU-Tasks work well with CPU hotplugPaul E. McKenney <[email protected]>
rcu: Suppresssmp_processor_id()complaint insynchronize_rcu_expedited_wait()Paul E. McKenney <[email protected]>
rcu: MakeRCU_LOCKDEP_WARN()avoid early lockdep checksJisoo Jang <[email protected]>
wifi: brcmfmac: Fix potential stack-out-of-bounds inbrcmf_c_preinit_dcmds()Minsuk Kang <[email protected]>
wifi: ath9k: Fix use-after-free inath9k_hif_usb_disconnect()Greg Kroah-Hartman <[email protected]>
trace/blktrace: fix memory leak with usingdebugfs_lookup()Li Nan <[email protected]>
blk-iocost: fix divide by 0 error incalc_lcoefs()Markuss Broks <[email protected]>
ARM: dts: exynos: Use Exynos5420 compatible for the MIPI video phyJan Kara <[email protected]>
udf: Define EFSCORRUPTED error codeBjorn Andersson <[email protected]>
rpmsg: glink: Avoid infinite loop on intent for missing channelTasos Sahanidis <[email protected]>
media: saa7134: Usevideo_unregister_deviceforradio_devDuoming Zhou <[email protected]>
media: usb: siano: Fix use after free bugs caused bydo_submit_urbHans Verkuil <[email protected]>
media: i2c: ov7670: 0 instead of-EINVALwas returnedDuoming Zhou <[email protected]>
media: rc: Fix use-after-free bugs caused byene_tx_irqsim()Ming Qian <[email protected]>
media: imx-jpeg: Applyclk_bulkapi instead of operating specific clkMing Qian <[email protected]>
media: v4l2-jpeg: ignore the unknown APP14 markerMing Qian <[email protected]>
media: v4l2-jpeg: correct the skip count injpeg_parse_app14_dataJai Luthra <[email protected]>
media: i2c: imx219: Fix binning for RAW8 captureAdam Ford <[email protected]>
media: i2c: imx219: Split common registers from mode tablesYuan Can <[email protected]>
media: i2c: ov772x: Fix memleak in ov772x_probe()Shang XiaoJing <[email protected]>
media: ov5675: Fix memleak in ov5675_init_controls()Shang XiaoJing <[email protected]>
media: ov2740: Fix memleak in ov2740_init_controls()Shang XiaoJing <[email protected]>
media: max9286: Fix memleak in max9286_v4l2_register()Bastian Germann <[email protected]>
builddeb: clean generated package contentNathan Chancellor <[email protected]>
s390/vdso: Drop '-shared' from KBUILD_CFLAGS_64Masahiro Yamada <[email protected]>
s390/vdso: remove -nostdlib compiler flagNathan Chancellor <[email protected]>
powerpc: Remove linker flag fromKBUILD_AFLAGSJiasheng Jiang <[email protected]>
media: platform: ti: Add missing check fordevm_regulator_getGaosheng Cui <[email protected]>
media: ti: cal: fix possible memory leak incal_ctx_create()Sibi Sankar <[email protected]>
remoteproc:qcom_q6v5_mss: Use a carveout to authenticate modem headersPatrick Kelsey <[email protected]>
IB/hfi1: Fix sdma.h tx->num_descs off-by-one errorsPatrick Kelsey <[email protected]>
IB/hfi1: Fix math bugs inhfi1_can_pin_pages()Tina Zhang <[email protected]>
iommu/vt-d: Allow to use flush-queue when first level is defaultLu Baolu <[email protected]>
iommu/vt-d: Use second level for GPA->HPA translationLu Baolu <[email protected]>
iommu/vt-d: Check FL and SL capability sanity in scalable modeLu Baolu <[email protected]>
iommu/vt-d: Remove duplicate identity domain flagLu Baolu <[email protected]>
iommu/vt-d: Fix error handling in sva enable/disable pathsKees Cook <[email protected]>
dmaengine: dw-axi-dmac: Do not dereference NULL structureShravan Chippa <[email protected]>
dmaengine: sf-pdma:pdma_descmemory leak fixJason Gunthorpe <[email protected]>
iommu: Fix error unwind iniommu_group_alloc()Dan Carpenter <[email protected]>
iw_cxgb4: Fix potential NULL dereference inc4iw_fill_res_cm_id_entry()Neill Kapron <[email protected]>
phy: rockchip-typec: fixtcphy_get_modeerror caseSerge Semin <[email protected]>
dmaengine: dw-edma: Fixreadq_ch()return value truncationSaravana Kannan <[email protected]>
driver core:fw_devlink: AddDL_FLAG_CYCLEsupport to device linksPeng Fan <[email protected]>
tty: serial: imx: disable Ageing Timer interrupt request irqMarek Vasut <[email protected]>
tty: serial: imx: Handle RS485 DE signal active highShenwei Wang <[email protected]>
serial:fsl_lpuart: fix RS485 RTS polariy inverse issueMustafa Ismail <[email protected]>
RDMA/irdma: Cap MSIX used to online CPUs + 1Mark Tomlinson <[email protected]>
usb: max-3421: Fix setting of I/O pinsNikita Zhandarovich <[email protected]>
RDMA/cxgb4: Fix potential null-ptr-deref inpass_establish()Andreas Kemnade <[email protected]>
power: supply: remove faulty cooling logicLu Baolu <[email protected]>
iommu/vt-d: Set No Execute Enable bit in PASID table entryUdipto Goswami <[email protected]>
usb: gadget: configfs: Restrict symlink creation is UDC already bindedJakob Koschel <[email protected]>
usb: gadget: configfs: remove using list iterator after loop body as a ptrLinyu Yuan <[email protected]>
usb: gadget: configfs: useto_usb_function_instance()in cfg (un)link funcLinyu Yuan <[email protected]>
usb: gadget: configfs: useto_config_usb_cfg()inos_desc_link()Dan Carpenter <[email protected]>
usb: musb: mediatek: don't unregister something that wasn't registeredNikita Zhandarovich <[email protected]>
RDMA/cxgb4: add null-ptr-check afterip_dev_find()Sherry Sun <[email protected]>
tty: serial:fsl_lpuart: Fix the wrong RXWATER setting for rx dma caseChristophe JAILLET <[email protected]>
usb: early: xhci-dbc: Fix a potential out-of-bound memory accessSerge Semin <[email protected]>
dmaengine: dw-edma: Fix missing src/dst address of interleaved xfersFabian Vogt <[email protected]>
fotg210-udc: Add missing completion handlerChen Zhongjin <[email protected]>
firmware: dmi-sysfs: Fix null-ptr-deref indmi_sysfs_register_handleYang Yingliang <[email protected]>
drivers: base:transport_class: fix resource leak whentransport_add_device()failsYang Yingliang <[email protected]>
drivers: base:transport_class: fix possible memory leakZhengchao Shao <[email protected]>
driver core: fix resource leak indevice_add()Andy Shevchenko <[email protected]>
misc/mei/hdcp: Use correct macros to initializeuuid_leGeorge Kennedy <[email protected]>
VMCI: check context->notify_page after call to get_user_pages_fast() to avoid GPFYang Yingliang <[email protected]>
firmware: stratix10-svc: add missinggen_pool_destroy()instratix10_svc_drv_probe()Xiongfeng Wang <[email protected]>
applicom: Fix PCI device refcount leak inapplicom_init()Yuan Can <[email protected]>
eeprom:idt_89hpesx: Fix error handling inidt_init()Duoming Zhou <[email protected]>
Revert "char: pcmcia:cm4000_cs: Replace mdelay withusleep_rangeinset_protocol"Yi Yang <[email protected]>
serial: tegra: Add missingclk_disable_unprepare()integra_uart_hw_init()Bartosz Golaszewski <[email protected]>
tty: serial: qcom-geni-serial: stop operations in progress at shutdownSherry Sun <[email protected]>
tty: serial:fsl_lpuart: clear LPUART Status Register inlpuart32_shutdown()Sherry Sun <[email protected]>
tty: serial:fsl_lpuart: disable Rx/Tx DMA inlpuart32_shutdown()Bjorn Helgaas <[email protected]>
PCI: switchtec: Return-EFAULTforcopy_to_user()errorsAlexey V. Vissarionov <[email protected]>
PCI/IOV: Enlarge virtfn sysfs name bufferAndy Shevchenko <[email protected]>
usb: typec:intel_pmc_mux: Don't leak the ACPI device reference countHeikki Krogerus <[email protected]>
usb: typec:intel_pmc_mux: Use the helperacpi_dev_get_memory_resources()Heikki Krogerus <[email protected]>
ACPI: resource: Add helper functionacpi_dev_get_memory_resources()Mao Jinlong <[email protected]>
coresight: cti: Add PM runtime call inenable_storeJames Clark <[email protected]>
coresight: cti: Prevent negative values of enable countJunhao He <[email protected]>
coresight: etm4x: Fix accesses to TRCSEQRSTEVR and TRCSEQSTRHans Verkuil <[email protected]>
media: uvcvideo: Check for INACTIVE inuvc_ctrl_is_accessible()Ricardo Ribalda <[email protected]>
media: uvcvideo: Check controls flags before accessing themRicardo Ribalda <[email protected]>
media: uvcvideo: Use control names from frameworkRicardo Ribalda <[email protected]>
media: uvcvideo: Add support forV4L2_CTRL_TYPE_CTRL_CLASSRicardo Ribalda <[email protected]>
media: uvcvideo: refactor__uvc_ctrl_add_mappingRicardo Ribalda <[email protected]>
media: uvcvideo: Removes_ctrlandg_ctrlRicardo Ribalda <[email protected]>
media: uvcvideo: Do not check forV4L2_CTRL_WHICH_DEF_VALAl Viro <[email protected]>
alpha/boot/tools/objstrip: fix the check for ELF headerWang Hai <[email protected]>
kobject: Fix slab-out-of-bounds infill_kobj_path()Greg Kroah-Hartman <[email protected]>
kobject: modifykobject_get_path()to take a const *Yang Yingliang <[email protected]>
driver core: fix potential null-ptr-deref indevice_add()Richard Fitzgerald <[email protected]>
soundwire: cadence: Don't overflow the command FIFOsHanna Hawa <[email protected]>
i2c: designware: fixi2c_dw_clk_rate()return size to be u32Gaosheng Cui <[email protected]>
usb: gadget:fusb300_udc: free irq on the error path infusb300_probe()Ferry Toth <[email protected]>
iio: light: tsl2563: Do not hardcode interrupt trigger typeGeert Uytterhoeven <[email protected]>
dmaengine:HISI_DMAshould depend onARCH_HISIFenghua Yu <[email protected]>
dmaengine: idxd: Set traffic class values in GRPCFG on DSA 2.0Qiheng Lin <[email protected]>
mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read()Randy Dunlap <[email protected]>
mfd: cs5535: Don't build on UMLArnd Bergmann <[email protected]>
objtool: add UACCESS exceptions for __tsan_volatile_read/writeArnd Bergmann <[email protected]>
printf: fixerrname.clistMasami Hiramatsu (Google) <[email protected]>
selftests/ftrace: Fix bash specific "==" operatorRandy Dunlap <[email protected]>
sparc: allow PM configs for sparc32COMPILE_TESTYicong Yang <[email protected]>
perf tools: Fix auto-complete on aarch64Namhyung Kim <[email protected]>
perf intel-pt: Do not try to queue auxtrace data on pipeAdrian Hunter <[email protected]>
perf intel-pt: Add support for emulated ptwriteAdrian Hunter <[email protected]>
perf intel-pt: Add link to the perf wiki's Intel PT pageAdrian Hunter <[email protected]>
perf intel-pt: Add documentation for Event Trace and TNT disableNamhyung Kim <[email protected]>
perf inject: Useperf_data__read()for auxtraceMiaoqian Lin <[email protected]>
leds: led-core: Fix refcount leak inof_led_get()Ian Rogers <[email protected]>
perf llvm: Fix inadvertent file creationAndreas Gruenbacher <[email protected]>
gfs2: jdata writepage fixZhang Xiaoxu <[email protected]>
cifs: Fix warning and UAF when destroy the MR listZhang Xiaoxu <[email protected]>
cifs: Fix lost destroy smbd connection when MR allocate failedBenjamin Coddington <[email protected]>
nfsd: fix race to checkls_layoutsAsahi Lina <[email protected]>
drm/shmem-helper: Fix locking fordrm_gem_shmem_get_pages_sgt()Pietro Borrello <[email protected]>
hid:bigben_probe(): validate report countPietro Borrello <[email protected]>
HID: bigben: use spinlock to safely schedule workersPietro Borrello <[email protected]>
HID:bigben_worker()remove unneeded check onreport_fieldPietro Borrello <[email protected]>
HID: bigben: use spinlock to protect concurrent accessesLucas Tanure <[email protected]>
ASoC:soc-dapm.h: fixup warning structsnd_pcm_substreamnot declaredChristophe JAILLET <[email protected]>
spi: synquacer: Fix timeout handling insynquacer_spi_transfer_one()NeilBrown <[email protected]>
NFS: fix disabling of swapBenjamin Coddington <[email protected]>
nfs4trace: fix state manager flag printingNeilBrown <[email protected]>
NFSv4: keep state manager thread active if swap is enabledMike Snitzer <[email protected]>
dm: removeflush_scheduled_work()duringlocal_exit()Steffen Aschbacher <[email protected]>
ASoC: tlv320adcx140: fix 'ti,gpio-config' DT property initVadim Pasternak <[email protected]>
hwmon: (mlxreg-fan) Return zero speed for broken fanWilliam Zhang <[email protected]>
spi: bcm63xx-hsspi: Fix multi-bit mode settingWilliam Zhang <[email protected]>
spi: bcm63xx-hsspi: Endianness fix for ARM based SoCSrinivas Kandagatla <[email protected]>
ASoC: codecs: lpass: fix incorrect mclk rateSrinivas Kandagatla <[email protected]>
ASoC: codecs: tx-macro: move to individual clks from bulkSrinivas Kandagatla <[email protected]>
ASoC: codecs: rx-macro: move to individual clks from bulkSrinivas Kandagatla <[email protected]>
ASoC: codecs: tx-macro: move clk provider to managed variantsSrinivas Kandagatla <[email protected]>
ASoC: codecs: rx-macro: move clk provider to managed variantsSrinivasa Rao Mandadapu <[email protected]>
ASoC: codecs: Change bulk clock voting to optional voting in digital codecsDmitry Torokhov <[email protected]>
HID: retain initial quirks set up when creating HID devicesAllen Ballway <[email protected]>
HID: multitouch: Add quirks for flipped axesJiasheng Jiang <[email protected]>
scsi: aic94xx: Add missing check fordma_map_single()Tomas Henzl <[email protected]>
scsi: mpt3sas: Fix a memory leakArnd Bergmann <[email protected]>
drm/amdgpu: fix enumodm_combine_modemismatchJonathan Cormier <[email protected]>
hwmon: (ltc2945) Handle error case inltc2945_value_storeJerome Brunet <[email protected]>
ASoC: dt-bindings: meson: fix gx-card codec node regexNathan Chancellor <[email protected]>
ASoC: mchp-spdifrx: Fix uninitialized use of mr inmchp_spdifrx_hw_params()Kuninori Morimoto <[email protected]>
ASoC: rsnd: fixup #endif positionClaudiu Beznea <[email protected]>
ASoC: mchp-spdifrx: disable all interrupts inmchp_spdifrx_dai_remove()Claudiu Beznea <[email protected]>
ASoC: mchp-spdifrx: fix controls that works with completion mechanismClaudiu Beznea <[email protected]>
ASoC: mchp-spdifrx: fix return value in case completion times outClaudiu Beznea <[email protected]>
ASoC: mchp-spdifrx: fix controls which rely on rsr registerArnd Bergmann <[email protected]>
spi:dw_bt1: fixMUX_MMIOdependenciesHaibo Chen <[email protected]>
gpio: vf610: connect GPIO label to dev nameKuninori Morimoto <[email protected]>
ASoC:soc-compress.c: fixupprivate_dataonsnd_soc_new_compress()Nícolas F. R. A. Prado <[email protected]>
drm/mediatek: Clean dangling pointer on bind error pathruanjinjie <[email protected]>
drm/mediatek:mtk_drm_crtc: Add checks fordevm_kcallocRob Clark <[email protected]>
drm/mediatek: Drop unbalanced obj unrefMiles Chen <[email protected]>
drm/mediatek: Use NULL instead of 0 for NULL pointerXinlei Lee <[email protected]>
drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmdDmitry Baryshkov <[email protected]>
drm/msm/dpu: set pdpu->is_rt_pipe early in dpu_plane_sspp_atomic_update()Mikko Perttunen <[email protected]>
drm/tegra: firewall: Check foris_addr_regexistence in IMM checkMikko Perttunen <[email protected]>
gpu: host1x: Don't skip assigning syncpoints to channelsGuodong Liu <[email protected]>
pinctrl: mediatek: Initialize variable *buf to zeroGuodong Liu <[email protected]>
pinctrl: mediatek: Initialize variable pullen and pullup to zeroZhiyong Tao <[email protected]>
pinctrl: mediatek: fix coding styleAndy Shevchenko <[email protected]>
pinctrl: bcm2835: Remove of_node_put() in bcm2835_of_gpio_ranges_fallback()Jiasheng Jiang <[email protected]>
drm/msm/mdp5: Add check for kzallocJiasheng Jiang <[email protected]>
drm/msm/dpu: Add check for pstatesJiasheng Jiang <[email protected]>
drm/msm/dpu: Add check for cstateDmitry Baryshkov <[email protected]>
drm/msm: use strscpy instead of strncpyKonrad Dybcio <[email protected]>
drm/msm/dsi: Allow 2 CTRLs on v2.5.0Jagan Teki <[email protected]>
drm: exynos: dsi: Fix MIPI_DSI*_NO_* mode flagsDaniel Mentz <[email protected]>
drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightnessDmitry Baryshkov <[email protected]>
drm/bridge: lt9611: pass a pointer to the of nodeDmitry Baryshkov <[email protected]>
drm/bridge: lt9611: fix clock calculationDmitry Baryshkov <[email protected]>
drm/bridge: lt9611: fix programming of video modesDmitry Baryshkov <[email protected]>
drm/bridge: lt9611: fix polarity programmingDmitry Baryshkov <[email protected]>
drm/bridge: lt9611: fix HPD reenablementDmitry Baryshkov <[email protected]>
drm/bridge: lt9611: fix sleep mode setupMarijn Suijten <[email protected]>
drm/msm/dpu: Disallow unallocated resources to be returnedJiasheng Jiang <[email protected]>
drm/msm/gem: Add check for kmallocAlexey V. Vissarionov <[email protected]>
ALSA: hda/ca0132: minor fix for allocation sizeAkhil P Oommen <[email protected]>
drm/msm/adreno: Fix null ptr access inadreno_gpu_cleanup()Shengjiu Wang <[email protected]>
ASoC:fsl_sai: initializeis_dsp_modeflagMark Brown <[email protected]>
ASoC:fsl_sai: Update to modern clocking terminologyQuinn Tran <[email protected]>
scsi: qla2xxx: Fix exchange oversubscription for management commandsQuinn Tran <[email protected]>
scsi: qla2xxx: Fix exchange oversubscriptionQuinn Tran <[email protected]>
scsi: qla2xxx: edif: Fix I/O timeout due to over-subscriptionDmitry Baryshkov <[email protected]>
drm/msm: clean event_thread->worker in case of an errorDave Stevenson <[email protected]>
drm/vc4: hdmi: Correct interlaced timings againDave Stevenson <[email protected]>
drm/vc4: hvs: Fix colour order for xRGB1555 on HVS5Dave Stevenson <[email protected]>
drm/vc4: hvs: Set AXI panic modesMiaoqian Lin <[email protected]>
pinctrl: rockchip: Fix refcount leak inrockchip_pinctrl_parse_groupsMiaoqian Lin <[email protected]>
pinctrl: stm32: Fix refcount leak instm32_pctrl_get_irq_domainAdam Skladowski <[email protected]>
pinctrl: qcom: pinctrl-msm8976: Correct function names for wcss pinsJiasheng Jiang <[email protected]>
drm/msm/hdmi: Add missing check foralloc_ordered_workqueueArmin Wolf <[email protected]>
hwmon: (ftsteutates) Fix scaling of measurementsLiang He <[email protected]>
gpu: ipu-v3: common: Addof_node_put()for reference returned byof_graph_get_port_by_id()Randolph Sapp <[email protected]>
drm: tidss: Fix pixel format definitionDave Stevenson <[email protected]>
drm/vc4: dpi: Fix format mapping for RGB565Dave Stevenson <[email protected]>
drm/vc4: dpi: Add option for inverting pixel clock and output enableYuan Can <[email protected]>
drm/vkms: Fix null-ptr-deref invkms_release()Yuan Can <[email protected]>
drm/vkms: Fix memory leak invkms_init()Yuan Can <[email protected]>
drm/bridge: megachips: Fix error handling ini2c_register_driver()Geert Uytterhoeven <[email protected]>
drm: mxsfb: DRM_MXSFB should depend on ARCH_MXS || ARCH_MXCFrieder Schrempf <[email protected]>
drm/bridge: ti-sn65dsi83: Fix delay after reset deassert to match specGeert Uytterhoeven <[email protected]>
drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formatsShang XiaoJing <[email protected]>
drm: Fix potential null-ptr-deref due todrmm_mode_config_init()Jiri Pirko <[email protected]>
sefltests: netdevsim: wait for devlink instance after netns removalRoxana Nicolescu <[email protected]>
selftest:fib_tests: Always cleanup before exitDoug Berger <[email protected]>
net: bcmgenet: fix MoCA LED controlShigeru Yoshida <[email protected]>
l2tp: Avoid possible recursive deadlock inl2tp_tunnel_register()Jakub Sitnicki <[email protected]>
selftests/net: InterpretUDP_GROcmsg data as an int valueFlorian Fainelli <[email protected]>
irqchip/irq-bcm7120-l2: SetIRQ_LEVELfor level triggered interruptsFlorian Fainelli <[email protected]>
irqchip/irq-brcmstb-l2: SetIRQ_LEVELfor level triggered interruptsAndrii Nakryiko <[email protected]>
bpf: Fix global subprog context argument resolution logicFrank Jungclaus <[email protected]>
can:esd_usb: Move mislocated storage ofSJA1000_ECC_SEGbits in case of a bus errorYongqin Liu <[email protected]>
thermal/drivers/hisi: Drop second sensor hi3660Shayne Chen <[email protected]>
wifi: mac80211: make rate u32 in sta_set_rate_info_rx()Herbert Xu <[email protected]>
crypto: crypto4xx - Calldma_unmap_pagewhen doneWerner Sembach <[email protected]>
ACPI: resource: Do IRQ override on all TongFang GMxRGxxAdam Niederer <[email protected]>
ACPI: resource: Add IRQ overrides for MAINGEAR Vector Pro 2 modelsIlya Leoshkevich <[email protected]>
selftests/bpf: Fix out-of-srctree buildDan Carpenter <[email protected]>
wifi: mwifiex: fix loop iterator inmwifiex_update_ampdu_txwinsize()Jiasheng Jiang <[email protected]>
wifi: iwl4965: Add missing check forcreate_singlethread_workqueue()Jiasheng Jiang <[email protected]>
wifi: iwl3945: Add missing check forcreate_singlethread_workqueueConor Dooley <[email protected]>
RISC-V: time: initialize hrtimer based broadcast clock event deviceRandy Dunlap <[email protected]>
m68k:/proc/hardwareshould depend onPROC_FSHerbert Xu <[email protected]>
crypto: rsa-pkcs1pad - Useakcipher_request_completePietro Borrello <[email protected]>
rds:rds_rm_zerocopy_callback()correct order forlist_add_tail()Ilya Leoshkevich <[email protected]>
libbpf: Fix alen calculation inlibbpf_nla_dump_errormsg()Halil Pasic <[email protected]>
s390/ap: fix status returned byap_qact()Halil Pasic <[email protected]>
s390/ap: fix status returned byap_aqic()Zhengping Jiang <[email protected]>
Bluetooth:hci_qca: get wakeup status from serdev device handleLuiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix potential user-after-freeQi Zheng <[email protected]>
OPP: fix error checking inopp_migrate_dentry()Pietro Borrello <[email protected]>
tap:tap_open(): correctly initialize socket uidPietro Borrello <[email protected]>
tun:tun_chr_open(): correctly initialize socket uidPietro Borrello <[email protected]>
net: addsock_init_data_uid()Vasily Gorbik <[email protected]>
s390/vmem: fix empty page tables cleanup under KASANVasily Gorbik <[email protected]>
s390/mem_detect: fixdetect_memory()error handlingMiaoqian Lin <[email protected]>
irqchip/ti-sci: Fix refcount leak inti_sci_intr_irq_domain_probeMiaoqian Lin <[email protected]>
irqchip/irq-mvebu-gicp: Fix refcount leak inmvebu_gicp_probeMiaoqian Lin <[email protected]>
irqchip/alpine-msi: Fix refcount leak inalpine_msix_init_domainsMiaoqian Lin <[email protected]>
irqchip: Fix refcount leak inplatform_irqchip_probeJack Morgenstein <[email protected]>
net/mlx5: Enhance debug print in page allocation failureFelix Fietkau <[email protected]>
mt76: mt7915: fix polling firmware-own statusTonghao Zhang <[email protected]>
bpftool: profile online CPUs instead of possibleTom Lendacky <[email protected]>
crypto: ccp - Flush the SEV-ES TMR memory before giving it to firmwarePeter Gonda <[email protected]>
crypto: ccp - Refactor outsev_fw_alloc()Hans de Goede <[email protected]>
leds: led-class: Add missingput_device()toled_put()Herbert Xu <[email protected]>
crypto: xts - Handle EBUSY correctlyAshok Raj <[email protected]>
x86/microcode: Adjust late loading result reporting messageAshok Raj <[email protected]>
x86/microcode: Check CPU capabilities after late microcode update correctlyAshok Raj <[email protected]>
x86/microcode: Add a parameter tomicrocode_check()to store CPU capabilitiesAshok Raj <[email protected]>
x86/microcode: Print previous version of microcode after reloadBorislav Petkov <[email protected]>
x86/microcode: Default-disable late loadingBorislav Petkov <[email protected]>
x86/microcode: Rip out theOLD_INTERFACEPeter Zijlstra <[email protected]>
x86: Markstop_this_cpu()__noreturnYang Yingliang <[email protected]>
powercap: fix possible name leak inpowercap_register_zone()Herbert Xu <[email protected]>
crypto: seqiv - Handle EBUSY correctlyHerbert Xu <[email protected]>
crypto: essiv - Handle EBUSY correctlyKoba Ko <[email protected]>
crypto: ccp - Failure on re-initialization due to duplicate sysfs filenameArmin Wolf <[email protected]>
ACPI: battery: Fix missing NUL-termination with large stringsShivani Baranwal <[email protected]>
wifi: cfg80211: Fix extended KCK key length check innl80211_set_rekey_data()Miaoqian Lin <[email protected]>
wifi: ath11k: Fix memory leak inath11k_peer_rx_frag_setupMinsuk Kang <[email protected]>
wifi: ath9k: Fix potential stack-out-of-bounds write inath9k_wmi_rsp_callback()Fedor Pchelkin <[email protected]>
wifi: ath9k:hif_usb: clean up skbs ifath9k_hif_usb_rx_stream()failsPavel Skripkin <[email protected]>
ath9k: htc: clean up statistics macrosWan Jiabing <[email protected]>
ath9k:hif_usb: simplify if-if to if-elseFedor Pchelkin <[email protected]>
wifi: ath9k:htc_hst: free skb inath9k_htc_rx_msg()if there is no callback functionAlexey Kodanev <[email protected]>
wifi: orinoco: check return value ofhermes_write_wordrec()Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix memory leaks with RTL8723BU, RTL8192EUDmitry Baryshkov <[email protected]>
thermal/drivers/tsens: limitnum_sensorsto 9 for msm8939Dmitry Baryshkov <[email protected]>
thermal/drivers/tsens: fix slope values for msm8939Dmitry Baryshkov <[email protected]>
thermal/drivers/tsens: Sort out msm8976 vs msm8956 dataDmitry Baryshkov <[email protected]>
thermal/drivers/tsens: Add compat string for the qcom,msm8960Dmitry Baryshkov <[email protected]>
thermal/drivers/tsens: Drop msm8976-specific definesDaniil Tatianin <[email protected]>
ACPICA: nsrepair: handle cases without a return value correctlyDavid Rientjes <[email protected]>
crypto: ccp - Avoid page allocation failure warning forSEV_GET_ID2Herbert Xu <[email protected]>
lib/mpi: Fix buffer overrun when SG is too longFrederic Weisbecker <[email protected]>
rcu-tasks: Fixsynchronize_rcu_tasks()VSzap_pid_ns_processes()Frederic Weisbecker <[email protected]>
rcu-tasks: Remove preemption disablement around srcu_read_[un]lock() callsFrederic Weisbecker <[email protected]>
rcu-tasks: Improve comments explainingtasks_rcu_exit_srcupurposeZhen Lei <[email protected]>
genirq: Fix the return type ofkstat_cpu_irqs_sum()Mario Limonciello <[email protected]>
ACPICA: Drop port I/O validation for some regionsEric Biggers <[email protected]>
crypto: x86/ghash - fix unaligned access inghash_setkey()Yang Yingliang <[email protected]>
wifi:wl3501_cs: don't callkfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi: libertas: cmdresp: don't callkfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi: libertas: main: don't callkfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi: libertas:if_usb: don't callkfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi:libertas_tf: don't callkfree_skb()underspin_lock_irqsave()Zhengchao Shao <[email protected]>
wifi: brcmfmac: unmap dma buffer inbrcmf_msgbuf_alloc_pktid()Zhang Changzhong <[email protected]>
wifi: brcmfmac: fix potential memory leak inbrcmf_netdev_start_xmit()Zhang Changzhong <[email protected]>
wifi: wilc1000: fix potential memory leak inwilc_mac_xmit()Zhengchao Shao <[email protected]>
wifi: ipw2200: fix memory leak inipw_wdev_init()Yang Yingliang <[email protected]>
wifi: ipw2x00: don't calldev_kfree_skb()underspin_lock_irqsave()Andrii Nakryiko <[email protected]>
libbpf: Fixbtf__align_of()by taking into account field offsetsLi Zetao <[email protected]>
wifi: rtlwifi: Fix global-out-of-bounds bug in_rtl8812ae_phy_set_txpower_limit()Yang Yingliang <[email protected]>
wifi: rtl8xxxu: don't calldev_kfree_skb()underspin_lock_irqsave()Zhengchao Shao <[email protected]>
wifi: libertas: fix memory leak inlbs_init_adapter()Yang Yingliang <[email protected]>
wifi: iwlegacy: common: don't calldev_kfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi: rtlwifi: rtl8723be: don't callkfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi: rtlwifi: rtl8188ee: don't callkfree_skb()underspin_lock_irqsave()Yang Yingliang <[email protected]>
wifi: rtlwifi: rtl8821ae: don't callkfree_skb()underspin_lock_irqsave()Yuan Can <[email protected]>
wifi: rsi: Fix memory leak inrsi_coex_attach()Martin K. Petersen <[email protected]>
block: bio-integrity: Copy flags whenbio_integrity_payloadis clonedKonrad Dybcio <[email protected]>
arm64: dts: qcom: pmk8350: Use the correct PON compatibleKonrad Dybcio <[email protected]>
arm64: dts: qcom: pmk8350: Specify PBS register for PONDenis Kenzior <[email protected]>
KEYS: asymmetric: Fix ECDSA use via keyctl uapisilviazhao <[email protected]>
x86/perf/zhaoxin: Add stepping check for ZXCPietro Borrello <[email protected]>
sched/rt:pick_next_rt_entity(): checklist_entryDietmar Eggemann <[email protected]>
sched/deadline,rt: Remove unused parameter from pick_next_[rt|dl]_entity()Qiheng Lin <[email protected]>
s390/dasd: Fix potential memleak indasd_eckd_init()Jamie Douglass <[email protected]>
arm64: dts: qcom: msm8992-lg-bullhead: Correct memory overlaps with the SMEM and MPSS memory regionsKemeng Shi <[email protected]>
blk-mq: correct stale comment of .get_budgetKemeng Shi <[email protected]>
blk-mq: remove stale comment forblk_mq_sched_mark_restart_hctxKemeng Shi <[email protected]>
blk-mq: avoid sleep inblk_mq_alloc_request_hctxAngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt7622: Add missing pwm-cells to pwm nodeAngeloGioacchino Del Regno <[email protected]>
arm64: dts: mt8192: Fix CPU map for single-cluster SoCPeng Fan <[email protected]>
ARM: dts: imx7s: correct iomuxc gpr mux controller cellsSamuel Holland <[email protected]>
ARM: dts: sun8i: nanopi-duo2: Fix regulator GPIO referenceChristian Hewitt <[email protected]>
arm64: dts: meson: bananapi-m5: switchVDDIO_Cpin toOPEN_DRAINAdam Ford <[email protected]>
arm64: dts: renesas: beacon-renesom: Fix gpio expander referenceWaiman Long <[email protected]>
locking/rwsem: Disable preemption in all down_read*() andup_read()code pathsMuchun Song <[email protected]>
locking/rwsem: Optimizedown_read_trylock()under highly contended caseNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-sm1-odroid-hc4: fix active fan thermal tripNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gxbb-kii-pro: fix led node nameNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gxl-s905d-phicomm-n1: fix led node nameNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-sm1-bananapi-m5: fix adc keys node namesNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gx-libretech-pc: fix update button nameNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gxl: add missing unit address to eth-phy-mux node nameNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gx: add missing unit address to rng node nameNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gxl-s905d-sml5442tw: drop invalid clock-names propertyNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gx: add missing SCPI sensors compatibleNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-axg: fix SCPI clock dvfs node nameNeil Armstrong <[email protected]>
arm64: dts: amlogic: meson-gx: fix SCPI clock dvfs node nameAngus Chen <[email protected]>
ARM: imx: Callida_simple_remove()forida_simple_getKrzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct wr-active property in Exynos3250 RinatoVaishnav Achath <[email protected]>
arm64: dts: ti: k3-j7200: Fix wakeup pinmux rangeArnd Bergmann <[email protected]>
ARM: s3c: fixs3c64xx_set_timer_sourceprototypeStefan Wahren <[email protected]>
ARM:bcm2835_defconfig: Enable the framebufferYang Yingliang <[email protected]>
ARM: OMAP1: callplatform_device_put()in error case inomap1_dm_timer_init()Christian Hewitt <[email protected]>
arm64: dts: meson: remove CPU opps below 1GHz for G12A boardsRobert Marko <[email protected]>
arm64: dts: qcom: ipq8074: correct PCIe QMP PHY output clock namesRobert Marko <[email protected]>
arm64: dts: qcom: ipq8074: fix Gen3 PCIe nodeRobert Marko <[email protected]>
arm64: dts: qcom: ipq8074: correct Gen2 PCIe rangesRobert Marko <[email protected]>
arm64: dts: qcom: ipq8074: fix Gen3 PCIe QMP PHYJohan Hovold <[email protected]>
arm64: dts: qcom: ipq8074: fix PCIe PHY serdes sizeShawn Guo <[email protected]>
arm64: dts: qcom: Fix IPQ8074 PCIe PHY nodesRobert Marko <[email protected]>
arm64: dts: qcom: ipq8074: correct USB3 QMP PHY-s clock output namesPetr Vorel <[email protected]>
arm64: dts: qcom: msm8992-bullhead: Disabledfps_data_memPetr Vorel <[email protected]>
arm64: dts: qcom: msm8992-bullhead: Fixcont_splash_memsizeDominik Kobinski <[email protected]>
arm64: dts: msm8992-bullhead: add memory hole regionMartin Blumenstingl <[email protected]>
arm64: dts: meson-gx: Fix the SCPI DVFS node name and unit addressMartin Blumenstingl <[email protected]>
arm64: dts: meson-g12a: Fix internal Ethernet PHY unit nameMartin Blumenstingl <[email protected]>
arm64: dts: meson-gx: Fix Ethernet MAC address unit nameKrzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7280: correct SPMI bus address cellsKrzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7180: correct SPMI bus address cellsKrzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-db845c: fix audio codec interrupt pin nameChen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8183: Fix systimer 13 MHz clock descriptionQiheng Lin <[email protected]>
ARM: zynq: Fix refcount leak inzynq_early_slcr_initMarek Vasut <[email protected]>
arm64: dts: imx8m: Align SoC unique ID node unit addressMarijn Suijten <[email protected]>
arm64: dts: qcom: sm6125: Reorder HSUSB PHY clocks to match bindingsMarijn Suijten <[email protected]>
arm64: dts: qcom: sm8150-kumano: Panel framebuffer is 2.5k instead of 4kKonrad Dybcio <[email protected]>
arm64: dts: qcom: msm8996-tone: Fix USB taking 6 minutes to wake upDmitry Baryshkov <[email protected]>
arm64: dts: qcom: qcs404: use symbol names for PCIe resetsChen Hui <[email protected]>
ARM: OMAP2+: Fix memory leak inrealtime_counter_init()Anders Roxell <[email protected]>
powerpc/mm: Rearrange if-else block to avoid clang warningPietro Borrello <[email protected]>
HID: asus: use spinlock to safely schedule workersPietro Borrello <[email protected]>
HID: asus: use spinlock to protect concurrent accesses-------------
Diffstat:
Documentation/admin-guide/cgroup-v1/memory.rst | 13 +- Documentation/admin-guide/hw-vuln/spectre.rst | 21 +- Documentation/admin-guide/kdump/gdbmacros.txt | 2 +- Documentation/dev-tools/gdb-kernel-debugging.rst | 4 + .../bindings/sound/amlogic,gx-sound-card.yaml | 2 +- Documentation/hwmon/ftsteutates.rst | 4 + Documentation/virt/kvm/api.rst | 18 +- Documentation/virt/kvm/devices/vm.rst | 4 + Makefile | 4 +- arch/alpha/boot/tools/objstrip.c | 2 +- arch/alpha/kernel/traps.c | 30 +- arch/arm/boot/dts/exynos3250-rinato.dts | 2 +- arch/arm/boot/dts/exynos4-cpu-thermal.dtsi | 2 +- arch/arm/boot/dts/exynos4.dtsi | 2 +- arch/arm/boot/dts/exynos4210.dtsi | 1 - arch/arm/boot/dts/exynos5250.dtsi | 2 +- arch/arm/boot/dts/exynos5410-odroidxu.dts | 1 - arch/arm/boot/dts/exynos5420.dtsi | 2 +- arch/arm/boot/dts/exynos5422-odroidhc1.dts | 10 +- arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 10 +- arch/arm/boot/dts/imx7s.dtsi | 2 +- arch/arm/boot/dts/qcom-sdx55.dtsi | 2 +- arch/arm/boot/dts/sun8i-h3-nanopi-duo2.dts | 2 +- arch/arm/configs/bcm2835_defconfig | 1 + arch/arm/mach-imx/mmdc.c | 24 +- arch/arm/mach-omap1/timer.c | 2 +- arch/arm/mach-omap2/timer.c | 1 + arch/arm/mach-s3c/s3c64xx.c | 3 +- arch/arm/mach-zynq/slcr.c | 1 + arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 +- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 20 -- .../boot/dts/amlogic/meson-gx-libretech-pc.dtsi | 2 +- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 +- arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts | 2 +- .../dts/amlogic/meson-gxl-s905d-phicomm-n1.dts | 2 +- .../boot/dts/amlogic/meson-gxl-s905d-sml5442tw.dts | 1 - arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 2 +- .../boot/dts/amlogic/meson-sm1-bananapi-m5.dts | 6 +- .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 10 +- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 +- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 1 + arch/arm64/boot/dts/mediatek/mt8183.dtsi | 12 +- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 11 +- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 93 ++++-- .../boot/dts/qcom/msm8992-bullhead-rev-101.dts | 18 +- .../boot/dts/qcom/msm8996-sony-xperia-tone.dtsi | 5 +- arch/arm64/boot/dts/qcom/pmk8350.dtsi | 5 +- arch/arm64/boot/dts/qcom/qcs404.dtsi | 12 +- arch/arm64/boot/dts/qcom/sc7180.dtsi | 4 +- arch/arm64/boot/dts/qcom/sc7280.dtsi | 4 +- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- arch/arm64/boot/dts/qcom/sm6125.dtsi | 6 +- .../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 7 +- .../boot/dts/renesas/beacon-renesom-baseboard.dtsi | 24 +- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 2 +- arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 29 +- arch/m68k/68000/entry.S | 2 + arch/m68k/Kconfig.devices | 1 + arch/m68k/coldfire/entry.S | 2 + arch/m68k/kernel/entry.S | 3 + arch/mips/boot/dts/ingenic/ci20.dts | 2 +- arch/mips/include/asm/syscall.h | 2 +- arch/powerpc/Makefile | 2 +- arch/powerpc/mm/book3s64/radix_tlb.c | 11 +- arch/riscv/Makefile | 6 +- arch/riscv/include/asm/ftrace.h | 50 ++- arch/riscv/include/asm/jump_label.h | 2 + arch/riscv/include/asm/pgtable.h | 2 +- arch/riscv/include/asm/thread_info.h | 1 + arch/riscv/kernel/ftrace.c | 65 ++-- arch/riscv/kernel/mcount-dyn.S | 42 +-- arch/riscv/kernel/time.c | 3 + arch/riscv/mm/fault.c | 10 +- arch/s390/boot/mem_detect.c | 2 +- arch/s390/include/asm/ap.h | 12 +- arch/s390/kernel/idle.c | 2 +- arch/s390/kernel/kprobes.c | 4 +- arch/s390/kernel/vdso32/Makefile | 2 +- arch/s390/kernel/vdso64/Makefile | 4 +- arch/s390/kernel/vmlinux.lds.S | 1 + arch/s390/kvm/kvm-s390.c | 17 + arch/s390/mm/extmem.c | 12 +- arch/s390/mm/vmem.c | 6 +- arch/sparc/Kconfig | 2 +- arch/x86/Kconfig | 15 +- arch/x86/crypto/ghash-clmulni-intel_glue.c | 6 +- arch/x86/events/zhaoxin/core.c | 8 +- arch/x86/include/asm/microcode.h | 4 +- arch/x86/include/asm/microcode_amd.h | 4 +- arch/x86/include/asm/msr-index.h | 4 + arch/x86/include/asm/processor.h | 5 +- arch/x86/include/asm/reboot.h | 2 + arch/x86/include/asm/virtext.h | 16 +- arch/x86/kernel/cpu/bugs.c | 35 ++- arch/x86/kernel/cpu/common.c | 47 ++- arch/x86/kernel/cpu/microcode/amd.c | 53 ++-- arch/x86/kernel/cpu/microcode/core.c | 134 ++------ arch/x86/kernel/crash.c | 17 +- arch/x86/kernel/kprobes/opt.c | 6 +- arch/x86/kernel/process.c | 2 +- arch/x86/kernel/reboot.c | 88 ++++-- arch/x86/kernel/smp.c | 6 +- arch/x86/kvm/lapic.c | 10 +- arch/x86/kvm/svm/sev.c | 4 +- arch/x86/kvm/svm/svm_onhyperv.h | 4 +- block/bio-integrity.c | 1 + block/blk-iocost.c | 11 +- block/blk-mq-sched.c | 7 +- block/blk-mq.c | 3 +- block/fops.c | 21 +- crypto/asymmetric_keys/public_key.c | 24 +- crypto/essiv.c | 7 +- crypto/rsa-pkcs1pad.c | 34 +- crypto/seqiv.c | 2 +- crypto/xts.c | 8 +- drivers/acpi/acpica/Makefile | 2 +- drivers/acpi/acpica/hwvalid.c | 7 +- drivers/acpi/acpica/nsrepair.c | 12 +- drivers/acpi/battery.c | 2 +- drivers/acpi/resource.c | 43 ++- drivers/acpi/video_detect.c | 2 +- drivers/base/core.c | 31 +- drivers/base/power/domain.c | 5 +- drivers/base/transport_class.c | 17 +- drivers/block/brd.c | 26 +- drivers/block/rbd.c | 20 +- drivers/bluetooth/btusb.c | 4 + drivers/bluetooth/hci_qca.c | 7 +- drivers/char/applicom.c | 5 +- drivers/char/ipmi/ipmi_ssif.c | 74 ++--- drivers/char/pcmcia/cm4000_cs.c | 6 +- drivers/crypto/amcc/crypto4xx_core.c | 10 +- drivers/crypto/ccp/ccp-dmaengine.c | 21 +- drivers/crypto/ccp/sev-dev.c | 33 +- drivers/crypto/hisilicon/sgl.c | 3 +- drivers/crypto/qat/qat_common/qat_algs.c | 2 +- drivers/dax/bus.c | 2 +- drivers/dax/kmem.c | 4 +- drivers/dma/Kconfig | 2 +- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 - drivers/dma/dw-edma/dw-edma-core.c | 4 + drivers/dma/dw-edma/dw-edma-v0-core.c | 2 +- drivers/dma/idxd/device.c | 2 +- drivers/dma/idxd/init.c | 2 +- drivers/dma/idxd/sysfs.c | 4 +- drivers/dma/sf-pdma/sf-pdma.c | 3 +- drivers/dma/sf-pdma/sf-pdma.h | 1 - drivers/firmware/dmi-sysfs.c | 10 +- drivers/firmware/google/framebuffer-coreboot.c | 4 +- drivers/firmware/stratix10-svc.c | 16 +- drivers/gpio/gpio-vf610.c | 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 - drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 14 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 1 - .../amd/display/dc/dml/dcn20/display_mode_vba_20.c | 8 +- .../display/dc/dml/dcn20/display_mode_vba_20v2.c | 10 +- .../amd/display/dc/dml/dcn21/display_mode_vba_21.c | 12 +- drivers/gpu/drm/bridge/lontium-lt9611.c | 65 ++-- .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 6 +- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 + drivers/gpu/drm/drm_edid.c | 21 +- drivers/gpu/drm/drm_fourcc.c | 4 + drivers/gpu/drm/drm_gem_shmem_helper.c | 52 ++-- drivers/gpu/drm/drm_mipi_dsi.c | 52 ++++ drivers/gpu/drm/drm_mode_config.c | 8 +- drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 +- drivers/gpu/drm/i915/display/intel_quirks.c | 2 + drivers/gpu/drm/i915/gt/intel_ring.c | 4 +- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 + drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + drivers/gpu/drm/mediatek/mtk_drm_gem.c | 4 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 4 +- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 15 +- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 + drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 5 +- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 4 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 + drivers/gpu/drm/msm/hdmi/hdmi.c | 4 + drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_fence.c | 2 +- drivers/gpu/drm/msm/msm_gem_submit.c | 4 + drivers/gpu/drm/mxsfb/Kconfig | 1 + drivers/gpu/drm/omapdrm/dss/dsi.c | 26 +- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 4 +- drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 3 +- drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 2 - drivers/gpu/drm/radeon/atombios_encoders.c | 5 +- drivers/gpu/drm/radeon/radeon_device.c | 1 + drivers/gpu/drm/tegra/firewall.c | 3 + drivers/gpu/drm/tidss/tidss_dispc.c | 4 +- drivers/gpu/drm/tiny/ili9486.c | 13 +- drivers/gpu/drm/vc4/vc4_dpi.c | 66 ++-- drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +- drivers/gpu/drm/vc4/vc4_hvs.c | 11 + drivers/gpu/drm/vc4/vc4_plane.c | 2 + drivers/gpu/drm/vc4/vc4_regs.h | 6 + drivers/gpu/drm/vkms/vkms_drv.c | 10 +- drivers/gpu/host1x/hw/syncpt_hw.c | 3 - drivers/gpu/ipu-v3/ipu-common.c | 1 + drivers/hid/hid-asus.c | 37 ++- drivers/hid/hid-bigbenff.c | 75 ++++- drivers/hid/hid-debug.c | 1 + drivers/hid/hid-input.c | 8 + drivers/hid/hid-logitech-hidpp.c | 32 +- drivers/hid/hid-multitouch.c | 39 ++- drivers/hid/hid-quirks.c | 2 +- drivers/hid/i2c-hid/i2c-hid-core.c | 6 +- drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 42 +++ drivers/hid/i2c-hid/i2c-hid.h | 3 + drivers/hwmon/coretemp.c | 128 ++++---- drivers/hwmon/ftsteutates.c | 19 +- drivers/hwmon/ltc2945.c | 2 + drivers/hwmon/mlxreg-fan.c | 6 + drivers/hwtracing/coresight/coresight-cti-core.c | 11 +- drivers/hwtracing/coresight/coresight-cti-sysfs.c | 13 +- drivers/hwtracing/coresight/coresight-etm4x-core.c | 18 +- drivers/i2c/busses/i2c-designware-common.c | 2 +- drivers/i2c/busses/i2c-designware-core.h | 2 +- drivers/iio/light/tsl2563.c | 8 +- drivers/infiniband/hw/cxgb4/cm.c | 7 + drivers/infiniband/hw/cxgb4/restrack.c | 2 +- drivers/infiniband/hw/hfi1/sdma.c | 4 +- drivers/infiniband/hw/hfi1/sdma.h | 15 +- drivers/infiniband/hw/hfi1/user_pages.c | 61 ++-- drivers/infiniband/hw/irdma/hw.c | 2 + drivers/infiniband/sw/siw/siw_mem.c | 23 +- drivers/iommu/intel/cap_audit.c | 13 + drivers/iommu/intel/cap_audit.h | 1 + drivers/iommu/intel/iommu.c | 50 ++- drivers/iommu/intel/pasid.c | 11 + drivers/iommu/iommu.c | 8 +- drivers/irqchip/irq-alpine-msi.c | 1 + drivers/irqchip/irq-bcm7120-l2.c | 3 +- drivers/irqchip/irq-brcmstb-l2.c | 6 +- drivers/irqchip/irq-mvebu-gicp.c | 1 + drivers/irqchip/irq-ti-sci-intr.c | 1 + drivers/irqchip/irqchip.c | 8 +- drivers/leds/led-class.c | 6 +- drivers/md/dm-cache-target.c | 4 + drivers/md/dm-flakey.c | 31 +- drivers/md/dm-ioctl.c | 13 +- drivers/md/dm-thin.c | 2 + drivers/md/dm.c | 29 +- drivers/md/dm.h | 2 +- drivers/media/i2c/imx219.c | 255 +++++++-------- drivers/media/i2c/max9286.c | 1 + drivers/media/i2c/ov2740.c | 4 +- drivers/media/i2c/ov5675.c | 4 +- drivers/media/i2c/ov7670.c | 2 +- drivers/media/i2c/ov772x.c | 3 +- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 + drivers/media/pci/saa7134/saa7134-core.c | 2 +- drivers/media/platform/imx-jpeg/mxc-jpeg.c | 35 +-- drivers/media/platform/imx-jpeg/mxc-jpeg.h | 4 +- drivers/media/platform/omap3isp/isp.c | 9 + drivers/media/platform/ti-vpe/cal.c | 4 +- drivers/media/rc/ene_ir.c | 3 +- drivers/media/usb/siano/smsusb.c | 1 + drivers/media/usb/uvc/uvc_ctrl.c | 250 ++++++++++++--- drivers/media/usb/uvc/uvc_driver.c | 8 +- drivers/media/usb/uvc/uvc_v4l2.c | 90 ++---- drivers/media/usb/uvc/uvcvideo.h | 6 +- drivers/media/v4l2-core/v4l2-jpeg.c | 4 +- drivers/mfd/Kconfig | 1 + drivers/mfd/pcf50633-adc.c | 7 +- drivers/misc/eeprom/idt_89hpesx.c | 10 +- drivers/misc/mei/hdcp/mei_hdcp.c | 4 +- drivers/misc/vmw_vmci/vmci_host.c | 2 + drivers/mtd/spi-nor/core.c | 9 + drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/sfdp.c | 6 +- drivers/mtd/spi-nor/spansion.c | 9 +- drivers/net/can/usb/esd_usb2.c | 4 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 + drivers/net/ethernet/broadcom/genet/bcmmii.c | 11 +- drivers/net/ethernet/intel/ice/ice_main.c | 17 +- drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- .../ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 2 +- .../net/ethernet/mellanox/mlx5/core/pagealloc.c | 3 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 11 +- drivers/net/hyperv/netvsc.c | 18 ++ drivers/net/tap.c | 2 +- drivers/net/tun.c | 2 +- drivers/net/wireless/ath/ath11k/core.h | 1 - drivers/net/wireless/ath/ath11k/debugfs.c | 48 ++- drivers/net/wireless/ath/ath11k/dp_rx.c | 1 + drivers/net/wireless/ath/ath11k/pci.c | 2 +- drivers/net/wireless/ath/ath9k/hif_usb.c | 62 ++-- drivers/net/wireless/ath/ath9k/htc.h | 32 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 + drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 10 +- drivers/net/wireless/ath/ath9k/htc_hst.c | 4 +- drivers/net/wireless/ath/ath9k/wmi.c | 1 + .../wireless/broadcom/brcm80211/brcmfmac/common.c | 7 +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 1 + .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 5 +- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 11 +- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 16 +- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 12 +- drivers/net/wireless/intel/iwlegacy/common.c | 4 +- drivers/net/wireless/intersil/orinoco/hw.c | 2 + drivers/net/wireless/marvell/libertas/cmdresp.c | 2 +- drivers/net/wireless/marvell/libertas/if_usb.c | 2 +- drivers/net/wireless/marvell/libertas/main.c | 3 +- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 2 +- drivers/net/wireless/marvell/mwifiex/11n.c | 6 +- drivers/net/wireless/mediatek/mt76/dma.c | 13 +- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/regs.h | 1 + drivers/net/wireless/mediatek/mt7601u/dma.c | 3 +- drivers/net/wireless/microchip/wilc1000/netdev.c | 1 + .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 5 + .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 19 +- .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 6 +- .../net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 6 +- .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 6 +- .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 52 ++-- drivers/net/wireless/rsi/rsi_91x_coex.c | 1 + drivers/net/wireless/wl3501_cs.c | 2 +- drivers/opp/debugfs.c | 2 +- drivers/pci/iov.c | 2 +- drivers/pci/pci.c | 2 +- drivers/pci/pci.h | 43 +-- drivers/pci/quirks.c | 1 + drivers/pci/switch/switchtec.c | 9 +- drivers/phy/rockchip/phy-rockchip-typec.c | 4 +- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 - drivers/pinctrl/mediatek/pinctrl-paris.c | 12 +- drivers/pinctrl/pinctrl-at91-pio4.c | 4 +- drivers/pinctrl/pinctrl-at91.c | 2 +- drivers/pinctrl/pinctrl-rockchip.c | 1 + drivers/pinctrl/qcom/pinctrl-msm8976.c | 8 +- drivers/pinctrl/stm32/pinctrl-stm32.c | 1 + drivers/power/supply/power_supply_core.c | 97 ------ drivers/powercap/powercap_sys.c | 14 +- drivers/regulator/max77802-regulator.c | 34 +- drivers/regulator/s5m8767.c | 6 +- drivers/remoteproc/mtk_scp_ipi.c | 11 +- drivers/remoteproc/qcom_q6v5_mss.c | 59 +++- drivers/rpmsg/qcom_glink_native.c | 1 + drivers/rtc/rtc-pm8xxx.c | 24 +- drivers/s390/block/dasd_eckd.c | 4 +- drivers/scsi/aic94xx/aic94xx_task.c | 3 + drivers/scsi/hosts.c | 2 + drivers/scsi/lpfc/lpfc_sli.c | 19 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 3 + drivers/scsi/qla2xxx/qla_bsg.c | 9 +- drivers/scsi/qla2xxx/qla_def.h | 6 +- drivers/scsi/qla2xxx/qla_dfs.c | 10 +- drivers/scsi/qla2xxx/qla_edif.c | 8 + drivers/scsi/qla2xxx/qla_init.c | 14 +- drivers/scsi/qla2xxx/qla_inline.h | 55 +++- drivers/scsi/qla2xxx/qla_iocb.c | 95 +++++- drivers/scsi/qla2xxx/qla_isr.c | 6 +- drivers/scsi/qla2xxx/qla_nvme.c | 34 +- drivers/scsi/qla2xxx/qla_os.c | 9 +- drivers/scsi/ses.c | 64 +++- drivers/scsi/snic/snic_debugfs.c | 4 +- drivers/soundwire/cadence_master.c | 3 +- drivers/spi/Kconfig | 1 - drivers/spi/spi-bcm63xx-hsspi.c | 14 +- drivers/spi/spi-synquacer.c | 7 +- drivers/thermal/hisi_thermal.c | 4 - drivers/thermal/intel/intel_pch_thermal.c | 8 + drivers/thermal/intel/intel_powerclamp.c | 20 +- drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +- drivers/thermal/qcom/tsens-v0_1.c | 28 +- drivers/thermal/qcom/tsens-v1.c | 61 ++-- drivers/thermal/qcom/tsens.c | 6 + drivers/thermal/qcom/tsens.h | 2 +- drivers/tty/serial/fsl_lpuart.c | 19 +- drivers/tty/serial/imx.c | 69 ++++- drivers/tty/serial/qcom_geni_serial.c | 2 + drivers/tty/serial/serial-tegra.c | 7 +- drivers/usb/early/xhci-dbc.c | 3 +- drivers/usb/gadget/configfs.c | 44 +-- drivers/usb/gadget/udc/fotg210-udc.c | 16 + drivers/usb/gadget/udc/fusb300_udc.c | 10 +- drivers/usb/host/max3421-hcd.c | 2 +- drivers/usb/musb/mediatek.c | 3 +- drivers/usb/typec/mux/intel_pmc_mux.c | 15 +- drivers/vfio/vfio_iommu_type1.c | 99 ++++-- drivers/video/fbdev/core/fbcon.c | 17 +- fs/btrfs/discard.c | 41 ++- fs/ceph/file.c | 8 + fs/cifs/smb2ops.c | 13 +- fs/cifs/smbdirect.c | 4 +- fs/coda/upcall.c | 2 +- fs/dlm/midcomms.c | 45 +-- fs/exfat/dir.c | 7 +- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 3 +- fs/exfat/inode.c | 6 +- fs/exfat/namei.c | 2 +- fs/exfat/super.c | 3 +- fs/ext4/namei.c | 11 +- fs/ext4/xattr.c | 35 ++- fs/f2fs/data.c | 6 +- fs/f2fs/inline.c | 13 +- fs/fuse/ioctl.c | 6 + fs/gfs2/aops.c | 3 +- fs/gfs2/super.c | 8 +- fs/hfs/bnode.c | 1 + fs/hfsplus/super.c | 4 +- fs/jbd2/transaction.c | 50 +-- fs/ksmbd/smb2misc.c | 31 +- fs/nfs/file.c | 15 +- fs/nfs/nfs4_fs.h | 1 + fs/nfs/nfs4proc.c | 22 ++ fs/nfs/nfs4state.c | 40 ++- fs/nfs/nfs4trace.h | 42 +-- fs/nfsd/nfs4layouts.c | 4 +- fs/nfsd/nfs4proc.c | 2 + fs/ocfs2/move_extents.c | 34 +- fs/udf/file.c | 26 +- fs/udf/inode.c | 74 ++--- fs/udf/super.c | 1 + fs/udf/udf_i.h | 3 +- fs/udf/udf_sb.h | 2 + include/drm/drm_mipi_dsi.h | 4 + include/linux/acpi.h | 1 + include/linux/device.h | 1 + include/linux/hid.h | 1 + include/linux/ima.h | 6 +- include/linux/intel-iommu.h | 3 - include/linux/kernel_stat.h | 2 +- include/linux/kobject.h | 2 +- include/linux/kprobes.h | 2 + include/linux/nfs_xdr.h | 2 + include/linux/rcupdate.h | 11 +- include/linux/transport_class.h | 8 +- include/linux/uaccess.h | 4 + include/net/sock.h | 7 +- include/sound/soc-dapm.h | 1 + io_uring/io_uring.c | 41 ++- kernel/bpf/btf.c | 13 +- kernel/irq/irqdomain.c | 153 +++++---- kernel/kprobes.c | 6 +- kernel/locking/rwsem.c | 60 ++-- kernel/pid_namespace.c | 17 + kernel/power/energy_model.c | 5 +- kernel/rcu/tasks.h | 64 ++-- kernel/rcu/tree_exp.h | 2 + kernel/resource.c | 14 - kernel/sched/deadline.c | 5 +- kernel/sched/rt.c | 10 +- kernel/time/clocksource.c | 45 ++- kernel/time/hrtimer.c | 2 + kernel/time/posix-stubs.c | 2 + kernel/time/posix-timers.c | 2 + kernel/time/test_udelay.c | 2 +- kernel/trace/blktrace.c | 4 +- kernel/trace/ring_buffer.c | 42 +-- lib/errname.c | 22 +- lib/kobject.c | 20 +- lib/mpi/mpicoder.c | 3 +- mm/huge_memory.c | 3 + mm/memcontrol.c | 4 + net/bluetooth/l2cap_core.c | 24 -- net/bluetooth/l2cap_sock.c | 8 + net/core/scm.c | 2 + net/core/sock.c | 15 +- net/ipv4/inet_hashtables.c | 12 +- net/l2tp/l2tp_ppp.c | 125 ++++---- net/mac80211/sta_info.c | 2 +- net/netfilter/nf_tables_api.c | 3 + net/rds/message.c | 2 +- net/sunrpc/clnt.c | 4 + net/wireless/nl80211.c | 2 +- net/wireless/sme.c | 31 +- scripts/package/mkdebian | 2 +- security/integrity/ima/ima_main.c | 7 +- security/security.c | 7 +- sound/pci/hda/patch_ca0132.c | 2 +- sound/pci/hda/patch_realtek.c | 1 + sound/pci/ice1712/aureon.c | 2 +- sound/soc/atmel/mchp-spdifrx.c | 342 ++++++++++++++------- sound/soc/codecs/lpass-rx-macro.c | 100 ++++-- sound/soc/codecs/lpass-tx-macro.c | 104 +++++-- sound/soc/codecs/lpass-va-macro.c | 2 +- sound/soc/codecs/tlv320adcx140.c | 2 +- sound/soc/fsl/fsl_sai.c | 35 ++- sound/soc/fsl/fsl_sai.h | 2 +- sound/soc/kirkwood/kirkwood-dma.c | 2 +- sound/soc/sh/rcar/rsnd.h | 4 +- sound/soc/soc-compress.c | 11 +- tools/bootconfig/scripts/ftrace2bconf.sh | 2 +- tools/bpf/bpftool/prog.c | 38 ++- tools/lib/bpf/btf.c | 13 + tools/lib/bpf/nlattr.c | 2 +- tools/objtool/check.c | 3 + tools/perf/Documentation/perf-intel-pt.txt | 229 +++++++++++++- tools/perf/builtin-inject.c | 6 +- tools/perf/perf-completion.sh | 11 +- tools/perf/util/auxtrace.c | 3 + .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 99 +++++- .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 1 + .../util/intel-pt-decoder/intel-pt-insn-decoder.c | 1 + .../util/intel-pt-decoder/intel-pt-insn-decoder.h | 1 + tools/perf/util/intel-pt.c | 43 ++- tools/perf/util/llvm-utils.c | 25 +- tools/power/x86/intel-speed-select/isst-config.c | 2 +- tools/testing/ktest/ktest.pl | 26 +- tools/testing/ktest/sample.conf | 5 + tools/testing/selftests/bpf/Makefile | 2 - .../selftests/drivers/net/netdevsim/devlink.sh | 18 ++ .../ftrace/test.d/ftrace/func_event_triggers.tc | 2 +- tools/testing/selftests/landlock/fs_test.c | 47 +++ tools/testing/selftests/landlock/ptrace_test.c | 113 ++++++- tools/testing/selftests/net/fib_tests.sh | 2 + tools/testing/selftests/net/udpgso_bench_rx.c | 6 +- virt/kvm/coalesced_mmio.c | 8 +- 521 files changed, 5196 insertions(+), 2849 deletions(-)
Quoted 14 lines · Harshit Mogalapalli
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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.
While trying to build 5.15.99-rc1 with
* make -Ctools/perfallThe following build errors are seen.
util/intel-pt-decoder/intel-pt-decoder.c: In function 'intel_pt_eptw_lookahead_cb':util/intel-pt-decoder/intel-pt-decoder.c:1445:14: error: 'INTEL_PT_CFE'
[...]
Quoted 3 lines
[PATCH 5.15 264/567] perf intel-pt: Add support for emulated ptwrite is causing this error.
In addition, cherry-picking this fixes the build (but we haven't done a full test with it):
commit 2750af50a360b52c6df1f5652ae728878bececc0
Author: Adrian Hunter <[email protected]> Date: Mon Jan 24 10:41:39 2022 +0200
perf intel-pt: pkt-decoder: Add CFE and EVD packets
Greg: Do you prefer this kind of error report go to the 0/N email (like in this case) or to the specific problematic patch email if we've already identified it?
Thanks,
Vegard
Greg Kroah-Hartman
maintainerQuoted 26 lines · Vegard Nossum
Quoted 15 lines · Harshit Mogalapalli
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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.
While trying to build 5.15.99-rc1 with
* make -Ctools/perfallThe following build errors are seen.
util/intel-pt-decoder/intel-pt-decoder.c: In function 'intel_pt_eptw_lookahead_cb':util/intel-pt-decoder/intel-pt-decoder.c:1445:14: error: 'INTEL_PT_CFE'[...]
Quoted 3 lines
[PATCH 5.15 264/567] perf intel-pt: Add support for emulated ptwrite is causing this error.
In addition, cherry-picking this fixes the build (but we haven't done a full test with it):
commit
2750af50a360b52c6df1f5652ae728878bececc0
Quoted 8 lines
Author: Adrian Hunter <[email protected]> Date: Mon Jan 24 10:41:39 2022 +0200perf intel-pt: pkt-decoder: Add CFE and EVD packets
Greg: Do you prefer this kind of error report go to the 0/N email (like in this case) or to the specific problematic patch email if we've already identified it?
Either works for me, I'll go queue this up now, thanks!
greg k-h
Hello!
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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 Thu, 09 Mar 2023 16:57:34 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.99-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
We see Perf failing to compile on: arm, arm64, i386, x86_64, under OpenEmbedded (GCC 11.3) when building for the following machines:
* Dragonboard 410c (arm64)
* Dragonboard 845c (arm64)
* Juno (arm64)
* X15 (arm)
* intel-core2-32 (i386)
* intel-corei7-64 (x86_64)
Error:
-----8<-----util/intel-pt-decoder/intel-pt-decoder.c: In function 'intel_pt_eptw_lookahead_cb':util/intel-pt-decoder/intel-pt-decoder.c:1445:7: error: 'INTEL_PT_CFE' undeclared (first use in this function); did you mean 'INTEL_PT_CBR'?
1445 | case INTEL_PT_CFE:
| ^~~~~~~~~~~~
| INTEL_PT_CBR
util/intel-pt-decoder/intel-pt-decoder.c:1445:7: note: each undeclared identifier is reported only once for each function it appears in
util/intel-pt-decoder/intel-pt-decoder.c:1446:7: error: 'INTEL_PT_CFE_IP' undeclared (first use in this function); did you mean 'INTEL_PT_BEP_IP'?
1446 | case INTEL_PT_CFE_IP:
| ^~~~~~~~~~~~~~~
| INTEL_PT_BEP_IP
util/intel-pt-decoder/intel-pt-decoder.c:1447:7: error: 'INTEL_PT_EVD' undeclared (first use in this function); did you mean 'INTEL_PT_OVF'?
1447 | case INTEL_PT_EVD:
| ^~~~~~~~~~~~
| INTEL_PT_OVF----->8-----
Additionally, we see this same problem outside of OpenEmbedded but only on arm (32-bits), because in all other cases it fails to build at an earlier point with the already reported problem of init_disassemble_info() [1][2], so it's very likely to be there too on all architectures.
[1] https://lore.kernel.org/all/CAEUSe7-vBpHrbEy+eQrNZ_LTeqHpn2eQEr3C7cmfNYjK1YL4Ww@mail.gmail.com/
[2] https://lore.kernel.org/all/[email protected]/
Greetings!
Daniel Díaz
[email protected]
Greg Kroah-Hartman
maintainerQuoted 45 lines · Daniel Díaz
Hello!
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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 Thu, 09 Mar 2023 16:57:34 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.99-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
We see Perf failing to compile on: arm, arm64, i386,
x86_64, under OpenEmbedded (GCC 11.3) when building for the following machines:
* Dragonboard 410c (arm64)
* Dragonboard 845c (arm64)
* Juno (arm64)
* X15 (arm)
* intel-core2-32 (i386)
* intel-corei7-64 (x86_64)Error:
-----8<-----util/intel-pt-decoder/intel-pt-decoder.c: In function 'intel_pt_eptw_lookahead_cb':util/intel-pt-decoder/intel-pt-decoder.c:1445:7: error: 'INTEL_PT_CFE' undeclared (first use in this function); did you mean 'INTEL_PT_CBR'?1445 | case INTEL_PT_CFE: | ^~~~~~~~~~~~ | INTEL_PT_CBR util/intel-pt-decoder/intel-pt-decoder.c:1445:7: note: each undeclared identifier is reported only once for each function it appears in util/intel-pt-decoder/intel-pt-decoder.c:1446:7: error: 'INTEL_PT_CFE_IP' undeclared (first use in this function); did you mean 'INTEL_PT_BEP_IP'? 1446 | case INTEL_PT_CFE_IP: | ^~~~~~~~~~~~~~~ | INTEL_PT_BEP_IP util/intel-pt-decoder/intel-pt-decoder.c:1447:7: error: 'INTEL_PT_EVD' undeclared (first use in this function); did you mean 'INTEL_PT_OVF'? 1447 | case INTEL_PT_EVD: | ^~~~~~~~~~~~ | INTEL_PT_OVF
Quoted 1 line
----->8-----
Should now be fixed.
thanks,
greg k-h
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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.
Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0) and powerpc (ps3_defconfig, GCC 12.2.0).
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Hello!
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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 Thu, 09 Mar 2023 16:57:34 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.99-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
A new warning has been introduced on x86_64; we've seen it with GCC 8, 11, 12, and Clang 16.
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x54: unreachable instruction
Bisection pointed towards "x86: Mark stop_this_cpu() __noreturn" (upstream commit f9cdf7ca57cada055f61ef6d0eb4db21c3f200db). Reverting this commit did remove the warning.
Reproducer:
tuxmake \
--runtime podman \
--target-arch x86_64 \
--toolchain gcc-11 \
--kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2MhGKYH63pYIllJIDAxH3FsvakK/configGreetings!
Daniel Díaz
[email protected]
Quoted 26 lines · Daniel Díaz
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.99 release. There are 567 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.
Quoted 8 lines
Responses should be made by Thu, 09 Mar 2023 16:57:34 +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/v5.x/stable-review/patch-5.15.99-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-5.15.y and the diffstat can be found below.A new warning has been introduced on
x86_64; we've seen it with GCC 8, 11, 12, and Clang 16.
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x54:
unreachable instructionBisection pointed towards "x86: Mark
stop_this_cpu()__noreturn" (upstream commitf9cdf7ca57cada055f61ef6d0eb4db21c3f200db). Reverting this commit did remove the warning.
Quoted 8 lines
Reproducer:
tuxmake \
--runtime podman \
--target-archx86_64\
--toolchain gcc-11 \
--kconfig
https://storage.tuxsuite.com/public/linaro/lkft/builds/2MhGKYH63pYIllJIDAxH3FsvakK/config
FWIW, thee is another report about it here:
https://bugzilla.kernel.org/show_bug.cgi?id=217175
CCing the reporter
This is definitely not my area of expertise, so you might better want to ignore the the following: I did some quick searching and now wonder if backporting be0075951fde ("x86: Annotate call_on_stack()") might fix the warning; it already was backported to 5.15 afaics:
https://lore.kernel.org/all/[email protected]/
Ciao, Thorsten