Hi,
A problem exists where dGPUs with type-C ports are considered power
supplies that power the system.
This leads to poor performance of the dGPU because graphics drivers like
amdgpu use power_supply_is_system_supplied() to decide how to configure
the dGPU.
This has been fixed in 6.5-rc1 by marking dGPUs as "DEVICE".
The logic to fix what to do when DEVICE is encountered was fixed in
6.4-rc4 and already backported to stable:
95339f40a8b6 ("power: supply: Fix logic checking if system is running
from battery")
So to wrap up the fix in stable kernels can you please backport:
6.4.y:
a7fbfd44c020 ("usb: typec: ucsi: Mark dGPUs as DEVICE scope")
6.1.y:
f510b0a3565b ("i2c: nvidia-gpu: Add ACPI property to align with
device-tree")
430b38764fbb ("i2c: nvidia-gpu: Remove ccgx,firmware-build property")
a7fbfd44c020 ("usb: typec: ucsi: Mark dGPUs as DEVICE scope")
Thanks!
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x 36ce9d76b0a93bae799e27e4f5ac35478c676592
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071640-facedown-shrine-ada1@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..
Possible dependencies:
36ce9d76b0a9 ("shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs")
d7167b149943 ("fs_parse: fold fs_parameter_desc/fs_parameter_spec")
96cafb9ccb15 ("fs_parser: remove fs_parameter_description name field")
cc3c0b533ab9 ("add prefix to fs_context->log")
c80c98f0dc5d ("ceph_parse_param(), ceph_parse_mon_ips(): switch to passing fc_log")
7f5d38141e30 ("new primitive: __fs_parse()")
2c3f3dc31556 ("switch rbd and libceph to p_log-based primitives")
3fbb8d5554a1 ("struct p_log, variants of warnf() et.al. taking that one instead")
9f09f649ca33 ("teach logfc() to handle prefices, give it saner calling conventions")
5eede625297f ("fold struct fs_parameter_enum into struct constant_table")
2710c957a8ef ("fs_parse: get rid of ->enums")
0f89589a8c6f ("Pass consistent param->type to fs_parse()")
f2aedb713c28 ("NFS: Add fs_context support.")
e38bb238ed8c ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
e558100fda7e ("NFS: Do some tidying of the parsing code")
48be8a66cf98 ("NFS: Add a small buffer in nfs_fs_context to avoid string dup")
cbd071b5daa0 ("NFS: Deindent nfs_fs_context_parse_option()")
f8ee01e3e2c8 ("NFS: Split nfs_parse_mount_options()")
5eb005caf538 ("NFS: Rename struct nfs_parsed_mount_data to struct nfs_fs_context")
e0a626b12474 ("NFS: Constify mount argument match tables")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 36ce9d76b0a93bae799e27e4f5ac35478c676592 Mon Sep 17 00:00:00 2001
From: Roberto Sassu <roberto.sassu(a)huawei.com>
Date: Wed, 7 Jun 2023 18:15:23 +0200
Subject: [PATCH] shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based
tmpfs
As the ramfs-based tmpfs uses ramfs_init_fs_context() for the
init_fs_context method, which allocates fc->s_fs_info, use ramfs_kill_sb()
to free it and avoid a memory leak.
Link: https://lkml.kernel.org/r/20230607161523.2876433-1-roberto.sassu@huaweiclou…
Fixes: c3b1b1cbf002 ("ramfs: add support for "mode=" mount option")
Signed-off-by: Roberto Sassu <roberto.sassu(a)huawei.com>
Cc: Hugh Dickins <hughd(a)google.com>
Cc: David Howells <dhowells(a)redhat.com>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 5ba580c78835..fef477c78107 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -278,7 +278,7 @@ int ramfs_init_fs_context(struct fs_context *fc)
return 0;
}
-static void ramfs_kill_sb(struct super_block *sb)
+void ramfs_kill_sb(struct super_block *sb)
{
kfree(sb->s_fs_info);
kill_litter_super(sb);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 917528d102c4..d506dc63dd47 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -7,6 +7,7 @@
struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
umode_t mode, dev_t dev);
extern int ramfs_init_fs_context(struct fs_context *fc);
+extern void ramfs_kill_sb(struct super_block *sb);
#ifdef CONFIG_MMU
static inline int
diff --git a/mm/shmem.c b/mm/shmem.c
index 5e54ab5f61f2..c606ab89693a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4199,7 +4199,7 @@ static struct file_system_type shmem_fs_type = {
.name = "tmpfs",
.init_fs_context = ramfs_init_fs_context,
.parameters = ramfs_fs_parameters,
- .kill_sb = kill_litter_super,
+ .kill_sb = ramfs_kill_sb,
.fs_flags = FS_USERNS_MOUNT,
};
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 36ce9d76b0a93bae799e27e4f5ac35478c676592
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071639-deeply-cuddly-0824@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
36ce9d76b0a9 ("shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs")
d7167b149943 ("fs_parse: fold fs_parameter_desc/fs_parameter_spec")
96cafb9ccb15 ("fs_parser: remove fs_parameter_description name field")
cc3c0b533ab9 ("add prefix to fs_context->log")
c80c98f0dc5d ("ceph_parse_param(), ceph_parse_mon_ips(): switch to passing fc_log")
7f5d38141e30 ("new primitive: __fs_parse()")
2c3f3dc31556 ("switch rbd and libceph to p_log-based primitives")
3fbb8d5554a1 ("struct p_log, variants of warnf() et.al. taking that one instead")
9f09f649ca33 ("teach logfc() to handle prefices, give it saner calling conventions")
5eede625297f ("fold struct fs_parameter_enum into struct constant_table")
2710c957a8ef ("fs_parse: get rid of ->enums")
0f89589a8c6f ("Pass consistent param->type to fs_parse()")
f2aedb713c28 ("NFS: Add fs_context support.")
e38bb238ed8c ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
e558100fda7e ("NFS: Do some tidying of the parsing code")
48be8a66cf98 ("NFS: Add a small buffer in nfs_fs_context to avoid string dup")
cbd071b5daa0 ("NFS: Deindent nfs_fs_context_parse_option()")
f8ee01e3e2c8 ("NFS: Split nfs_parse_mount_options()")
5eb005caf538 ("NFS: Rename struct nfs_parsed_mount_data to struct nfs_fs_context")
e0a626b12474 ("NFS: Constify mount argument match tables")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 36ce9d76b0a93bae799e27e4f5ac35478c676592 Mon Sep 17 00:00:00 2001
From: Roberto Sassu <roberto.sassu(a)huawei.com>
Date: Wed, 7 Jun 2023 18:15:23 +0200
Subject: [PATCH] shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based
tmpfs
As the ramfs-based tmpfs uses ramfs_init_fs_context() for the
init_fs_context method, which allocates fc->s_fs_info, use ramfs_kill_sb()
to free it and avoid a memory leak.
Link: https://lkml.kernel.org/r/20230607161523.2876433-1-roberto.sassu@huaweiclou…
Fixes: c3b1b1cbf002 ("ramfs: add support for "mode=" mount option")
Signed-off-by: Roberto Sassu <roberto.sassu(a)huawei.com>
Cc: Hugh Dickins <hughd(a)google.com>
Cc: David Howells <dhowells(a)redhat.com>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 5ba580c78835..fef477c78107 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -278,7 +278,7 @@ int ramfs_init_fs_context(struct fs_context *fc)
return 0;
}
-static void ramfs_kill_sb(struct super_block *sb)
+void ramfs_kill_sb(struct super_block *sb)
{
kfree(sb->s_fs_info);
kill_litter_super(sb);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 917528d102c4..d506dc63dd47 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -7,6 +7,7 @@
struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
umode_t mode, dev_t dev);
extern int ramfs_init_fs_context(struct fs_context *fc);
+extern void ramfs_kill_sb(struct super_block *sb);
#ifdef CONFIG_MMU
static inline int
diff --git a/mm/shmem.c b/mm/shmem.c
index 5e54ab5f61f2..c606ab89693a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4199,7 +4199,7 @@ static struct file_system_type shmem_fs_type = {
.name = "tmpfs",
.init_fs_context = ramfs_init_fs_context,
.parameters = ramfs_fs_parameters,
- .kill_sb = kill_litter_super,
+ .kill_sb = ramfs_kill_sb,
.fs_flags = FS_USERNS_MOUNT,
};
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x 36ce9d76b0a93bae799e27e4f5ac35478c676592
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071638-barbecue-imaginary-c2c3@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
36ce9d76b0a9 ("shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs")
d7167b149943 ("fs_parse: fold fs_parameter_desc/fs_parameter_spec")
96cafb9ccb15 ("fs_parser: remove fs_parameter_description name field")
cc3c0b533ab9 ("add prefix to fs_context->log")
c80c98f0dc5d ("ceph_parse_param(), ceph_parse_mon_ips(): switch to passing fc_log")
7f5d38141e30 ("new primitive: __fs_parse()")
2c3f3dc31556 ("switch rbd and libceph to p_log-based primitives")
3fbb8d5554a1 ("struct p_log, variants of warnf() et.al. taking that one instead")
9f09f649ca33 ("teach logfc() to handle prefices, give it saner calling conventions")
5eede625297f ("fold struct fs_parameter_enum into struct constant_table")
2710c957a8ef ("fs_parse: get rid of ->enums")
0f89589a8c6f ("Pass consistent param->type to fs_parse()")
f2aedb713c28 ("NFS: Add fs_context support.")
e38bb238ed8c ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
e558100fda7e ("NFS: Do some tidying of the parsing code")
48be8a66cf98 ("NFS: Add a small buffer in nfs_fs_context to avoid string dup")
cbd071b5daa0 ("NFS: Deindent nfs_fs_context_parse_option()")
f8ee01e3e2c8 ("NFS: Split nfs_parse_mount_options()")
5eb005caf538 ("NFS: Rename struct nfs_parsed_mount_data to struct nfs_fs_context")
e0a626b12474 ("NFS: Constify mount argument match tables")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 36ce9d76b0a93bae799e27e4f5ac35478c676592 Mon Sep 17 00:00:00 2001
From: Roberto Sassu <roberto.sassu(a)huawei.com>
Date: Wed, 7 Jun 2023 18:15:23 +0200
Subject: [PATCH] shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based
tmpfs
As the ramfs-based tmpfs uses ramfs_init_fs_context() for the
init_fs_context method, which allocates fc->s_fs_info, use ramfs_kill_sb()
to free it and avoid a memory leak.
Link: https://lkml.kernel.org/r/20230607161523.2876433-1-roberto.sassu@huaweiclou…
Fixes: c3b1b1cbf002 ("ramfs: add support for "mode=" mount option")
Signed-off-by: Roberto Sassu <roberto.sassu(a)huawei.com>
Cc: Hugh Dickins <hughd(a)google.com>
Cc: David Howells <dhowells(a)redhat.com>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 5ba580c78835..fef477c78107 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -278,7 +278,7 @@ int ramfs_init_fs_context(struct fs_context *fc)
return 0;
}
-static void ramfs_kill_sb(struct super_block *sb)
+void ramfs_kill_sb(struct super_block *sb)
{
kfree(sb->s_fs_info);
kill_litter_super(sb);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 917528d102c4..d506dc63dd47 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -7,6 +7,7 @@
struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
umode_t mode, dev_t dev);
extern int ramfs_init_fs_context(struct fs_context *fc);
+extern void ramfs_kill_sb(struct super_block *sb);
#ifdef CONFIG_MMU
static inline int
diff --git a/mm/shmem.c b/mm/shmem.c
index 5e54ab5f61f2..c606ab89693a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4199,7 +4199,7 @@ static struct file_system_type shmem_fs_type = {
.name = "tmpfs",
.init_fs_context = ramfs_init_fs_context,
.parameters = ramfs_fs_parameters,
- .kill_sb = kill_litter_super,
+ .kill_sb = ramfs_kill_sb,
.fs_flags = FS_USERNS_MOUNT,
};
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x a5a319ec2c2236bb96d147c16196d2f1f3799301
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071628-dazzling-pretense-8a8d@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..
Possible dependencies:
a5a319ec2c22 ("um: Use HOST_DIR for mrproper")
0663c68c4d2d ("kbuild: remove {CLEAN,MRPROPER,DISTCLEAN}_DIRS")
610134b750bb ("kbuild: remove misleading stale FIXME comment")
63ec90f18204 ("um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/")
8b41fc4454e3 ("kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf")
b1fbfcb4a209 ("kbuild: make single target builds even faster")
bbc55bded4aa ("modpost: dump missing namespaces into a single modules.nsdeps file")
0241ea8cae19 ("modpost: free ns_deps_buf.p after writing ns_deps files")
bff9c62b5d20 ("modpost: do not invoke extra modpost for nsdeps")
35e046a203ee ("kbuild: remove unneeded variable, single-all")
39808e451fdf ("kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers")
1747269ab016 ("modpost: do not parse vmlinux for external module builds")
fab546e6cd7a ("kbuild: update comments in scripts/Makefile.modpost")
57baec7b1b04 ("scripts/nsdeps: make sure to pass all module source files to spatch")
09684950050b ("scripts/nsdeps: use alternative sed delimiter")
e0703556644a ("Merge tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a5a319ec2c2236bb96d147c16196d2f1f3799301 Mon Sep 17 00:00:00 2001
From: Kees Cook <keescook(a)chromium.org>
Date: Tue, 6 Jun 2023 15:24:45 -0700
Subject: [PATCH] um: Use HOST_DIR for mrproper
When HEADER_ARCH was introduced, the MRPROPER_FILES (then MRPROPER_DIRS)
list wasn't adjusted, leaving SUBARCH as part of the path argument.
This resulted in the "mrproper" target not cleaning up arch/x86/... when
SUBARCH was specified. Since HOST_DIR is arch/$(HEADER_ARCH), use it
instead to get the correct path.
Cc: Richard Weinberger <richard(a)nod.at>
Cc: Anton Ivanov <anton.ivanov(a)cambridgegreys.com>
Cc: Johannes Berg <johannes(a)sipsolutions.net>
Cc: Azeem Shaikh <azeemshaikh38(a)gmail.com>
Cc: linux-um(a)lists.infradead.org
Fixes: 7bbe7204e937 ("um: merge Makefile-{i386,x86_64}")
Cc: stable(a)vger.kernel.org
Signed-off-by: Kees Cook <keescook(a)chromium.org>
Link: https://lore.kernel.org/r/20230606222442.never.807-kees@kernel.org
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 8186d4761bda..da4d5256af2f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -149,7 +149,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) $(CC_FLAGS_
# When cleaning we don't include .config, so we don't include
# TT or skas makefiles and don't clean skas_ptregs.h.
CLEAN_FILES += linux x.i gmon.out
-MRPROPER_FILES += arch/$(SUBARCH)/include/generated
+MRPROPER_FILES += $(HOST_DIR)/include/generated
archclean:
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x a5a319ec2c2236bb96d147c16196d2f1f3799301
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071622-improving-scrambler-114b@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
a5a319ec2c22 ("um: Use HOST_DIR for mrproper")
0663c68c4d2d ("kbuild: remove {CLEAN,MRPROPER,DISTCLEAN}_DIRS")
610134b750bb ("kbuild: remove misleading stale FIXME comment")
63ec90f18204 ("um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/")
8b41fc4454e3 ("kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf")
b1fbfcb4a209 ("kbuild: make single target builds even faster")
bbc55bded4aa ("modpost: dump missing namespaces into a single modules.nsdeps file")
0241ea8cae19 ("modpost: free ns_deps_buf.p after writing ns_deps files")
bff9c62b5d20 ("modpost: do not invoke extra modpost for nsdeps")
35e046a203ee ("kbuild: remove unneeded variable, single-all")
39808e451fdf ("kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers")
1747269ab016 ("modpost: do not parse vmlinux for external module builds")
fab546e6cd7a ("kbuild: update comments in scripts/Makefile.modpost")
57baec7b1b04 ("scripts/nsdeps: make sure to pass all module source files to spatch")
09684950050b ("scripts/nsdeps: use alternative sed delimiter")
e0703556644a ("Merge tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a5a319ec2c2236bb96d147c16196d2f1f3799301 Mon Sep 17 00:00:00 2001
From: Kees Cook <keescook(a)chromium.org>
Date: Tue, 6 Jun 2023 15:24:45 -0700
Subject: [PATCH] um: Use HOST_DIR for mrproper
When HEADER_ARCH was introduced, the MRPROPER_FILES (then MRPROPER_DIRS)
list wasn't adjusted, leaving SUBARCH as part of the path argument.
This resulted in the "mrproper" target not cleaning up arch/x86/... when
SUBARCH was specified. Since HOST_DIR is arch/$(HEADER_ARCH), use it
instead to get the correct path.
Cc: Richard Weinberger <richard(a)nod.at>
Cc: Anton Ivanov <anton.ivanov(a)cambridgegreys.com>
Cc: Johannes Berg <johannes(a)sipsolutions.net>
Cc: Azeem Shaikh <azeemshaikh38(a)gmail.com>
Cc: linux-um(a)lists.infradead.org
Fixes: 7bbe7204e937 ("um: merge Makefile-{i386,x86_64}")
Cc: stable(a)vger.kernel.org
Signed-off-by: Kees Cook <keescook(a)chromium.org>
Link: https://lore.kernel.org/r/20230606222442.never.807-kees@kernel.org
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 8186d4761bda..da4d5256af2f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -149,7 +149,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) $(CC_FLAGS_
# When cleaning we don't include .config, so we don't include
# TT or skas makefiles and don't clean skas_ptregs.h.
CLEAN_FILES += linux x.i gmon.out
-MRPROPER_FILES += arch/$(SUBARCH)/include/generated
+MRPROPER_FILES += $(HOST_DIR)/include/generated
archclean:
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x a5a319ec2c2236bb96d147c16196d2f1f3799301
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071621-diary-henchman-76a2@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
a5a319ec2c22 ("um: Use HOST_DIR for mrproper")
0663c68c4d2d ("kbuild: remove {CLEAN,MRPROPER,DISTCLEAN}_DIRS")
610134b750bb ("kbuild: remove misleading stale FIXME comment")
63ec90f18204 ("um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/")
8b41fc4454e3 ("kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf")
b1fbfcb4a209 ("kbuild: make single target builds even faster")
bbc55bded4aa ("modpost: dump missing namespaces into a single modules.nsdeps file")
0241ea8cae19 ("modpost: free ns_deps_buf.p after writing ns_deps files")
bff9c62b5d20 ("modpost: do not invoke extra modpost for nsdeps")
35e046a203ee ("kbuild: remove unneeded variable, single-all")
39808e451fdf ("kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers")
1747269ab016 ("modpost: do not parse vmlinux for external module builds")
fab546e6cd7a ("kbuild: update comments in scripts/Makefile.modpost")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a5a319ec2c2236bb96d147c16196d2f1f3799301 Mon Sep 17 00:00:00 2001
From: Kees Cook <keescook(a)chromium.org>
Date: Tue, 6 Jun 2023 15:24:45 -0700
Subject: [PATCH] um: Use HOST_DIR for mrproper
When HEADER_ARCH was introduced, the MRPROPER_FILES (then MRPROPER_DIRS)
list wasn't adjusted, leaving SUBARCH as part of the path argument.
This resulted in the "mrproper" target not cleaning up arch/x86/... when
SUBARCH was specified. Since HOST_DIR is arch/$(HEADER_ARCH), use it
instead to get the correct path.
Cc: Richard Weinberger <richard(a)nod.at>
Cc: Anton Ivanov <anton.ivanov(a)cambridgegreys.com>
Cc: Johannes Berg <johannes(a)sipsolutions.net>
Cc: Azeem Shaikh <azeemshaikh38(a)gmail.com>
Cc: linux-um(a)lists.infradead.org
Fixes: 7bbe7204e937 ("um: merge Makefile-{i386,x86_64}")
Cc: stable(a)vger.kernel.org
Signed-off-by: Kees Cook <keescook(a)chromium.org>
Link: https://lore.kernel.org/r/20230606222442.never.807-kees@kernel.org
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 8186d4761bda..da4d5256af2f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -149,7 +149,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) $(CC_FLAGS_
# When cleaning we don't include .config, so we don't include
# TT or skas makefiles and don't clean skas_ptregs.h.
CLEAN_FILES += linux x.i gmon.out
-MRPROPER_FILES += arch/$(SUBARCH)/include/generated
+MRPROPER_FILES += $(HOST_DIR)/include/generated
archclean:
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x 80fca8a10b604afad6c14213fdfd816c4eda3ee4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071622-crablike-glaucoma-f28c@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..
Possible dependencies:
80fca8a10b60 ("bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent")
17e4aed8309f ("bcache: remove 'int n' from parameter list of bch_bucket_alloc_set()")
8792099f9ad4 ("bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set")
fc2d5988b597 ("bcache: add identifier names to arguments of function definitions")
6f10f7d1b02b ("bcache: style fix to replace 'unsigned' by 'unsigned int'")
ea8c5356d390 ("bcache: set max writeback rate when I/O request is idle")
b467a6ac0b4b ("bcache: add code comments for bset.c")
b4cb6efc1af7 ("bcache: display rate debug parameters to 0 when writeback is not running")
94f71c16062e ("bcache: fix I/O significant decline while backend devices registering")
99a27d59bd7b ("bcache: simplify the calculation of the total amount of flash dirty data")
ddcf35d39797 ("block: Add and use op_stat_group() for indexing disk_stat fields.")
3f289dcb4b26 ("block: make bdev_ops->rw_page() take a REQ_OP instead of bool")
0f0709e6bfc3 ("bcache: stop bcache device when backing device is offline")
522a777566f5 ("block: consolidate struct request timestamp fields")
4bc6339a583c ("block: move blk_stat_add() to __blk_mq_end_request()")
84c7afcebed9 ("block: use ktime_get_ns() instead of sched_clock() for cfq and bfq")
544ccc8dc904 ("block: get rid of struct blk_issue_stat")
a8a45941706b ("block: pass struct request instead of struct blk_issue_stat to wbt")
934031a12980 ("block: move some wbt helpers to blk-wbt.c")
782f569774d7 ("blk-wbt: throttle discards like background writes")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 80fca8a10b604afad6c14213fdfd816c4eda3ee4 Mon Sep 17 00:00:00 2001
From: Zheng Wang <zyytlz.wz(a)163.com>
Date: Thu, 15 Jun 2023 20:12:22 +0800
Subject: [PATCH] bcache: Fix __bch_btree_node_alloc to make the failure
behavior consistent
In some specific situations, the return value of __bch_btree_node_alloc
may be NULL. This may lead to a potential NULL pointer dereference in
caller function like a calling chain :
btree_split->bch_btree_node_alloc->__bch_btree_node_alloc.
Fix it by initializing the return value in __bch_btree_node_alloc.
Fixes: cafe56359144 ("bcache: A block layer cache")
Cc: stable(a)vger.kernel.org
Signed-off-by: Zheng Wang <zyytlz.wz(a)163.com>
Signed-off-by: Coly Li <colyli(a)suse.de>
Link: https://lore.kernel.org/r/20230615121223.22502-6-colyli@suse.de
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 7c21e54468bf..0ddf91204782 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1090,10 +1090,12 @@ struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,
struct btree *parent)
{
BKEY_PADDED(key) k;
- struct btree *b = ERR_PTR(-EAGAIN);
+ struct btree *b;
mutex_lock(&c->bucket_lock);
retry:
+ /* return ERR_PTR(-EAGAIN) when it fails */
+ b = ERR_PTR(-EAGAIN);
if (__bch_bucket_alloc_set(c, RESERVE_BTREE, &k.key, wait))
goto err;
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 80fca8a10b604afad6c14213fdfd816c4eda3ee4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071621-lubricate-dragging-07c6@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
80fca8a10b60 ("bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent")
17e4aed8309f ("bcache: remove 'int n' from parameter list of bch_bucket_alloc_set()")
8792099f9ad4 ("bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 80fca8a10b604afad6c14213fdfd816c4eda3ee4 Mon Sep 17 00:00:00 2001
From: Zheng Wang <zyytlz.wz(a)163.com>
Date: Thu, 15 Jun 2023 20:12:22 +0800
Subject: [PATCH] bcache: Fix __bch_btree_node_alloc to make the failure
behavior consistent
In some specific situations, the return value of __bch_btree_node_alloc
may be NULL. This may lead to a potential NULL pointer dereference in
caller function like a calling chain :
btree_split->bch_btree_node_alloc->__bch_btree_node_alloc.
Fix it by initializing the return value in __bch_btree_node_alloc.
Fixes: cafe56359144 ("bcache: A block layer cache")
Cc: stable(a)vger.kernel.org
Signed-off-by: Zheng Wang <zyytlz.wz(a)163.com>
Signed-off-by: Coly Li <colyli(a)suse.de>
Link: https://lore.kernel.org/r/20230615121223.22502-6-colyli@suse.de
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 7c21e54468bf..0ddf91204782 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1090,10 +1090,12 @@ struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,
struct btree *parent)
{
BKEY_PADDED(key) k;
- struct btree *b = ERR_PTR(-EAGAIN);
+ struct btree *b;
mutex_lock(&c->bucket_lock);
retry:
+ /* return ERR_PTR(-EAGAIN) when it fails */
+ b = ERR_PTR(-EAGAIN);
if (__bch_bucket_alloc_set(c, RESERVE_BTREE, &k.key, wait))
goto err;
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x 80fca8a10b604afad6c14213fdfd816c4eda3ee4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023071620-dangling-strike-bfaa@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
80fca8a10b60 ("bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent")
17e4aed8309f ("bcache: remove 'int n' from parameter list of bch_bucket_alloc_set()")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 80fca8a10b604afad6c14213fdfd816c4eda3ee4 Mon Sep 17 00:00:00 2001
From: Zheng Wang <zyytlz.wz(a)163.com>
Date: Thu, 15 Jun 2023 20:12:22 +0800
Subject: [PATCH] bcache: Fix __bch_btree_node_alloc to make the failure
behavior consistent
In some specific situations, the return value of __bch_btree_node_alloc
may be NULL. This may lead to a potential NULL pointer dereference in
caller function like a calling chain :
btree_split->bch_btree_node_alloc->__bch_btree_node_alloc.
Fix it by initializing the return value in __bch_btree_node_alloc.
Fixes: cafe56359144 ("bcache: A block layer cache")
Cc: stable(a)vger.kernel.org
Signed-off-by: Zheng Wang <zyytlz.wz(a)163.com>
Signed-off-by: Coly Li <colyli(a)suse.de>
Link: https://lore.kernel.org/r/20230615121223.22502-6-colyli@suse.de
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 7c21e54468bf..0ddf91204782 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1090,10 +1090,12 @@ struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,
struct btree *parent)
{
BKEY_PADDED(key) k;
- struct btree *b = ERR_PTR(-EAGAIN);
+ struct btree *b;
mutex_lock(&c->bucket_lock);
retry:
+ /* return ERR_PTR(-EAGAIN) when it fails */
+ b = ERR_PTR(-EAGAIN);
if (__bch_bucket_alloc_set(c, RESERVE_BTREE, &k.key, wait))
goto err;