id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
d0f98e14c010bcf27898b635a54c1994ac4110a8
Analyze and fix the following issue in the Linux kernel code: mailbox: th1520: Fix a NULL vs IS_ERR() bug
Problem Details: The devm_ioremap() function doesn't return error pointers, it returns NULL. Update the error checking to match. Fixes: 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Michal Wilczynski <m.wilczynski@sams...
```diff diff --git a/drivers/mailbox/mailbox-th1520.c b/drivers/mailbox/mailbox-th1520.c index 4e84640ac3b8..e16e7c85ee3c 100644 --- a/drivers/mailbox/mailbox-th1520.c +++ b/drivers/mailbox/mailbox-th1520.c @@ -387,8 +387,10 @@ static void __iomem *th1520_map_mmio(struct platform_device *pdev, mapped = devm_ioremap...
13265fe7426ec9ba5aa86baab913417ca361e8a4
Analyze and fix the following issue in the Linux kernel code: drm/xe/vf: Perform early GT MMIO initialization to read GMDID
Problem Details: VFs need to communicate with the GuC to obtain the GMDID value and existing GuC functions used for that assume that the GT has it's MMIO members already setup. However, due to recent refactoring the gt->mmio is initialized later, and any attempt by the VF to use xe_mmio_read|write() from GuC functions ...
```diff diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 48d1c81d441e..bf35a18bf5e7 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -501,6 +501,7 @@ static void read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, gt->info.type = XE_GT_TYPE_MA...
57d7713af93e4b7344d3022fad9ddf0f10f815ec
Analyze and fix the following issue in the Linux kernel code: selftests: riscv: Fix vector tests
Problem Details: Overhaul the riscv vector tests to use kselftest_harness to help the test cases correctly report the results and decouple the individual test cases from each other. With this refactoring, only run the test cases if vector is reported and properly report the test case as skipped otherwise. The v_initval...
```diff diff --git a/tools/testing/selftests/riscv/vector/.gitignore b/tools/testing/selftests/riscv/vector/.gitignore index 9ae7964491d5..7d9c87cd0649 100644 --- a/tools/testing/selftests/riscv/vector/.gitignore +++ b/tools/testing/selftests/riscv/vector/.gitignore @@ -1,3 +1,4 @@ vstate_exec_nolibc vstate_prctl -v_...
9d87cf525fd2e1a5fcbbb40ee3df216d1d266c88
Analyze and fix the following issue in the Linux kernel code: RISC-V: Mark riscv_v_init() as __init
Problem Details: This trips up with Xtheadvector enabled, but as far as I can tell it's just been an issue since the original patchset. Fixes: 7ca7a7b9b635 ("riscv: Add sysctl to set the default vector rule for new processes") Reviewed-by: Charlie Jenkins <charlie@rivosinc.com> Tested-by: Charlie Jenkins <charlie@rivo...
```diff diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c index 821818886fab..39f0577f580d 100644 --- a/arch/riscv/kernel/vector.c +++ b/arch/riscv/kernel/vector.c @@ -309,7 +309,7 @@ static int __init riscv_v_sysctl_init(void) static int __init riscv_v_sysctl_init(void) { return 0; } #endif /* ! C...
62892e77b8a64b9dc0e1da75980aa145347b6820
Analyze and fix the following issue in the Linux kernel code: perf bench: Fix undefined behavior in cmpworker()
Problem Details: The comparison function cmpworker() violates the C standard's requirements for qsort() comparison functions, which mandate symmetry and transitivity: Symmetry: If x < y, then y > x. Transitivity: If x < y and y < z, then x < z. In its current implementation, cmpworker() incorrectly returns 0 when w1-...
```diff diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c index ef5c4257844d..20fe4f72b4af 100644 --- a/tools/perf/bench/epoll-wait.c +++ b/tools/perf/bench/epoll-wait.c @@ -420,7 +420,12 @@ static int cmpworker(const void *p1, const void *p2) struct worker *w1 = (struct worker *) p1; str...
86a016e278b78cc2281edd4ffaddbc011c87a593
Analyze and fix the following issue in the Linux kernel code: PCI: dwc: Always stop link in the dw_pcie_suspend_noirq
Problem Details: On the i.MX8QM, PCIe link can't be re-established again in dw_pcie_resume_noirq(), if the LTSSM_EN bit is not cleared properly in dw_pcie_suspend_noirq(). So, add dw_pcie_stop_link() to dw_pcie_suspend_noirq() to fix this issue and to align the suspend/resume functions since there is dw_pcie_start_lin...
```diff diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index bcbbe02f8f86..d6d5fff1121c 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -952,6 +952,7 @@ int dw_pcie_suspend_noirq...
0e0b45ab5d770a748487ba0ae8f77d1fb0f0de3e
Analyze and fix the following issue in the Linux kernel code: PCI: dw-rockchip: Enumerate endpoints based on dll_link_up IRQ
Problem Details: Most boards using the pcie-dw-rockchip PCIe controller lack standard hotplug support. Thus, when an endpoint is attached to the SoC, users have to rescan the bus manually to enumerate the device. This can be avoided by using the 'dll_link_up' interrupt in the combined system interrupt 'sys'. Once the...
```diff diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c index 1170e1107508..1ff8c36c3fa5 100644 --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c @@ -389,6 +389,34 @@ static const struct dw_pcie_ops dw_pcie_...
f0639013d340580b72df95d012a93f35eeb0da64
Analyze and fix the following issue in the Linux kernel code: PCI: qcom: Update ICC and OPP values after Link Up event
Problem Details: 4581403f6792 ("PCI: qcom: Enumerate endpoints based on Link up event in 'global_irq' interrupt") added the Link Up-based enumeration support, but did not update the ICC/OPP vote once link is up. Before that, the update happened during probe and the endpoints may or may not be enumerated at that time, s...
```diff diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 656d2be9d87f..e4d3366ead1f 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1569,6 +1569,8 @@ static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)...
574913f9e197c050178f36b6e6fdd92031baa078
Analyze and fix the following issue in the Linux kernel code: PCI: dwc: Fix potential truncation in dw_pcie_edma_irq_verify()
Problem Details: Increase the size of the string buffer to avoid potential truncation in dw_pcie_edma_irq_verify(). This fixes the following build warning when compiling with W=1: drivers/pci/controller/dwc/pcie-designware.c: In function ‘dw_pcie_edma_detect’: drivers/pci/controller/dwc/pcie-designware.c:989:50: ...
```diff diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 6d6cbc8b5b2c..61e2314ce475 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -970,7 +970,7 @@ static int dw_pcie_edma_irq_verify(struct dw_...
e6b087676954e36a7b1ed51249362bb499f8c1c2
Analyze and fix the following issue in the Linux kernel code: apparmor: fix dbus permission queries to v9 ABI
Problem Details: dbus permission queries need to be synced with fine grained unix mediation to avoid potential policy regressions. To ensure that dbus queries don't result in a case where fine grained unix mediation is not being applied but dbus mediation is check the loaded policy support ABI and abort the query if po...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index c5c756dda5cf..0b0e24cd4868 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -632,6 +632,14 @@ static void profile_query_cb(struct aa_profile *profile, struct aa_perms *perms, } else if (rules-...
a9eb185be84e998aa9a99c7760534ccc06216705
Analyze and fix the following issue in the Linux kernel code: apparmor: fix x_table_lookup when stacking is not the first entry
Problem Details: x_table_lookup currently does stacking during label_parse() if the target specifies a stack but its only caller ensures that it will never be used with stacking. Refactor to slightly simplify the code in x_to_label(), this also fixes a long standing problem where x_to_labels check on stacking is only ...
```diff diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 630806573793..b9c299097372 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -509,6 +509,7 @@ static const char *next_name(int xtype, const char *name) * @name: returns: name tested to find label (NOT NULL) ...
cd769b05cc87fb527dbab547e65b934b45705d6b
Analyze and fix the following issue in the Linux kernel code: apparmor: ensure labels with more than one entry have correct flags
Problem Details: labels containing more than one entry need to accumulate flag info from profiles that the label is constructed from. This is done correctly for labels created by a merge but is not being done for labels created by an update or directly created via a parse. This technically is a bug fix, however the ef...
```diff diff --git a/security/apparmor/label.c b/security/apparmor/label.c index f950dcc1842b..868874ef3d35 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -645,6 +645,7 @@ static bool __label_replace(struct aa_label *old, struct aa_label *new) rb_replace_node(&old->node, &new->node, &ls->r...
71e6cff3e0dde6f6a3355d6c73ca3e176567995e
Analyze and fix the following issue in the Linux kernel code: apparmor: Improve debug print infrastructure
Problem Details: Make it so apparmor debug output can be controlled by class flags as well as the debug flag on labels. This provides much finer control at what is being output so apparmor doesn't flood the logs with information that is not needed, making it hard to find what is important. Signed-off-by: John Johansen...
```diff diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 5939bd9a9b9b..c906ab98f53a 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -652,7 +652,7 @@ static struct aa_label *profile_transition(const struct cred *subj_cred, if (error) { if (profile_unconfined(pro...
c602537de3c137e55582d7fccfb18e50f1cd9c83
Analyze and fix the following issue in the Linux kernel code: apparmor: Use str_yes_no() helper function
Problem Details: Remove hard-coded strings by using the str_yes_no() helper function. Fix a typo in a comment: s/unpritable/unprintable/ Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: John Johansen <john.johansen@canonical.com>
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 2c0185ebc900..1bce9a7d2129 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -997,7 +997,7 @@ static int aa_sfs_seq_show(struct seq_file *seq, void *v) switch (fs_file->v_type) { case AA_SF...
01099f635a4c68b8574d350a972ba062dd5142e9
Analyze and fix the following issue in the Linux kernel code: ubi: Implement ioctl for detailed erase counters
Problem Details: Currently, "max_ec" can be read from sysfs, which provides a limited view of the flash device’s wear. In certain cases, such as bugs in the wear-leveling algorithm, specific blocks can be worn down more than others, resulting in uneven wear distribution. Also some use cases can wear the erase blocks of...
```diff diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 6bb80d7714bc..4c3e4edb6853 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -828,6 +828,69 @@ out_free: return err; } +static int ubi_get_ec_info(struct ubi_device *ubi, struct ubi_ecinfo_req __user *ureq) +{ + struct ubi...
bdb0ca39e0acccf6771db49c3f94ed787d05f2d7
Analyze and fix the following issue in the Linux kernel code: ubifs: skip dumping tnc tree when zroot is null
Problem Details: Clearing slab cache will free all znode in memory and make c->zroot.znode = NULL, then dumping tnc tree will access c->zroot.znode which cause null pointer dereference. Link: https://bugzilla.kernel.org/show_bug.cgi?id=219624#c0 Fixes: 1e51764a3c2a ("UBIFS: add new flash file system") Signed-off-by: p...
```diff diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 987eb5b6782a..b01f382ce8db 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -945,16 +945,20 @@ void ubifs_dump_tnc(struct ubifs_info *c) pr_err("\n"); pr_err("(pid %d) start dumping TNC tree\n", current->pid); - znode = ubifs_tnc_levelorder_nex...
844c6fdc13cf3d9d251533631988a58f8356a8c8
Analyze and fix the following issue in the Linux kernel code: ubi: Revert "ubi: wl: Close down wear-leveling before nand is suspended"
Problem Details: Commit 5580cdae05ae ("ubi: wl: Close down wear-leveling before nand is suspended") added a reboot notification in UBI layer to shutdown the wear-leveling subsystem, which imported an UAF problem[1]. Besides that, the method also brings other potential UAF problems, for example: reboot ...
```diff diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 26cc53ad34ec..c792b9bcab9b 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h @@ -549,7 +549,6 @@ struct ubi_debug_info { * @peb_buf: a buffer of PEB size used for different purposes * @buf_mutex: protects @peb_buf * @ckvol_mutex...
97bbf9e312c3fbaf0baa56120238825d2eb23b8a
Analyze and fix the following issue in the Linux kernel code: ubi: Add a check for ubi_num
Problem Details: Added a check for ubi_num for negative numbers If the variable ubi_num takes negative values then we get: qemu-system-arm ... -append "ubi.mtd=0,0,0,-22222345" ... [ 0.745065] ubi_attach_mtd_dev from ubi_init+0x178/0x218 [ 0.745230] ubi_init from do_one_initcall+0x70/0x1ac [ 0.745344] do_o...
```diff diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 30be4ed68fad..ef6a22f372f9 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -1537,7 +1537,7 @@ static int ubi_mtd_param_parse(const char *val, const struct kernel_param *kp) if (token) { int err = kstrtoint(token, 10,...
41c5d104f338b21b98aee5a207336c281325583f
Analyze and fix the following issue in the Linux kernel code: net/mlx5: fix unintentional sign extension on shift of dest_attr->vport.vhca_id
Problem Details: Shifting dest_attr->vport.vhca_id << 16 results in a promotion from an unsigned 16 bit integer to a 32 bit signed integer, this is then sign extended to a 64 bit unsigned long on 64 bitarchitectures. If vhca_id is greater than 0x7fff then this leads to a sign extended result where all the upper 32 bits...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c index 05329afeb9ea..f34bbbbba1c2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws...
70d81f25cc92cc4e914516c9935ae752f27d78ad
Analyze and fix the following issue in the Linux kernel code: net/mlxfw: Drop hard coded max FW flash image size
Problem Details: Currently, mlxfw kernel module limits FW flash image size to be 10MB at most, preventing the ability to burn recent BlueField-3 FW that exceeds the said size limit. Thus, drop the hard coded limit. Instead, rely on FW's max_component_size threshold that is reported in MCQI register as the size limit f...
```diff diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c index 46245e0b2462..43c84900369a 100644 --- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c +++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c @@ -14,7 +14,6 @@ #define MLXFW_FSM_STATE_WAIT_TIMEO...
d1f9f79fa2af8e3b45cffdeef66e05833480148a
Analyze and fix the following issue in the Linux kernel code: net: let net.core.dev_weight always be non-zero
Problem Details: The following problem was encountered during stability test: (NULL net_device): NAPI poll function process_backlog+0x0/0x530 \ returned 1, exceeding its budget of 0. ------------[ cut here ]------------ list_add double add: new=ffff88905f746f48, prev=ffff88905f746f48, \ next=ffff88905f746e40. WARNIN...
```diff diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index cb8d32e5c14e..ad2741f1346a 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -319,7 +319,7 @@ static int proc_do_dev_weight(const struct ctl_table *table, int write, int ret, weight; mutex_lock(&dev_weight...
82db1c29103ebf581484c0b30805e68726121dcb
Analyze and fix the following issue in the Linux kernel code: genksyms: fix syntax error for attribute after 'struct'
Problem Details: A longstanding issue with genksyms is that it has hidden syntax errors. When a syntax error occurs, yyerror() is called. However, error_with_pos() is a no-op unless the -w option is provided. You can observe syntax errors by manually passing the -w option. For example, with CONFIG_MODVERSIONS=y on v...
```diff diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index e886133af578..a1f969dcf24f 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l @@ -438,7 +438,12 @@ fini: if (suppress_type_lookup > 0) --suppress_type_lookup; - if (dont_want_brace_phrase > 0) + + /* + * __attribute_...
2ac068cb0b366c61e7aebaccf0240eae8b2c1b43
Analyze and fix the following issue in the Linux kernel code: genksyms: fix syntax error for attribute after abstact_declarator
Problem Details: A longstanding issue with genksyms is that it has hidden syntax errors. When a syntax error occurs, yyerror() is called. However, error_with_pos() is a no-op unless the -w option is provided. You can observe syntax errors by manually passing the -w option. For example, with CONFIG_MODVERSIONS=y on v...
```diff diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index 49d3e536b9a8..82774df50642 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y @@ -383,8 +383,8 @@ abstract_declarator: ptr_operator | ptr_operator abstract_declarator { $$ = $2 ? $2 : $1; } - | direct_abstract_declar...
a8b7d066f8626ec847d3e66aef1320968d1fe298
Analyze and fix the following issue in the Linux kernel code: genksyms: fix syntax error for attribute before nested_declarator
Problem Details: A longstanding issue with genksyms is that it has hidden syntax errors. When a syntax error occurs, yyerror() is called. However, error_with_pos() is a no-op unless the -w option is provided. You can observe syntax errors by manually passing the -w option. For example, with CONFIG_MODVERSIONS=y on v...
```diff diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index 54e16c2e0b4b..49d3e536b9a8 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y @@ -345,8 +345,8 @@ direct_nested_declarator1: { $$ = $4; } | direct_nested_declarator1 BRACKET_PHRASE { $$ = $2; } - | '(' nested_declar...
2966b66c94a2b0d897f8626b8f2c50a0fd4878a9
Analyze and fix the following issue in the Linux kernel code: genksyms: fix syntax error for attribute before abstract_declarator
Problem Details: A longstanding issue with genksyms is that it has hidden syntax errors. When a syntax error occurs, yyerror() is called. However, error_with_pos() is a no-op unless the -w option is provided. You can observe syntax errors by manually passing the -w option. For example, with CONFIG_MODVERSIONS=y on v...
```diff diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index cd933a95548d..54e16c2e0b4b 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y @@ -203,8 +203,9 @@ decl_specifier_seq_opt: ; decl_specifier_seq: - decl_specifier { decl_spec = *$1; } + attribute_opt decl_specifier {...
ccc11a195c69b0c01ee140aecadfbdcdcdd03605
Analyze and fix the following issue in the Linux kernel code: genksyms: record attributes consistently for init-declarator
Problem Details: I believe the missing action here is a bug. For rules with no explicit action, the following default is used: { $$ = $1; } However, in this case, $1 is the value of attribute_opt itself. As a result, the value of attribute_opt is always NULL. The following test code demonstrates inconsistent be...
```diff diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index 33a6aab53b69..e3c160046143 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y @@ -480,7 +480,7 @@ member_bitfield_declarator: attribute_opt: /* empty */ { $$ = NULL; } - | attribute_opt ATTRIBUTE_PHRASE + | attribu...
668de2b9d48dccdc1b992e07287f15459515fefb
Analyze and fix the following issue in the Linux kernel code: genksyms: fix last 3 shift/reduce conflicts
Problem Details: The genksyms parser has ambiguities in its grammar, which are currently suppressed by a workaround in scripts/genksyms/Makefile. Building genksyms with W=1 generates the following warnings: YACC scripts/genksyms/parse.tab.[ch] scripts/genksyms/parse.y: warning: 3 shift/reduce conflicts [-Wco...
```diff diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index dc575d467bbf..fafce939c32f 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y @@ -363,35 +363,47 @@ parameter_declaration_list: ; parameter_declaration: - decl_specifier_seq abstract_declarator + decl_specifier_seq abs...
3ccda63a3af5f12c9e0b01c06561285227d2f79c
Analyze and fix the following issue in the Linux kernel code: genksyms: fix 6 shift/reduce conflicts and 5 reduce/reduce conflicts
Problem Details: The genksyms parser has ambiguities in its grammar, which are currently suppressed by a workaround in scripts/genksyms/Makefile. Building genksyms with W=1 generates the following warnings: YACC scripts/genksyms/parse.tab.[ch] scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wco...
```diff diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 8c45ada59ece..0c355075f0e6 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h @@ -12,6 +12,7 @@ #ifndef MODUTILS_GENKSYMS_H #define MODUTILS_GENKSYMS_H 1 +#include <stdbool.h> #include <stdio.h> #include...
25ff08aa43e373a61c3e36fc7d7cae88ed0fc2d7
Analyze and fix the following issue in the Linux kernel code: kbuild: Fix signing issue for external modules
Problem Details: When running the sign script the kernel is within the source directory of external modules. This caused issues when the kernel uses relative paths, like: make[5]: Entering directory '/build/client/devel/kernel/work/linux-2.6' make[6]: Entering directory '/build/client/devel/addmodules/vtx/work/vtx' ...
```diff diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index f97c9926ed31..1628198f3e83 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -105,7 +105,7 @@ else sig-key := $(CONFIG_MODULE_SIG_KEY) endif quiet_cmd_sign = SIGN $@ - cmd_sign = scripts/sign-file $(CONFIG_MO...
60295b944ff6805e677c48ae4178532b207d43be
Analyze and fix the following issue in the Linux kernel code: tracing: gfp: Fix the GFP enum values shown for user space tracing tools
Problem Details: Tracing tools like perf and trace-cmd read the /sys/kernel/tracing/events/*/*/format files to know how to parse the data and also how to print it. For the "print fmt" portion of that file, if anything uses an enum that is not exported to the tracing system, user space will not be able to parse it. The...
```diff diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index bb8a59c6caa2..d36c857dd249 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -13,6 +13,69 @@ * Thus most bits set go first. */ +/* These define the values that are enums (the bits) */ +#def...
193700b9b218a77222a1b5cd53206c17c40f786b
Analyze and fix the following issue in the Linux kernel code: dm raid: fix spelling errors in raid_ctr()
Problem Details: Fix the respective spelling errors in raid_ctr() function. Signed-off-by: liujing <liujing@cmss.chinamobile.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
```diff diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 1e0d3b9b75d6..6adc55fd90d3 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3196,7 +3196,7 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) if (reshape_sectors || rs_is_raid1(rs)) { /* * We can...
709631924ee544ba0b661c41b442427897569f30
Analyze and fix the following issue in the Linux kernel code: drm/i915/uc: Include requested frequency in slow firmware load messages
Problem Details: To aid debug of sporadic issues, include the requested frequency in the debug message as well as the actual frequency. That way we know for certain that the clamping is not because the driver forgot to ask. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Vinay Belgaumkar <vinay.b...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c index 23f54c84cbab..e37d227dc199 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c @@ -259,13 +259,14 @@ static int guc_wait_ucode(struct intel_guc *guc) } el...
e9188ae3cd4e75297430c932d6e256c053bcc896
Analyze and fix the following issue in the Linux kernel code: perf lock: Add percpu-rwsem for type filter
Problem Details: percpu-rwsem was missing in man page. And for backward compatibility, replace `pcpu-sem` with `percpu-rwsem` before parsing lock name. Tested `./perf lock con -ab -Y pcpu-sem` and `./perf lock con -ab -Y percpu-rwsem` Fixes: 4f701063bfa2 ("perf lock contention: Show lock type with address") Reviewed-b...
```diff diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt index 57a940399de0..d3793054f7d3 100644 --- a/tools/perf/Documentation/perf-lock.txt +++ b/tools/perf/Documentation/perf-lock.txt @@ -187,8 +187,8 @@ CONTENTION OPTIONS Show lock contention only for given lock types (...
1be9264158ef4818393e5d8144887a1a5d3cc480
Analyze and fix the following issue in the Linux kernel code: perf lock: Fix parse_lock_type which only retrieve one lock flag
Problem Details: `parse_lock_type` can only add the first lock flag in `lock_type_table` given input `str`. For example, for `Y rwlock`, it only adds `rwlock:R` into this perf session. Another example is for `-Y mutex`, it only adds the mutex without `LCB_F_SPIN` flag. The patch fixes this issue, makes sure both `rwloc...
```diff diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 94a2bc15a2fa..70440966d8e3 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -1484,8 +1484,8 @@ static const struct { { LCB_F_PERCPU | LCB_F_WRITE, "pcpu-sem:W", "percpu-rwsem" }, { LCB_F_MUTEX, "mutex", "mute...
83196dd3499ae032e6cd2afbc663dbad50b3850a
Analyze and fix the following issue in the Linux kernel code: perf lock: Fix return code for functions in __cmd_contention
Problem Details: perf lock contention returns zero exit value even if the lock contention BPF setup failed. # ./perf lock con -b true libbpf: kernel BTF is missing at '/sys/kernel/btf/vmlinux', was CONFIG_DEBUG_INFO_BTF enabled? libbpf: failed to find '.BTF' ELF section in /lib/modules/6.13.0-rc3+/build/vmlinux ...
```diff diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 208c482daa56..94a2bc15a2fa 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -2049,7 +2049,8 @@ static int __cmd_contention(int argc, const char **argv) goto out_delete; } - if (lock_contention_prepare(&c...
5147779d5e1b6425f30eb57071717be2bb65fa3b
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Add wrappers.h
Problem Details: Extract syscall wrappers to make them usable by standalone binaries (see next commit). Cc: Günther Noack <gnoack@google.com> Link: https://lore.kernel.org/r/20250108154338.1129069-22-mic@digikod.net [mic: Fix comments] Signed-off-by: Mickaël Salaün <mic@digikod.net>
```diff diff --git a/tools/testing/selftests/landlock/common.h b/tools/testing/selftests/landlock/common.h index 61056fa074bb..8391ab574f64 100644 --- a/tools/testing/selftests/landlock/common.h +++ b/tools/testing/selftests/landlock/common.h @@ -9,17 +9,15 @@ #include <arpa/inet.h> #include <errno.h> -#include <li...
2107c35128ad751b201eb92fe91443450d9e5c37
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Fix error message
Problem Details: The global variable errno may not be set in test_execute(). Do not use it in related error message. Cc: Günther Noack <gnoack@google.com> Fixes: e1199815b47b ("selftests/landlock: Add user space tests") Link: https://lore.kernel.org/r/20250108154338.1129069-21-mic@digikod.net Signed-off-by: Mickaël S...
```diff diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c index 42ce1e79ba82..a359c0d3107f 100644 --- a/tools/testing/selftests/landlock/fs_test.c +++ b/tools/testing/selftests/landlock/fs_test.c @@ -2011,8 +2011,7 @@ static void test_execute(struct __test_metadata *co...
12264f721f64a235f81e845e2cf95ad4a267613a
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Add test to check partial access in a mount tree
Problem Details: Add layout1.refer_part_mount_tree_is_allowed to test the masked logical issue regarding collect_domain_accesses() calls followed by the is_access_to_paths_allowed() check in current_check_refer_path(). See previous commit. This test should work without the previous fix as well, but it enables us to m...
```diff diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c index 6788762188fe..42ce1e79ba82 100644 --- a/tools/testing/selftests/landlock/fs_test.c +++ b/tools/testing/selftests/landlock/fs_test.c @@ -85,6 +85,9 @@ static const char file1_s3d1[] = TMP_DIR "/s3d1/f1"; /...
058518c2092081f224edb37cbc236bed5c28852d
Analyze and fix the following issue in the Linux kernel code: landlock: Align partial refer access checks with final ones
Problem Details: Fix a logical issue that could have been visible if the source or the destination of a rename/link action was allowed for either the source or the destination but not both. However, this logical bug is unreachable because either: - the rename/link action is allowed by the access rights tied to the s...
```diff diff --git a/security/landlock/fs.c b/security/landlock/fs.c index 4eb972f2292f..110b8cfaab9c 100644 --- a/security/landlock/fs.c +++ b/security/landlock/fs.c @@ -565,6 +565,12 @@ static void test_no_more_access(struct kunit *const test) #undef NMA_TRUE #undef NMA_FALSE +static bool is_layer_masks_allowed( ...
622e2f5954763385c4fa1f9a11a11366952a9b60
Analyze and fix the following issue in the Linux kernel code: landlock: Move access types
Problem Details: Move LANDLOCK_ACCESS_FS_INITIALLY_DENIED, access_mask_t, struct access_mask, and struct access_masks_all to a dedicated access.h file. Rename LANDLOCK_ACCESS_FS_INITIALLY_DENIED to _LANDLOCK_ACCESS_FS_INITIALLY_DENIED to make it clear that it's not part of UAPI. Add some newlines when appropriate. T...
```diff diff --git a/security/landlock/access.h b/security/landlock/access.h new file mode 100644 index 000000000000..9ee4b30a87e6 --- /dev/null +++ b/security/landlock/access.h @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Landlock LSM - Access types and helpers + * + * Copyright © 2016-2020 Mi...
0e4db4f843c2c0115b5981bd6f6b75dea62e7d60
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Fix build with non-default pthread linking
Problem Details: Old toolchains require explicit -lpthread (e.g. on Debian 11). Cc: Nathan Chancellor <nathan@kernel.org> Cc: Tahera Fahimi <fahimitahera@gmail.com> Fixes: c8994965013e ("selftests/landlock: Test signal scoping for threads") Reviewed-by: Günther Noack <gnoack3000@gmail.com> Link: https://lore.kernel.or...
```diff diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile index 348e2dbdb4e0..480f13e77fcc 100644 --- a/tools/testing/selftests/landlock/Makefile +++ b/tools/testing/selftests/landlock/Makefile @@ -13,11 +13,11 @@ TEST_GEN_PROGS := $(src_test:.c=) TEST_GEN_PROGS_EXTENDE...
036e2faa997c39a5f15dbeb50528911778d8b29d
Analyze and fix the following issue in the Linux kernel code: perf hist: Fix width calculation in hpp__fmt()
Problem Details: hpp__width_fn() round up width to length of the field name, hpp__fmt() should do it too. Otherwise, the numbers may end up unaligned if the field name is long. Signed-off-by: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: James Clark <james.clark@linaro.org> Link: https://lore.kernel.org/r/2025010806...
```diff diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index e5491995adf0..34fda1d5eccb 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -121,7 +121,7 @@ int hpp__fmt(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, const char *fmtstr, hpp_snprint_fn print_fn, enum perf_hpp_fmt_typ...
0025d83a3c201d0f1cda1085a3847591af563ec2
Analyze and fix the following issue in the Linux kernel code: ACPI: platform_profile: Add a prefix to log messages
Problem Details: Declare a pr_fmt prefix. Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Kurt Borja <kuurtb@gmail.com> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca> Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca> Link: https://lore.kernel.org/r/20250116002721.75592-20-kuurtb@gmai...
```diff diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c index 49af808153a7..fc92e43d0fe9 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -2,6 +2,8 @@ /* Platform profile sysfs interface */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include ...
f4ab186830222a18e2c232b425f2945b408e2607
Analyze and fix the following issue in the Linux kernel code: sparc: replace zero-length array with flexible-array member
Problem Details: The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mecha...
```diff diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 50a0927a84a6..ddac216a2aff 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -932,7 +932,7 @@ static void pci_bus_slot_names(struct device_node *node, struct pci_bus *bus) { const struct pci_slot_names { u32 slot_mask...
8537a7011be9d9f9d205d8ec842f022a1598862d
Analyze and fix the following issue in the Linux kernel code: of: Correct element count for two arrays in API of_parse_phandle_with_args_map()
Problem Details: of_parse_phandle_with_args_map() defines array @dummy_mask and @dummy_pass these two arrays only need @MAX_PHANDLE_ARGS elements separately, but they actually have (@MAX_PHANDLE_ARGS + 1) elements, One extra element doesn't hurt anything except for some stack usage. Fix by using (@MAX_PHANDLE_ARGS - 1...
```diff diff --git a/drivers/of/base.c b/drivers/of/base.c index f4ab4086b80f..2432e0f4646d 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1448,8 +1448,8 @@ int of_parse_phandle_with_args_map(const struct device_node *np, char *pass_name __free(kfree) = kasprintf(GFP_KERNEL, "%s-map-pass-thru", stem_name)...
81dfedd5234b42df11a473eefe7328ea4a0416ad
Analyze and fix the following issue in the Linux kernel code: of: reserved-memory: Warn for missing static reserved memory regions
Problem Details: For child node of /reserved-memory, its property 'reg' may contain multiple regions, but fdt_scan_reserved_mem_reg_nodes() only takes into account the first region, and miss remaining regions. But there are no simple approach to fix it, so give user warning message when miss remaining regions. Fixes:...
```diff diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 17c57118c496..75e819f66a56 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -263,6 +263,11 @@ void __init fdt_scan_reserved_mem_reg_nodes(void) uname); continue; } + + if (len > t_len...
72d1c18262dd5a18d835a94391c31cf04252c748
Analyze and fix the following issue in the Linux kernel code: of: Do not expose of_alias_scan() and correct its comments
Problem Details: of_alias_scan() has no external callers and returns void. Do not expose it and delete return value descriptions in its comments. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20250114-of_core_fix-v5-1-b8bafd00a86f@quicinc.com Signed-off-by: Rob Herring (Arm) <robh@k...
```diff diff --git a/drivers/of/base.c b/drivers/of/base.c index 969b99838655..f4ab4086b80f 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1812,8 +1812,7 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np, * for storing the resulting tree * * The function scans all the properti...
01f3ce5328c405179b2c69ea047c423dad2bfa6d
Analyze and fix the following issue in the Linux kernel code: tools: Sync if_xdp.h uapi tooling header
Problem Details: Sync if_xdp.h uapi header to remove following warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/if_xdp.h' differs from latest version at 'include/uapi/linux/if_xdp.h' Fixes: 48eb03dd2630 ("xsk: Add TX timestamp and TX checksum offload support") Signed-off-by: Vishal Chourasia <vish...
```diff diff --git a/tools/include/uapi/linux/if_xdp.h b/tools/include/uapi/linux/if_xdp.h index 2f082b01ff22..42ec5ddaab8d 100644 --- a/tools/include/uapi/linux/if_xdp.h +++ b/tools/include/uapi/linux/if_xdp.h @@ -117,12 +117,12 @@ struct xdp_options { ((1ULL << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1) /* Request tra...
f8a05692de060a889fe5b9eb00cc8f1fc8935899
Analyze and fix the following issue in the Linux kernel code: libbpf: Work around kernel inconsistently stripping '.llvm.' suffix
Problem Details: Some versions of kernel were stripping out '.llvm.<hash>' suffix from kerne symbols (produced by Clang LTO compilation) from function names reported in available_filter_functions, while kallsyms reported full original name. This confuses libbpf's multi-kprobe logic of finding all matching kernel functi...
```diff diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 6c262d0152f8..194809da5172 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -11387,9 +11387,33 @@ static int avail_kallsyms_cb(unsigned long long sym_addr, char sym_type, struct kprobe_multi_resolve *res = data->res; int e...
bea6afc1bfad1d44f87ee73cfb631533b82aa3e2
Analyze and fix the following issue in the Linux kernel code: cgroup/rdma: Drop bogus PAGE_COUNTER select
Problem Details: When adding the Device memory controller (DMEM), "select PAGE_COUNTER" was added to CGROUP_RDMA, presumably instead of CGROUP_DMEM. While commit e33b51499a0a6bca ("cgroup/dmem: Select PAGE_COUNTER") added the missing select to CGROUP_DMEM, the bogus select is still there. Remove it. Fixes: b168ed458dd...
```diff diff --git a/init/Kconfig b/init/Kconfig index 5e5328506138..d66b215ac93d 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1128,7 +1128,6 @@ config CGROUP_PIDS config CGROUP_RDMA bool "RDMA controller" - select PAGE_COUNTER help Provides enforcement of RDMA resources defined by IB stack. It is fa...
970b9757cb44c315b5c3da6b1b35a1ffb07cca5a
Analyze and fix the following issue in the Linux kernel code: ntsync: Fix reference leaks in the remaining create ioctls.
Problem Details: When ntsync_obj_get_fd() fails, we free the ntsync object but forget to drop the "file" member. This was fixed for semaphores in 0e7d523b5f7a23b1dc6ceceb04e31a60e9e3321d, but that commit did not fix the similar leak for events and mutexes, since they were part of patches not yet in the mainline kernel...
```diff diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c index b6441e978974..055395cde42b 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -781,7 +781,7 @@ static int ntsync_create_mutex(struct ntsync_device *dev, void __user *argp) mutex->u.mutex.owner = args.owner; fd = ntsync_obj_get_f...
d3eb58549842c60ed46f37da7f4da969e3d6ecd3
Analyze and fix the following issue in the Linux kernel code: net: phy: realtek: always clear NBase-T lpa
Problem Details: Clear NBase-T link partner advertisement before calling rtlgen_read_status() to avoid phy_resolve_aneg_linkmode() wrongly setting speed and duplex. This fixes bogus 2.5G/5G/10G link partner advertisement and thus speed and duplex being set by phy_resolve_aneg_linkmode() due to stale NBase-T lpa. Fixe...
```diff diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 93704abb6787..9cefca1aefa1 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -952,15 +952,15 @@ static int rtl822x_read_status(struct phy_device *phydev) { int lpadv, ret; + mii_10gbt_stat_mod_linkmode_lpa_t(ph...
ea8318cb33e593bbfc59d637eae45a69732c5387
Analyze and fix the following issue in the Linux kernel code: net: phy: realtek: clear master_slave_state if link is down
Problem Details: rtlgen_decode_physr() which sets master_slave_state isn't called in case the link is down and other than rtlgen_read_status(), rtl822x_c45_read_status() doesn't implicitely clear master_slave_state. Avoid stale master_slave_state by always setting it to MASTER_SLAVE_STATE_UNKNOWN in rtl822x_c45_read_s...
```diff diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 26b324ab0f90..93704abb6787 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -1038,8 +1038,10 @@ static int rtl822x_c45_read_status(struct phy_device *phydev) if (ret < 0) return ret; - if (!phydev->link) + i...
34d5a86ff7bbe225fba3ad91f9b4dc85fb408e18
Analyze and fix the following issue in the Linux kernel code: net: phy: realtek: clear 1000Base-T lpa if link is down
Problem Details: Only read 1000Base-T link partner advertisement if autonegotiation has completed and otherwise 1000Base-T link partner advertisement bits. This fixes bogus 1000Base-T link partner advertisement after link goes down (eg. by disconnecting the wire). Fixes: 5cb409b3960e ("net: phy: realtek: clear 1000Bas...
```diff diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index f65d7f1f348e..26b324ab0f90 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -1023,23 +1023,20 @@ static int rtl822x_c45_read_status(struct phy_device *phydev) { int ret, val; - ret = genphy_c45_read_status(phy...
651dee03696e1dfde6d9a7e8664bbdcd9a10ea7f
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Increment the runtime usage counter for the earlycon device
Problem Details: In the sh-sci driver, serial ports are mapped to the sci_ports[] array, with earlycon mapped at index zero. The uart_add_one_port() function eventually calls __device_attach(), which, in turn, calls pm_request_idle(). The identified code path is as follows: uart_add_one_port() -> serial_ctrl_regist...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index e64d59888ecd..b1ea48f38248 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3436,6 +3436,22 @@ static int sci_probe_single(struct platform_device *dev, } if (sci_uart_earlycon && sci_ports[0].port.ma...
5f1017069933489add0c08659673443c9905659e
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Clean sci_ports[0] after at earlycon exit
Problem Details: The early_console_setup() function initializes sci_ports[0].port with an object of type struct uart_port obtained from the struct earlycon_device passed as an argument to early_console_setup(). Later, during serial port probing, the serial port used as earlycon (e.g., port A) might be remapped to a di...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index b85a9d425f7e..e64d59888ecd 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -166,6 +166,7 @@ static struct sci_port sci_ports[SCI_NPORTS]; static unsigned long sci_ports_in_use; static struct uart_driver ...
9f7dea875cc7f9c1a56a5c688290634a59cd1420
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use
Problem Details: In the sh-sci driver, sci_ports[0] is used by earlycon. If the earlycon is still active when sci_probe() is called and the new serial port is supposed to map to sci_ports[0], return -EBUSY to prevent breaking the earlycon. This situation should occurs in debug scenarios, and users should be aware of t...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 51382e354a2d..b85a9d425f7e 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -165,6 +165,7 @@ struct sci_port { static struct sci_port sci_ports[SCI_NPORTS]; static unsigned long sci_ports_in_use; static ...
239f11209e5f282e16f5241b99256e25dd0614b6
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Move runtime PM enable to sci_probe_single()
Problem Details: Relocate the runtime PM enable operation to sci_probe_single(). This change prepares the codebase for upcoming fixes. While at it, replace the existing logic with a direct call to devm_pm_runtime_enable() and remove sci_cleanup_single(). The devm_pm_runtime_enable() function automatically handles disa...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 09e69cb7d798..51382e354a2d 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3056,10 +3056,6 @@ static int sci_init_single(struct platform_device *dev, ret = sci_init_clocks(sci_port, &dev->dev); if (...
eaeee4225dba30bef4d424bdf134a07b7f423e8b
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Drop __initdata macro for port_cfg
Problem Details: The port_cfg object is used by serial_console_write(), which serves as the write function for the earlycon device. Marking port_cfg as __initdata causes it to be freed after kernel initialization, resulting in earlycon becoming unavailable thereafter. Remove the __initdata macro from port_cfg to resolv...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index e0c56c328d10..09e69cb7d798 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3562,7 +3562,7 @@ sh_early_platform_init_buffer("earlyprintk", &sci_driver, early_serial_buf, ARRAY_SIZE(early_serial_buf)...
086fd062bc3883ae1ce4166cff5355db315ad879
Analyze and fix the following issue in the Linux kernel code: Revert "usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null"
Problem Details: This reverts commit 13014969cbf07f18d62ceea40bd8ca8ec9d36cec. It is reported to cause crashes on Tegra systems, so revert it for now. Link: https://lore.kernel.org/r/1037c1ad-9230-4181-b9c3-167dbaa47644@nvidia.com Reported-by: Jon Hunter <jonathanh@nvidia.com> Cc: stable <stable@kernel.org> Cc: Lianq...
```diff diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 5413882b1498..36fff45e8c9b 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1421,10 +1421,6 @@ void gserial_disconnect(struct gserial *gser) /* REVISIT as abov...
4d27afbf256028a1f54363367f30efc8854433c3
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS
Problem Details: The Source can drop its output voltage to the minimum of the requested PPS APDO voltage range when it is in Current Limit Mode. If this voltage falls within the range of vPpsShutdown, the Source initiates a Hard Reset and discharges Vbus. However, currently the Sink may disconnect before the voltage re...
```diff diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index 48762508cc86..19ab6647af70 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -27,6 +27,7 @@ #define VPPS_NEW_MIN_PERCENT 95 #define VPPS_VALID_MIN_MV 100 #define VSINKDISCONNECT_PD_MIN_PER...
983e375849fe4fd987cab94d940ba2af6f9e7a71
Analyze and fix the following issue in the Linux kernel code: usb: xhci: tegra: Fix OF boolean read warning
Problem Details: After commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties") was added, the following warning is observed for the Tegra XHCI driver ... OF: /bus@0/usb@3610000: Read of boolean property 'power-domains' with a value. Previously, of_property_read_bool() was...
```diff diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index a51ce71a6a77..22dc86fb5254 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -1668,7 +1668,7 @@ static int tegra_xusb_probe(struct platform_device *pdev) goto put_padctl; } - if (!of_property_...
eb124822186be8ea433f568e92cc3bfbf6117a30
Analyze and fix the following issue in the Linux kernel code: usb: host: xhci-plat: add support compatible ID PNP0D15
Problem Details: Add support compatible ID PNP0D15 which declare that the xHCI controller doesn't support standard debug capability. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/20250116125141.25856-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfo...
```diff diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index e88814c5743b..d85ffa9ffaa7 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -569,6 +569,7 @@ EXPORT_SYMBOL_GPL(xhci_plat_pm_ops); static const struct acpi_device_id usb_xhci_acpi_match[] = { /* XHCI-...
66e0ea341a2a78d14336117f19763bd9be26d45d
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: core: Defer the probe until USB power supply ready
Problem Details: Currently, DWC3 driver attempts to acquire the USB power supply only once during the probe. If the USB power supply is not ready at that time, the driver simply ignores the failure and continues the probe, leading to permanent non-functioning of the gadget vbus_draw callback. Address this problem by d...
```diff diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 7578c5133568..dfa1b5fe48dc 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1684,8 +1684,6 @@ static void dwc3_get_properties(struct dwc3 *dwc) u8 tx_thr_num_pkt_prd = 0; u8 tx_max_burst_prd = 0; u8 tx_fifo_re...
81702d41457a8aec49bfd0942f98697d529656f0
Analyze and fix the following issue in the Linux kernel code: usbip: Correct format specifier for seqnum from %d to %u
Problem Details: The seqnum field in USBIP protocol is an unsigned value. So we fix the format specifier from %d to %u to correctly display the value. Signed-off-by: Xiong Nandi <xndchn@gmail.com> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20241231161539.20192-3-xndchn@gmail.com S...
```diff diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c index 6338d818bc8b..9aa30ef76f3b 100644 --- a/drivers/usb/usbip/stub_rx.c +++ b/drivers/usb/usbip/stub_rx.c @@ -269,7 +269,7 @@ static int stub_recv_cmd_unlink(struct stub_device *sdev, return 0; } - usbip_dbg_stub_rx("seqnum %d is no...
15b93f340fa6bcb0b47f574e1cd3b5ce02fec403
Analyze and fix the following issue in the Linux kernel code: usbip: Fix seqnum sign extension issue in vhci_tx_urb
Problem Details: The atomic_inc_return function returns an int, while priv->seqnum is an unsigned long. So we must cast the result to u32 to prevent potential sign extension and size mismatch issues. Signed-off-by: Xiong Nandi <xndchn@gmail.com> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kerne...
```diff diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index f4843ea5080c..e70fba9f55d6 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -676,7 +676,7 @@ static void vhci_tx_urb(struct urb *urb, struct vhci_device *vdev) spin_lock_irqsave(&vdev->priv_lock, fl...
9983fd3c8dc315e0e4869d4522787163de57e0e9
Analyze and fix the following issue in the Linux kernel code: drm/i915/dmc_wl: Track pipe interrupt registers
Problem Details: Pipe interrupt registers live in their respective pipes' power wells, which are below PG0. That means that they must also be tracked as registers that are powered-off during dynamic DC states. There are probably more ranges that we need to track down and add to the powered_off_ranges. However, let's m...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c index 1bdc08e6aa45..43884740f8ea 100644 --- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c +++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c @@ -67,6 +67,7 @@ struct intel_dmc_wl_range { }; static const str...
01009b06a6b52d8439c55b530633a971c13b6cb2
Analyze and fix the following issue in the Linux kernel code: arm64/sysreg: Get rid of TRFCR_ELx SysregFields
Problem Details: There is no such thing as TRFCR_ELx in the architecture. What we have is TRFCR_EL1, for which TRFCR_EL12 is an accessor. Rename TRFCR_ELx_* to TRFCR_EL1_*, and fix the bit of code using these names. Similarly, TRFCR_EL12 is redefined as a mapping to TRFCR_EL1. Reviewed-by: James Clark <james.clark@l...
```diff diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 4c2c9c6767c9..ac5202e1df86 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -1999,7 +1999,7 @@ Field 17:16 ZEN Res0 15:0 EndSysreg -SysregFields TRFCR_ELx +Sysreg TRFCR_EL1 3 0 1 2 1 Res0 63:7 UnsignedEnum 6:5 TS 0...
5cb4e5b056772e341b590755a976081776422053
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek - Fixed headphone distorted sound on Acer Aspire A115-31 laptop
Problem Details: Sound played through headphones is distorted. Fixes: 34ab5bbc6e82 ("ALSA: hda/realtek - Add Headset Mic supported Acer NB platform") Closes: https://lore.kernel.org/linux-sound/e142749b-7714-4733-9452-918fbe328c8f@gmail.com/ Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.o...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7d76775bf97d..2871ae51819c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10158,6 +10158,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24...
e8c59791ebb60790c74b2c3ab520f04a8a57219a
Analyze and fix the following issue in the Linux kernel code: pwm: stm32: Add check for clk_enable()
Problem Details: Add check for the return value of clk_enable() to catch the potential error. Fixes: 19f1016ea960 ("pwm: stm32: Fix enable count for clk in .probe()") Signed-off-by: Mingwei Zheng <zmw12306@gmail.com> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Link: https://lore.kernel.org/r/2024121522...
```diff diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 17e591f61efb..a59de4de18b6 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -858,8 +858,11 @@ static int stm32_pwm_probe(struct platform_device *pdev) chip->ops = &stm32pwm_ops; /* Initialize clock refcount to number...
082f1bcae8d1b5f76e92e369091176b8d61120ec
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Fully decode all combinations of alloc_paging_flags
Problem Details: Currently AMD does not support IOMMU_HWPT_ALLOC_PASID | IOMMU_HWPT_ALLOC_DIRTY_TRACKING It should be rejected. Instead it creates a V1 domain without dirty tracking support. Use a switch to fully decode the flags. Fixes: ce2cd175469f ("iommu/amd: Enhance amd_iommu_domain_alloc_user()") Reviewed-by:...
```diff diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 0600f0682b91..12c1245baaf9 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2554,24 +2554,24 @@ amd_iommu_domain_alloc_paging_flags(struct device *dev, u32 flags, if ((flags & ~supported_flags) || user_data) ...
13b4ec749163710e3d188d2fed7405308b1b1e73
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Change amd_iommu_pgtable to use enum protection_domain_mode
Problem Details: Currently it uses enum io_pgtable_fmt which is from the io pagetable code and most of the enum values are invalid. protection_domain_mode is internal the driver and has the only two valid values. Fix some signatures and variables to use the right type as well. Reviewed-by: Vasant Hegde <vasant.hegde@...
```diff diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h index d6f4cf823599..0fb0c8392b53 100644 --- a/drivers/iommu/amd/amd_iommu.h +++ b/drivers/iommu/amd/amd_iommu.h @@ -40,7 +40,7 @@ void amd_iommu_disable(void); int amd_iommu_reenable(int mode); int amd_iommu_enable_faulting(unsigned in...
55b237dd7f7ec2ee9c7986e0fc28c5867bf63282
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Remove type argument from do_iommu_domain_alloc() and related
Problem Details: do_iommu_domain_alloc() is only called from amd_iommu_domain_alloc_paging_flags() so type is always IOMMU_DOMAIN_UNMANAGED. Remove type and all the dead conditionals checking it. IOMMU_DOMAIN_IDENTITY checks are similarly obsolete as the conversion to the global static identity domain removed those ca...
```diff diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h index cdbfa5f096dd..d6f4cf823599 100644 --- a/drivers/iommu/amd/amd_iommu.h +++ b/drivers/iommu/amd/amd_iommu.h @@ -46,7 +46,7 @@ extern unsigned long amd_iommu_pgsize_bitmap; /* Protection domain ops */ void amd_iommu_init_identity_...
1a684b099fac9a37e6fe2f0e594adbb1eff5181a
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Remove unused amd_iommu_domain_update()
Problem Details: All the callers have been removed by the below commit, remove the implementation and prototypes. Fixes: 322d889ae7d3 ("iommu/amd: Remove amd_iommu_domain_update() from page table freeing") Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com...
```diff diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h index c4cd272b31f4..cdbfa5f096dd 100644 --- a/drivers/iommu/amd/amd_iommu.h +++ b/drivers/iommu/amd/amd_iommu.h @@ -88,7 +88,6 @@ int amd_iommu_complete_ppr(struct device *dev, u32 pasid, int status, int tag); */ void amd_iommu_flush_...
10c62c38b073ecea775b7e23fa7c7a3995a84ff3
Analyze and fix the following issue in the Linux kernel code: iommu/riscv: Fixup compile warning
Problem Details: When __BITS_PER_LONG == 32, size_t is defined as unsigned int rather than unsigned long. Therefore, we should use size_t to avoid type-checking errors. Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support") Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org...
```diff diff --git a/drivers/iommu/riscv/iommu.c b/drivers/iommu/riscv/iommu.c index 670b4302aca8..8f049d4a0e2c 100644 --- a/drivers/iommu/riscv/iommu.c +++ b/drivers/iommu/riscv/iommu.c @@ -1278,7 +1278,7 @@ static phys_addr_t riscv_iommu_iova_to_phys(struct iommu_domain *iommu_domain, dma_addr_t iova) { ...
605a33e765890e4f1345315afc25268d4ae0fb7c
Analyze and fix the following issue in the Linux kernel code: drm/i915/hdcp: Fix Repeater authentication during topology change
Problem Details: When topology changes, before beginning a new HDCP authentication by sending AKE_init message we need to first authenticate only the repeater. Only after repeater authentication failure, it makes sense to start a new HDCP authentication. Even though it made sense to not enable HDCP directly from check_...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 7464b44c8bb3..c60b22aaa819 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -2188,6 +2188,19 @@ static int intel_hdcp2_check_link(struct intel_connect...
8ac412a3361173e3000b16167af3d1f6f90af613
Analyze and fix the following issue in the Linux kernel code: bpf: tcp: Mark bpf_load_hdr_opt() arg2 as read-write
Problem Details: MEM_WRITE attribute is defined as: "Non-presence of MEM_WRITE means that MEM is only being read". bpf_load_hdr_opt() both reads and writes from its arg2 - void *search_res. This matters a lot for the next commit where we more precisely track stack accesses. Without this annotation, the verifier will m...
```diff diff --git a/net/core/filter.c b/net/core/filter.c index 21131ec25f24..713d6f454df3 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -7643,7 +7643,7 @@ static const struct bpf_func_proto bpf_sock_ops_load_hdr_opt_proto = { .gpl_only = false, .ret_type = RET_INTEGER, .arg1_type = ARG_PTR_TO_CTX, -...
3030e3d57ba8d0f59bd8162b3b1f3f7ee273f280
Analyze and fix the following issue in the Linux kernel code: selftests/net: packetdrill: make tcp buf limited timing tests benign
Problem Details: The following tests are failing on debug kernels: tcp_tcp_info_tcp-info-rwnd-limited.pkt tcp_tcp_info_tcp-info-sndbuf-limited.pkt with reports like: assert 19000 <= tcpi_sndbuf_limited <= 21000, tcpi_sndbuf_limited; \ AssertionError: 18000 and: assert 348000 <= tcpi_busy_time <= ...
```diff diff --git a/tools/testing/selftests/net/packetdrill/ksft_runner.sh b/tools/testing/selftests/net/packetdrill/ksft_runner.sh index ff989c325eef..e15c43b7359b 100755 --- a/tools/testing/selftests/net/packetdrill/ksft_runner.sh +++ b/tools/testing/selftests/net/packetdrill/ksft_runner.sh @@ -43,6 +43,7 @@ if [[ -...
03abf2a7c65451e663b078b0ed1bfa648cd9380f
Analyze and fix the following issue in the Linux kernel code: net: phylink: add EEE management
Problem Details: Add EEE management to phylink, making use of the phylib implementation. This will only be used where a MAC driver populates the methods and capabilities bitfield, otherwise we keep our old behaviour. Phylink will keep track of the EEE configuration, including the clock stop abilities at each end of th...
```diff diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 918cb9a919f9..66eea3f963d3 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -60,6 +60,7 @@ struct phylink { u8 act_link_an_mode; /* Active MLO_AN_xxx mode */ u8 link_port; /* The current non-phy ethtool port...
e361560a7912958ba3059f51e7dd21612d119169
Analyze and fix the following issue in the Linux kernel code: dev: Acquire netdev_rename_lock before restoring dev->name in dev_change_name().
Problem Details: The cited commit forgot to add netdev_rename_lock in one of the error paths in dev_change_name(). Let's hold netdev_rename_lock before restoring the old dev->name. Fixes: 0840556e5a3a ("net: Protect dev->name by seqlock.") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index 782ae3ff3f8d..cb6da0cac211 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1389,7 +1389,9 @@ int dev_change_name(struct net_device *dev, const char *newname) rollback: ret = device_rename(&dev->dev, dev->name); if (ret) { + write_seqlock_bh(&netdev_r...
3d72d603afa72082501e9076eed61e0531339ef8
Analyze and fix the following issue in the Linux kernel code: riscv: dts: spacemit: move aliases to board dts
Problem Details: aliases info should belong to board dts, instead of putting it at SoC dtsi file. Fixes: d8fe64691955 ("riscv: dts: add initial SpacemiT K1 SoC device tree") Link: https://lore.kernel.org/all/6a8bb914-858e-479d-a7d9-09e0ff688160@app.fastmail.com Signed-off-by: Yixun Lan <dlan@gentoo.org>
```diff diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts index bc88d4de25a6..1d617b40a2d5 100644 --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts @@ -10,6 +10,10 @@ model = "Banana Pi BPI-F3"; co...
5ca681a86ef93369685cb63f71994f4cf7303e7c
Analyze and fix the following issue in the Linux kernel code: libbpf: Fix incorrect traversal end type ID when marking BTF_IS_EMBEDDED
Problem Details: When redirecting the split BTF to the vmlinux base BTF, we need to mark the distilled base struct/union members of split BTF structs/unions in id_map with BTF_IS_EMBEDDED. This indicates that these types must match both name and size later. Therefore, we need to traverse the entire split BTF, which inv...
```diff diff --git a/tools/lib/bpf/btf_relocate.c b/tools/lib/bpf/btf_relocate.c index b72f83e15156..53d1f3541bce 100644 --- a/tools/lib/bpf/btf_relocate.c +++ b/tools/lib/bpf/btf_relocate.c @@ -212,7 +212,7 @@ static int btf_relocate_map_distilled_base(struct btf_relocate *r) * need to match both name and size, oth...
5436a54332c19df0acbef2b87cbf9f7cba56f2dd
Analyze and fix the following issue in the Linux kernel code: libbpf: Fix return zero when elf_begin failed
Problem Details: The error number of elf_begin is omitted when encapsulating the btf_find_elf_sections function. Fixes: c86f180ffc99 ("libbpf: Make btf_parse_elf process .BTF.base transparently") Signed-off-by: Pu Lehui <pulehui@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.o...
```diff diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index a4ae2df68b91..48c66f3a9200 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -1186,6 +1186,7 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf, elf = elf_begin(fd, ELF_C_READ, NULL); if (!elf) { + err = -LIB...
4a04cb326a6c7f9a2c066f8c2ca78a5a9b87ddab
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix btf leak on new btf alloc failure in btf_distill test
Problem Details: Fix btf leak on new btf alloc failure in btf_distill test. Fixes: affdeb50616b ("selftests/bpf: Extend distilled BTF tests to cover BTF relocation") Signed-off-by: Pu Lehui <pulehui@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20250115100241.4171581-...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/btf_distill.c b/tools/testing/selftests/bpf/prog_tests/btf_distill.c index ca84726d5ac1..b72b966df77b 100644 --- a/tools/testing/selftests/bpf/prog_tests/btf_distill.c +++ b/tools/testing/selftests/bpf/prog_tests/btf_distill.c @@ -385,7 +385,7 @@ static void t...
a8d1c48d0720140b53063ff23507845bb2078e92
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix undefined UINT_MAX in veristat.c
Problem Details: Include <limits.h> in 'veristat.c' to provide a UINT_MAX definition and avoid multiple compile errors against mips64el/musl-libc: veristat.c: In function 'max_verifier_log_size': veristat.c:1135:36: error: 'UINT_MAX' undeclared (first use in this function) 1135 | const int SMALL_LOG_SIZE = UI...
```diff diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c index 8dcf5ee000ca..c72111dfb35d 100644 --- a/tools/testing/selftests/bpf/veristat.c +++ b/tools/testing/selftests/bpf/veristat.c @@ -21,6 +21,7 @@ #include <gelf.h> #include <float.h> #include <math.h> +#include <li...
d7f12857f095ef38523399d47e68787b357232f6
Analyze and fix the following issue in the Linux kernel code: clk: analogbits: Fix incorrect calculation of vco rate delta
Problem Details: In wrpll_configure_for_rate() we try to determine the best PLL configuration for a target rate. However, in the loop where we try values of R, we should compare the derived `vco` with `target_vco_rate`. However, we were in fact comparing it with `target_rate`, which is actually after Q shift. This is i...
```diff diff --git a/drivers/clk/analogbits/wrpll-cln28hpc.c b/drivers/clk/analogbits/wrpll-cln28hpc.c index 65d422a588e1..9d178afc73bd 100644 --- a/drivers/clk/analogbits/wrpll-cln28hpc.c +++ b/drivers/clk/analogbits/wrpll-cln28hpc.c @@ -292,7 +292,7 @@ int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate...
8b4799e4f0f40a4ec737bf870aa38d06288bf0fb
Analyze and fix the following issue in the Linux kernel code: perf hist: Fix bogus profiles when filters are enabled
Problem Details: When a filtered column is not present in the sort order, profiles become arbitrary broken. Filtered and non-filtered entries are collapsed together, and the filtered-by field ends up with a random value (either from a filtered or non-filtered entry). If we end up with filtered entry/value, then the who...
```diff diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 493b3cc30eac..0f30f843c566 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1303,7 +1303,16 @@ hist_entry__cmp_impl(struct perf_hpp_list *hpp_list, struct hist_entry *left, struct hists *hists = left->hists; struct perf_h...
3f4818ec139030f425476bf8a10b616bab53a7b5
Analyze and fix the following issue in the Linux kernel code: iommufd/fault: Destroy response and mutex in iommufd_fault_destroy()
Problem Details: Both were missing in the initial patch. Fixes: 07838f7fd529 ("iommufd: Add iommufd fault object") Link: https://patch.msgid.link/r/bc8bb13e215af27e62ee51bdba3648dd4ed2dce3.1736923732.git.nicolinc@nvidia.com Cc: stable@vger.kernel.org Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tia...
```diff diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 1fe804e28a86..685510224d05 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -213,6 +213,7 @@ void iommufd_fault_destroy(struct iommufd_object *obj) { struct iommufd_fault *fault = container_of(ob...
93d883f89063744a92006fc356b1c767eb62d950
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Add missing reference clock disable logic
Problem Details: Ensure the *_enable_ref_clk() function is symmetric by addressing missing disable parts on some platforms. Fixes: d0a75c791f98 ("PCI: imx6: Factor out ref clock disable to match enable") Link: https://lore.kernel.org/r/20241126075702.4099164-7-hongxing.zhu@nxp.com Signed-off-by: Richard Zhu <hongxing....
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 261c2ae5f218..e98e1894e91d 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -600,10 +600,9 @@ static int imx_pcie_attach_pd(struct device *dev) static int imx6sx_p...
ef61c7d8d032adb467f99d03ccfaa293b417ac75
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Deassert apps_reset in imx_pcie_deassert_core_reset()
Problem Details: Since the apps_reset is asserted in imx_pcie_assert_core_reset(), it should be deasserted in imx_pcie_deassert_core_reset(). Fixes: 9b3fe6796d7c ("PCI: imx6: Add code to support i.MX7D") Link: https://lore.kernel.org/r/20241126075702.4099164-6-hongxing.zhu@nxp.com Signed-off-by: Richard Zhu <hongxing....
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 0e1d60388043..261c2ae5f218 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -777,6 +777,7 @@ static void imx_pcie_assert_core_reset(struct imx_pcie *imx_pcie) static...
f068ffdd034c93f0c768acdc87d4d2d7023c1379
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Skip controller_id generation logic for i.MX7D
Problem Details: The i.MX7D only has one PCIe controller, so controller_id should always be 0. The previous code is incorrect although yielding the correct result. Fix by removing "IMX7D" from the switch case branch. Fixes: 2d8ed461dbc9 ("PCI: imx6: Add support for i.MX8MQ") Link: https://lore.kernel.org/r/2024112607...
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 555f56286789..0e1d60388043 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1385,7 +1385,6 @@ static int imx_pcie_probe(struct platform_device *pdev) switch (imx_p...
de22e20589b79f35f92543119c33051f8179dba0
Analyze and fix the following issue in the Linux kernel code: PCI: imx6: Configure PHY based on Root Complex or Endpoint mode
Problem Details: Pass PHY_MODE_PCIE_EP if the PCI controller operates in Endpoint (EP) mode, and fix the Root Complex (RC) mode being hardcoded using a drvdata mode check. Fixes: 8026f2d8e8a9 ("PCI: imx6: Call common PHY API to set mode, speed, and submode") Link: https://lore.kernel.org/r/20241119-pci_fixup_addr-v8-6...
```diff diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 4beb12b6e6ea..59d3ce6f9e9b 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -968,7 +968,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) goto err_clk_dis...
68abd0c4ebf24cd499841a488b97a6873d5efabb
Analyze and fix the following issue in the Linux kernel code: wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize()
Problem Details: On removal of the device or unloading of the kernel module a potential NULL pointer dereference occurs. The following sequence deletes the interface: brcmf_detach() brcmf_remove_interface() brcmf_del_if() Inside the brcmf_del_if() function the drvr->if2bss[ifidx] is updated to BRCMF_BSSI...
```diff diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index c3a57e30c855..3d63010ae079 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -540,6 +540,11 @@ ...
b4bfbc50b1b92a0815800eb1231f73bfc917af03
Analyze and fix the following issue in the Linux kernel code: wifi: rtw88: add RTW88_LEDS depends on LEDS_CLASS to Kconfig
Problem Details: When using allmodconfig, .config has CONFIG_LEDS_CLASS=m but autoconf.h has CONFIG_LEDS_CLASS_MODULE (additional suffix _MODULE) instead of CONFIG_LEDS_CLASS, which condition CONFIG_LEDS_CLASS in rtw88/led.h can't work properly. Add RTW88_LEDS to Kconfig, and use it as condition to fix this problem. ...
```diff diff --git a/drivers/net/wireless/realtek/rtw88/Kconfig b/drivers/net/wireless/realtek/rtw88/Kconfig index 733b3e58da51..ab21b8059e0b 100644 --- a/drivers/net/wireless/realtek/rtw88/Kconfig +++ b/drivers/net/wireless/realtek/rtw88/Kconfig @@ -238,4 +238,9 @@ config RTW88_DEBUGFS If unsure, say Y to simpli...
db902986dee453bfb5835cbc8efa67154ab34caf
Analyze and fix the following issue in the Linux kernel code: erofs: fix potential return value overflow of z_erofs_shrink_scan()
Problem Details: z_erofs_shrink_scan() could return small numbers due to the mistyped `freed`. Although I don't think it has any visible impact. Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Lin...
```diff diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 19ef4ff2a134..f416b73e0ca3 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -927,8 +927,7 @@ unsigned long z_erofs_shrink_scan(struct erofs_sb_info *sbi, unsigned long nr_shrink) { struct z_erofs_pcluster *pcl; - unsigned int freed = 0; - u...
a78c5c2269e39544fab4140105f55fca4502e915
Analyze and fix the following issue in the Linux kernel code: fs: erofs: xattr.c change kzalloc to kcalloc
Problem Details: Refactor xattr.c to use kcalloc instead of kzalloc when multiplying allocation size by count. This refactor prevents unintentional memory overflows. Discovered by checkpatch.pl. Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Link: https://lore.kernel.org/r/i3CLJhMELKzBJr3DaRyv-hP_4m-3Tw...
```diff diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index a90d7d649739..7940241d9355 100644 --- a/fs/erofs/xattr.c +++ b/fs/erofs/xattr.c @@ -478,7 +478,7 @@ int erofs_xattr_prefixes_init(struct super_block *sb) if (!sbi->xattr_prefix_count) return 0; - pfs = kzalloc(sbi->xattr_prefix_count * sizeof(*pfs), ...
b1231ff7ea0689d04040a44864c265bc11612fa8
Analyze and fix the following issue in the Linux kernel code: drm/xe: Mark ComputeCS read mode as UC on iGPU
Problem Details: RING_CMD_CCTL read index should be UC on iGPU parts due to L3 caching structure. Having this as WB blocks ULLS from being enabled. Change to UC to unblock ULLS on iGPU. v2: - Drop internal communications commnet, bspec is updated Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> ...
```diff diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c index 1557acee3523..eeeb98f66982 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine.c +++ b/drivers/gpu/drm/xe/xe_hw_engine.c @@ -419,7 +419,7 @@ hw_engine_setup_default_state(struct xe_hw_engine *hwe) * Bspec: 72161 */ const u...
4dd8bc4bf58e973eea3fdf5e2013011d83fba6c4
Analyze and fix the following issue in the Linux kernel code: perf test: Fix parallel/sequential option documentation
Problem Details: The parallel option was removed in commit 94d1a913bdc4 ("perf test: Make parallel testing the default"). Update the sequential documentation to reflect it isn't the default except for "exclusive" tests. Fixes: 94d1a913bdc4 ("perf test: Make parallel testing the default") Signed-off-by: Ian Rogers <iro...
```diff diff --git a/tools/perf/Documentation/perf-test.txt b/tools/perf/Documentation/perf-test.txt index efcdec528a8f..2e40869b64de 100644 --- a/tools/perf/Documentation/perf-test.txt +++ b/tools/perf/Documentation/perf-test.txt @@ -33,13 +33,9 @@ OPTIONS -S:: --sequential:: - Run tests one after the other, this ...
b824709ee1d0dbfed4b1757279c97fc0edad1e1a
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix a typo in xe_vm_doc.h
Problem Details: s/vm->ttm.base.resv->lock/vm->gpuvm.r_obj->resv->lock Signed-off-by: Oak Zeng <oak.zeng@intel.com> Reviewed-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250113212324.3264218-1-oak.zeng@intel.com Signed-off-by: Himal Prasad Ghimiray <himal.pras...
```diff diff --git a/drivers/gpu/drm/xe/xe_vm_doc.h b/drivers/gpu/drm/xe/xe_vm_doc.h index 078786958403..1030ce214032 100644 --- a/drivers/gpu/drm/xe/xe_vm_doc.h +++ b/drivers/gpu/drm/xe/xe_vm_doc.h @@ -431,7 +431,7 @@ * bind path also acquires this lock in write while the exec / compute mode * rebind worker acquir...
6912bdb7c676019b6dd4520f555079c4d3ab1bdb
Analyze and fix the following issue in the Linux kernel code: Documentation: Fix x86_64 UEFI outdated references to elilo
Problem Details: Problem: The x86_64 UEFI doc references Elilo which is an unmaintained/orphaned bootloader project. Also, on x86_64 a bootloader is technically not actually required since there is support for the Linux EFI stub. Solution: Remove the references to Elilo from the doc and refer to the EFI stub doc page,...
```diff diff --git a/Documentation/arch/x86/x86_64/uefi.rst b/Documentation/arch/x86/x86_64/uefi.rst index fbc30c9a071d..e84592dbd6c1 100644 --- a/Documentation/arch/x86/x86_64/uefi.rst +++ b/Documentation/arch/x86/x86_64/uefi.rst @@ -12,14 +12,20 @@ with EFI firmware and specifications are listed below. 1. UEFI spe...