6.1.132-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 128/198 ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit ed92bc5264c4357d4fca292c769ea9967cd3d3b6 ]
Free some resources in the error handling path of the probe, as already done in the remove function.
--- sound/soc/codecs/wm0010.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/codecs/wm0010.c +11 -2
@@ -951,7 +951,7 @@ static int wm0010_spi_probe(struct spi_device *spi)if (ret) {dev_err (wm0010->dev,"Failed to set IRQ %d as wake source: %d\n" , irq, ret); -return ret; + goto free_irq; }if (spi->max_speed_hz)
@@ -963,9 +963,18 @@ static int wm0010_spi_probe(struct spi_device *spi) &soc_component_dev_wm0010, wm0010_dai, ARRAY_SIZE(wm0010_dai));if (ret <0 ) -return ret; + goto disable_irq_wake;return 0 ; + +disable_irq_wake: +irq_set_irq_wake (wm0010->irq,0 ); + +free_irq: +if (wm0010->irq) +free_irq (wm0010->irq, wm0010); + +return ret; }static void wm0010_spi_remove (struct spi_device *spi)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 129/198 scripts: generate_rust_analyzer: Handle sub-modules with no Makefile
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Asahi Lina <[email protected]>
[ Upstream commit 5c7548d5a25306dcdb97689479be81cacc8ce596 ]
More complex drivers might want to use modules to organize their Rust code, but those module folders do not need a Makefile. generate_rust_analyzer.py currently crashes on those. Fix it so that a missing Makefile is silently ignored.
Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
--- scripts/generate_rust_analyzer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/generate_rust_analyzer.py +4 -1
@@ -98,7 +98,10 @@ def generate_crates(srctree, objtree, sysroot_src): name = path.name.replace(".rs", "") # Skip those that are not crate roots. - if f"{name}.o" not in open(path.parent / "Makefile").read(): + try: + if f"{name}.o" not in open(path.parent / "Makefile").read(): + continue + except FileNotFoundError: continue logging.info("Adding %s", name)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 130/198 scripts: `make rust-analyzer` for out-of-tree modules
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinay Varma <[email protected]>
[ Upstream commit 49a9ef76740206d52e7393f6fe25fc764de8df32 ]
Adds support for out-of-tree rust modules to use the rust-analyzer make target to generate the rust-project.json file.
The change involves adding an optional parameter external_src to the generate_rust_analyzer.py which expects the path to the out-of-tree module's source directory. When this parameter is passed, I have chosen not to add the non-core modules (samples and drivers) into the result since these are not expected to be used in third party modules. Related changes are also made to the Makefile and rust/Makefile allowing the rust-analyzer target to be used for out-of-tree modules as well.
Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
--- Makefile | 11 ++++++----- rust/Makefile | 6 ++++-- scripts/generate_rust_analyzer.py | 27 ++++++++++++++++++--------- 3 files changed, 28 insertions(+), 16 deletions(-)
Makefile +6 -5
@@ -1851,11 +1851,6 @@ rustfmt: rustfmtcheck: rustfmt_flags = --check rustfmtcheck: rustfmt -# IDE support targets -PHONY += rust-analyzer -rust-analyzer: - $(Q)$(MAKE) $(build)=rust $@ - # Misc # ---------------------------------------------------------------------------
@@ -1908,6 +1903,7 @@ help: @echo ' modules - default target, build the module(s)' @echo ' modules_install - install the module' @echo ' clean - remove generated files in module directory only' + @echo ' rust-analyzer - generate rust-project.json rust-analyzer support file' @echo '' endif # KBUILD_EXTMOD
@@ -2044,6 +2040,11 @@ quiet_cmd_tags = GEN $@ tags TAGS cscope gtags: FORCE $(call cmd,tags) +# IDE support targets +PHONY += rust-analyzer +rust-analyzer: + $(Q)$(MAKE) $(build)=rust $@ + # Script to generate missing namespace dependencies # ---------------------------------------------------------------------------
rust/Makefile +4 -2
@@ -344,8 +344,10 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L $(if $(rustc_objcopy),;$(OBJCOPY) $(rustc_objcopy) $@) rust-analyzer: - $(Q)$(srctree)/scripts/generate_rust_analyzer.py $(srctree) $(objtree) \ - $(RUST_LIB_SRC) > $(objtree)/rust-project.json + $(Q)$(srctree)/scripts/generate_rust_analyzer.py \ + $(abs_srctree) $(abs_objtree) \ + $(RUST_LIB_SRC) $(KBUILD_EXTMOD) > \ + $(if $(KBUILD_EXTMOD),$(extmod_prefix),$(objtree))/rust-project.json $(obj)/core.o: private skip_clippy = 1 $(obj)/core.o: private skip_flags = -Dunreachable_pub
scripts/generate_rust_analyzer.py +18 -9
@@ -6,10 +6,11 @@ import argparse import json import logging +import os import pathlib import sys -def generate_crates(srctree, objtree, sysroot_src): +def generate_crates(srctree, objtree, sysroot_src, external_src): # Generate the configuration list. cfg = [] with open(objtree / "include" / "generated" / "rustc_cfg") as fd:
@@ -65,7 +66,7 @@ def generate_crates(srctree, objtree, sysroot_src): [], is_proc_macro=True, ) - crates[-1]["proc_macro_dylib_path"] = "rust/libmacros.so" + crates[-1]["proc_macro_dylib_path"] = f"{objtree}/rust/libmacros.so" append_crate( "bindings",
@@ -89,19 +90,26 @@ def generate_crates(srctree, objtree, sysroot_src): "exclude_dirs": [], } + def is_root_crate(build_file, target): + try: + return f"{target}.o" in open(build_file).read() + except FileNotFoundError: + return False + # Then, the rest outside of `rust/`. # # We explicitly mention the top-level folders we want to cover. - for folder in ("samples", "drivers"): - for path in (srctree / folder).rglob("*.rs"): + extra_dirs = map(lambda dir: srctree / dir, ("samples", "drivers")) + if external_src is not None: + extra_dirs = [external_src] + for folder in extra_dirs: + for path in folder.rglob("*.rs"): logging.info("Checking %s", path) name = path.name.replace(".rs", "") # Skip those that are not crate roots. - try: - if f"{name}.o" not in open(path.parent / "Makefile").read(): - continue - except FileNotFoundError: + if not is_root_crate(path.parent / "Makefile", name) and \ + not is_root_crate(path.parent / "Kbuild", name): continue logging.info("Adding %s", name)
@@ -120,6 +128,7 @@ def main(): parser.add_argument("srctree", type=pathlib.Path) parser.add_argument("objtree", type=pathlib.Path) parser.add_argument("sysroot_src", type=pathlib.Path) + parser.add_argument("exttree", type=pathlib.Path, nargs="?") args = parser.parse_args() logging.basicConfig(
@@ -128,7 +137,7 @@ def main(): ) rust_project = { - "crates": generate_crates(args.srctree, args.objtree, args.sysroot_src), + "crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.exttree), "sysroot_src": str(args.sysroot_src), }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 131/198 scripts: generate_rust_analyzer: provide `cfg`s for `core` and `alloc`
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Rodriguez Reboredo <[email protected]>
[ Upstream commit 4f353e0d1282dfe6b8082290fe8e606c5739a954 ]
Both core and alloc have their cfgs (such as no_rc) missing in rust-project.json.
To remedy this, pass the flags to generate_rust_analyzer.py for them to be added to a dictionary where each key corresponds to a crate and each value to a list of cfgs. The dictionary is then used to pass the cfgs to each crate in the generated file (for core and alloc only).
Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps")
--- rust/Makefile | 1 + scripts/generate_rust_analyzer.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
rust/Makefile +1 -0
@@ -345,6 +345,7 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L rust-analyzer: $(Q)$(srctree)/scripts/generate_rust_analyzer.py \ + --cfgs='core=$(core-cfgs)' --cfgs='alloc=$(alloc-cfgs)' \ $(abs_srctree) $(abs_objtree) \ $(RUST_LIB_SRC) $(KBUILD_EXTMOD) > \ $(if $(KBUILD_EXTMOD),$(extmod_prefix),$(objtree))/rust-project.json
scripts/generate_rust_analyzer.py +14 -2
@@ -10,7 +10,15 @@ import os import pathlib import sys -def generate_crates(srctree, objtree, sysroot_src, external_src): +def args_crates_cfgs(cfgs): + crates_cfgs = {} + for cfg in cfgs: + crate, vals = cfg.split("=", 1) + crates_cfgs[crate] = vals.replace("--cfg", "").split() + + return crates_cfgs + +def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): # Generate the configuration list. cfg = [] with open(objtree / "include" / "generated" / "rustc_cfg") as fd:
@@ -24,6 +32,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src): # Avoid O(n^2) iterations by keeping a map of indexes. crates = [] crates_indexes = {} + crates_cfgs = args_crates_cfgs(cfgs) def append_crate(display_name, root_module, deps, cfg=[], is_workspace_member=True, is_proc_macro=False): crates_indexes[display_name] = len(crates)
@@ -45,6 +54,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src): "core", sysroot_src / "core" / "src" / "lib.rs", [], + cfg=crates_cfgs.get("core", []), is_workspace_member=False, )
@@ -58,6 +68,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src): "alloc", srctree / "rust" / "alloc" / "lib.rs", ["core", "compiler_builtins"], + cfg=crates_cfgs.get("alloc", []), ) append_crate(
@@ -125,6 +136,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src): def main(): parser = argparse.ArgumentParser() parser.add_argument('--verbose', '-v', action='store_true') + parser.add_argument('--cfgs', action='append', default=[]) parser.add_argument("srctree", type=pathlib.Path) parser.add_argument("objtree", type=pathlib.Path) parser.add_argument("sysroot_src", type=pathlib.Path)
@@ -137,7 +149,7 @@ def main(): ) rust_project = { - "crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.exttree), + "crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.exttree, args.cfgs), "sysroot_src": str(args.sysroot_src), }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 132/198 scripts: generate_rust_analyzer: add missing macros deps
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tamir Duberstein <[email protected]>
[ Upstream commit 2e0f91aba507a3cb59f7a12fc3ea2b7d4d6675b7 ]
The macros crate has depended on std and proc_macro since its introduction in commit 1fbde52bde73 ("rust: add macros crate"). These dependencies were omitted from commit 8c4555ccc55c ("scripts: add generate_rust_analyzer.py") resulting in missing go-to-definition and autocomplete, and false-positive warnings emitted from rust-analyzer such as:
[{
"resource": "/Users/tamird/src/linux/rust/macros/module.rs",
"owner": "_generated_diagnostic_collection_name_#1",
"code": {
"value": "non_snake_case",
"target": {
"$mid": 1,
"path": "/rustc/",
"scheme": "https",
"authority": "doc.rust-lang.org",
"query": "search=non_snake_case"
}
},
"severity": 4,
"message": "Variable `None` should have snake_case name, e.g. `none`",
"source": "rust-analyzer",
"startLineNumber": 123,
"startColumn": 17,
"endLineNumber": 123,
"endColumn": 21
}]Add the missing dependencies to improve the developer experience.
[ Fiona had a different approach (thanks!) at:
https://lore.kernel.org/rust-for-linux/[email protected]/
But Tamir and Fiona agreed to this one. - Miguel ]
[ Removed return. Changed tag name. Added Link. Slightly
reworded. - Miguel ]
--- scripts/generate_rust_analyzer.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-)
scripts/generate_rust_analyzer.py +21 -9
@@ -49,14 +49,26 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): } }) - # First, the ones in `rust/` since they are a bit special. - append_crate( - "core", - sysroot_src / "core" / "src" / "lib.rs", - [], - cfg=crates_cfgs.get("core", []), - is_workspace_member=False, - ) + def append_sysroot_crate( + display_name, + deps, + cfg=[], + ): + append_crate( + display_name, + sysroot_src / display_name / "src" / "lib.rs", + deps, + cfg, + is_workspace_member=False, + ) + + # NB: sysroot crates reexport items from one another so setting up our transitive dependencies + # here is important for ensuring that rust-analyzer can resolve symbols. The sources of truth + # for this dependency graph are `(sysroot_src / crate / "Cargo.toml" for crate in crates)`. + append_sysroot_crate("core", [], cfg=crates_cfgs.get("core", [])) + append_sysroot_crate("alloc", ["core"]) + append_sysroot_crate("std", ["alloc", "core"]) + append_sysroot_crate("proc_macro", ["core", "std"]) append_crate( "compiler_builtins",
@@ -74,7 +86,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): append_crate( "macros", srctree / "rust" / "macros" / "lib.rs", - [], + ["std", "proc_macro"], is_proc_macro=True, ) crates[-1]["proc_macro_dylib_path"] = f"{objtree}/rust/libmacros.so"
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 133/198 cifs: Fix integer overflow while processing acregmax mount option
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
[ Upstream commit 7489161b1852390b4413d57f2457cd40b34da6cc ]
User-provided mount parameter acregmax of type u32 is intended to have an upper limit, but before it is validated, the value is converted from seconds to jiffies which can lead to an integer overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/smb/client/fs_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/fs_context.c +2 -2
@@ -1078,11 +1078,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->got_wsize = true;break ;case Opt_acregmax: - ctx->acregmax =HZ * result.uint_32; -if (ctx->acregmax >CIFS_MAX_ACTIMEO ) { +if (result.uint_32 >CIFS_MAX_ACTIMEO /HZ ) {cifs_errorf (fc,"acregmax too large\n" ); goto cifs_parse_mount_err; } + ctx->acregmax =HZ * result.uint_32;break ;case Opt_acdirmax: ctx->acdirmax =HZ * result.uint_32;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 134/198 cifs: Fix integer overflow while processing acdirmax mount option
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
[ Upstream commit 5b29891f91dfb8758baf1e2217bef4b16b2b165b ]
User-provided mount parameter acdirmax of type u32 is intended to have an upper limit, but before it is validated, the value is converted from seconds to jiffies which can lead to an integer overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/smb/client/fs_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/fs_context.c +2 -2
@@ -1085,11 +1085,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->acregmax =HZ * result.uint_32;break ;case Opt_acdirmax: - ctx->acdirmax =HZ * result.uint_32; -if (ctx->acdirmax >CIFS_MAX_ACTIMEO ) { +if (result.uint_32 >CIFS_MAX_ACTIMEO /HZ ) {cifs_errorf (fc,"acdirmax too large\n" ); goto cifs_parse_mount_err; } + ctx->acdirmax =HZ * result.uint_32;break ;case Opt_actimeo:if (HZ * result.uint_32 >CIFS_MAX_ACTIMEO ) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 135/198 cifs: Fix integer overflow while processing actimeo mount option
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
[ Upstream commit 64f690ee22c99e16084e0e45181b2a1eed2fa149 ]
User-provided mount parameter actimeo of type u32 is intended to have an upper limit, but before it is validated, the value is converted from seconds to jiffies which can lead to an integer overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/smb/client/fs_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/fs_context.c +1 -1
@@ -1092,7 +1092,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->acdirmax =HZ * result.uint_32;break ;case Opt_actimeo: -if (HZ * result.uint_32 >CIFS_MAX_ACTIMEO ) { +if (result.uint_32 >CIFS_MAX_ACTIMEO /HZ ) {cifs_errorf (fc,"timeout too large\n" ); goto cifs_parse_mount_err; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 136/198 cifs: Fix integer overflow while processing closetimeo mount option
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
[ Upstream commit d5a30fddfe2f2e540f6c43b59cf701809995faef ]
User-provided mount parameter closetimeo of type u32 is intended to have an upper limit, but before it is validated, the value is converted from seconds to jiffies which can lead to an integer overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/smb/client/fs_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/fs_context.c +2 -2
@@ -1104,11 +1104,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->acdirmax = ctx->acregmax =HZ * result.uint_32;break ;case Opt_closetimeo: - ctx->closetimeo =HZ * result.uint_32; -if (ctx->closetimeo >SMB3_MAX_DCLOSETIMEO ) { +if (result.uint_32 >SMB3_MAX_DCLOSETIMEO /HZ ) {cifs_errorf (fc,"closetimeo too large\n" ); goto cifs_parse_mount_err; } + ctx->closetimeo =HZ * result.uint_32;break ;case Opt_echo_interval: ctx->echo_interval = result.uint_32;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 137/198 i2c: ali1535: Fix an error handling path in ali1535_probe()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 9b5463f349d019a261f1e80803447efca3126151 ]
If i2c_add_adapter() fails, the request_region() call in ali1535_setup() must be undone by a corresponding release_region() call, as done in the remove function.
--- drivers/i2c/busses/i2c-ali1535.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-ali1535.c +11 -1
@@ -490,6 +490,8 @@ MODULE_DEVICE_TABLE(pci, ali1535_ids);static int ali1535_probe (struct pci_dev *dev,const struct pci_device_id *id) { +int ret; +if (ali1535_setup (dev)) {dev_warn (&dev->dev,"ALI1535 not detected, module not inserted.\n" );
@@ -501,7 +503,15 @@ static int ali1535_probe(struct pci_dev *dev, const struct pci_device_id *id)snprintf (ali1535_adapter.name,sizeof (ali1535_adapter.name),"SMBus ALI1535 adapter at %04x" , ali1535_offset); -return i2c_add_adapter (&ali1535_adapter); + ret =i2c_add_adapter (&ali1535_adapter); +if (ret) + goto release_region; + +return 0 ; + +release_region: +release_region (ali1535_smba,ALI1535_SMB_IOSIZE ); +return ret; }static void ali1535_remove (struct pci_dev *dev)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 138/198 i2c: ali15x3: Fix an error handling path in ali15x3_probe()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 6e55caaf30c88209d097e575a169b1dface1ab69 ]
If i2c_add_adapter() fails, the request_region() call in ali15x3_setup() must be undone by a corresponding release_region() call, as done in the remove function.
--- drivers/i2c/busses/i2c-ali15x3.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-ali15x3.c +11 -1
@@ -473,6 +473,8 @@ MODULE_DEVICE_TABLE (pci, ali15x3_ids);static int ali15x3_probe (struct pci_dev *dev,const struct pci_device_id *id) { +int ret; +if (ali15x3_setup (dev)) {dev_err (&dev->dev,"ALI15X3 not detected, module not inserted.\n" );
@@ -484,7 +486,15 @@ static int ali15x3_probe(struct pci_dev *dev, const struct pci_device_id *id)snprintf (ali15x3_adapter.name,sizeof (ali15x3_adapter.name),"SMBus ALI15X3 adapter at %04x" , ali15x3_smba); -return i2c_add_adapter (&ali15x3_adapter); + ret =i2c_add_adapter (&ali15x3_adapter); +if (ret) + goto release_region; + +return 0 ; + +release_region: +release_region (ali15x3_smba,ALI15X3_SMB_IOSIZE ); +return ret; }static void ali15x3_remove (struct pci_dev *dev)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 139/198 i2c: sis630: Fix an error handling path in sis630_probe()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 2b22459792fcb4def9f0936d64575ac11a95a58d ]
If i2c_add_adapter() fails, the request_region() call in sis630_setup() must be undone by a corresponding release_region() call, as done in the remove function.
--- drivers/i2c/busses/i2c-sis630.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-sis630.c +11 -1
@@ -509,6 +509,8 @@ MODULE_DEVICE_TABLE(pci, sis630_ids);static int sis630_probe (struct pci_dev *dev,const struct pci_device_id *id) { +int ret; +if (sis630_setup (dev)) {dev_err (&dev->dev, "SIS630 compatible bus not detected, "
@@ -522,7 +524,15 @@ static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id)snprintf (sis630_adapter.name,sizeof (sis630_adapter.name),"SMBus SIS630 adapter at %04x" , smbus_base +SMB_STS ); -return i2c_add_adapter (&sis630_adapter); + ret =i2c_add_adapter (&sis630_adapter); +if (ret) + goto release_region; + +return 0 ; + +release_region: +release_region (smbus_base +SMB_STS ,SIS630_SMB_IOREGION ); +return ret; }static void sis630_remove (struct pci_dev *dev)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 140/198 arm64: mm: Populate vmemmap at the page level if not section aligned
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhenhua Huang <[email protected]>
[ Upstream commit d4234d131b0a3f9e65973f1cdc71bb3560f5d14b ]
On the arm64 platform with 4K base page config, SECTION_SIZE_BITS is set to 27, making one section 128M. The related page struct which vmemmap points to is 2M then.
Commit c1cc1552616d ("arm64: MMU initialisation") optimizes the vmemmap to populate at the PMD section level which was suitable initially since hot plug granule is always one section(128M). However, commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") introduced a 2M(SUBSECTION_SIZE) hot plug granule, which disrupted the existing arm64 assumptions.
The first problem is that if start or end is not aligned to a section boundary, such as when a subsection is hot added, populating the entire section is wasteful.
The next problem is if we hotplug something that spans part of 128 MiB section (subsections, let's call it memblock1), and then hotplug something that spans another part of a 128 MiB section(subsections, let's call it memblock2), and subsequently unplug memblock1, vmemmap_free() will clear the entire PMD entry which also supports memblock2 even though memblock2 is still active.
Assuming hotplug/unplug sizes are guaranteed to be symmetric. Do the fix similar to x86-64: populate to pages levels if start/end is not aligned with section boundary.
--- arch/arm64/mm/mmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm64/mm/mmu.c +4 -1
@@ -1209,8 +1209,11 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,pmd_t *pmdp;WARN_ON ((start <VMEMMAP_START ) || (end >VMEMMAP_END )); +/* [start, end] should be within one section */ +WARN_ON_ONCE (end - start >PAGES_PER_SECTION *sizeof (struct page )); -if (!ARM64_KERNEL_USES_PMD_MAPS ) +if (!ARM64_KERNEL_USES_PMD_MAPS || + (end - start <PAGES_PER_SECTION *sizeof (struct page )))return vmemmap_populate_basepages (start, end, node, altmap); do {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 141/198 smb3: add support for IAKerb
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steve French <[email protected]>
[ Upstream commit eea5119fa5979c350af5783a8148eacdd4219715 ]
There are now more servers which advertise support for IAKerb (passthrough Kerberos authentication via proxy). IAKerb is a public extension industry standard Kerberos protocol that allows a client without line-of-sight to a Domain Controller to authenticate. There can be cases where we would fail to mount if the server only advertises the OID for IAKerb in SPNEGO/GSSAPI. Add code to allow us to still upcall to userspace in these cases to obtain the Kerberos ticket.
Stable-dep-of: 605b249ea967 ("smb: client: Fix match_session bug preventing session reuse")
--- fs/smb/client/asn1.c | 2 ++ fs/smb/client/cifs_spnego.c | 4 +++- fs/smb/client/cifsglob.h | 4 ++++ fs/smb/client/sess.c | 3 ++- fs/smb/client/smb2pdu.c | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-)
fs/smb/client/asn1.c +2 -0
@@ -52,6 +52,8 @@ int cifs_neg_token_init_mech_type(void *context, size_t hdrlen, server->sec_kerberos = true; else if (oid == OID_ntlmssp) server->sec_ntlmssp = true; + else if (oid == OID_IAKerb) + server->sec_iakerb = true; else {char buf[50 ];
fs/smb/client/cifs_spnego.c +3 -1
@@ -130,11 +130,13 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo, dp = description +strlen (description); -/* for now, only sec=krb5 and sec=mskrb5 are valid */ +/* for now, only sec=krb5 and sec=mskrb5 and iakerb are valid */ if (server->sec_kerberos)sprintf (dp,";sec=krb5" );else if (server->sec_mskerberos)sprintf (dp,";sec=mskrb5" ); +else if (server->sec_iakerb) +sprintf (dp,";sec=iakerb" );else {cifs_dbg (VFS ,"unknown or missing server auth type, use krb5\n" );sprintf (dp,";sec=krb5" );
fs/smb/client/cifsglob.h +4 -0
@@ -148,6 +148,7 @@ enum securityEnum { NTLMv2,/* Legacy NTLM auth with NTLMv2 hash */ RawNTLMSSP,/* NTLMSSP without SPNEGO, NTLMv2 hash */ Kerberos,/* Kerberos via SPNEGO */ + IAKerb, /* Kerberos proxy */ }; struct session_key {
@@ -685,6 +686,7 @@ struct TCP_Server_Info {bool sec_kerberosu2u;/* supports U2U Kerberos */ bool sec_kerberos;/* supports plain Kerberos */ bool sec_mskerberos;/* supports legacy MS Kerberos */ +bool sec_iakerb;/* supports pass-through auth for Kerberos (krb5 proxy) */ bool large_buf;/* is current buffer large? */ /* use SMBD connection instead of socket */ bool rdma;
@@ -2049,6 +2051,8 @@ static inline char *get_security_type_str(enum securityEnum sectype)return "Kerberos" ;case NTLMv2:return "NTLMv2" ; +case IAKerb: +return "IAKerb" ;default :return "Unknown" ; }
fs/smb/client/sess.c +2 -1
@@ -1209,12 +1209,13 @@ cifs_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested)switch (requested) {case Kerberos:case RawNTLMSSP: +case IAKerb:return requested;case Unspecified:if (server->sec_ntlmssp && (global_secflags &CIFSSEC_MAY_NTLMSSP ))return RawNTLMSSP; -if ((server->sec_kerberos || server->sec_mskerberos) && +if ((server->sec_kerberos || server->sec_mskerberos || server->sec_iakerb) && (global_secflags &CIFSSEC_MAY_KRB5 ))return Kerberos; fallthrough;
fs/smb/client/smb2pdu.c +1 -1
@@ -1270,7 +1270,7 @@ smb2_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested)if (server->sec_ntlmssp && (global_secflags &CIFSSEC_MAY_NTLMSSP ))return RawNTLMSSP; -if ((server->sec_kerberos || server->sec_mskerberos) && +if ((server->sec_kerberos || server->sec_mskerberos || server->sec_iakerb) && (global_secflags &CIFSSEC_MAY_KRB5 ))return Kerberos; fallthrough;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 142/198 smb: client: Fix match_session bug preventing session reuse
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henrique Carvalho <[email protected]>
[ Upstream commit 605b249ea96770ac4fac4b8510a99e0f8442be5e ]
Fix a bug in match_session() that can causes the session to not be reused in some cases.
Reproduction steps:
mount.cifs //server/share /mnt/a -o credentials=creds mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp cat /proc/fs/cifs/DebugData | grep SessionId | wc -l
mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp mount.cifs //server/share /mnt/a -o credentials=creds cat /proc/fs/cifs/DebugData | grep SessionId | wc -l
--- fs/smb/client/connect.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
fs/smb/client/connect.c +12 -4
@@ -1881,9 +1881,8 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,/* this function must be called with ses_lock and chan_lock held */ static int match_session (struct cifs_ses *ses,struct smb3_fs_context *ctx) { -if (ctx->sectype != Unspecified && - ctx->sectype != ses->sectype) -return 0 ; +struct TCP_Server_Info *server = ses->server; +enum securityEnum ctx_sec, ses_sec;/* * If an existing session is limited to less channels than
@@ -1892,11 +1891,20 @@ static int match_session(struct cifs_ses *ses, struct smb3_fs_context *ctx)if (ses->chan_max < ctx->max_channels)return 0 ; -switch (ses->sectype) { + ctx_sec = server->ops->select_sectype (server, ctx->sectype); + ses_sec = server->ops->select_sectype (server, ses->sectype); + +if (ctx_sec != ses_sec) +return 0 ; + +switch (ctx_sec) { +case IAKerb:case Kerberos:if (!uid_eq (ctx->cred_uid, ses->cred_uid))return 0 ;break ; +case NTLMv2: +case RawNTLMSSP:default :/* NULL username means anonymous session */ if (ses->user_name ==NULL ) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 143/198 HID: apple: disable Fn key handling on the Omoton KB066
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Henrie <[email protected]>
commit 221cea1003d8a412e5ec64a58df7ab19b654f490 upstream.
Remove the fixup to make the Omoton KB066's F6 key F6 when not holding Fn. That was really just a hack to allow typing F6 in fnmode>0, and it didn't fix any of the other F keys that were likewise untypable in fnmode>0. Instead, because the Omoton's Fn key is entirely internal to the keyboard, completely disable Fn key translation when an Omoton is detected, which will prevent the hid-apple driver from interfering with the keyboard's built-in Fn key handling. All of the F keys, including F6, are then typable when Fn is held.
The Omoton KB066 and the Apple A1255 both have HID product code 05ac:022c. The self-reported name of every original A1255 when they left the factory was "Apple Wireless Keyboard". By default, Mac OS changes the name to "<username>'s keyboard" when pairing with the keyboard, but Mac OS allows the user to set the internal name of Apple keyboards to anything they like. The Omoton KB066's name, on the other hand, is not
configurable: It is always "Bluetooth Keyboard". Because that name is so generic that a user might conceivably use the same name for a real Apple keyboard, detect Omoton keyboards based on both having that exact name and having HID product code 022c.
--- drivers/hid/hid-apple.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/hid/hid-apple.c +7 -4
@@ -339,6 +339,12 @@ static bool apple_is_non_apple_keyboard(return false; } +static bool apple_is_omoton_kb066 (struct hid_device *hdev) +{ +return hdev->product ==USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI && +strcmp (hdev->name,"Bluetooth Keyboard" ) ==0 ; +} +static inline void apple_setup_key_translation (struct input_dev *input,const struct apple_key_translation *table) {
@@ -497,9 +503,6 @@ static int hidinput_apple_event(struct h } } -if (usage->hid ==0xc0301 )/* Omoton KB066 quirk */ - code =KEY_F6 ; -if (usage->code != code) {input_event_with_scancode (input, usage->type, code, usage->hid, value);
@@ -679,7 +682,7 @@ static int apple_input_configured(struct {struct apple_sc *asc =hid_get_drvdata (hdev); -if ((asc->quirks &APPLE_HAS_FN ) && !asc->fn_found) { +if (((asc->quirks &APPLE_HAS_FN ) && !asc->fn_found) ||apple_is_omoton_kb066 (hdev)) {hid_info (hdev,"Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling\n" ); asc->quirks &= ~APPLE_HAS_FN ; }
Greg Kroah-Hartman
maintainerPATCH 144/198 nvme-tcp: Fix a C2HTermReq error message
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maurizio Lombardi <[email protected]>
commit afb41b08c44e5386f2f52fa859010ac4afd2b66f upstream.
In H2CTermReq, a FES with value 0x05 means "R2T Limit Exceeded"; but in C2HTermReq the same value has a different meaning (Data Transfer Limit Exceeded).
--- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp.c +1 -1
@@ -706,7 +706,7 @@ static void nvme_tcp_handle_c2h_term(str [NVME_TCP_FES_PDU_SEQ_ERR] = "PDU Sequence Error", [NVME_TCP_FES_HDR_DIGEST_ERR] = "Header Digest Error", [NVME_TCP_FES_DATA_OUT_OF_RANGE] = "Data Transfer Out Of Range", - [NVME_TCP_FES_R2T_LIMIT_EXCEEDED] = "R2T Limit Exceeded", + [NVME_TCP_FES_DATA_LIMIT_EXCEEDED] = "Data Transfer Limit Exceeded", [NVME_TCP_FES_UNSUPPORTED_PARAM] = "Unsupported Parameter", };
Greg Kroah-Hartman
maintainerPATCH 145/198 smb: client: fix potential UAF in cifs_dump_full_key()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit 58acd1f497162e7d282077f816faa519487be045 upstream.
Skip sessions that are being teared down (status == SES_EXITING) to avoid UAF.
--- fs/smb/client/ioctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/smb/client/ioctl.c +5 -1
@@ -246,7 +246,9 @@ static int cifs_dump_full_key(struct cifspin_lock (&cifs_tcp_ses_lock);list_for_each_entry (server_it, &cifs_tcp_ses_list, tcp_ses_list) {list_for_each_entry (ses_it, &server_it->smb_ses_list, smb_ses_list) { -if (ses_it->Suid == out.session_id) { +spin_lock (&ses_it->ses_lock); +if (ses_it->ses_status !=SES_EXITING && + ses_it->Suid == out.session_id) { ses = ses_it;/* * since we are using the session outside the crit
@@ -254,9 +256,11 @@ static int cifs_dump_full_key(struct cif* so increment its refcount */ ses->ses_count++; +spin_unlock (&ses_it->ses_lock); found = true; goto search_end; } +spin_unlock (&ses_it->ses_lock); } } search_end:
Greg Kroah-Hartman
maintainerPATCH 146/198 firmware: imx-scu: fix OF node leak in .probe()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit fbf10b86f6057cf79300720da4ea4b77e6708b0d ]
imx_scu_probe() calls of_parse_phandle_with_args(), but does not release the OF node reference obtained by it. Add a of_node_put() call after done with the node.
--- drivers/firmware/imx/imx-scu.c | 1 + 1 file changed, 1 insertion(+)
drivers/firmware/imx/imx-scu.c +1 -0
@@ -279,6 +279,7 @@ static int imx_scu_probe(struct platform_device *pdev)return ret; sc_ipc->fast_ipc =of_device_is_compatible (args.np,"fsl,imx8-mu-scu" ); +of_node_put (args.np); num_channel = sc_ipc->fast_ipc ?2 :SCU_MU_CHAN_NUM ;for (i =0 ; i < num_channel; i++) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 147/198 arm64: dts: freescale: tqma8mpql: Fix vqmmc-supply
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit 38f59e0e8bd2b3e1319716e4aeaeb9a6223b006d ]
eMMC is supplied by BUCK5 rail. Use the actual regulator instead of a virtual fixed regulator.
--- .../boot/dts/freescale/imx8mp-tqma8mpql.dtsi | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi +4 -12
@@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /* - * Copyright 2021-2022 TQ-Systems GmbH - * Author: Alexander Stein <[email protected]> + * Copyright 2021-2025 TQ-Systems GmbH <[email protected]>, + * D-82229 Seefeld, Germany. + * Author: Alexander Stein */ #include "imx8mp.dtsi"
@@ -23,15 +24,6 @@ reg_vcc3v3: regulator-vcc3v3 { regulator-max-microvolt = <3300000>; regulator-always-on; }; - - /* e-MMC IO, needed for HS modes */ - reg_vcc1v8: regulator-vcc1v8 { - compatible = "regulator-fixed"; - regulator-name = "VCC1V8"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-always-on; - }; }; &A53_0 {
@@ -194,7 +186,7 @@ &usdhc3 { no-sd; no-sdio; vmmc-supply = <®_vcc3v3>; - vqmmc-supply = <®_vcc1v8>; + vqmmc-supply = <&buck5_reg>; status = "okay"; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 148/198 xfrm_output: Force software GSO only in tunnel mode
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <[email protected]>
[ Upstream commit 0aae2867aa6067f73d066bc98385e23c8454a1d7 ]
The cited commit fixed a software GSO bug with VXLAN + IPSec in tunnel mode. Unfortunately, it is slightly broader than necessary, as it also severely affects performance for Geneve + IPSec transport mode over a device capable of both HW GSO and IPSec crypto offload. In this case, xfrm_output unnecessarily triggers software GSO instead of letting the HW do it. In simple iperf3 tests over Geneve + IPSec transport mode over a back-2-back pair of NICs with MTU 1500, the performance was observed to be up to 6x worse when doing software GSO compared to leaving it to the hardware.
This commit makes xfrm_output only trigger software GSO in crypto offload cases for already encapsulated packets in tunnel mode, as not doing so would then cause the inner tunnel skb->inner_networking_header to be overwritten and break software GSO for that packet later if the device turns out to not be capable of HW GSO.
Taking a closer look at the conditions for the original bug, to better understand the reasons for this change:
- vxlan_build_skb -> iptunnel_handle_offloads sets inner_protocol and inner network header.
- then, udp_tunnel_xmit_skb -> ip_tunnel_xmit adds outer transport and network headers.
- later in the xmit path, xfrm_output -> xfrm_outer_mode_output -> xfrm4_prepare_output -> xfrm4_tunnel_encap_add overwrites the inner network header with the one set in ip_tunnel_xmit before adding the second outer header.
- __dev_queue_xmit -> validate_xmit_skb checks whether GSO segmentation needs to happen based on dev features. In the original bug, the hw couldn't segment the packets, so skb_gso_segment was invoked.
- deep in the .gso_segment callback machinery, __skb_udp_tunnel_segment tries to use the wrong inner network header, expecting the one set in iptunnel_handle_offloads but getting the one set by xfrm instead.
- a bit later, ipv6_gso_segment accesses the wrong memory based on that wrong inner network header.
With the new change, the original bug (or similar ones) cannot happen again, as xfrm will now trigger software GSO before applying a tunnel. This concern doesn't exist in packet offload mode, when the HW adds encapsulation headers. For the non-offloaded packets (crypto in SW), software GSO is still done unconditionally in the else branch.
--- net/xfrm/xfrm_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/xfrm/xfrm_output.c +1 -1
@@ -738,7 +738,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb) skb->encapsulation =1 ;if (skb_is_gso (skb)) { -if (skb->inner_protocol) +if (skb->inner_protocol && x->props.mode ==XFRM_MODE_TUNNEL )return xfrm_output_gso (net, sk, skb);skb_shinfo (skb)->gso_type |=SKB_GSO_ESP ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 149/198 soc: imx8m: Remove global soc_uid
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 9c1c02fe8d7f33c18547b79c41f3fa41ef7bae8f ]
The static global soc_uid is only ever used as kasprintf() parameter in imx8m_soc_probe(). Pass pointer to local u64 variable to .soc_revision() callback instead and let the .soc_revision() callback fill in the content. Remove the unnecessary static global variable.
Stable-dep-of: cf7139aac463 ("soc: imx8m: Unregister cpufreq and soc dev in cleanup path")
--- drivers/soc/imx/soc-imx8m.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/soc/imx/soc-imx8m.c +15 -16
@@ -30,11 +30,9 @@struct imx8_soc_data {char *name; -int (*soc_revision)(u32 *socrev); +int (*soc_revision)(u32 *socrev,u64 *socuid); }; -static u64 soc_uid; -#ifdef CONFIG_HAVE_ARM_SMCCC static u32 imx8mq_soc_revision_from_atf (void ) {
@@ -51,7 +49,7 @@ static u32 imx8mq_soc_revision_from_atf(void)static inline u32 imx8mq_soc_revision_from_atf (void ) {return 0 ; };#endif -static int imx8mq_soc_revision (u32 *socrev) +static int imx8mq_soc_revision (u32 *socrev,u64 *socuid) {struct device_node *np;void __iomem *ocotp_base;
@@ -89,9 +87,9 @@ static int imx8mq_soc_revision(u32 *socrev) rev =REV_B1 ; } - soc_uid =readl_relaxed (ocotp_base +OCOTP_UID_HIGH ); - soc_uid <<=32 ; - soc_uid |=readl_relaxed (ocotp_base +OCOTP_UID_LOW ); + *socuid =readl_relaxed (ocotp_base +OCOTP_UID_HIGH ); + *socuid <<=32 ; + *socuid |=readl_relaxed (ocotp_base +OCOTP_UID_LOW ); *socrev = rev;
@@ -109,7 +107,7 @@ static int imx8mq_soc_revision(u32 *socrev)return ret; } -static int imx8mm_soc_uid (void ) +static int imx8mm_soc_uid (u64 *socuid) {void __iomem *ocotp_base;struct device_node *np;
@@ -136,9 +134,9 @@ static int imx8mm_soc_uid(void)clk_prepare_enable (clk); - soc_uid =readl_relaxed (ocotp_base +OCOTP_UID_HIGH + offset); - soc_uid <<=32 ; - soc_uid |=readl_relaxed (ocotp_base +OCOTP_UID_LOW + offset); + *socuid =readl_relaxed (ocotp_base +OCOTP_UID_HIGH + offset); + *socuid <<=32 ; + *socuid |=readl_relaxed (ocotp_base +OCOTP_UID_LOW + offset);clk_disable_unprepare (clk);clk_put (clk);
@@ -151,7 +149,7 @@ static int imx8mm_soc_uid(void)return ret; } -static int imx8mm_soc_revision (u32 *socrev) +static int imx8mm_soc_revision (u32 *socrev,u64 *socuid) {struct device_node *np;void __iomem *anatop_base;
@@ -172,7 +170,7 @@ static int imx8mm_soc_revision(u32 *socrev)iounmap (anatop_base);of_node_put (np); -return imx8mm_soc_uid (); +return imx8mm_soc_uid (socuid); err_iomap:of_node_put (np);
@@ -215,10 +213,11 @@ static __maybe_unused const struct of_device_id imx8_soc_match[] = {static int imx8m_soc_probe (struct platform_device *pdev) {struct soc_device_attribute *soc_dev_attr; -struct soc_device *soc_dev; +const struct imx8_soc_data *data;const struct of_device_id *id; +struct soc_device *soc_dev;u32 soc_rev =0 ; -const struct imx8_soc_data *data; +u64 soc_uid =0 ;int ret; soc_dev_attr =kzalloc (sizeof (*soc_dev_attr),GFP_KERNEL );
@@ -241,7 +240,7 @@ static int imx8m_soc_probe(struct platform_device *pdev)if (data) { soc_dev_attr->soc_id = data->name;if (data->soc_revision) { - ret = data->soc_revision (&soc_rev); + ret = data->soc_revision (&soc_rev, &soc_uid);if (ret) goto free_soc; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 150/198 soc: imx8m: Use devm_* to simplify probe failure handling
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 22b03a4e957e462b380a982759ccf0f6554735d3 ]
Use device managed functions to simplify handling of failures during probe. Remove fail paths which are no longer necessary.
Stable-dep-of: cf7139aac463 ("soc: imx8m: Unregister cpufreq and soc dev in cleanup path")
--- drivers/soc/imx/soc-imx8m.c | 92 ++++++++++++------------------------- 1 file changed, 29 insertions(+), 63 deletions(-)
drivers/soc/imx/soc-imx8m.c +29 -63
@@ -51,22 +51,20 @@ static inline u32 imx8mq_soc_revision_from_atf(void) { return 0; };static int imx8mq_soc_revision (u32 *socrev,u64 *socuid) { -struct device_node *np; + struct device_node *np __free(device_node) = +of_find_compatible_node (NULL ,NULL ,"fsl,imx8mq-ocotp" );void __iomem *ocotp_base;u32 magic;u32 rev;struct clk *clk;int ret; - np =of_find_compatible_node (NULL ,NULL ,"fsl,imx8mq-ocotp" );if (!np)return -EINVAL ; ocotp_base =of_iomap (np,0 ); -if (!ocotp_base) { - ret = -EINVAL ; - goto err_iomap; - } +if (!ocotp_base) +return -EINVAL ; clk =of_clk_get_by_name (np,NULL );if (IS_ERR (clk)) {
@@ -96,35 +94,30 @@ static int imx8mq_soc_revision(u32 *socrev, u64 *socuid)clk_disable_unprepare (clk);clk_put (clk);iounmap (ocotp_base); -of_node_put (np);return 0 ; err_clk:iounmap (ocotp_base); -err_iomap: -of_node_put (np);return ret; }static int imx8mm_soc_uid (u64 *socuid) { + struct device_node *np __free(device_node) = +of_find_compatible_node (NULL ,NULL ,"fsl,imx8mm-ocotp" );void __iomem *ocotp_base; -struct device_node *np;struct clk *clk;int ret =0 ;u32 offset =of_machine_is_compatible ("fsl,imx8mp" ) ?IMX8MP_OCOTP_UID_OFFSET :0 ; - np =of_find_compatible_node (NULL ,NULL ,"fsl,imx8mm-ocotp" );if (!np)return -EINVAL ; ocotp_base =of_iomap (np,0 ); -if (!ocotp_base) { - ret = -EINVAL ; - goto err_iomap; - } +if (!ocotp_base) +return -EINVAL ; clk =of_clk_get_by_name (np,NULL );if (IS_ERR (clk)) {
@@ -143,38 +136,27 @@ static int imx8mm_soc_uid(u64 *socuid) err_clk:iounmap (ocotp_base); -err_iomap: -of_node_put (np); -return ret; }static int imx8mm_soc_revision (u32 *socrev,u64 *socuid) { -struct device_node *np; + struct device_node *np __free(device_node) = +of_find_compatible_node (NULL ,NULL ,"fsl,imx8mm-anatop" );void __iomem *anatop_base; -int ret; - np =of_find_compatible_node (NULL ,NULL ,"fsl,imx8mm-anatop" );if (!np)return -EINVAL ; anatop_base =of_iomap (np,0 ); -if (!anatop_base) { - ret = -EINVAL ; - goto err_iomap; - } +if (!anatop_base) +return -EINVAL ; *socrev =readl_relaxed (anatop_base +ANADIG_DIGPROG_IMX8MM );iounmap (anatop_base); -of_node_put (np);return imx8mm_soc_uid (socuid); - -err_iomap: -of_node_put (np); -return ret; }static const struct imx8_soc_data imx8mq_soc_data = {
@@ -205,22 +187,23 @@ static __maybe_unused const struct of_device_id imx8_soc_match[] = { { } }; -#define imx8_revision (soc_rev) \ - soc_rev ? \ - kasprintf(GFP_KERNEL, "%d.%d", (soc_rev >> 4) & 0xf, soc_rev & 0xf) : \ +#define imx8_revision (dev, soc_rev) \ + (soc_rev) ? \ + devm_kasprintf((dev), GFP_KERNEL, "%d.%d", ((soc_rev) >> 4) & 0xf, (soc_rev) & 0xf) : \ "unknown"static int imx8m_soc_probe (struct platform_device *pdev) {struct soc_device_attribute *soc_dev_attr;const struct imx8_soc_data *data; +struct device *dev = &pdev->dev;const struct of_device_id *id;struct soc_device *soc_dev;u32 soc_rev =0 ;u64 soc_uid =0 ;int ret; - soc_dev_attr =kzalloc (sizeof (*soc_dev_attr),GFP_KERNEL ); + soc_dev_attr =devm_kzalloc (dev,sizeof (*soc_dev_attr),GFP_KERNEL );if (!soc_dev_attr)return -ENOMEM ;
@@ -228,13 +211,11 @@ static int imx8m_soc_probe(struct platform_device *pdev) ret =of_property_read_string (of_root,"model" , &soc_dev_attr->machine);if (ret) - goto free_soc; +return ret; id =of_match_node (imx8_soc_match, of_root); -if (!id) { - ret = -ENODEV ; - goto free_soc; - } +if (!id) +return -ENODEV ; data = id->data;if (data) {
@@ -242,27 +223,21 @@ static int imx8m_soc_probe(struct platform_device *pdev)if (data->soc_revision) { ret = data->soc_revision (&soc_rev, &soc_uid);if (ret) - goto free_soc; +return ret; } } - soc_dev_attr->revision =imx8_revision (soc_rev); -if (!soc_dev_attr->revision) { - ret = -ENOMEM ; - goto free_soc; - } + soc_dev_attr->revision =imx8_revision (dev, soc_rev); +if (!soc_dev_attr->revision) +return -ENOMEM ; - soc_dev_attr->serial_number =kasprintf (GFP_KERNEL ,"%016llX" , soc_uid); -if (!soc_dev_attr->serial_number) { - ret = -ENOMEM ; - goto free_rev; - } + soc_dev_attr->serial_number =devm_kasprintf (dev,GFP_KERNEL ,"%016llX" , soc_uid); +if (!soc_dev_attr->serial_number) +return -ENOMEM ; soc_dev =soc_device_register (soc_dev_attr); -if (IS_ERR (soc_dev)) { - ret =PTR_ERR (soc_dev); - goto free_serial_number; - } +if (IS_ERR (soc_dev)) +return PTR_ERR (soc_dev);pr_info ("SoC: %s revision %s\n" , soc_dev_attr->soc_id, soc_dev_attr->revision);
@@ -271,15 +246,6 @@ static int imx8m_soc_probe(struct platform_device *pdev)platform_device_register_simple ("imx-cpufreq-dt" ,-1 ,NULL ,0 );return 0 ; - -free_serial_number: -kfree (soc_dev_attr->serial_number); -free_rev: -if (strcmp (soc_dev_attr->revision,"unknown" )) -kfree (soc_dev_attr->revision); -free_soc: -kfree (soc_dev_attr); -return ret; }static struct platform_driver imx8m_soc_driver = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 151/198 soc: imx8m: Unregister cpufreq and soc dev in cleanup path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <[email protected]>
[ Upstream commit cf7139aac463880cbd5c5e999c118fbe91631411 ]
Unregister the cpufreq device and soc device when resource unwinding, otherwise there will be warning when do removing test:
sysfs: cannot create duplicate filename '/devices/platform/imx-cpufreq-dt'
CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.13.0-rc1-next-20241204 Hardware name: NXP i.MX8MPlus EVK board (DT)
--- drivers/soc/imx/soc-imx8m.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
drivers/soc/imx/soc-imx8m.c +24 -2
@@ -192,9 +192,20 @@ static __maybe_unused const struct of_device_id imx8_soc_match[] = { devm_kasprintf((dev), GFP_KERNEL, "%d.%d", ((soc_rev) >> 4) & 0xf, (soc_rev) & 0xf) : \ "unknown" +static void imx8m_unregister_soc(void *data) +{ +soc_device_unregister (data); +} + +static void imx8m_unregister_cpufreq (void *data) +{ +platform_device_unregister (data); +} +static int imx8m_soc_probe (struct platform_device *pdev) {struct soc_device_attribute *soc_dev_attr; +struct platform_device *cpufreq_dev;const struct imx8_soc_data *data;struct device *dev = &pdev->dev;const struct of_device_id *id;
@@ -239,11 +250,22 @@ static int imx8m_soc_probe(struct platform_device *pdev)if (IS_ERR (soc_dev))return PTR_ERR (soc_dev); + ret =devm_add_action (dev, imx8m_unregister_soc, soc_dev); +if (ret) +return ret; +pr_info ("SoC: %s revision %s\n" , soc_dev_attr->soc_id, soc_dev_attr->revision); -if (IS_ENABLED (CONFIG_ARM_IMX_CPUFREQ_DT )) -platform_device_register_simple ("imx-cpufreq-dt" ,-1 ,NULL ,0 ); +if (IS_ENABLED (CONFIG_ARM_IMX_CPUFREQ_DT )) { + cpufreq_dev =platform_device_register_simple ("imx-cpufreq-dt" ,-1 ,NULL ,0 ); +if (IS_ERR (cpufreq_dev)) +return dev_err_probe (dev,PTR_ERR (cpufreq_dev), +"Failed to register imx-cpufreq-dev device\n" ); + ret =devm_add_action (dev, imx8m_unregister_cpufreq, cpufreq_dev); +if (ret) +return ret; + }return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 152/198 ARM: dts: bcm2711: PL011 UARTs are actually r1p5
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Elwell <[email protected]>
[ Upstream commit 0de09025f161f67c07978c4742e221243d070d41 ]
The ARM PL011 UART instances in BCM2711 are r1p5 spec, which means they have 32-entry FIFOs. The correct periphid value for this is 0x00341011. Thanks to N Buchwitz for pointing this out.
--- arch/arm/boot/dts/bcm2711.dtsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm/boot/dts/bcm2711.dtsi +5 -4
@@ -134,7 +134,7 @@ uart2: serial@7e201400 { clocks = <&clocks BCM2835_CLOCK_UART>, <&clocks BCM2835_CLOCK_VPU>; clock-names = "uartclk", "apb_pclk"; - arm,primecell-periphid = <0x00241011>; + arm,primecell-periphid = <0x00341011>; status = "disabled"; };
@@ -145,7 +145,7 @@ uart3: serial@7e201600 { clocks = <&clocks BCM2835_CLOCK_UART>, <&clocks BCM2835_CLOCK_VPU>; clock-names = "uartclk", "apb_pclk"; - arm,primecell-periphid = <0x00241011>; + arm,primecell-periphid = <0x00341011>; status = "disabled"; };
@@ -156,7 +156,7 @@ uart4: serial@7e201800 { clocks = <&clocks BCM2835_CLOCK_UART>, <&clocks BCM2835_CLOCK_VPU>; clock-names = "uartclk", "apb_pclk"; - arm,primecell-periphid = <0x00241011>; + arm,primecell-periphid = <0x00341011>; status = "disabled"; };
@@ -167,7 +167,7 @@ uart5: serial@7e201a00 { clocks = <&clocks BCM2835_CLOCK_UART>, <&clocks BCM2835_CLOCK_VPU>; clock-names = "uartclk", "apb_pclk"; - arm,primecell-periphid = <0x00241011>; + arm,primecell-periphid = <0x00341011>; status = "disabled"; };
@@ -1154,6 +1154,7 @@ &txp { }; &uart0 { + arm,primecell-periphid = <0x00341011>; interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 153/198 RDMA/bnxt_re: Add missing paranthesis in map_qp_id_to_tbl_indx
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kashyap Desai <[email protected]>
[ Upstream commit 67ee8d496511ad8e1cb88f72944847e7b3e4e47c ]
The modulo operation returns wrong result without the paranthesis and that resulted in wrong QP table indexing.
--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +2 -1
@@ -220,9 +220,10 @@ int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw);int bnxt_qplib_init_rcfw (struct bnxt_qplib_rcfw *rcfw,struct bnxt_qplib_ctx *ctx,int is_virtfn);void bnxt_qplib_mark_qp_error (void *qp_handle); +static inline u32 map_qp_id_to_tbl_indx (u32 qid,struct bnxt_qplib_rcfw *rcfw) {/* Last index of the qp_tbl is for QP1 ie. qp_tbl_size - 1*/ -return (qid ==1 ) ? rcfw->qp_tbl_size -1 : qid % rcfw->qp_tbl_size -2 ; +return (qid ==1 ) ? rcfw->qp_tbl_size -1 : (qid % (rcfw->qp_tbl_size -2 )); }#endif /* __BNXT_QPLIB_RCFW_H__ */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 154/198 ARM: OMAP1: select CONFIG_GENERIC_IRQ_CHIP
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 98f3ab18a0a55aa1ff2cd6b74bd0c02c8f76f17e ]
When GENERIC_IRQ_CHIP is disabled, OMAP1 kernels fail to link:
arm-linux-gnueabi-ld: arch/arm/mach-omap1/irq.o: in function `omap1_init_irq':
irq.c:(.init.text+0x1e8): undefined reference to `irq_alloc_generic_chip'
arm-linux-gnueabi-ld: irq.c:(.init.text+0x228): undefined reference to `irq_setup_generic_chip'
arm-linux-gnueabi-ld: irq.c:(.init.text+0x2a8): undefined reference to `irq_gc_set_wake'
arm-linux-gnueabi-ld: irq.c:(.init.text+0x2b0): undefined reference to `irq_gc_mask_set_bit'
arm-linux-gnueabi-ld: irq.c:(.init.text+0x2b4): undefined reference to `irq_gc_mask_clr_bit'
This has apparently been the case for many years, but I never caught it in randconfig builds until now, as there are dozens of other drivers that also 'select GENERIC_IRQ_CHIP' and statistically there is almost always one of them enabled.
--- arch/arm/mach-omap1/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap1/Kconfig +1 -0
@@ -9,6 +9,7 @@ menuconfig ARCH_OMAP1 select ARCH_OMAP select CLKSRC_MMIO select FORCE_PCI if PCCARD + select GENERIC_IRQ_CHIP select GPIOLIB help Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 155/198 ARM: dts: bcm2711: Dont mark timer regs unconfigured
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Elwell <[email protected]>
[ Upstream commit c24f272ae751a9f54f8816430e7f2d56031892cc ]
During upstream process of Raspberry Pi 4 back in 2019 the ARMv7 stubs didn't configured the ARM architectural timer. This firmware issue has been fixed in 2020, which gave users enough time to update their system.
So drop this property to allow the use of the vDSO version of clock_gettime.
--- arch/arm/boot/dts/bcm2711.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm/boot/dts/bcm2711.dtsi +0 -2
@@ -451,8 +451,6 @@ IRQ_TYPE_LEVEL_LOW)>, IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; - /* This only applies to the ARMv7 stub */ - arm,cpu-registers-not-fw-configured; }; cpus: cpus {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 156/198 RDMA/bnxt_re: Avoid clearing VLAN_ID mask in modify qp path
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saravanan Vajravel <[email protected]>
[ Upstream commit 81c0db302a674f8004ed805393d17fd76f552e83 ]
Driver is always clearing the mask that sets the VLAN ID/Service Level in the adapter. Recent change for supporting multiple traffic class exposed this issue.
Allow setting SL and VLAN_ID while QP is moved from INIT to RTR state.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +0 -2
@@ -1186,8 +1186,6 @@ static void __modify_flags_from_init_state(struct bnxt_qplib_qp *qp) qp->path_mtu =CMDQ_MODIFY_QP_PATH_MTU_MTU_2048 ; } - qp->modify_flags &= - ~CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID ;/* Bono FW require the max_dest_rd_atomic to be >= 1 */ if (qp->max_dest_rd_atomic <1 ) qp->max_dest_rd_atomic =1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 157/198 RDMA/hns: Fix soft lockup during bt pages loop
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxian Huang <[email protected]>
[ Upstream commit 25655580136de59ec89f09089dd28008ea440fc9 ]
Driver runs a for-loop when allocating bt pages and mapping them with buffer pages. When a large buffer (e.g. MR over 100GB) is being allocated, it may require a considerable loop count. This will lead to soft lockup:
watchdog: BUG: soft lockup - CPU#27 stuck for 22s!
...
Call trace:
hem_list_alloc_mid_bt+0x124/0x394 [hns_roce_hw_v2]
hns_roce_hem_list_request+0xf8/0x160 [hns_roce_hw_v2]
hns_roce_mtr_create+0x2e4/0x360 [hns_roce_hw_v2]
alloc_mr_pbl+0xd4/0x17c [hns_roce_hw_v2]
hns_roce_reg_user_mr+0xf8/0x190 [hns_roce_hw_v2]
ib_uverbs_reg_mr+0x118/0x290
watchdog: BUG: soft lockup - CPU#35 stuck for 23s!
...
Call trace:
hns_roce_hem_list_find_mtt+0x7c/0xb0 [hns_roce_hw_v2]
mtr_map_bufs+0xc4/0x204 [hns_roce_hw_v2]
hns_roce_mtr_create+0x31c/0x3c4 [hns_roce_hw_v2]
alloc_mr_pbl+0xb0/0x160 [hns_roce_hw_v2]
hns_roce_reg_user_mr+0x108/0x1c0 [hns_roce_hw_v2]
ib_uverbs_reg_mr+0x120/0x2bcAdd a cond_resched() to fix soft lockup during these loops. In order not to affect the allocation performance of normal-size buffer, set the loop count of a 100GB MR as the threshold to call cond_resched().
--- drivers/infiniband/hw/hns/hns_roce_hem.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_hem.c +15 -1
@@ -1416,6 +1416,11 @@ static int hem_list_alloc_root_bt(struct hns_roce_dev *hr_dev,return ret; } +/* This is the bottom bt pages number of a 100G MR on 4K OS, assuming +* the bt page size is not expanded by cal_best_bt_pg_sz() +*/ +#define RESCHED_LOOP_CNT_THRESHOLD_ON_4K 12800 +/* construct the base address table and link them by address hop config */ int hns_roce_hem_list_request(struct hns_roce_dev *hr_dev, struct hns_roce_hem_list *hem_list,
@@ -1424,6 +1429,7 @@ int hns_roce_hem_list_request(struct hns_roce_dev *hr_dev, {const struct hns_roce_buf_region *r;int ofs, end; +int loop;int unit;int ret;int i;
@@ -1441,7 +1447,10 @@ int hns_roce_hem_list_request(struct hns_roce_dev *hr_dev,continue ; end = r->offset + r->count; -for (ofs = r->offset; ofs < end; ofs += unit) { +for (ofs = r->offset, loop =1 ; ofs < end; ofs += unit, loop++) { +if (!(loop %RESCHED_LOOP_CNT_THRESHOLD_ON_4K )) +cond_resched (); + ret =hem_list_alloc_mid_bt (hr_dev, r, unit, ofs, hem_list->mid_bt[i], &hem_list->btm_bt);
@@ -1498,9 +1507,14 @@ void *hns_roce_hem_list_find_mtt(struct hns_roce_dev *hr_dev,struct list_head *head = &hem_list->btm_bt;struct hns_roce_hem_item *hem, *temp_hem;void *cpu_base =NULL ; +int loop =1 ;int nr =0 ;list_for_each_entry_safe (hem, temp_hem, head, sibling) { +if (!(loop %RESCHED_LOOP_CNT_THRESHOLD_ON_4K )) +cond_resched (); + loop++; +if (hem_list_page_is_in_range (hem, offset)) { nr = offset - hem->start; cpu_base = hem->addr + nr *BA_BYTE_LEN ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 158/198 RDMA/hns: Fix unmatched condition in error path of alloc_user_qp_db()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxian Huang <[email protected]>
[ Upstream commit b9f59a24ba35a7d955a9f8e148dd9f85b7b40a01 ]
Currently the condition of unmapping sdb in error path is not exactly the same as the condition of mapping in alloc_user_qp_db(). This may cause a problem of unmapping an unmapped db in some case, such as when the QP is XRC TGT. Unified the two conditions.
--- drivers/infiniband/hw/hns/hns_roce_qp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hns/hns_roce_qp.c +5 -3
@@ -924,12 +924,14 @@ static int alloc_user_qp_db(struct hns_roce_dev *hr_dev,struct hns_roce_ib_create_qp *ucmd, struct hns_roce_ib_create_qp_resp *resp) { + bool has_sdb = user_qp_has_sdb(hr_dev, init_attr, udata, resp, ucmd);struct hns_roce_ucontext *uctx =rdma_udata_to_drv_context (udata, struct hns_roce_ucontext, ibucontext); +bool has_rdb =user_qp_has_rdb (hr_dev, init_attr, udata, resp);struct ib_device *ibdev = &hr_dev->ib_dev;int ret; -if (user_qp_has_sdb (hr_dev, init_attr, udata, resp, ucmd)) { +if (has_sdb) { ret =hns_roce_db_map_user (uctx, ucmd->sdb_addr, &hr_qp->sdb);if (ret) { ibdev_err(ibdev,
@@ -940,7 +942,7 @@ static int alloc_user_qp_db(struct hns_roce_dev *hr_dev, hr_qp->en_flags |=HNS_ROCE_QP_CAP_SQ_RECORD_DB ; } -if (user_qp_has_rdb (hr_dev, init_attr, udata, resp)) { +if (has_rdb) { ret =hns_roce_db_map_user (uctx, ucmd->db_addr, &hr_qp->rdb);if (ret) { ibdev_err(ibdev,
@@ -954,7 +956,7 @@ static int alloc_user_qp_db(struct hns_roce_dev *hr_dev,return 0 ; err_sdb: -if (hr_qp->en_flags &HNS_ROCE_QP_CAP_SQ_RECORD_DB ) +if (has_sdb)hns_roce_db_unmap_user (uctx, &hr_qp->sdb); err_out:return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 159/198 RDMA/hns: Fix a missing rollback in error path of hns_roce_create_qp_common()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxian Huang <[email protected]>
[ Upstream commit 444907dd45cbe62fd69398805b6e2c626fab5b3a ]
When ib_copy_to_udata() fails in hns_roce_create_qp_common(), hns_roce_qp_remove() should be called in the error path to clean up resources in hns_roce_qp_store().
--- drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_qp.c +1 -1
@@ -1213,7 +1213,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, min(udata->outlen, sizeof(resp)));if (ret) {ibdev_err (ibdev,"copy qp resp failed!\n" ); - goto err_store; + goto err_flow_ctrl; } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 160/198 RDMA/hns: Fix wrong value of max_sge_rd
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxian Huang <[email protected]>
[ Upstream commit 6b5e41a8b51fce520bb09bd651a29ef495e990de ]
There is no difference between the sge of READ and non-READ operations in hns RoCE. Set max_sge_rd to the same value as max_send_sge.
--- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_main.c +1 -1
@@ -182,7 +182,7 @@ static int hns_roce_query_device(struct ib_device *ib_dev,IB_DEVICE_RC_RNR_NAK_GEN ; props->max_send_sge = hr_dev->caps.max_sq_sg; props->max_recv_sge = hr_dev->caps.max_rq_sg; - props->max_sge_rd =1 ; + props->max_sge_rd = hr_dev->caps.max_sq_sg; props->max_cq = hr_dev->caps.num_cqs; props->max_cqe = hr_dev->caps.max_cqes; props->max_mr = hr_dev->caps.num_mtpts;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 161/198 Bluetooth: Fix error code in chan_alloc_skb_cb()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 72d061ee630d0dbb45c2920d8d19b3861c413e54 ]
The chan_alloc_skb_cb() function is supposed to return error pointers on error. Returning NULL will lead to a NULL dereference.
--- net/bluetooth/6lowpan.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/bluetooth/6lowpan.c +6 -1
@@ -825,11 +825,16 @@ static struct sk_buff *chan_alloc_skb_cb(struct l2cap_chan *chan,unsigned long hdr_len, unsigned long len, int nb) { + struct sk_buff *skb; +/* Note that we must allocate using GFP_ATOMIC here as * this function is called originally from netdev hard xmit * function in atomic context. */ -return bt_skb_alloc (hdr_len + len,GFP_ATOMIC ); + skb =bt_skb_alloc (hdr_len + len,GFP_ATOMIC ); +if (!skb) +return ERR_PTR (-ENOMEM ); +return skb; }static void chan_suspend_cb (struct l2cap_chan *chan)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 162/198 ipv6: Fix memleak of nhc_pcpu_rth_output in fib_check_nh_v6_gw().
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 9740890ee20e01f99ff1dde84c63dcf089fabb98 ]
fib_check_nh_v6_gw() expects that fib6_nh_init() cleans up everything when it fails.
Commit 7dd73168e273 ("ipv6: Always allocate pcpu memory in a fib6_nh") moved fib_nh_common_init() before alloc_percpu_gfp() within fib6_nh_init() but forgot to add cleanup for fib6_nh->nh_common.nhc_pcpu_rth_output in case it fails to allocate fib6_nh->rt6i_pcpu, resulting in memleak.
Let's call fib_nh_common_release() and clear nhc_pcpu_rth_output in the error path.
Note that we can remove the fib6_nh_release() call in nh_create_ipv6() later in net-next.git.
--- net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/route.c +2 -1
@@ -3637,7 +3637,8 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,in6_dev_put (idev);if (err) { -lwtstate_put (fib6_nh->fib_nh_lws); +fib_nh_common_release (&fib6_nh->nh_common); + fib6_nh->nh_common.nhc_pcpu_rth_output =NULL ; fib6_nh->fib_nh_lws =NULL ;dev_put (dev); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 163/198 ipv6: Set errno after ip_fib_metrics_init() in ip6_route_info_create().
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 9a81fc3480bf5dbe2bf80e278c440770f6ba2692 ]
While creating a new IPv6, we could get a weird -ENOMEM when RTA_NH_ID is set and either of the conditions below is true:
1) CONFIG_IPV6_SUBTREES is enabled and rtm_src_len is specified
2) nexthop_get() fails
e.g.)
# strace ip -6 route add fe80::dead:beef:dead:beef nhid 1 from ::
recvmsg(3, {msg_iov=[{iov_base=[...[
{error=-ENOMEM, msg=[... [...]]},
[{nla_len=49, nla_type=NLMSGERR_ATTR_MSG}, "Nexthops can not be used with so"...]
]], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 148Let's set err explicitly after ip_fib_metrics_init() in ip6_route_info_create().
--- net/ipv6/route.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv6/route.c +2 -0
@@ -3798,10 +3798,12 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,if (nh) {if (rt->fib6_src.plen) {NL_SET_ERR_MSG (extack,"Nexthops can not be used with source routing" ); + err = -EINVAL ; goto out_free; }if (!nexthop_get (nh)) {NL_SET_ERR_MSG (extack,"Nexthop has been deleted" ); + err = -ENOENT ; goto out_free; } rt->nh = nh;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 164/198 net: atm: fix use after free in lec_send()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit f3009d0d6ab78053117f8857b921a8237f4d17b3 ]
The ->send() operation frees skb so save the length before calling ->send() to avoid a use after free.
--- net/atm/lec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/atm/lec.c +2 -1
@@ -181,6 +181,7 @@ static void lec_send(struct atm_vcc *vcc, struct sk_buff *skb) { struct net_device *dev = skb->dev; +unsigned int len = skb->len;ATM_SKB (skb)->vcc = vcc;atm_account_tx (vcc, skb);
@@ -191,7 +192,7 @@ lec_send(struct atm_vcc *vcc, struct sk_buff *skb) } dev->stats.tx_packets++; - dev->stats.tx_bytes += skb->len; + dev->stats.tx_bytes += len; }static void lec_tx_timeout (struct net_device *dev,unsigned int txqueue)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 165/198 net: lwtunnel: fix recursion loops
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Iurman <[email protected]>
[ Upstream commit 986ffb3a57c5650fb8bf6d59a8f0f07046abfeb6 ]
This patch acts as a parachute, catch all solution, by detecting recursion loops in lwtunnel users and taking care of them (e.g., a loop between routes, a loop within the same route, etc). In general, such loops are the consequence of pathological configurations. Each lwtunnel user is still free to catch such loops early and do whatever they want with them. It will be the case in a separate patch for, e.g., seg6 and seg6_local, in order to provide drop reasons and update statistics. Another example of a lwtunnel user taking care of loops is ioam6, which has valid use cases that include loops (e.g., inline mode), and which is addressed by the next patch in this series. Overall, this patch acts as a last resort to catch loops and drop packets, since we don't want to leak something unintentionally because of a pathological configuration in lwtunnels.
The solution in this patch reuses dev_xmit_recursion(), dev_xmit_recursion_inc(), and dev_xmit_recursion_dec(), which seems fine considering the context.
--- net/core/lwtunnel.c | 65 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 12 deletions(-)
net/core/lwtunnel.c +53 -12
@@ -23,6 +23,8 @@#include <net/ip6_fib.h> #include <net/rtnh.h> +#include "dev.h" +DEFINE_STATIC_KEY_FALSE (nf_hooks_lwtunnel_enabled);EXPORT_SYMBOL_GPL (nf_hooks_lwtunnel_enabled);
@@ -325,13 +327,23 @@ EXPORT_SYMBOL_GPL(lwtunnel_cmp_encap);int lwtunnel_output (struct net *net,struct sock *sk,struct sk_buff *skb) { -struct dst_entry *dst =skb_dst (skb);const struct lwtunnel_encap_ops *ops;struct lwtunnel_state *lwtstate; -int ret = -EINVAL ; +struct dst_entry *dst; +int ret; + +if (dev_xmit_recursion ()) { +net_crit_ratelimited ("%s(): recursion limit reached on datapath\n" , + __func__); + ret = -ENETDOWN ; + goto drop; + } -if (!dst) + dst =skb_dst (skb); +if (!dst) { + ret = -EINVAL ; goto drop; + } lwtstate = dst->lwtstate; if (lwtstate->type == LWTUNNEL_ENCAP_NONE ||
@@ -341,8 +353,11 @@ int lwtunnel_output(struct net *net, struct sock *sk, struct sk_buff *skb) ret = -EOPNOTSUPP ;rcu_read_lock (); ops =rcu_dereference (lwtun_encaps[lwtstate->type]); -if (likely (ops && ops->output)) +if (likely (ops && ops->output)) { +dev_xmit_recursion_inc (); ret = ops->output (net, sk, skb); +dev_xmit_recursion_dec (); + }rcu_read_unlock ();if (ret == -EOPNOTSUPP )
@@ -359,13 +374,23 @@ EXPORT_SYMBOL_GPL(lwtunnel_output);int lwtunnel_xmit (struct sk_buff *skb) { -struct dst_entry *dst =skb_dst (skb);const struct lwtunnel_encap_ops *ops;struct lwtunnel_state *lwtstate; -int ret = -EINVAL ; +struct dst_entry *dst; +int ret; + +if (dev_xmit_recursion ()) { +net_crit_ratelimited ("%s(): recursion limit reached on datapath\n" , + __func__); + ret = -ENETDOWN ; + goto drop; + } -if (!dst) + dst =skb_dst (skb); +if (!dst) { + ret = -EINVAL ; goto drop; + } lwtstate = dst->lwtstate;
@@ -376,8 +401,11 @@ int lwtunnel_xmit(struct sk_buff *skb) ret = -EOPNOTSUPP ;rcu_read_lock (); ops =rcu_dereference (lwtun_encaps[lwtstate->type]); -if (likely (ops && ops->xmit)) +if (likely (ops && ops->xmit)) { +dev_xmit_recursion_inc (); ret = ops->xmit (skb); +dev_xmit_recursion_dec (); + }rcu_read_unlock ();if (ret == -EOPNOTSUPP )
@@ -394,13 +422,23 @@ EXPORT_SYMBOL_GPL(lwtunnel_xmit);int lwtunnel_input (struct sk_buff *skb) { -struct dst_entry *dst =skb_dst (skb);const struct lwtunnel_encap_ops *ops;struct lwtunnel_state *lwtstate; -int ret = -EINVAL ; +struct dst_entry *dst; +int ret; -if (!dst) +if (dev_xmit_recursion ()) { +net_crit_ratelimited ("%s(): recursion limit reached on datapath\n" , + __func__); + ret = -ENETDOWN ; goto drop; + } + + dst =skb_dst (skb); +if (!dst) { + ret = -EINVAL ; + goto drop; + } lwtstate = dst->lwtstate; if (lwtstate->type == LWTUNNEL_ENCAP_NONE ||
@@ -410,8 +448,11 @@ int lwtunnel_input(struct sk_buff *skb) ret = -EOPNOTSUPP ;rcu_read_lock (); ops =rcu_dereference (lwtun_encaps[lwtstate->type]); -if (likely (ops && ops->input)) +if (likely (ops && ops->input)) { +dev_xmit_recursion_inc (); ret = ops->input (skb); +dev_xmit_recursion_dec (); + }rcu_read_unlock ();if (ret == -EOPNOTSUPP )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 166/198 net/neighbor: add missing policy for NDTPA_QUEUE_LENBYTES
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ma <[email protected]>
[ Upstream commit 90a7138619a0c55e2aefaad27b12ffc2ddbeed78 ]
Previous commit 8b5c171bb3dc ("neigh: new unresolved queue limits") introduces new netlink attribute NDTPA_QUEUE_LENBYTES to represent approximative value for deprecated QUEUE_LEN. However, it forgot to add the associated nla_policy in nl_ntbl_parm_policy array. Fix it with one simple NLA_U32 type policy.
--- net/core/neighbour.c | 1 + 1 file changed, 1 insertion(+)
net/core/neighbour.c +1 -0
@@ -2283,6 +2283,7 @@ static const struct nla_policy nl_neightbl_policy[NDTA_MAX+1] = {static const struct nla_policy nl_ntbl_parm_policy[NDTPA_MAX +1 ] = { [NDTPA_IFINDEX ] = { .type =NLA_U32 }, [NDTPA_QUEUE_LEN ] = { .type =NLA_U32 }, + [NDTPA_QUEUE_LENBYTES ] = { .type =NLA_U32 }, [NDTPA_PROXY_QLEN ] = { .type =NLA_U32 }, [NDTPA_APP_PROBES ] = { .type =NLA_U32 }, [NDTPA_UCAST_PROBES ] = { .type =NLA_U32 },
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 167/198 Revert "gre: Fix IPv6 link-local address generation."
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
[ Upstream commit fc486c2d060f67d672ddad81724f7c8a4d329570 ]
This reverts commit 183185a18ff96751db52a46ccf93fff3a1f42815.
This patch broke net/forwarding/ip6gre_custom_multipath_hash.sh in some circumstances (https://lore.kernel.org/netdev/Z9RIyKZDNoka53EO@mini-arch/).
Let's revert it while the problem is being investigated.
--- net/ipv6/addrconf.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
net/ipv6/addrconf.c +6 -9
@@ -3162,13 +3162,16 @@ static void add_v4_addrs(struct inet6_dev *idev)struct in6_addr addr;struct net_device *dev;struct net *net =dev_net (idev->dev); -int scope, plen; +int scope, plen, offset =0 ;u32 pflags =0 ;ASSERT_RTNL ();memset (&addr,0 ,sizeof (struct in6_addr )); -memcpy (&addr.s6_addr32[3 ], idev->dev->dev_addr,4 ); +/* in case of IP6GRE the dev_addr is an IPv6 and therefore we use only the last 4 bytes */ +if (idev->dev->addr_len ==sizeof (struct in6_addr )) + offset =sizeof (struct in6_addr ) -4 ; +memcpy (&addr.s6_addr32[3 ], idev->dev->dev_addr + offset,4 );if (!(idev->dev->flags &IFF_POINTOPOINT ) && idev->dev->type ==ARPHRD_SIT ) { scope = IPV6_ADDR_COMPATv4;
@@ -3478,13 +3481,7 @@ static void addrconf_gre_config(struct net_device *dev)return ; } -/* Generate the IPv6 link-local address using addrconf_addr_gen(), -* unless we have an IPv4 GRE device not bound to an IP address and -* which is in EUI64 mode (as __ipv6_isatap_ifid() would fail in this -* case). Such devices fall back to add_v4_addrs() instead. -*/ -if (!(dev->type ==ARPHRD_IPGRE && *(__be32 *)dev->dev_addr ==0 && - idev->cnf.addr_gen_mode ==IN6_ADDR_GEN_MODE_EUI64 )) { +if (dev->type ==ARPHRD_ETHER ) {addrconf_addr_gen (idev, true);return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 168/198 i2c: omap: fix IRQ storms
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Kemnade <[email protected]>
commit 285df995f90e3d61d97f327d34b9659d92313314 upstream.
On the GTA04A5 writing a reset command to the gyroscope causes IRQ storms because NACK IRQs are enabled and therefore triggered but not acked.
Sending a reset command to the gyroscope by
i2cset 1 0x69 0x14 0xb6
with an additional debug print in the ISR (not the thread) itself causes
[ 363.353515] i2c i2c-1: ioctl, cmd=0x720, arg=0xbe801b00 [ 363.359039] omap_i2c 48072000.i2c: addr: 0x0069, len: 2, flags: 0x0, stop: 1 [ 363.366180] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x1110) [ 363.371673] omap_i2c 48072000.i2c: IRQ (ISR = 0x0010) [ 363.376892] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x0102) [ 363.382263] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x0102) [ 363.387664] omap_i2c 48072000.i2c: IRQ LL (ISR = 0x0102)
repeating till infinity
[...]
(0x2 = NACK, 0x100 = Bus free, which is not enabled) Apparently no other IRQ bit gets set, so this stalls.
Do not ignore enabled interrupts and make sure they are acked. If the NACK IRQ is not needed, it should simply not enabled, but according to the above log, caring about it is necessary unless the Bus free IRQ is enabled and handled. The assumption that is will always come with a ARDY IRQ, which was the idea behind ignoring it, proves wrong.
It is true for simple reads from an unused address.
To still avoid the i2cdetect trouble which is the reason for commit c770657bd261 ("i2c: omap: Fix standard mode false ACK readings"), avoid doing much about NACK in omap_i2c_xfer_data() which is used by both IRQ mode and polling mode, so also the false detection fix is extended to polling usage and IRQ storms are avoided.
By changing this, the hardirq handler is not needed anymore to filter stuff.
The mentioned gyro reset now just causes a -ETIMEDOUT instead of hanging the system.
--- drivers/i2c/busses/i2c-omap.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-)
drivers/i2c/busses/i2c-omap.c +7 -19
@@ -1049,23 +1049,6 @@ static int omap_i2c_transmit_data(structreturn 0 ; } -static irqreturn_t -omap_i2c_isr (int irq,void *dev_id) -{ -struct omap_i2c_dev *omap = dev_id; -irqreturn_t ret =IRQ_HANDLED ; -u16 mask; -u16 stat; - - stat =omap_i2c_read_reg (omap,OMAP_I2C_STAT_REG ); - mask =omap_i2c_read_reg (omap,OMAP_I2C_IE_REG ) & ~OMAP_I2C_STAT_NACK ; - -if (stat & mask) - ret =IRQ_WAKE_THREAD ; - -return ret; -} -static int omap_i2c_xfer_data (struct omap_i2c_dev *omap) {u16 bits;
@@ -1096,8 +1079,13 @@ static int omap_i2c_xfer_data(struct oma }if (stat &OMAP_I2C_STAT_NACK ) { - err |=OMAP_I2C_STAT_NACK ; + omap->cmd_err |=OMAP_I2C_STAT_NACK ;omap_i2c_ack_stat (omap,OMAP_I2C_STAT_NACK ); + +if (!(stat & ~OMAP_I2C_STAT_NACK )) { + err = -EAGAIN ; +break ; + } }if (stat &OMAP_I2C_STAT_AL ) {
@@ -1475,7 +1463,7 @@ omap_i2c_probe(struct platform_device *p IRQF_NO_SUSPEND, pdev->name, omap); else r =devm_request_threaded_irq (&pdev->dev, omap->irq, - omap_i2c_isr, omap_i2c_isr_thread, +NULL , omap_i2c_isr_thread,IRQF_NO_SUSPEND |IRQF_ONESHOT , pdev->name, omap);
Greg Kroah-Hartman
maintainerPATCH 169/198 can: rcar_canfd: Fix page entries in the AFL list
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Biju Das <[email protected]>
commit 1dba0a37644ed3022558165bbb5cb9bda540eaf7 upstream.
There are a total of 96 AFL pages and each page has 16 entries with registers CFDGAFLIDr, CFDGAFLMr, CFDGAFLP0r, CFDGAFLP1r holding the rule entries (r = 0..15).
Currently, RCANFD_GAFL* macros use a start variable to find AFL entries, which is incorrect as the testing on RZ/G3E shows ch1 and ch4 gets a start value of 0 and the register contents are overwritten.
Fix this issue by using rule_entry corresponding to the channel to find the page entries in the AFL list.
--- drivers/net/can/rcar/rcar_canfd.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-)
drivers/net/can/rcar/rcar_canfd.c +11 -17
@@ -772,22 +772,14 @@ static void rcar_canfd_configure_control }static void rcar_canfd_configure_afl_rules (struct rcar_canfd_global *gpriv, -u32 ch) +u32 ch,u32 rule_entry) { -u32 cfg; -int offset, start, page, num_rules =RCANFD_CHANNEL_NUMRULES ; +int offset, page, num_rules =RCANFD_CHANNEL_NUMRULES ; +u32 rule_entry_index = rule_entry %16 ;u32 ridx = ch +RCANFD_RFFIFO_IDX ; -if (ch ==0 ) { - start =0 ;/* Channel 0 always starts from 0th rule */ - }else { -/* Get number of Channel 0 rules and adjust */ - cfg =rcar_canfd_read (gpriv->base,RCANFD_GAFLCFG (ch)); - start =RCANFD_GAFLCFG_GETRNC (gpriv,0 , cfg); - } -/* Enable write access to entry */ - page =RCANFD_GAFL_PAGENUM (start); + page =RCANFD_GAFL_PAGENUM (rule_entry);rcar_canfd_set_bit (gpriv->base,RCANFD_GAFLECTR , (RCANFD_GAFLECTR_AFLPN (gpriv, page) |RCANFD_GAFLECTR_AFLDAE ));
@@ -803,13 +795,13 @@ static void rcar_canfd_configure_afl_rul offset =RCANFD_C_GAFL_OFFSET ;/* Accept all IDs */ -rcar_canfd_write (gpriv->base,RCANFD_GAFLID (offset, start),0 ); +rcar_canfd_write (gpriv->base,RCANFD_GAFLID (offset, rule_entry_index),0 );/* IDE or RTR is not considered for matching */ -rcar_canfd_write (gpriv->base,RCANFD_GAFLM (offset, start),0 ); +rcar_canfd_write (gpriv->base,RCANFD_GAFLM (offset, rule_entry_index),0 );/* Any data length accepted */ -rcar_canfd_write (gpriv->base,RCANFD_GAFLP0 (offset, start),0 ); +rcar_canfd_write (gpriv->base,RCANFD_GAFLP0 (offset, rule_entry_index),0 );/* Place the msg in corresponding Rx FIFO entry */ -rcar_canfd_set_bit (gpriv->base,RCANFD_GAFLP1 (offset, start), +rcar_canfd_set_bit (gpriv->base,RCANFD_GAFLP1 (offset, rule_entry_index),RCANFD_GAFLP1_GAFLFDP (ridx));/* Disable write access to page */
@@ -1825,6 +1817,7 @@ static int rcar_canfd_probe(struct platfunsigned long channels_mask =0 ;int err, ch_irq, g_irq;int g_err_irq, g_recc_irq; +u32 rule_entry =0 ;bool fdmode = true;/* CAN FD only mode - default */ enum rcanfd_chip_id chip_id;int max_channels;
@@ -2003,7 +1996,8 @@ static int rcar_canfd_probe(struct platfrcar_canfd_configure_tx (gpriv, ch);/* Configure receive rules */ -rcar_canfd_configure_afl_rules (gpriv, ch); +rcar_canfd_configure_afl_rules (gpriv, ch, rule_entry); + rule_entry +=RCANFD_CHANNEL_NUMRULES ; }/* Configure common interrupts */
Greg Kroah-Hartman
maintainerPATCH 170/198 can: flexcan: only change CAN state when link up in system PM
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haibo Chen <[email protected]>
commit fd99d6ed20234b83d65b9c5417794343577cf3e5 upstream.
After a suspend/resume cycle on a down interface, it will come up as ERROR-ACTIVE.
$ ip -details -s -s a s dev flexcan0
3: flexcan0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default qlen 10
link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0
can state STOPPED (berr-counter tx 0 rx 0) restart-ms 1000$ sudo systemctl suspend
$ ip -details -s -s a s dev flexcan0
3: flexcan0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default qlen 10
link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 1000And only set CAN state to CAN_STATE_ERROR_ACTIVE when resume process has no issue, otherwise keep in CAN_STATE_SLEEPING as suspend did.
--- drivers/net/can/flexcan/flexcan-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/can/flexcan/flexcan-core.c +4 -2
@@ -2236,8 +2236,9 @@ static int __maybe_unused flexcan_suspen }netif_stop_queue (dev);netif_device_detach (dev); + + priv->can.state =CAN_STATE_SLEEPING ; } - priv->can.state =CAN_STATE_SLEEPING ;return 0 ; }
@@ -2248,7 +2249,6 @@ static int __maybe_unused flexcan_resumestruct flexcan_priv *priv =netdev_priv (dev);int err; - priv->can.state =CAN_STATE_ERROR_ACTIVE ;if (netif_running (dev)) {netif_device_attach (dev);netif_start_queue (dev);
@@ -2268,6 +2268,8 @@ static int __maybe_unused flexcan_resumeflexcan_chip_interrupts_enable (dev); } + + priv->can.state =CAN_STATE_ERROR_ACTIVE ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 171/198 can: flexcan: disable transceiver during system PM
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haibo Chen <[email protected]>
commit 5a19143124be42900b3fbc9ada3c919632eb45eb upstream.
During system PM, if no wakeup requirement, disable transceiver to save power.
--- drivers/net/can/flexcan/flexcan-core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/can/flexcan/flexcan-core.c +11 -1
@@ -2230,6 +2230,10 @@ static int __maybe_unused flexcan_suspenflexcan_chip_interrupts_disable (dev); + err =flexcan_transceiver_disable (priv); +if (err) +return err; + err =pinctrl_pm_select_sleep_state (device);if (err)return err;
@@ -2262,10 +2266,16 @@ static int __maybe_unused flexcan_resumeif (err)return err; - err =flexcan_chip_start (dev); + err =flexcan_transceiver_enable (priv);if (err)return err; + err =flexcan_chip_start (dev); +if (err) { +flexcan_transceiver_disable (priv); +return err; + } +flexcan_chip_interrupts_enable (dev); }
Greg Kroah-Hartman
maintainerPATCH 172/198 drm/v3d: Dont run jobs that have errors flagged in its fence
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maíra Canal <[email protected]>
commit 80cbee810e4e13cdbd3ae9654e9ecddf17f3e828 upstream.
The V3D driver still relies on drm_sched_increase_karma() and drm_sched_resubmit_jobs() for resubmissions when a timeout occurs. The function drm_sched_increase_karma() marks the job as guilty, while drm_sched_resubmit_jobs() sets an error (-ECANCELED) in the DMA fence of that guilty job.
Because of this, we must check whether the job’s DMA fence has been flagged with an error before executing the job. Otherwise, the same guilty job may be resubmitted indefinitely, causing repeated GPU resets.
This patch adds a check for an error on the job's fence to prevent running a guilty job that was previously flagged when the GPU timed out.
Note that the CPU and CACHE_CLEAN queues do not require this check, as their jobs are executed synchronously once the DRM scheduler starts them.
--- drivers/gpu/drm/v3d/v3d_sched.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/v3d/v3d_sched.c +8 -1
@@ -179,11 +179,15 @@ v3d_tfu_job_run(struct drm_sched_job *scstruct drm_device *dev = &v3d->drm;struct dma_fence *fence; +if (unlikely (job->base.base.s_fence->finished.error)) +return NULL ; + + v3d->tfu_job = job; + fence =v3d_fence_create (v3d,V3D_TFU );if (IS_ERR (fence))return NULL ; - v3d->tfu_job = job;if (job->base.irq_fence)dma_fence_put (job->base.irq_fence); job->base.irq_fence =dma_fence_get (fence);
@@ -217,6 +221,9 @@ v3d_csd_job_run(struct drm_sched_job *scstruct dma_fence *fence;int i; +if (unlikely (job->base.base.s_fence->finished.error)) +return NULL ; + v3d->csd_job = job;v3d_invalidate_caches (v3d);
Greg Kroah-Hartman
maintainerPATCH 173/198 regulator: check that dummy regulator has been probed before using it
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Eggers <[email protected]>
commit 2c7a50bec4958f1d1c84d19cde518d0e96a676fd upstream.
Due to asynchronous driver probing there is a chance that the dummy regulator hasn't already been probed when first accessing it.
--- drivers/regulator/core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/regulator/core.c +11 -1
@@ -2091,6 +2091,10 @@ static int regulator_resolve_supply(struif (have_full_constraints ()) { r = dummy_regulator_rdev; +if (!r) { + ret = -EPROBE_DEFER ; + goto out; + }get_device (&r->dev); }else { dev_err(dev, "Failed to resolve %s-supply for %s\n",
@@ -2108,6 +2112,10 @@ static int regulator_resolve_supply(stru goto out; } r = dummy_regulator_rdev; +if (!r) { + ret = -EPROBE_DEFER ; + goto out; + }get_device (&r->dev); }
@@ -2216,8 +2224,10 @@ struct regulator *_regulator_get(struct* enabled, even if it isn't hooked up, and just * provide a dummy. */ -dev_warn (dev,"supply %s not found, using dummy regulator\n" , id); rdev = dummy_regulator_rdev; +if (!rdev) +return ERR_PTR (-EPROBE_DEFER ); +dev_warn (dev,"supply %s not found, using dummy regulator\n" , id);get_device (&rdev->dev);break ;
Greg Kroah-Hartman
maintainerPATCH 174/198 arm64: dts: freescale: imx8mm-verdin-dahlia: add Microphone Jack to sound card
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Eichenberger <[email protected]>
commit 2c1092823eb03f8508d6769e2f38eef7e1fe62a0 upstream.
The simple-audio-card's microphone widget currently connects to the headphone jack. Routing the microphone input to the microphone jack allows for independent operation of the microphone and headphones.
This resolves the following boot-time kernel log message, which indicated a conflict when the microphone and headphone functions were not separated:
debugfs: File 'Headphone Jack' in directory 'dapm' already present!
--- arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi +3 -3
@@ -16,10 +16,10 @@ "Headphone Jack", "HPOUTR", "IN2L", "Line In Jack", "IN2R", "Line In Jack", - "Headphone Jack", "MICBIAS", - "IN1L", "Headphone Jack"; + "Microphone Jack", "MICBIAS", + "IN1L", "Microphone Jack"; simple-audio-card,widgets = - "Microphone", "Headphone Jack", + "Microphone", "Microphone Jack", "Headphone", "Headphone Jack", "Line", "Line In Jack";
Greg Kroah-Hartman
maintainerPATCH 175/198 arm64: dts: rockchip: Add missing PCIe supplies to RockPro64 board dtsi
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dragan Simic <[email protected]>
commit ffcef3df680c437ca33ff434be18ec24d72907c2 upstream.
Add missing "vpcie0v9-supply" and "vpcie1v8-supply" properties to the "pcie0" node in the Pine64 RockPro64 board dtsi file. This eliminates the following warnings from the kernel log:
rockchip-pcie f8000000.pcie: supply vpcie1v8 not found, using dummy regulator rockchip-pcie f8000000.pcie: supply vpcie0v9 not found, using dummy regulator
These additions improve the accuracy of hardware description of the RockPro64 and, in theory, they should result in no functional changes to the way board works after the changes, because the "vcca_0v9" and "vcca_1v8" regulators are always enabled. [1][2] However, extended reliability testing, performed by Chris, [3] has proven that the age-old issues with some PCI Express cards, when used with a Pine64 RockPro64, are also resolved.
Those issues were already mentioned in the commit 43853e843aa6 (arm64: dts:
rockchip: Remove unsupported node from the Pinebook Pro dts, 2024-04-01), together with a brief description of the out-of-tree enumeration delay patch that reportedly resolves those issues. In a nutshell, booting a RockPro64 with some PCI Express cards attached to it caused a kernel oops. [4]
Symptomatically enough, to the commit author's best knowledge, only the Pine64 RockPro64, out of all RK3399-based boards and devices supported upstream, has been reported to suffer from those PCI Express issues, and only the RockPro64 had some of the PCI Express supplies missing in its DT. Thus, perhaps some weird timing issues exist that caused the "vcca_1v8" always-on regulator, which is part of the RK808 PMIC, to actually not be enabled before the PCI Express is initialized and enumerated on the RockPro64, causing oopses with some PCIe cards, and the aforementioned enumeration delay patch [4] probably acted as just a workaround for the underlying timing issue.
Admittedly, the Pine64 RockPro64 is a bit specific board by having a standard PCI Express slot, allowing use of various standard cards, but pretty much standard PCI Express cards have been attached to other RK3399 boards as well, and the commit author is unaware ot such issues reported for them.
It's quite hard to be sure that the PCI Express issues are fully resolved by these additions to the DT, without some really extensive and time-consuming testing. However, these additions to the DT can result in good things and improvements anyway, making them perfectly safe from the standpoint of being unable to do any harm or cause some unforeseen regressions.
These changes apply to the both supported hardware revisions of the Pine64 RockPro64, i.e. to the production-run revisions 2.0 and 2.1. [1][2]
[1] https://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf
[2] https://files.pine64.org/doc/rockpro64/rockpro64_v20-SCH.pdf
[3] https://z9.de/hedgedoc/s/nF4d5G7rg#reboot-tests-for-PCIe-improvements
[4] https://lore.kernel.org/lkml/[email protected]/T/#u
--- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi +2 -0
@@ -667,6 +667,8 @@ num-lanes = <4>; pinctrl-names = "default"; pinctrl-0 = <&pcie_perst>; + vpcie0v9-supply = <&vcca_0v9>; + vpcie1v8-supply = <&vcca_1v8>; vpcie12v-supply = <&vcc12v_dcin>; vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay";
Greg Kroah-Hartman
maintainerPATCH 176/198 mmc: sdhci-brcmstb: add cqhci suspend/resume to PM ops
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamal Dasu <[email protected]>
commit 723ef0e20dbb2aa1b5406d2bb75374fc48187daa upstream.
cqhci timeouts observed on brcmstb platforms during suspend:
...
[ 164.832853] mmc0: cqhci: timeout for tag 18 ...
Adding cqhci_suspend()/resume() calls to disable cqe in sdhci_brcmstb_suspend()/resume() respectively to fix CQE timeouts seen on PM suspend.
--- drivers/mmc/host/sdhci-brcmstb.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/mmc/host/sdhci-brcmstb.c +10 -0
@@ -396,8 +396,15 @@ static int sdhci_brcmstb_suspend(structstruct sdhci_host *host =dev_get_drvdata (dev);struct sdhci_pltfm_host *pltfm_host =sdhci_priv (host);struct sdhci_brcmstb_priv *priv =sdhci_pltfm_priv (pltfm_host); +int ret;clk_disable_unprepare (priv->base_clk); +if (host->mmc->caps2 &MMC_CAP2_CQE ) { + ret =cqhci_suspend (host->mmc); +if (ret) +return ret; + } +return sdhci_pltfm_suspend (dev); }
@@ -422,6 +429,9 @@ static int sdhci_brcmstb_resume(struct d ret = clk_set_rate(priv->base_clk, priv->base_freq_hz); } +if (host->mmc->caps2 &MMC_CAP2_CQE ) + ret =cqhci_resume (host->mmc); +return ret; }#endif
Greg Kroah-Hartman
maintainerPATCH 177/198 mmc: atmel-mci: Add missing clk_disable_unprepare()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gu Bowen <[email protected]>
commit e51a349d2dcf1df8422dabb90b2f691dc7df6f92 upstream.
The error path when atmci_configure_dma() set dma fails in atmci driver does not correctly disable the clock.
Add the missing clk_disable_unprepare() to the error path for pair with clk_prepare_enable().
--- drivers/mmc/host/atmel-mci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/atmel-mci.c +3 -1
@@ -2506,8 +2506,10 @@ static int atmci_probe(struct platform_d/* Get MCI capabilities and set operations according to it */ atmci_get_cap (host); ret =atmci_configure_dma (host); -if (ret == -EPROBE_DEFER ) +if (ret == -EPROBE_DEFER ) { +clk_disable_unprepare (host->mck); goto err_dma_probe_defer; + }if (ret ==0 ) { host->prepare_data = &atmci_prepare_data_dma; host->submit_data = &atmci_submit_data_dma;
Greg Kroah-Hartman
maintainerPATCH 178/198 proc: fix UAF in proc_get_inode()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ye Bin <[email protected]>
commit 654b33ada4ab5e926cd9c570196fefa7bec7c1df upstream.
Fix race between rmmod and /proc/XXX's inode instantiation.
The bug is that pde->proc_ops don't belong to /proc, it belongs to a module, therefore dereferencing it after /proc entry has been registered is a bug unless use_pde/unuse_pde() pair has been used.
use_pde/unuse_pde can be avoided (2 atomic ops!) because pde->proc_ops never changes so information necessary for inode instantiation can be saved _before_ proc_register() in PDE itself and used later, avoiding pde->proc_ops->... dereference.
rmmod lookupsys_delete_module
proc_lookup_de
pde_get(de);
proc_get_inode(dir->i_sb, de);
mod->exit()
proc_remove
remove_proc_subtree
proc_entry_rundown(de); free_module(mod);
if (S_ISREG(inode->i_mode))
if (de->proc_ops->proc_read_iter)
--> As module is already freed, will trigger UAFBUG: unable to handle page fault for address: fffffbfff80a702b PGD 817fc4067 P4D 817fc4067 PUD 817fc0067 PMD 102ef4067 PTE 0 Oops: Oops: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 26 UID: 0 PID: 2667 Comm: ls Tainted: G Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:proc_get_inode+0x302/0x6e0 RSP: 0018:ffff88811c837998 EFLAGS: 00010a06 RAX: dffffc0000000000 RBX: ffffffffc0538140 RCX: 0000000000000007 RDX: 1ffffffff80a702b RSI: 0000000000000001 RDI: ffffffffc0538158 RBP: ffff8881299a6000 R08: 0000000067bbe1e5 R09: 1ffff11023906f20 R10: ffffffffb560ca07 R11: ffffffffb2b43a58 R12: ffff888105bb78f0 R13: ffff888100518048 R14: ffff8881299a6004 R15: 0000000000000001 FS: 00007f95b9686840(0000) GS:ffff8883af100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: fffffbfff80a702b CR3: 0000000117dd2000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> proc_lookup_de+0x11f/0x2e0 __lookup_slow+0x188/0x350 walk_component+0x2ab/0x4f0 path_lookupat+0x120/0x660 filename_lookup+0x1ce/0x560 vfs_statx+0xac/0x150 __do_sys_newstat+0x96/0x110 do_syscall_64+0x5f/0x170 entry_SYSCALL_64_after_hwframe+0x76/0x7e
--- fs/proc/generic.c | 10 +++++++++- fs/proc/inode.c | 6 +++--- fs/proc/internal.h | 14 ++++++++++++++ include/linux/proc_fs.h | 7 +++++-- 4 files changed, 31 insertions(+), 6 deletions(-)
fs/proc/generic.c +9 -1
@@ -558,10 +558,16 @@ struct proc_dir_entry *proc_create_reg(creturn p; } -static inline void pde_set_flags (struct proc_dir_entry *pde) +static void pde_set_flags (struct proc_dir_entry *pde) {if (pde->proc_ops->proc_flags &PROC_ENTRY_PERMANENT ) pde->flags |=PROC_ENTRY_PERMANENT ; +if (pde->proc_ops->proc_read_iter) + pde->flags |= PROC_ENTRY_proc_read_iter; +#ifdef CONFIG_COMPAT +if (pde->proc_ops->proc_compat_ioctl) + pde->flags |= PROC_ENTRY_proc_compat_ioctl; +#endif } struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
@@ -625,6 +631,7 @@ struct proc_dir_entry *proc_create_seq_p p->proc_ops = &proc_seq_ops; p->seq_ops = ops; p->state_size = state_size; +pde_set_flags (p);return proc_register (parent, p); }EXPORT_SYMBOL (proc_create_seq_private);
@@ -655,6 +662,7 @@ struct proc_dir_entry *proc_create_singlreturn NULL ; p->proc_ops = &proc_single_ops; p->single_show = show; +pde_set_flags (p);return proc_register (parent, p); }EXPORT_SYMBOL (proc_create_single_data);
fs/proc/inode.c +3 -3
@@ -679,13 +679,13 @@ struct inode *proc_get_inode(struct supeif (S_ISREG (inode->i_mode)) { inode->i_op = de->proc_iops; -if (de->proc_ops->proc_read_iter) +if (pde_has_proc_read_iter (de)) inode->i_fop = &proc_iter_file_ops;else inode->i_fop = &proc_reg_file_ops;#ifdef CONFIG_COMPAT -if (de->proc_ops->proc_compat_ioctl) { -if (de->proc_ops->proc_read_iter) +if (pde_has_proc_compat_ioctl (de)) { +if (pde_has_proc_read_iter (de)) inode->i_fop = &proc_iter_file_ops_compat;else inode->i_fop = &proc_reg_file_ops_compat;
fs/proc/internal.h +14 -0
@@ -84,6 +84,20 @@ static inline void pde_make_permanent(st pde->flags |=PROC_ENTRY_PERMANENT ; } +static inline bool pde_has_proc_read_iter (const struct proc_dir_entry *pde) +{ +return pde->flags & PROC_ENTRY_proc_read_iter; +} + +static inline bool pde_has_proc_compat_ioctl (const struct proc_dir_entry *pde) +{ +#ifdef CONFIG_COMPAT +return pde->flags & PROC_ENTRY_proc_compat_ioctl; +#else +return false; +#endif +} +extern struct kmem_cache *proc_dir_entry_cache;void pde_free (struct proc_dir_entry *pde);
include/linux/proc_fs.h +5 -2
@@ -20,10 +20,13 @@ enum {* If in doubt, ignore this flag. */ #ifdef MODULE - PROC_ENTRY_PERMANENT = 0U, + PROC_ENTRY_PERMANENT = 0U, #else - PROC_ENTRY_PERMANENT = 1U << 0, + PROC_ENTRY_PERMANENT = 1U << 0, #endif + + PROC_ENTRY_proc_read_iter = 1U << 1, + PROC_ENTRY_proc_compat_ioctl = 1U << 2, }; struct proc_ops {
Greg Kroah-Hartman
maintainerPATCH 179/198 memcg: drain obj stock on cpu hotplug teardown
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <[email protected]>
commit 9f01b4954490d4ccdbcc2b9be34a9921ceee9cbb upstream.
Currently on cpu hotplug teardown, only memcg stock is drained but we need to drain the obj stock as well otherwise we will miss the stats accumulated on the target cpu as well as the nr_bytes cached. The stats include MEMCG_KMEM, NR_SLAB_RECLAIMABLE_B & NR_SLAB_UNRECLAIMABLE_B. In addition we are leaking reference to struct obj_cgroup object.
--- mm/memcontrol.c | 9 +++++++++ 1 file changed, 9 insertions(+)
mm/memcontrol.c +9 -0
@@ -2368,9 +2368,18 @@ static void drain_all_stock(struct mem_cstatic int memcg_hotplug_cpu_dead (unsigned int cpu) {struct memcg_stock_pcp *stock; +struct obj_cgroup *old; +unsigned long flags; stock = &per_cpu (memcg_stock, cpu); + +/* drain_obj_stock requires stock_lock */ +local_lock_irqsave (&memcg_stock.stock_lock, flags); + old =drain_obj_stock (stock); +local_unlock_irqrestore (&memcg_stock.stock_lock, flags); +drain_stock (stock); +obj_cgroup_put (old);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 180/198 ARM: shmobile: smp: Enforce shmobile_smp_* alignment
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 379c590113ce46f605439d4887996c60ab8820cc upstream.
When the addresses of the shmobile_smp_mpidr, shmobile_smp_fn, and shmobile_smp_arg variables are not multiples of 4 bytes, secondary CPU bring-up fails:
smp: Bringing up secondary CPUs ...
CPU1: failed to come online
CPU2: failed to come online
CPU3: failed to come online
smp: Brought up 1 node, 1 CPU
Fix this by adding the missing alignment directive.
--- arch/arm/mach-shmobile/headsmp.S | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/headsmp.S +1 -0
@@ -136,6 +136,7 @@ ENDPROC(shmobile_smp_sleep) .long shmobile_smp_arg - 1b .bss + .align 2 .globl shmobile_smp_mpidr shmobile_smp_mpidr: .space NR_CPUS * 4
Greg Kroah-Hartman
maintainerPATCH 181/198 efi/libstub: Avoid physical address 0x0 when doing random allocation
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit cb16dfed0093217a68c0faa9394fa5823927e04c upstream.
Ben reports spurious EFI zboot failures on a system where physical RAM starts at 0x0. When doing random memory allocation from the EFI stub on such a platform, a random seed of 0x0 (which means no entropy source is available) will result in the allocation to be placed at address 0x0 if sufficient space is available.
When this allocation is subsequently passed on to the decompression code, the 0x0 address is mistaken for NULL and the code complains and gives up.
So avoid address 0x0 when doing random allocation, and set the minimum address to the minimum alignment.
--- drivers/firmware/efi/libstub/randomalloc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/firmware/efi/libstub/randomalloc.c +4 -0
@@ -75,6 +75,10 @@ efi_status_t efi_random_alloc(unsigned lif (align <EFI_ALLOC_ALIGN ) align =EFI_ALLOC_ALIGN ; +/* Avoid address 0x0, as it can be mistaken for NULL */ +if (alloc_min ==0 ) + alloc_min = align; + size =round_up (size,EFI_ALLOC_ALIGN );/* count the suitable slots in each memory map entry */
Greg Kroah-Hartman
maintainerPATCH 182/198 xsk: fix an integer overflow in xp_create_and_assign_umem()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavrilov Ilia <[email protected]>
commit 559847f56769037e5b2e0474d3dbff985b98083d upstream.
Since the i and pool->chunk_size variables are of type 'u32', their product can wrap around and then be cast to 'u64'. This can lead to two different XDP buffers pointing to the same memory area.
Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE.
--- net/xdp/xsk_buff_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/xdp/xsk_buff_pool.c +1 -1
@@ -102,7 +102,7 @@ struct xsk_buff_pool *xp_create_and_assiif (pool->unaligned) pool->free_heads[i] = xskb;else -xp_init_xskb_addr (xskb, pool, i * pool->chunk_size); +xp_init_xskb_addr (xskb, pool, (u64 )i * pool->chunk_size); }return pool;
Greg Kroah-Hartman
maintainerPATCH 183/198 batman-adv: Ignore own maximum aggregation size during RX
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sven Eckelmann <[email protected]>
commit 548b0c5de7619ef53bbde5590700693f2f6d2a56 upstream.
An OGMv1 and OGMv2 packet receive processing were not only limited by the number of bytes in the received packet but also by the nodes maximum aggregation packet size limit. But this limit is relevant for TX and not for RX. It must not be enforced by batadv_(i)v_ogm_aggr_packet to avoid loss of information in case of a different limit for sender and receiver.
This has a minor side effect for B.A.T.M.A.N. IV because the batadv_iv_ogm_aggr_packet is also used for the preprocessing for the TX. But since the aggregation code itself will not allow more than BATADV_MAX_AGGREGATION_BYTES bytes, this check was never triggering (in this context) prior of removing it.
--- net/batman-adv/bat_iv_ogm.c | 3 +-- net/batman-adv/bat_v_ogm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
net/batman-adv/bat_iv_ogm.c +1 -2
@@ -325,8 +325,7 @@ batadv_iv_ogm_aggr_packet(int buff_pos,/* check if there is enough space for the optional TVLV */ next_buff_pos +=ntohs (ogm_packet->tvlv_len); -return (next_buff_pos <= packet_len) && - (next_buff_pos <=BATADV_MAX_AGGREGATION_BYTES ); +return next_buff_pos <= packet_len; }/* send a batman ogm to a given interface */
net/batman-adv/bat_v_ogm.c +1 -2
@@ -840,8 +840,7 @@ batadv_v_ogm_aggr_packet(int buff_pos, i/* check if there is enough space for the optional TVLV */ next_buff_pos +=ntohs (ogm2_packet->tvlv_len); -return (next_buff_pos <= packet_len) && - (next_buff_pos <=BATADV_MAX_AGGREGATION_BYTES ); +return next_buff_pos <= packet_len; }/**
Greg Kroah-Hartman
maintainerPATCH 184/198 soc: qcom: pdr: Fix the potential deadlock
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saranya R <[email protected]>
commit 2eeb03ad9f42dfece63051be2400af487ddb96d2 upstream.
When some client process A call pdr_add_lookup() to add the look up for the service and does schedule locator work, later a process B got a new server packet indicating locator is up and call pdr_locator_new_server() which eventually sets pdr->locator_init_complete to true which process A sees and takes list lock and queries domain list but it will timeout due to deadlock as the response will queued to the same qmi->wq and it is ordered workqueue and process B is not able to complete new server request work due to deadlock on list lock.
Fix it by removing the unnecessary list iteration as the list iteration is already being done inside locator work, so avoid it here and just call schedule_work() here.
Process A Process B
process_scheduled_works()pdr_add_lookup() qmi_data_ready_work()
process_scheduled_works() pdr_locator_new_server()
pdr->locator_init_complete=true;
pdr_locator_work()
mutex_lock(&pdr->list_lock);
pdr_locate_service() mutex_lock(&pdr->list_lock);
pdr_get_domain_list()
pr_err("PDR: %s get domain list
txn wait failed: %d\n",
req->service_name,
ret);Timeout error log due to deadlock:
"
PDR: tms/servreg get domain list txn wait failed: -110
PDR: service lookup for msm/adsp/sensor_pd:tms/servreg failed: -110
"
Thanks to Bjorn and Johan for letting me know that this commit also fixes an audio regression when using the in-kernel pd-mapper as that makes it easier to hit this race. [1]
--- drivers/soc/qcom/pdr_interface.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/soc/qcom/pdr_interface.c +1 -7
@@ -74,7 +74,6 @@ static int pdr_locator_new_server(struct { struct pdr_handle *pdr = container_of(qmi, struct pdr_handle, locator_hdl); -struct pdr_service *pds;mutex_lock (&pdr->lock);/* Create a local client port for QMI communication */
@@ -86,12 +85,7 @@ static int pdr_locator_new_server(structmutex_unlock (&pdr->lock);/* Service pending lookup requests */ -mutex_lock (&pdr->list_lock); -list_for_each_entry (pds, &pdr->lookups, node) { -if (pds->need_locator_lookup) -schedule_work (&pdr->locator_work); - } -mutex_unlock (&pdr->list_lock); +schedule_work (&pdr->locator_work);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 185/198 drm/radeon: fix uninitialized size issue in radeon_vce_cs_parse()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Zhandarovich <[email protected]>
commit dd8689b52a24807c2d5ce0a17cb26dc87f75235c upstream.
On the off chance that command stream passed from userspace via ioctl() call to radeon_vce_cs_parse() is weirdly crafted and first command to execute is to encode (case 0x03000001), the function in question will attempt to call radeon_vce_cs_reloc() with size argument that has not been properly initialized. Specifically, 'size' will point to 'tmp' variable before the latter had a chance to be assigned any value.
Play it safe and init 'tmp' with 0, thus ensuring that radeon_vce_cs_reloc() will catch an early error in cases like these.
Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE.
--- drivers/gpu/drm/radeon/radeon_vce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_vce.c +1 -1
@@ -557,7 +557,7 @@ int radeon_vce_cs_parse(struct radeon_cs {int session_idx =-1 ;bool destroyed = false, created = false, allocated = false; -uint32_t tmp, handle =0 ; +uint32_t tmp =0 , handle =0 ;uint32_t *size = &tmp;int i, r =0 ;
Greg Kroah-Hartman
maintainerPATCH 186/198 drm/amdgpu: Fix JPEG video caps max size for navi1x and raven
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Rosca <[email protected]>
commit ec33964d9d88488fa954a03d476a8b811efc6e85 upstream.
8192x8192 is the maximum supported resolution.
--- drivers/gpu/drm/amd/amdgpu/nv.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
@@ -87,7 +87,7 @@ static const struct amdgpu_video_codec_i {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 4096, 4096, 4)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)}, - {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)}, + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 8192, 8192, 0)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)}, };
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -1
@@ -125,7 +125,7 @@ static const struct amdgpu_video_codec_i {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 4096, 52)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1, 4096, 4096, 4)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 4096, 4096, 186)}, - {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)}, + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 8192, 8192, 0)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 4096, 4096, 0)}, };
Greg Kroah-Hartman
maintainerPATCH 187/198 ksmbd: fix incorrect validation for num_aces field of smb_acl
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 1b8b67f3c5e5169535e26efedd3e422172e2db64 upstream.
parse_dcal() validate num_aces to allocate posix_ace_state_array.
if (num_aces > ULONG_MAX / sizeof(struct smb_ace *))
It is an incorrect validation that we can create an array of size ULONG_MAX. smb_acl has ->size field to calculate actual number of aces in request buffer size. Use this to check invalid num_aces.
--- fs/smb/server/smbacl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/smb/server/smbacl.c +4 -1
@@ -398,7 +398,9 @@ static void parse_dacl(struct user_namesif (num_aces <=0 )return ; -if (num_aces >ULONG_MAX /sizeof (struct smb_ace *)) +if (num_aces > (le16_to_cpu (pdacl->size) -sizeof (struct smb_acl )) / + (offsetof(struct smb_ace , sid) + + offsetof(struct smb_sid , sub_auth) +sizeof (__le16)))return ; ret =init_acl_state (&acl_state, num_aces);
@@ -432,6 +434,7 @@ static void parse_dacl(struct user_names offsetof(struct smb_sid , sub_auth); if (end_of_acl - acl_base < acl_size || + ppace[i]->sid.num_subauth == 0 || ppace[i]->sid.num_subauth > SID_MAX_SUB_AUTHORITIES || (end_of_acl - acl_base < acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth) ||
Greg Kroah-Hartman
maintainerPATCH 188/198 drm/amd/display: Use HW lock mgr for PSR1 when only one eDP
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit acbf16a6ae775b4db86f537448cc466288aa307e upstream.
[WHY]
DMUB locking is important to make sure that registers aren't accessed while in PSR. Previously it was enabled but caused a deadlock in situations with multiple eDP panels.
[HOW]
Detect if multiple eDP panels are in use to decide whether to use lock. Refactor the function so that the first check is for PSR-SU and then replay is in use to prevent having to look up number of eDP panels for those configurations.
[superm1: Adjust for missing replay support bfeefe6ea5f1,
Adjust for dc_get_edp_links not being renamed from get_edp_links()]
--- drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +12 -0
@@ -67,5 +67,17 @@ bool should_use_dmub_lock(struct dc_link {if (link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 )return true; + +/* only use HW lock for PSR1 on single eDP */ +if (link->psr_settings.psr_version ==DC_PSR_VERSION_1 ) { +struct dc_link *edp_links[MAX_NUM_EDP ]; +int edp_num; + +get_edp_links (link->dc, edp_links, &edp_num); + +if (edp_num ==1 ) +return true; + } +return false; }
Greg Kroah-Hartman
maintainerPATCH 189/198 mptcp: Fix data stream corruption in the address announcement
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arthur Mongodin <[email protected]>
commit 2c1f97a52cb827a5f2768e67a9dddffae1ed47ab upstream.
Because of the size restriction in the TCP options space, the MPTCP ADD_ADDR option is exclusive and cannot be sent with other MPTCP ones. For this reason, in the linked mptcp_out_options structure, group of fields linked to different options are part of the same union.
There is a case where the mptcp_pm_add_addr_signal() function can modify opts->addr, but not ended up sending an ADD_ADDR. Later on, back in mptcp_established_options, other options will be sent, but with unexpected data written in other fields due to the union, e.g. in opts->ext_copy. This could lead to a data stream corruption in the next packet.
Using an intermediate variable, prevents from corrupting previously established DSS option. The assignment of the ADD_ADDR option parameters is now done once we are sure this ADD_ADDR option can be set in the packet, e.g. after having dropped other suboptions.
[ Matt: the commit message has been updated: long lines splits and some
clarifications. ]
--- net/mptcp/options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/mptcp/options.c +4 -2
@@ -649,6 +649,7 @@ static bool mptcp_established_options_adstruct mptcp_sock *msk =mptcp_sk (subflow->conn);bool drop_other_suboptions = false;unsigned int opt_size = *size; +struct mptcp_addr_info addr;bool echo;int len;
@@ -657,7 +658,7 @@ static bool mptcp_established_options_ad*/ if (!mptcp_pm_should_add_signal (msk) || (opts->suboptions & (OPTION_MPTCP_MPJ_ACK |OPTION_MPTCP_MPC_ACK )) || - !mptcp_pm_add_addr_signal (msk, skb, opt_size, remaining, &opts->addr, + !mptcp_pm_add_addr_signal (msk, skb, opt_size, remaining, &addr, &echo, &drop_other_suboptions))return false;
@@ -670,7 +671,7 @@ static bool mptcp_established_options_adelse if (opts->suboptions &OPTION_MPTCP_DSS )return false; - len =mptcp_add_addr_len (opts->addr.family, echo, !!opts->addr.port); + len =mptcp_add_addr_len (addr.family, echo, !!addr.port);if (remaining < len)return false;
@@ -687,6 +688,7 @@ static bool mptcp_established_options_ad opts->ahmac =0 ; *size -= opt_size; } + opts->addr = addr; opts->suboptions |=OPTION_MPTCP_ADD_ADDR ;if (!echo) { opts->ahmac = add_addr_generate_hmac(msk->local_key,
Greg Kroah-Hartman
maintainerPATCH 190/198 netfilter: nft_counter: Use u64_stats_t for statistic.
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 4a1d3acd6ea86075e77fcc1188c3fc372833ba73 upstream.
The nft_counter uses two s64 counters for statistics. Those two are protected by a seqcount to ensure that the 64bit variable is always properly seen during updates even on 32bit architectures where the store is performed by two writes. A side effect is that the two counter (bytes and packet) are written and read together in the same window.
This can be replaced with u64_stats_t. write_seqcount_begin()/ end() is replaced with u64_stats_update_begin()/ end() and behaves the same way as with seqcount_t on 32bit architectures. Additionally there is a preempt_disable on PREEMPT_RT to ensure that a reader does not preempt a writer.
On 64bit architectures the macros are removed and the reads happen without any retries. This also means that the reader can observe one counter (bytes) from before the update and the other counter (packets) but that is okay since there is no requirement to have both counter from the same update window.
Convert the statistic to u64_stats_t. There is one optimisation:nft_counter_do_init() and nft_counter_clone() allocate a new per-CPU counter and assign a value to it. During this assignment preemption is disabled which is not needed because the counter is not yet exposed to the system so there can not be another writer or reader. Therefore disabling preemption is omitted and raw_cpu_ptr() is used to obtain a pointer to a counter for the assignment.
--- net/netfilter/nft_counter.c | 90 ++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 44 deletions(-)
net/netfilter/nft_counter.c +46 -44
@@ -8,7 +8,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h> -#include <linux/seqlock.h> +#include <linux/u64_stats_sync.h> #include <linux/netlink.h> #include <linux/netfilter.h> #include <linux/netfilter/nf_tables.h>
@@ -17,6 +17,11 @@#include <net/netfilter/nf_tables_offload.h> struct nft_counter { +u64_stats_t bytes; +u64_stats_t packets; +}; + +struct nft_counter_tot {s64 bytes;s64 packets; };
@@ -25,25 +30,24 @@ struct nft_counter_percpu_priv {struct nft_counter __percpu *counter; }; -static DEFINE_PER_CPU(seqcount_t, nft_counter_seq); +static DEFINE_PER_CPU(struct u64_stats_sync, nft_counter_sync);static inline void nft_counter_do_eval (struct nft_counter_percpu_priv *priv,struct nft_regs *regs,const struct nft_pktinfo *pkt) { +struct u64_stats_sync *nft_sync;struct nft_counter *this_cpu; -seqcount_t *myseq;local_bh_disable (); this_cpu =this_cpu_ptr (priv->counter); - myseq =this_cpu_ptr (&nft_counter_seq); - -write_seqcount_begin (myseq); + nft_sync =this_cpu_ptr (&nft_counter_sync); - this_cpu->bytes += pkt->skb->len; - this_cpu->packets++; +u64_stats_update_begin (nft_sync); +u64_stats_add (&this_cpu->bytes, pkt->skb->len); +u64_stats_inc (&this_cpu->packets); +u64_stats_update_end (nft_sync); -write_seqcount_end (myseq);local_bh_enable (); }
@@ -66,17 +70,16 @@ static int nft_counter_do_init(const strif (cpu_stats ==NULL )return -ENOMEM ; -preempt_disable (); - this_cpu =this_cpu_ptr (cpu_stats); + this_cpu =raw_cpu_ptr (cpu_stats);if (tb[NFTA_COUNTER_PACKETS ]) { - this_cpu->packets = -be64_to_cpu (nla_get_be64 (tb[NFTA_COUNTER_PACKETS ])); +u64_stats_set (&this_cpu->packets, +be64_to_cpu (nla_get_be64 (tb[NFTA_COUNTER_PACKETS ]))); }if (tb[NFTA_COUNTER_BYTES ]) { - this_cpu->bytes = -be64_to_cpu (nla_get_be64 (tb[NFTA_COUNTER_BYTES ])); +u64_stats_set (&this_cpu->bytes, +be64_to_cpu (nla_get_be64 (tb[NFTA_COUNTER_BYTES ]))); } -preempt_enable (); + priv->counter = cpu_stats;return 0 ; }
@@ -104,40 +107,41 @@ static void nft_counter_obj_destroy(cons }static void nft_counter_reset (struct nft_counter_percpu_priv *priv, -struct nft_counter *total) +struct nft_counter_tot *total) { +struct u64_stats_sync *nft_sync;struct nft_counter *this_cpu; -seqcount_t *myseq;local_bh_disable (); this_cpu =this_cpu_ptr (priv->counter); - myseq =this_cpu_ptr (&nft_counter_seq); + nft_sync =this_cpu_ptr (&nft_counter_sync); + +u64_stats_update_begin (nft_sync); +u64_stats_add (&this_cpu->packets, -total->packets); +u64_stats_add (&this_cpu->bytes, -total->bytes); +u64_stats_update_end (nft_sync); -write_seqcount_begin (myseq); - this_cpu->packets -= total->packets; - this_cpu->bytes -= total->bytes; -write_seqcount_end (myseq);local_bh_enable (); }static void nft_counter_fetch (struct nft_counter_percpu_priv *priv, -struct nft_counter *total) +struct nft_counter_tot *total) {struct nft_counter *this_cpu; -const seqcount_t *myseq;u64 bytes, packets;unsigned int seq;int cpu;memset (total,0 ,sizeof (*total));for_each_possible_cpu (cpu) { - myseq =per_cpu_ptr (&nft_counter_seq, cpu); +struct u64_stats_sync *nft_sync =per_cpu_ptr (&nft_counter_sync, cpu); + this_cpu =per_cpu_ptr (priv->counter, cpu);do { - seq =read_seqcount_begin (myseq); - bytes = this_cpu->bytes; - packets = this_cpu->packets; - }while (read_seqcount_retry (myseq, seq)); + seq =u64_stats_fetch_begin (nft_sync); + bytes =u64_stats_read (&this_cpu->bytes); + packets =u64_stats_read (&this_cpu->packets); + }while (u64_stats_fetch_retry (nft_sync, seq)); total->bytes += bytes; total->packets += packets;
@@ -148,7 +152,7 @@ static int nft_counter_do_dump(struct sk struct nft_counter_percpu_priv *priv, bool reset) { -struct nft_counter total; +struct nft_counter_tot total;nft_counter_fetch (priv, &total);
@@ -236,7 +240,7 @@ static int nft_counter_clone(struct nft_struct nft_counter_percpu_priv *priv_clone =nft_expr_priv (dst);struct nft_counter __percpu *cpu_stats;struct nft_counter *this_cpu; -struct nft_counter total; +struct nft_counter_tot total;nft_counter_fetch (priv, &total);
@@ -244,11 +248,9 @@ static int nft_counter_clone(struct nft_if (cpu_stats ==NULL )return -ENOMEM ; -preempt_disable (); - this_cpu =this_cpu_ptr (cpu_stats); - this_cpu->packets = total.packets; - this_cpu->bytes = total.bytes; -preempt_enable (); + this_cpu =raw_cpu_ptr (cpu_stats); +u64_stats_set (&this_cpu->packets, total.packets); +u64_stats_set (&this_cpu->bytes, total.bytes); priv_clone->counter = cpu_stats;return 0 ;
@@ -266,17 +268,17 @@ static void nft_counter_offload_stats(st const struct flow_stats *stats) {struct nft_counter_percpu_priv *priv =nft_expr_priv (expr); +struct u64_stats_sync *nft_sync;struct nft_counter *this_cpu; -seqcount_t *myseq;local_bh_disable (); this_cpu =this_cpu_ptr (priv->counter); - myseq =this_cpu_ptr (&nft_counter_seq); + nft_sync =this_cpu_ptr (&nft_counter_sync); -write_seqcount_begin (myseq); - this_cpu->packets += stats->pkts; - this_cpu->bytes += stats->bytes; -write_seqcount_end (myseq); +u64_stats_update_begin (nft_sync); +u64_stats_add (&this_cpu->packets, stats->pkts); +u64_stats_add (&this_cpu->bytes, stats->bytes); +u64_stats_update_end (nft_sync);local_bh_enable (); }
@@ -285,7 +287,7 @@ void nft_counter_init_seqcount(void)int cpu;for_each_possible_cpu (cpu) -seqcount_init (per_cpu_ptr (&nft_counter_seq, cpu)); +u64_stats_init (per_cpu_ptr (&nft_counter_sync, cpu)); }struct nft_expr_type nft_counter_type;
Greg Kroah-Hartman
maintainerPATCH 191/198 drm/mediatek: Fix coverity issue with unintentional integer overflow
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason-JH.Lin <[email protected]>
commit b0b0d811eac6b4c52cb9ad632fa6384cf48869e7 upstream.
1. Instead of multiplying 2 variable of different types. Change to assign a value of one variable and then multiply the other variable.
2. Add a int variable for multiplier calculation instead of calculating different types multiplier with dma_addr_t variable directly.
[ For certain code segments with coverity issue do not exist in
function mtk_plane_update_new_state(), those not present in v6.1 are not back ported. ]
--- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 9 ++++++++- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_gem.c +8 -1
@@ -119,7 +119,14 @@ int mtk_drm_gem_dumb_create(struct drm_fint ret; args->pitch =DIV_ROUND_UP (args->width * args->bpp,8 ); - args->size = args->pitch * args->height; + +/* +* Multiply 2 variables of different types, +* for example: args->size = args->spacing * args->height; +* may cause coverity issue with unintentional overflow. +*/ + args->size = args->pitch; + args->size *= args->height; mtk_gem =mtk_drm_gem_create (dev, args->size, false);if (IS_ERR (mtk_gem))
drivers/gpu/drm/mediatek/mtk_drm_plane.c +11 -2
@@ -120,6 +120,7 @@ static void mtk_plane_update_new_state(sstruct mtk_drm_gem_obj *mtk_gem;unsigned int pitch, format;dma_addr_t addr; +int offset; gem = fb->obj[0 ]; mtk_gem =to_mtk_gem_obj (gem);
@@ -127,8 +128,16 @@ static void mtk_plane_update_new_state(s pitch = fb->pitches[0 ]; format = fb->format->format; - addr += (new_state->src.x1 >>16 ) * fb->format->cpp[0 ]; - addr += (new_state->src.y1 >>16 ) * pitch; +/* +* Using dma_addr_t variable to calculate with multiplier of different types, +* for example: addr += (new_state->src.x1 >> 16) * fb->format->cpp[0]; +* may cause coverity issue with unintentional overflow. +*/ + offset = (new_state->src.x1 >>16 ) * fb->format->cpp[0 ]; + addr += offset; + offset = (new_state->src.y1 >>16 ) * pitch; + addr += offset; + mtk_plane_state->pending.enable = true; mtk_plane_state->pending.pitch = pitch;
Greg Kroah-Hartman
maintainerPATCH 192/198 media: mediatek: vcodec: Fix VP8 stateless decoder smatch warning
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunfei Dong <[email protected]>
commit b113bc7c0e83b32f4dd2d291a2b6c4803e0a2c44 upstream.
Fix a smatch static checker warning on vdec_vp8_req_if.c. Which leads to a kernel crash when fb is NULL.
--- drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_req_if.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_req_if.c +7 -3
@@ -336,14 +336,18 @@ static int vdec_vp8_slice_decode(void *h src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer); fb = inst->ctx->dev->vdec_pdata->get_cap_buffer (inst->ctx); - dst_buf_info = container_of(fb, struct mtk_video_dec_buf, frame_buffer); +if (!fb) { +mtk_vcodec_err (inst,"fb buffer is NULL" ); +return -ENOMEM ; + } - y_fb_dma = fb ? (u64 )fb->base_y.dma_addr :0 ; + dst_buf_info = container_of(fb, struct mtk_video_dec_buf, frame_buffer); + y_fb_dma = fb->base_y.dma_addr;if (inst->ctx->q_data[MTK_Q_DATA_DST ].fmt->num_planes ==1 ) c_fb_dma = y_fb_dma + inst->ctx->picinfo.buf_w * inst->ctx->picinfo.buf_h;else - c_fb_dma = fb ? (u64 )fb->base_c.dma_addr :0 ; + c_fb_dma = fb->base_c.dma_addr; inst->vsi->dec.bs_dma = (u64 )bs->dma_addr; inst->vsi->dec.bs_sz = bs->size;
Greg Kroah-Hartman
maintainerPATCH 193/198 arm64: dts: rockchip: fix u2phy1_host status for NanoPi R4S
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Klaassen <[email protected]>
commit 38f4aa34a5f737ea8588dac320d884cc2e762c03 upstream.
The u2phy1_host should always have the same status as usb_host1_ehci and usb_host1_ohci, otherwise the EHCI and OHCI drivers may be initialized for a disabled usb port.
Per the NanoPi R4S schematic, the phy-supply for u2phy1_host is set to the vdd_5v regulator.
--- arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +1 -1
@@ -117,7 +117,7 @@ }; &u2phy1_host { - status = "disabled"; + phy-supply = <&vdd_5v>; }; &uart0 {
Greg Kroah-Hartman
maintainerPATCH 194/198 drm/amdgpu: fix use-after-free bug
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Prosyak <[email protected]>
commit 22207fd5c80177b860279653d017474b2812af5e upstream.
The bug can be triggered by sending a single amdgpu_gem_userptr_ioctl to the AMDGPU DRM driver on any ASICs with an invalid address and size. The bug was reported by Joonkyo Jung <[email protected]>. For example the following code:
static void Syzkaller1(int fd)
{
struct drm_amdgpu_gem_userptr arg;
int ret;
arg.addr = 0xffffffffffff0000;
arg.size = 0x80000000; /*2 Gb*/
arg.flags = 0x7;
ret = drmIoctl(fd, 0xc1186451/*amdgpu_gem_userptr_ioctl*/, &arg);
}Due to the address and size are not valid there is a failure in amdgpu_hmm_register->mmu_interval_notifier_insert->__mmu_interval_notifier_insert-> check_shl_overflow, but we even the amdgpu_hmm_register failure we still call amdgpu_hmm_unregister into amdgpu_gem_object_free which causes access to a bad address. The following stack is below when the issue is reproduced when Kazan is enabled:
[ +0.000014] Hardware name: ASUS System Product Name/ROG STRIX B550-F GAMING (WI-FI), BIOS 1401 12/03/2020 [ +0.000009] RIP: 0010:mmu_interval_notifier_remove+0x327/0x340 [ +0.000017] Code: ff ff 49 89 44 24 08 48 b8 00 01 00 00 00 00 ad de 4c 89 f7 49 89 47 40 48 83 c0 22 49 89 47 48 e8 ce d1 2d 01 e9 32 ff ff ff <0f> 0b e9 16 ff ff ff 4c 89 ef e8 fa 14 b3 ff e9 36 ff ff ff e8 80 [ +0.000014] RSP: 0018:ffffc90002657988 EFLAGS: 00010246 [ +0.000013] RAX: 0000000000000000 RBX: 1ffff920004caf35 RCX: ffffffff8160565b [ +0.000011] RDX: dffffc0000000000 RSI: 0000000000000004 RDI: ffff8881a9f78260 [ +0.000010] RBP: ffffc90002657a70 R08: 0000000000000001 R09: fffff520004caf25 [ +0.000010] R10: 0000000000000003 R11: ffffffff8161d1d6 R12: ffff88810e988c00 [ +0.000010] R13: ffff888126fb5a00 R14: ffff88810e988c0c R15: ffff8881a9f78260 [ +0.000011] FS: 00007ff9ec848540(0000) GS:ffff8883cc880000(0000) knlGS:0000000000000000 [ +0.000012] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ +0.000010] CR2: 000055b3f7e14328 CR3: 00000001b5770000 CR4: 0000000000350ef0 [ +0.000010] Call Trace: [ +0.000006] <TASK> [ +0.000007] ? show_regs+0x6a/0x80 [ +0.000018] ? __warn+0xa5/0x1b0 [ +0.000019] ? mmu_interval_notifier_remove+0x327/0x340 [ +0.000018] ? report_bug+0x24a/0x290 [ +0.000022] ? handle_bug+0x46/0x90 [ +0.000015] ? exc_invalid_op+0x19/0x50 [ +0.000016] ? asm_exc_invalid_op+0x1b/0x20 [ +0.000017] ? kasan_save_stack+0x26/0x50 [ +0.000017] ? mmu_interval_notifier_remove+0x23b/0x340 [ +0.000019] ? mmu_interval_notifier_remove+0x327/0x340 [ +0.000019] ? mmu_interval_notifier_remove+0x23b/0x340 [ +0.000020] ? __pfx_mmu_interval_notifier_remove+0x10/0x10 [ +0.000017] ? kasan_save_alloc_info+0x1e/0x30 [ +0.000018] ? srso_return_thunk+0x5/0x5f [ +0.000014] ? __kasan_kmalloc+0xb1/0xc0 [ +0.000018] ? srso_return_thunk+0x5/0x5f [ +0.000013] ? __kasan_check_read+0x11/0x20 [ +0.000020] amdgpu_hmm_unregister+0x34/0x50 [amdgpu] [ +0.004695] amdgpu_gem_object_free+0x66/0xa0 [amdgpu] [ +0.004534] ? __pfx_amdgpu_gem_object_free+0x10/0x10 [amdgpu] [ +0.004291] ? do_syscall_64+0x5f/0xe0 [ +0.000023] ? srso_return_thunk+0x5/0x5f [ +0.000017] drm_gem_object_free+0x3b/0x50 [drm] [ +0.000489] amdgpu_gem_userptr_ioctl+0x306/0x500 [amdgpu] [ +0.004295] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu] [ +0.004270] ? srso_return_thunk+0x5/0x5f [ +0.000014] ? __this_cpu_preempt_check+0x13/0x20 [ +0.000015] ? srso_return_thunk+0x5/0x5f [ +0.000013] ? sysvec_apic_timer_interrupt+0x57/0xc0 [ +0.000020] ? srso_return_thunk+0x5/0x5f [ +0.000014] ? asm_sysvec_apic_timer_interrupt+0x1b/0x20 [ +0.000022] ? drm_ioctl_kernel+0x17b/0x1f0 [drm] [ +0.000496] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu] [ +0.004272] ? drm_ioctl_kernel+0x190/0x1f0 [drm] [ +0.000492] drm_ioctl_kernel+0x140/0x1f0 [drm] [ +0.000497] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu] [ +0.004297] ? __pfx_drm_ioctl_kernel+0x10/0x10 [drm] [ +0.000489] ? srso_return_thunk+0x5/0x5f [ +0.000011] ? __kasan_check_write+0x14/0x20 [ +0.000016] drm_ioctl+0x3da/0x730 [drm] [ +0.000475] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu] [ +0.004293] ? __pfx_drm_ioctl+0x10/0x10 [drm] [ +0.000506] ? __pfx_rpm_resume+0x10/0x10 [ +0.000016] ? srso_return_thunk+0x5/0x5f [ +0.000011] ? __kasan_check_write+0x14/0x20 [ +0.000010] ? srso_return_thunk+0x5/0x5f [ +0.000011] ? _raw_spin_lock_irqsave+0x99/0x100 [ +0.000015] ? __pfx__raw_spin_lock_irqsave+0x10/0x10 [ +0.000014] ? srso_return_thunk+0x5/0x5f [ +0.000013] ? srso_return_thunk+0x5/0x5f [ +0.000011] ? srso_return_thunk+0x5/0x5f [ +0.000011] ? preempt_count_sub+0x18/0xc0 [ +0.000013] ? srso_return_thunk+0x5/0x5f [ +0.000010] ? _raw_spin_unlock_irqrestore+0x27/0x50 [ +0.000019] amdgpu_drm_ioctl+0x7e/0xe0 [amdgpu] [ +0.004272] __x64_sys_ioctl+0xcd/0x110 [ +0.000020] do_syscall_64+0x5f/0xe0 [ +0.000021] entry_SYSCALL_64_after_hwframe+0x6e/0x76 [ +0.000015] RIP: 0033:0x7ff9ed31a94f [ +0.000012] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00 [ +0.000013] RSP: 002b:00007fff25f66790 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ +0.000016] RAX: ffffffffffffffda RBX: 000055b3f7e133e0 RCX: 00007ff9ed31a94f [ +0.000012] RDX: 000055b3f7e133e0 RSI: 00000000c1186451 RDI: 0000000000000003 [ +0.000010] RBP: 00000000c1186451 R08: 0000000000000000 R09: 0000000000000000 [ +0.000009] R10: 0000000000000008 R11: 0000000000000246 R12: 00007fff25f66ca8 [ +0.000009] R13: 0000000000000003 R14: 000055b3f7021ba8 R15: 00007ff9ed7af040 [ +0.000024] </TASK> [ +0.000007] ---[ end trace 0000000000000000 ]---
v2: Consolidate any error handling into amdgpu_hmm_register
which applied to kfd_bo also. (Christian)
v3: Improve syntax and comment (Christian)
[ drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c is renamed from
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c since d9483ecd327b ("drm/amdgpu: rename the files for HMM handling"). The path is changed accordingly to apply the patch on 6.1.y. ]
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +16 -4
@@ -132,13 +132,25 @@ static const struct mmu_interval_notifie*/ int amdgpu_mn_register (struct amdgpu_bo *bo,unsigned long addr) { +int r; +if (bo->kfd_bo) -return mmu_interval_notifier_insert (&bo->notifier, current->mm, + r =mmu_interval_notifier_insert (&bo->notifier, current->mm, addr,amdgpu_bo_size (bo), &amdgpu_mn_hsa_ops); -return mmu_interval_notifier_insert (&bo->notifier, current->mm, addr, -amdgpu_bo_size (bo), - &amdgpu_mn_gfx_ops); +else + r =mmu_interval_notifier_insert (&bo->notifier, current->mm, addr, +amdgpu_bo_size (bo), + &amdgpu_mn_gfx_ops); +if (r) +/* +* Make sure amdgpu_hmm_unregister() doesn't call +* mmu_interval_notifier_remove() when the notifier isn't properly +* initialized. +*/ + bo->notifier.mm =NULL ; + +return r; }/**
Greg Kroah-Hartman
maintainerPATCH 195/198 fs/ntfs3: Change new sparse cluster processing
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
commit c380b52f6c5702cc4bdda5e6d456d6c19a201a0b upstream.
Remove ntfs_sparse_cluster.
Zero clusters in attr_allocate_clusters.
Fixes xfstest generic/263
--- fs/ntfs3/attrib.c | 178 ++++++++++++++++++++++++++++++++++++----------------- fs/ntfs3/file.c | 151 +++++++++----------------------------------- fs/ntfs3/frecord.c | 2 fs/ntfs3/index.c | 4 - fs/ntfs3/inode.c | 12 +-- fs/ntfs3/ntfs_fs.h | 7 -- 6 files changed, 167 insertions(+), 187 deletions(-)
fs/ntfs3/attrib.c +123 -55
@@ -176,7 +176,7 @@ out:int attr_allocate_clusters (struct ntfs_sb_info *sbi,struct runs_tree *run,CLST vcn,CLST lcn,CLST len,CLST *pre_alloc,enum ALLOCATE_OPT opt,CLST *alen,const size_t fr, -CLST *new_lcn) +CLST *new_lcn,CLST *new_len) {int err;CLST flen, vcn0 = vcn, pre = pre_alloc ? *pre_alloc :0 ;
@@ -196,20 +196,36 @@ int attr_allocate_clusters(struct ntfs_sif (err) goto out; -if (new_lcn && vcn == vcn0) - *new_lcn = lcn; +if (vcn == vcn0) { +/* Return the first fragment. */ +if (new_lcn) + *new_lcn = lcn; +if (new_len) + *new_len = flen; + }/* Add new fragment into run storage. */ -if (!run_add_entry (run, vcn, lcn, flen, opt ==ALLOCATE_MFT )) { +if (!run_add_entry (run, vcn, lcn, flen, opt &ALLOCATE_MFT )) {/* Undo last 'ntfs_look_for_free_space' */ mark_as_free_ex (sbi, lcn, len, false); err = -ENOMEM ; goto out; } +if (opt &ALLOCATE_ZERO ) { +u8 shift = sbi->cluster_bits -SECTOR_SHIFT ; + + err =blkdev_issue_zeroout (sbi->sb->s_bdev, + (sector_t )lcn << shift, + (sector_t )flen << shift, +GFP_NOFS ,0 ); +if (err) + goto out; + } + vcn += flen; -if (flen >= len || opt ==ALLOCATE_MFT || +if (flen >= len || (opt &ALLOCATE_MFT ) || (fr && run->count - cnt >= fr)) { *alen = vcn - vcn0;return 0 ;
@@ -287,7 +303,8 @@ int attr_make_nonresident(struct ntfs_inconst char *data =resident_data (attr); err =attr_allocate_clusters (sbi, run,0 ,0 , len,NULL , -ALLOCATE_DEF , &alen,0 ,NULL ); +ALLOCATE_DEF , &alen,0 ,NULL , +NULL );if (err) goto out1;
@@ -582,13 +599,13 @@ add_alloc_in_same_attr_seg:/* ~3 bytes per fragment. */ err =attr_allocate_clusters ( sbi, run, vcn, lcn, to_allocate, &pre_alloc, - is_mft ?ALLOCATE_MFT :0 , &alen, + is_mft ?ALLOCATE_MFT :ALLOCATE_DEF , &alen, is_mft ?0 : (sbi->record_size -le32_to_cpu (rec->used) +8 ) /3 +1 , -NULL ); +NULL ,NULL );if (err) goto out; }
@@ -886,8 +903,19 @@ bad_inode:return err; } +/* +* attr_data_get_block - Returns 'lcn' and 'len' for given 'vcn'. +* +* @new == NULL means just to get current mapping for 'vcn' +* @new != NULL means allocate real cluster if 'vcn' maps to hole +* @zero - zeroout new allocated clusters +* +* NOTE: +* - @new != NULL is called only for sparsed or compressed attributes. +* - new allocated clusters are zeroed via blkdev_issue_zeroout. +*/ int attr_data_get_block (struct ntfs_inode *ni,CLST vcn,CLST clen,CLST *lcn, -CLST *len,bool *new) +CLST *len,bool *new,bool zero) {int err =0 ;struct runs_tree *run = &ni->file.run;
@@ -896,29 +924,27 @@ int attr_data_get_block(struct ntfs_inodstruct ATTRIB *attr =NULL , *attr_b;struct ATTR_LIST_ENTRY *le, *le_b;struct mft_inode *mi, *mi_b; -CLST hint, svcn, to_alloc, evcn1, next_svcn, asize, end; +CLST hint, svcn, to_alloc, evcn1, next_svcn, asize, end, vcn0, alen; +unsigned int fr;u64 total_size; -u32 clst_per_frame; -bool ok;if (new) *new = false; +/* Try to find in cache. */ down_read (&ni->file.run_lock); - ok =run_lookup_entry (run, vcn, lcn, len,NULL ); +if (!run_lookup_entry (run, vcn, lcn, len,NULL )) + *len =0 ;up_read (&ni->file.run_lock); -if (ok && (*lcn !=SPARSE_LCN || !new)) { -/* Normal way. */ -return 0 ; +if (*len) { +if (*lcn !=SPARSE_LCN || !new) +return 0 ;/* Fast normal way without allocation. */ +else if (clen > *len) + clen = *len; } -if (!clen) - clen =1 ; - -if (ok && clen > *len) - clen = *len; - +/* No cluster in cache or we need to allocate cluster in hole. */ sbi = ni->mi.sbi; cluster_bits = sbi->cluster_bits;
@@ -944,12 +970,6 @@ int attr_data_get_block(struct ntfs_inod goto out; } - clst_per_frame =1u << attr_b->nres.c_unit; - to_alloc = (clen + clst_per_frame -1 ) & ~(clst_per_frame -1 ); - -if (vcn + to_alloc > asize) - to_alloc = asize - vcn; - svcn =le64_to_cpu (attr_b->nres.svcn); evcn1 =le64_to_cpu (attr_b->nres.evcn) +1 ;
@@ -968,36 +988,68 @@ int attr_data_get_block(struct ntfs_inod evcn1 =le64_to_cpu (attr->nres.evcn) +1 ; } +/* Load in cache actual information. */ err =attr_load_runs (attr, ni, run,NULL );if (err) goto out; -if (!ok) { - ok =run_lookup_entry (run, vcn, lcn, len,NULL ); -if (ok && (*lcn !=SPARSE_LCN || !new)) { -/* Normal way. */ - err =0 ; +if (!*len) { +if (run_lookup_entry (run, vcn, lcn, len,NULL )) { +if (*lcn !=SPARSE_LCN || !new) + goto ok;/* Slow normal way without allocation. */ + +if (clen > *len) + clen = *len; + }else if (!new) { +/* Here we may return -ENOENT. +* In any case caller gets zero length. */ goto ok; } - -if (!ok && !new) { - *len =0 ; - err =0 ; - goto ok; - } - -if (ok && clen > *len) { - clen = *len; - to_alloc = (clen + clst_per_frame -1 ) & - ~(clst_per_frame -1 ); - } }if (!is_attr_ext (attr_b)) { +/* The code below only for sparsed or compressed attributes. */ err = -EINVAL ; goto out; } + vcn0 = vcn; + to_alloc = clen; + fr = (sbi->record_size -le32_to_cpu (mi->mrec->used) +8 ) /3 +1 ; +/* Allocate frame aligned clusters. +* ntfs.sys usually uses 16 clusters per frame for sparsed or compressed. +* ntfs3 uses 1 cluster per frame for new created sparsed files. */ +if (attr_b->nres.c_unit) { +CLST clst_per_frame =1u << attr_b->nres.c_unit; +CLST cmask = ~(clst_per_frame -1 ); + +/* Get frame aligned vcn and to_alloc. */ + vcn = vcn0 & cmask; + to_alloc = ((vcn0 + clen + clst_per_frame -1 ) & cmask) - vcn; +if (fr < clst_per_frame) + fr = clst_per_frame; + zero = true; + +/* Check if 'vcn' and 'vcn0' in different attribute segments. */ +if (vcn < svcn || evcn1 <= vcn) { +/* Load attribute for truncated vcn. */ + attr =ni_find_attr (ni, attr_b, &le,ATTR_DATA ,NULL ,0 , + &vcn, &mi); +if (!attr) { + err = -EINVAL ; + goto out; + } + svcn =le64_to_cpu (attr->nres.svcn); + evcn1 =le64_to_cpu (attr->nres.evcn) +1 ; + err =attr_load_runs (attr, ni, run,NULL ); +if (err) + goto out; + } + } + +if (vcn + to_alloc > asize) + to_alloc = asize - vcn; +/* Get the last LCN to allocate from. */ hint =0 ;
@@ -1011,18 +1063,33 @@ int attr_data_get_block(struct ntfs_inod hint =-1 ; } - err =attr_allocate_clusters ( - sbi, run, vcn, hint +1 , to_alloc,NULL ,0 , len, - (sbi->record_size -le32_to_cpu (mi->mrec->used) +8 ) /3 +1 , - lcn); +/* Allocate and zeroout new clusters. */ + err =attr_allocate_clusters (sbi, run, vcn, hint +1 , to_alloc,NULL , + zero ?ALLOCATE_ZERO :ALLOCATE_DEF , &alen, + fr, lcn, len);if (err) goto out; *new = true; - end = vcn + *len; - + end = vcn + alen; total_size =le64_to_cpu (attr_b->nres.total_size) + - ((u64)*len << cluster_bits); + ((u64 )alen << cluster_bits); + +if (vcn != vcn0) { +if (!run_lookup_entry (run, vcn0, lcn, len,NULL )) { + err = -EINVAL ; + goto out; + } +if (*lcn ==SPARSE_LCN ) { +/* Internal error. Should not happened. */ +WARN_ON (1 ); + err = -EINVAL ; + goto out; + } +/* Check case when vcn0 + len overlaps new allocated clusters. */ +if (vcn0 + *len > end) + *len = end - vcn0; + } repack: err =mi_pack_runs (mi, attr, run,max (end, evcn1) - svcn);
@@ -1547,7 +1614,7 @@ int attr_allocate_frame(struct ntfs_inodstruct ATTRIB *attr =NULL , *attr_b;struct ATTR_LIST_ENTRY *le, *le_b;struct mft_inode *mi, *mi_b; -CLST svcn, evcn1, next_svcn, lcn, len; +CLST svcn, evcn1, next_svcn, len;CLST vcn, end, clst_data;u64 total_size, valid_size, data_size;
@@ -1623,8 +1690,9 @@ int attr_allocate_frame(struct ntfs_inod } err =attr_allocate_clusters (sbi, run, vcn + clst_data, - hint +1 , len - clst_data,NULL ,0 , - &alen,0 , &lcn); + hint +1 , len - clst_data,NULL , +ALLOCATE_DEF , &alen,0 ,NULL , +NULL );if (err) goto out;
fs/ntfs3/file.c +33 -118
232 lines not on this page · raw message
fs/ntfs3/frecord.c +1 -1
@@ -2297,7 +2297,7 @@ int ni_decompress_file(struct ntfs_inodefor (vcn = vbo >> sbi->cluster_bits; vcn < end; vcn += clen) { err =attr_data_get_block (ni, vcn, cend - vcn, &lcn, - &clen, &new); + &clen, &new, false);if (err) goto out; }
fs/ntfs3/index.c +2 -2
@@ -1442,8 +1442,8 @@ static int indx_create_allocate(struct nrun_init (&run); - err =attr_allocate_clusters (sbi, &run,0 ,0 , len,NULL ,0 , &alen,0 , -NULL ); + err =attr_allocate_clusters (sbi, &run,0 ,0 , len,NULL ,ALLOCATE_DEF , + &alen,0 ,NULL ,NULL );if (err) goto out;
fs/ntfs3/inode.c +5 -7
@@ -592,7 +592,8 @@ static noinline int ntfs_get_block_vbo(s off = vbo & sbi->cluster_mask; new = false; - err =attr_data_get_block (ni, vcn,1 , &lcn, &len, create ? &new :NULL ); + err =attr_data_get_block (ni, vcn,1 , &lcn, &len, create ? &new :NULL , + create && sbi->cluster_size >PAGE_SIZE );if (err) goto out;
@@ -610,11 +611,8 @@ static noinline int ntfs_get_block_vbo(sWARN_ON (1 ); } -if (new) { +if (new)set_buffer_new (bh); -if ((len << cluster_bits) > block_size) -ntfs_sparse_cluster (inode, page, vcn, len); - } lbo = ((u64 )lcn << cluster_bits) + off;
@@ -1533,8 +1531,8 @@ struct inode *ntfs_create_inode(struct ucpu_to_le64 (ntfs_up_cluster (sbi, nsize)); err =attr_allocate_clusters (sbi, &ni->file.run,0 ,0 , - clst,NULL ,0 , &alen,0 , -NULL ); + clst,NULL ,ALLOCATE_DEF , + &alen,0 ,NULL ,NULL );if (err) goto out5;
fs/ntfs3/ntfs_fs.h +3 -4
@@ -128,6 +128,7 @@ struct ntfs_buffers {enum ALLOCATE_OPT {ALLOCATE_DEF =0 ,// Allocate all clusters. ALLOCATE_MFT =1 ,// Allocate for MFT. +ALLOCATE_ZERO =2 ,// Zeroout new allocated clusters };enum bitmap_mutex_classes {
@@ -418,7 +419,7 @@ enum REPARSE_SIGN {int attr_allocate_clusters (struct ntfs_sb_info *sbi,struct runs_tree *run,CLST vcn,CLST lcn,CLST len,CLST *pre_alloc,enum ALLOCATE_OPT opt,CLST *alen,const size_t fr, -CLST *new_lcn); +CLST *new_lcn,CLST *new_len); int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr, struct ATTR_LIST_ENTRY *le, struct mft_inode *mi, u64 new_size, struct runs_tree *run,
@@ -428,7 +429,7 @@ int attr_set_size(struct ntfs_inode *ni, u64 new_size, const u64 *new_valid, bool keep_prealloc, struct ATTRIB **ret);int attr_data_get_block (struct ntfs_inode *ni,CLST vcn,CLST clen,CLST *lcn, -CLST *len,bool *new); +CLST *len,bool *new,bool zero);int attr_data_read_resident (struct ntfs_inode *ni,struct page *page);int attr_data_write_resident (struct ntfs_inode *ni,struct page *page); int attr_load_runs_vcn(struct ntfs_inode *ni, enum ATTR_TYPE type,
@@ -493,8 +494,6 @@ extern const struct file_operations ntfs/* Globals from file.c */ int ntfs_getattr (struct user_namespace *mnt_userns,const struct path *path,struct kstat *stat,u32 request_mask,u32 flags); -void ntfs_sparse_cluster (struct inode *inode,struct page *page0,CLST vcn, -CLST len);int ntfs3_setattr (struct user_namespace *mnt_userns,struct dentry *dentry,struct iattr *attr);int ntfs_file_open (struct inode *inode,struct file *file);
Greg Kroah-Hartman
maintainerPATCH 196/198 wifi: iwlwifi: mvm: ensure offloading TID queue exists
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Berg <[email protected]>
commit 78f65fbf421a61894c14a1b91fe2fb4437b3fe5f upstream.
The resume code path assumes that the TX queue for the offloading TID has been configured. At resume time it then tries to sync the write pointer as it may have been updated by the firmware.
In the unusual event that no packets have been send on TID 0, the queue will not have been allocated and this causes a crash. Fix this by ensuring the queue exist at suspend time.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 9 +++++++- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 28 +++++++++++++++++++++++++++ drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 3 +- 3 files changed, 38 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +8 -1
@@ -1286,7 +1286,9 @@ static int __iwl_mvm_suspend(struct ieee mvm->net_detect = true; }else { -struct iwl_wowlan_config_cmd wowlan_config_cmd = {}; +struct iwl_wowlan_config_cmd wowlan_config_cmd = { + .offloading_tid =0 , + }; wowlan_config_cmd.sta_id = mvmvif->ap_sta_id;
@@ -1298,6 +1300,11 @@ static int __iwl_mvm_suspend(struct ieee goto out_noreset; } + ret =iwl_mvm_sta_ensure_queue ( + mvm, ap_sta->txq[wowlan_config_cmd.offloading_tid]); +if (ret) + goto out_noreset; + ret =iwl_mvm_get_wowlan_config (mvm, wowlan, &wowlan_config_cmd, vif, mvmvif, ap_sta);if (ret)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +28 -0
@@ -1419,6 +1419,34 @@ out_err:return ret; } +int iwl_mvm_sta_ensure_queue (struct iwl_mvm *mvm, +struct ieee80211_txq *txq) +{ +struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_mac80211 (txq); +int ret = -EINVAL ; + +lockdep_assert_held (&mvm->mutex); + +if (likely (test_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state)) || + !txq->sta) { +return 0 ; + } + +if (!iwl_mvm_sta_alloc_queue (mvm, txq->sta, txq->ac, txq->tid)) { +set_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); + ret =0 ; + } + +local_bh_disable (); +spin_lock (&mvm->add_stream_lock); +if (!list_empty (&mvmtxq->list)) +list_del_init (&mvmtxq->list); +spin_unlock (&mvm->add_stream_lock); +local_bh_enable (); + +return ret; +} +void iwl_mvm_add_new_dqa_stream_wk (struct work_struct *wk) { struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm,
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +2 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2012-2014, 2018-2021 Intel Corporation +* Copyright (C) 2012-2014, 2018-2024 Intel Corporation * Copyright (C) 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2015-2016 Intel Deutschland GmbH */
@@ -544,6 +544,7 @@ void iwl_mvm_modify_all_sta_disable_tx(sstruct iwl_mvm_vif *mvmvif, bool disable);void iwl_mvm_csa_client_absent (struct iwl_mvm *mvm,struct ieee80211_vif *vif); +int iwl_mvm_sta_ensure_queue (struct iwl_mvm *mvm,struct ieee80211_txq *txq);void iwl_mvm_add_new_dqa_stream_wk (struct work_struct *wk); int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
Greg Kroah-Hartman
maintainerPATCH 197/198 mm/migrate: fix shmem xarray update during migration
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zi Yan <[email protected]>
commit 60cf233b585cdf1f3c5e52d1225606b86acd08b0 upstream.
A shmem folio can be either in page cache or in swap cache, but not at the same time. Namely, once it is in swap cache, folio->mapping should be NULL, and the folio is no longer in a shmem mapping.
In __folio_migrate_mapping(), to determine the number of xarray entries to update, folio_test_swapbacked() is used, but that conflates shmem in page cache case and shmem in swap cache case. It leads to xarray multi-index entry corruption, since it turns a sibling entry to a normal entry during xas_store() (see [1] for a userspace reproduction). Fix it by only using folio_test_swapcache() to determine whether xarray is storing swap cache entries or not to choose the right number of xarray entries to update.
[1] https://lore.kernel.org/linux-mm/[email protected]/
Note:
In __split_huge_page(), folio_test_anon() && folio_test_swapcache() is used to get swap_cache address space, but that ignores the shmem folio in swap cache case. It could lead to NULL pointer dereferencing when a in-swap-cache shmem folio is split at __xa_store(), since !folio_test_anon() is true and folio->mapping is NULL. But fortunately, its caller split_huge_page_to_list_to_order() bails out early with EBUSY when folio->mapping is NULL. So no need to take care of it here.
--- mm/migrate.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
mm/migrate.c +7 -9
@@ -420,19 +420,17 @@ int folio_migrate_mapping(struct address newfolio->index = folio->index; newfolio->mapping = folio->mapping;folio_ref_add (newfolio, nr);/* add cache reference */ -if (folio_test_swapbacked (folio)) { +if (folio_test_swapbacked (folio))__folio_set_swapbacked (newfolio); -if (folio_test_swapcache (folio)) { -int i; +if (folio_test_swapcache (folio)) { +int i; -folio_set_swapcache (newfolio); -for (i =0 ; i < nr; i++) -set_page_private (folio_page (newfolio, i), -page_private (folio_page (folio, i))); - } +folio_set_swapcache (newfolio); +for (i =0 ; i < nr; i++) +set_page_private (folio_page (newfolio, i), +page_private (folio_page (folio, i))); entries = nr; }else { -VM_BUG_ON_FOLIO (folio_test_swapcache (folio), folio); entries =1 ; }
Greg Kroah-Hartman
maintainerPATCH 198/198 block, bfq: fix re-introduced UAF in bic_set_bfqq()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Acs, Jakub" <[email protected]>
Commit eca0025faa96ac ("block, bfq: split sync bfq_queues on a per-actuator basis"), which is a backport of 9778369a2d6c5e ("block,
bfq: split sync bfq_queues on a per-actuator basis") re-introduces UAF bug originally fixed by b600de2d7d3a16 ("block, bfq: fix uaf for bfqq in bic_set_bfqq()") and backported to 6.1 in cb1876fc33af26 ("block, bfq:
fix uaf for bfqq in bic_set_bfqq()").
bfq_release_process_ref() may release the sync_bfqq variable, which points to the same bfqq as bic->bfqq member for call context from __bfq_bic_change_cgroup(). bic_set_bfqq() then accesses bic->bfqq member which leads to the UAF condition.
Fix this by bringing the incriminated function calls back in correct order.
--- block/bfq-cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/bfq-cgroup.c +1 -1
@@ -739,8 +739,8 @@ static void bfq_sync_bfqq_move(struct bf* old cgroup. */ bfq_put_cooperator (sync_bfqq); -bfq_release_process_ref (bfqd, sync_bfqq);bic_set_bfqq (bic,NULL , true, act_idx); +bfq_release_process_ref (bfqd, sync_bfqq); } }
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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, 27 Mar 2025 12:21:27 +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/v6.x/stable-review/patch-6.1.132-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Regressions on arm64 rk3399 dtb builds failed with gcc-13 the stable-rc 6.1.132-rc1
First seen on the v6.1.131-199-gc8f0cb669e59
Good: v6.1.131
Bad: 6.1.132-rc1
* arm64, build
- gcc-13-defconfig
Regression Analysis:
- New regression? yes
- Reproducibility? Yes
Build regression: arm64 dtb rockchip non-existent node or label "vcca_0v9"
## Build log arch/arm64/boot/dts/rockchip/rk3399.dtsi:221.23-266.4: ERROR (phandle_references):
/pcie@f8000000: Reference to non-existent node or label "vcca_0v9"
also defined at arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi:665.8-675.3
## Source
* Kernel version: 6.1.132-rc1
* Git tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* Git sha: c8f0cb669e590c6c73c274b9fc56270ec33fa06b
* Git describe: v6.1.131-199-gc8f0cb669e59
* Project details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/
## Build
* Build log: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/testrun/27755718/suite/build/test/gcc-13-lkftconfig-devicetree/log
* Build history:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/testrun/27755718/suite/build/test/gcc-13-lkftconfig-devicetree/history/
* Build details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/testrun/27755718/suite/build/test/gcc-13-lkftconfig-devicetree/details/
* Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2uoE2WrLPnhBvFm7ejgwd6QJxk8/
* Kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2uoE2WrLPnhBvFm7ejgwd6QJxk8/config
## Steps to reproduce
- # tuxmake --runtime podman --target-arch arm64 --toolchain gcc-13
--kconfig defconfig
--
Linaro LKFT
https://lkft.linaro.org
Hello Naresh,
Quoted 69 lines · Naresh Kamboju
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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, 27 Mar 2025 12:21:27 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.132-rc1.gz
or in the git tree and branch at:Quoted 6 lines
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y and the diffstat can be found below.thanks,
greg k-h
Regressions on arm64 rk3399 dtb builds failed with gcc-13 the stable-rc 6.1.132-rc1
First seen on the v6.1.131-199-gc8f0cb669e59
Good: v6.1.131
Bad: 6.1.132-rc1* arm64, build
- gcc-13-defconfigRegression Analysis:
- New regression? yes
- Reproducibility? YesBuild regression: arm64 dtb rockchip non-existent node or label "
vcca_0v9"## Build log arch/arm64/boot/dts/rockchip/rk3399.dtsi:221.23-266.4: ERROR (
phandle_references):
/pcie@f8000000: Reference to non-existent node or label "vcca_0v9"also defined at
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi:665.8-675.3## Source
* Kernel version: 6.1.132-rc1
* Git tree:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* Git sha:c8f0cb669e590c6c73c274b9fc56270ec33fa06b
* Git describe: v6.1.131-199-gc8f0cb669e59
* Project details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/## Build
* Build log:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/testrun/27755718/suite/build/test/gcc-13-lkftconfig-devicetree/log
* Build history:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/testrun/27755718/suite/build/test/gcc-13-lkftconfig-devicetree/history/
* Build details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.131-199-gc8f0cb669e59/testrun/27755718/suite/build/test/gcc-13-lkftconfig-devicetree/details/
* Build link:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2uoE2WrLPnhBvFm7ejgwd6QJxk8/
* Kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2uoE2WrLPnhBvFm7ejgwd6QJxk8/config
Quoted 3 lines
## Steps to reproduce
- # tuxmake --runtime podman --target-arch arm64 --toolchain gcc-13
--kconfig defconfig
This is caused by another patch from the original series failing to apply due to some bulk regulator renaming. I'll send backported version of that patch soon, which should make everything fine.
Jon Hunter
maintainerQuoted 36 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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, 27 Mar 2025 12:21:27 +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/v6.x/stable-review/patch-6.1.132-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Regressions on arm64 rk3399 dtb builds failed with gcc-13 the stable-rc 6.1.132-rc1
First seen on the v6.1.131-199-gc8f0cb669e59
Good: v6.1.131
Bad: 6.1.132-rc1* arm64, build
- gcc-13-defconfigRegression Analysis:
- New regression? yes
- Reproducibility? YesBuild regression: arm64 dtb rockchip non-existent node or label "
vcca_0v9"
Quoted 8 lines
## Build log arch/arm64/boot/dts/rockchip/rk3399.dtsi:221.23-266.4: ERROR (
phandle_references):
/pcie@f8000000: Reference to non-existent node or label "vcca_0v9"also defined at arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi:665.8-675.3
I am also seeing this build error for linux v6.1.y, v6.6.y and v6.12.y too.
Cheers
Jon
Signature · 1 line
nvpublic
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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, 27 Mar 2025 12:21:27 +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/v6.x/stable-review/patch-6.1.132-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 8 lines · On Tue, 25 Mar 2025 08:19:22 -0400 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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, 27 Mar 2025 12:21:27 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64:
Thanks!
Cheers,
Miguel
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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.
We see failures on arm64:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/1734533150
for example:
arch/arm64/boot/dts/rockchip/rk3399.dtsi:221.23-266.4: ERROR (phandle_references): /pcie@f8000000: Reference to non-existent node or label "vcca_0v9"
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.1.132 release. There are 198 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.
Ouch, and we see failure in xfs, too:
In file included from ./include/linux/string.h:5,
3824
from ./include/linux/uuid.h:12,
3825
from ./fs/xfs/xfs_linux.h:10,
3826
from ./fs/xfs/xfs.h:22,3827
from fs/xfs/libxfs/xfs_alloc.c:6:
3828fs/xfs/libxfs/xfs_alloc.c: In function '__xfs_free_extent_later':
3829fs/xfs/libxfs/xfs_alloc.c:2551:51: error: 'mp' undeclared (first use in this function); did you mean 'tp'? 3830
2551 | if (XFS_IS_CORRUPT(mp, !xfs_verify_fsbext(mp, bno, len)))
3831
| ^~
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/jobs/9518260339
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany