id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
5fa96c7ab3dc666c2904a35895635156c17a8f05
Analyze and fix the following issue in the Linux kernel code: Documentation/ABI/configfs-tsm: Fix an unexpected indentation silly
Problem Details: Fix: Documentation/ABI/testing/configfs-tsm:97: ERROR: Unexpected indentation when building htmldocs with sphinx. I can't say I'm loving those rigid sphinx rules but whatever, make it shut up. Fixes: 627dc671518b ("x86/sev: Extend the config-fs attestation support for an SVSM") Reported-by: Stephe...
```diff diff --git a/Documentation/ABI/testing/configfs-tsm b/Documentation/ABI/testing/configfs-tsm index 1db2008f25f9..534408bc1408 100644 --- a/Documentation/ABI/testing/configfs-tsm +++ b/Documentation/ABI/testing/configfs-tsm @@ -103,8 +103,7 @@ Description: provider for TVMs, like SEV-SNP running under an SVSM...
0440feb090790c6243bca85d6a794824e71ff26c
Analyze and fix the following issue in the Linux kernel code: x86/sev: Do RMP memory coverage check after max_pfn has been set
Problem Details: The RMP table is probed early in the boot process before max_pfn has been set, so the logic to check if the RMP covers all of system memory is not valid. Move the RMP memory coverage check from snp_probe_rmptable_info() into snp_rmptable_init(), which is well after max_pfn has been set. Also, fix the ...
```diff diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c index 0ae10535c699..0ce17766c0e5 100644 --- a/arch/x86/virt/svm/sev.c +++ b/arch/x86/virt/svm/sev.c @@ -120,7 +120,7 @@ static __init void snp_enable(void *arg) bool snp_probe_rmptable_info(void) { - u64 max_rmp_pfn, calc_rmp_sz, rmp_sz, rmp_bas...
7a99afef17af66c276c1d6e6f4dbcac223eaf6ac
Analyze and fix the following issue in the Linux kernel code: net: ks8851: Fix potential TX stall after interface reopen
Problem Details: The amount of TX space in the hardware buffer is tracked in the tx_space variable. The initial value is currently only set during driver probing. After closing the interface and reopening it the tx_space variable has the last value it had before close. If it is smaller than the size of the first send ...
```diff diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c index 13462811eaae..7fa1820db9cc 100644 --- a/drivers/net/ethernet/micrel/ks8851_common.c +++ b/drivers/net/ethernet/micrel/ks8851_common.c @@ -482,6 +482,7 @@ static int ks8851_net_open(struct net_device *dev...
5c0b485a8c6116516f33925b9ce5b6104a6eadfd
Analyze and fix the following issue in the Linux kernel code: udp: Set SOCK_RCU_FREE earlier in udp_lib_get_port().
Problem Details: syzkaller triggered the warning [0] in udp_v4_early_demux(). In udp_v[46]_early_demux() and sk_lookup(), we do not touch the refcount of the looked-up sk and use sock_pfree() as skb->destructor, so we check SOCK_RCU_FREE to ensure that the sk is safe to access during the RCU grace period. Currently, ...
```diff diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 189c9113fe9a..578668878a85 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -326,6 +326,8 @@ found: goto fail_unlock; } + sock_set_flag(sk, SOCK_RCU_FREE); + sk_add_node_rcu(sk, &hslot->head); hslot->count++; sock_prot_inuse_add(sock_net(s...
bd9f5348089b65612e5ca976e2ae22f005340331
Analyze and fix the following issue in the Linux kernel code: i2c: mark HostNotify target address as used
Problem Details: I2C core handles the local target for receiving HostNotify alerts. There is no separate driver bound to that address. That means userspace can access it if desired, leading to further complications if controllers are not capable of reading their own local target. Bind the local target to the dummy driv...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index db0d1ac82910..7e7b15440832 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1067,6 +1067,7 @@ EXPORT_SYMBOL(i2c_find_device_by_fwnode); static const struct i2c_device_id dummy_id[] = { { "dummy", 0 },...
6dfe0aba99e544326583aa20ef760370f03ec3b9
Analyze and fix the following issue in the Linux kernel code: i2c: testunit: correct Kconfig description
Problem Details: The testunit has nothing to do with 'eeprom', remove that term. It was a copy&paste leftover. Fixes: a8335c64c5f0 ("i2c: add slave testunit driver") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
```diff diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 9388823bb0bb..44710267d669 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -135,7 +135,7 @@ config I2C_SLAVE_EEPROM Documentation/i2c/slave-eeprom-backend.rst for further details. config I2C_SLAVE_TESTUNIT - tristate "I2C eeprom t...
cff3bd012a9512ac5ed858d38e6ed65f6391008c
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: prefer nft_chain_validate
Problem Details: nft_chain_validate already performs loop detection because a cycle will result in a call stack overflow (ctx->level >= NFT_JUMP_STACK_SIZE). It also follows maps via ->validate callback in nft_lookup, so there appears no reason to iterate the maps again. nf_tables_check_loops() and all its helper fun...
```diff diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 081c08536d0f..91cc3a81ba8f 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -3823,6 +3823,15 @@ static void nf_tables_rule_release(const struct nft_ctx *ctx, struct nft_rule *r nf_tables_rule_dest...
631a4b3ddc7831b20442c59c28b0476d0704c9af
Analyze and fix the following issue in the Linux kernel code: netfilter: nfnetlink_queue: drop bogus WARN_ON
Problem Details: Happens when rules get flushed/deleted while packet is out, so remove this WARN_ON. This WARN exists in one form or another since v4.14, no need to backport this to older releases, hence use a more recent fixes tag. Fixes: 3f8019688894 ("netfilter: move nf_reinject into nfnetlink_queue modules") Repo...
```diff diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index f1c31757e496..55e28e1da66e 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -325,7 +325,7 @@ static void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) hooks = nf_hook_ent...
911daf695a740d9a58daef65dabfb5f69f18190f
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Fix formatting, change comments, renaming
Problem Details: Huacai Chen: The label end_reply is obviously a typo. It should be "replay" in this context. So rename end_reply to end_replay. Suggested-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
```diff diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index 1d63e1c9469b..6ede3e924dec 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -291,9 +291,9 @@ int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr, struct address_space *mapping = ni->vfs_inode.i_mapping; struct folio *foli...
2fef55d8f78383c8e6d6d4c014b9597375132696
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Update log->page_{mask,bits} if log->page_size changed
Problem Details: If an NTFS file system is mounted to another system with different PAGE_SIZE from the original system, log->page_size will change in log_replay(), but log->page_{mask,bits} don't change correspondingly. This will cause a panic because "u32 bytes = log->page_size - page_off" will get a negative value in...
```diff diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index f8da043be169..5ee923904b6a 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -3922,6 +3922,9 @@ check_restart_area: goto out; } + log->page_mask = log->page_size - 1; + log->page_bits = blksize_bits(log->page_size); + /* If the file size has ...
d57431c6f511bf020e474026d9f3123d7bfbea8c
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Do copy_to_user out of run_lock
Problem Details: In order not to call copy_to_user (from fiemap_fill_next_extent) we allocate memory in the kernel, fill it and copy it to user memory after up_read(run_lock). Reported-by: syzbot+36bb70085ef6edc2ebb9@syzkaller.appspotmail.com Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
```diff diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index d792908c85f4..a469c608a394 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -1898,6 +1898,47 @@ enum REPARSE_SIGN ni_parse_reparse(struct ntfs_inode *ni, struct ATTRIB *attr, return REPARSE_LINK; } +/* + * fiemap_fill_next_extent_k - a c...
eb95678ee930d67d79fc83f0a700245ae7230455
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP
Problem Details: We skip the run_truncate_head call also for $MFT::$ATTR_BITMAP. Otherwise wnd_map()/run_lookup_entry will not find the disk position for the bitmap parts. Fixes: 0e5b044cbf3a ("fs/ntfs3: Refactoring attr_set_size to restore after errors") Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-...
```diff diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index e62a8fee5250..1d63e1c9469b 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -672,7 +672,8 @@ pack_runs: goto undo_2; } - if (!is_mft) + /* keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP. */ + if (ni->mi.rno != MFT_REC_MFT) ...
2cbbd96820255fff4f0ad1533197370c9ccc570b
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Missed error return
Problem Details: Fixes: 3f3b442b5ad2 ("fs/ntfs3: Add bitmap") Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
```diff diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c index c9eb01ccee51..cf4fe21a5039 100644 --- a/fs/ntfs3/bitmap.c +++ b/fs/ntfs3/bitmap.c @@ -1382,7 +1382,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits) err = ntfs_vbo_to_lbo(sbi, &wnd->run, vbo, &lbo, &bytes); if (err) - break; + retur...
d392e85fd1e8d58e460c17ca7d0d5c157848d9c1
Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: Fix the format of the "nocase" mount option
Problem Details: The 'nocase' option was mistakenly added as fsparam_flag_no with the 'no' prefix, causing the case-insensitive mode to require the 'nonocase' option to be enabled. Fixes: a3a956c78efa ("fs/ntfs3: Add option "nocase"") Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
```diff diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 5af07ced25ed..c39a70b93bb1 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -275,7 +275,7 @@ static const struct fs_parameter_spec ntfs_fs_parameters[] = { fsparam_flag_no("acl", Opt_acl), fsparam_string("iocharset", Opt_iocharset), fsparam_...
c184cf94e73b04ff7048d045f5413899bc664788
Analyze and fix the following issue in the Linux kernel code: ethtool: netlink: do not return SQI value if link is down
Problem Details: Do not attach SQI value if link is down. "SQI values are only valid if link-up condition is present" per OpenAlliance specification of 100Base-T1 Interoperability Test suite [1]. The same rule would apply for other link types. [1] https://opensig.org/automotive-ethernet-specifications/# Fixes: 806602...
```diff diff --git a/net/ethtool/linkstate.c b/net/ethtool/linkstate.c index b2de2108b356..34d76e87847d 100644 --- a/net/ethtool/linkstate.c +++ b/net/ethtool/linkstate.c @@ -37,6 +37,8 @@ static int linkstate_get_sqi(struct net_device *dev) mutex_lock(&phydev->lock); if (!phydev->drv || !phydev->drv->get_sqi) r...
f2aeb7306a898e1cbd03963d376f4b6656ca2b55
Analyze and fix the following issue in the Linux kernel code: ppp: reject claimed-as-LCP but actually malformed packets
Problem Details: Since 'ppp_async_encode()' assumes valid LCP packets (with code from 1 to 7 inclusive), add 'ppp_check_packet()' to ensure that LCP packet has an actual body beyond PPP_LCP header bytes, and reject claimed-as-LCP but actually malformed data otherwise. Reported-by: syzbot+ec0723ba9605678b14bf@syzkaller...
```diff diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 0a65b6d690fe..eb9acfcaeb09 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -70,6 +70,7 @@ #define MPHDRLEN_SSN 4 /* ditto with short sequence numbers */ #define PPP_PROTO_LEN 2 +#define PPP_LCP...
50bd5a0c658d132507673c4d59347c025dd149ed
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add timer lockup selftest
Problem Details: Add a selftest that tries to trigger a situation where two timer callbacks are attempting to cancel each other's timer. By running them continuously, we hit a condition where both run in parallel and cancel each other. Without the fix in the previous patch, this would cause a lockup as hrtimer_cancel ...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/timer_lockup.c b/tools/testing/selftests/bpf/prog_tests/timer_lockup.c new file mode 100644 index 000000000000..871d16cb95cf --- /dev/null +++ b/tools/testing/selftests/bpf/prog_tests/timer_lockup.c @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 + +#def...
8c6790b5c25dfac11b589cc37346bcf9e23ad468
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk-star-emac: set mac_managed_pm when probing
Problem Details: The below commit introduced a warning message when phy state is not in the states: PHY_HALTED, PHY_READY, and PHY_UP. commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") mtk-star-emac doesn't need mdiobus suspend/resume. To fix the warning message during resume, indicate...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c index 31aebeb2e285..25989c79c92e 100644 --- a/drivers/net/ethernet/mediatek/mtk_star_emac.c +++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c @@ -1524,6 +1524,7 @@ static int mtk_star_probe(struct platfo...
943ad0b62e3c21f324c4884caa6cb4a871bca05c
Analyze and fix the following issue in the Linux kernel code: kernel: rerun task_work while freezing in get_signal()
Problem Details: io_uring can asynchronously add a task_work while the task is getting freezed. TIF_NOTIFY_SIGNAL will prevent the task from sleeping in do_freezer_trap(), and since the get_signal()'s relock loop doesn't retry task_work, the task will spin there not being able to sleep until the freezing is cancelled /...
```diff diff --git a/kernel/signal.c b/kernel/signal.c index 1f9dd41c04be..60c737e423a1 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2600,6 +2600,14 @@ static void do_freezer_trap(void) spin_unlock_irq(&current->sighand->siglock); cgroup_enter_frozen(); schedule(); + + /* + * We could've been woken by ...
0453aad676ff99787124b9b3af4a5f59fbe808e2
Analyze and fix the following issue in the Linux kernel code: io_uring/io-wq: limit retrying worker initialisation
Problem Details: If io-wq worker creation fails, we retry it by queueing up a task_work. tasK_work is needed because it should be done from the user process context. The problem is that retries are not limited, and if queueing a task_work is the reason for the failure, we might get into an infinite loop. It doesn't se...
```diff diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index 913c92249522..f1e7c670add8 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -23,6 +23,7 @@ #include "io_uring.h" #define WORKER_IDLE_TIMEOUT (5 * HZ) +#define WORKER_INIT_LIMIT 3 enum { IO_WORKER_F_UP = 0, /* up and active */ @@ -58,6 +59,7...
fd748e177194ebcbbaf98df75152a30e08230cc6
Analyze and fix the following issue in the Linux kernel code: macintosh/therm_windtunnel: fix module unload.
Problem Details: The of_device_unregister call in therm_windtunnel's module_exit procedure does not fully reverse the effects of of_platform_device_create in the module_init prodedure. Once you unload this module, it is impossible to load it ever again since only the first of_platform_device_create call on the fan nod...
```diff diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 37cdc6931f6d..2576a53f247e 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c @@ -549,7 +549,7 @@ g4fan_exit( void ) platform_driver_unregister( &therm_of_driver ); if( ...
14196e47c5ffe32af7ed5a51c9e421c5ea5bccce
Analyze and fix the following issue in the Linux kernel code: powerpc/xmon: Fix disassembly CPU feature checks
Problem Details: In the xmon disassembly code there are several CPU feature checks to determine what dialects should be passed to the disassembler. The dialect controls which instructions the disassembler will recognise. Unfortunately the checks are incorrect, because instead of passing a single CPU feature they are p...
```diff diff --git a/arch/powerpc/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c index 75fa98221d48..af105e1bc3fc 100644 --- a/arch/powerpc/xmon/ppc-dis.c +++ b/arch/powerpc/xmon/ppc-dis.c @@ -122,32 +122,21 @@ int print_insn_powerpc (unsigned long insn, unsigned long memaddr) bool insn_is_short; ppc_cpu_t dialect;...
489116d784bebec7e441f400715fbfe6edbce66c
Analyze and fix the following issue in the Linux kernel code: powerpc: Drop clang workaround for builtin constant checks
Problem Details: The CPU/MMU feature code has build-time checks that the feature value is a builtin constant. Back when the code was added clang wasn't able to compile the checks, so an ifdef was added to avoid the checks for clang builds. See commit b5fa0f7f88ed ("powerpc: Fix build failure with clang due to BUILD_BU...
```diff diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h index 0efabccd820c..92e24e979954 100644 --- a/arch/powerpc/include/asm/cpu_has_feature.h +++ b/arch/powerpc/include/asm/cpu_has_feature.h @@ -24,9 +24,7 @@ static __always_inline bool cpu_has_feature(unsigned lo...
f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6
Analyze and fix the following issue in the Linux kernel code: ext4: make sure the first directory block is not a hole
Problem Details: The syzbot constructs a directory that has no dirblock but is non-inline, i.e. the first directory block is a hole. And no errors are reported when creating files in this directory in the following flow. ext4_mknod ... ext4_add_entry // Read block 0 ext4_read_dirblock(di...
```diff diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 6917c1de8f41..1311ad0464b2 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -151,10 +151,11 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode, return bh; } - if (!bh && (type == INDEX || type == DIRENT_HTREE)) { + /* The first...
50ea741def587a64e08879ce6c6a30131f7111e7
Analyze and fix the following issue in the Linux kernel code: ext4: check dot and dotdot of dx_root before making dir indexed
Problem Details: Syzbot reports a issue as follows: ============================================ BUG: unable to handle page fault for address: ffffed11022e24fe PGD 23ffee067 P4D 23ffee067 PUD 0 Oops: Oops: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 0 PID: 5079 Comm: syz-executor306 Not tainted 6.10.0-rc5-g55027e689933 #0 Cal...
```diff diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index a630b27a4cc6..6917c1de8f41 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2217,6 +2217,52 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, return err ? err : err2; } +static bool ext4_check_dx_root(struct inode *dir,...
6ca9fede7c73b3c83f4cc8ecb3c29e1d501107c6
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Convert comma to semicolon
Problem Details: Replace a comma between expression statements by a semicolon. Fixes: d4523bd6fd5d ("scsi: qla2xxx: Refactor asynchronous command initialization") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://lore.kernel.org/r/20240711005724.2358446-1-nichen@iscas.ac.cn Reviewed-by: Himanshu Madhani <himan...
```diff diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index eda3bdab934d..31fc6a0eca3e 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -423,7 +423,7 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) sp->type = SRB_LOGOUT_CMD; ...
348744f27a35e087acc9378bf53537fbfb072775
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix optrom version displayed in FDMI
Problem Details: Bios version was popluated for FDMI response. Systems with EFI would show optrom version as 0. EFI version is populated here and BIOS version is already displayed under FDMI_HBA_BOOT_BIOS_NAME. Cc: stable@vger.kernel.org Signed-off-by: Shreyas Deodhar <sdeodhar@marvell.com> Signed-off-by: Nilesh Java...
```diff diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index e801cd9e2345..caa9a3cd2580 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -1710,7 +1710,7 @@ qla2x00_hba_attributes(scsi_qla_host_t *vha, void *entries, eiter->type = cpu_to_be16(FDMI_HBA_OPTION...
76f480d7c717368f29a3870f7d64471ce0ff8fb2
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: During vport delete send async logout explicitly
Problem Details: During vport delete, it is observed that during unload we hit a crash because of stale entries in outstanding command array. For all these stale I/O entries, eh_abort was issued and aborted (fast_fail_io = 2009h) but I/Os could not complete while vport delete is in process of deleting. BUG: kernel ...
```diff diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index b67416951a5f..76703f2706b8 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -180,7 +180,7 @@ qla24xx_disable_vp(scsi_qla_host_t *vha) atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha...
4475afa2646d3fec176fc4d011d3879b26cb26e3
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Complete command early within lock
Problem Details: A crash was observed while performing NPIV and FW reset, BUG: kernel NULL pointer dereference, address: 000000000000001c #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 1 PREEMPT_RT SMP NOPTI RIP: 0010:dma_direct_unmap_sg+0x51/0x1e0 R...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 70f43eab3f01..e4056cddb727 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1875,14 +1875,9 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) for (cnt = 1; cnt < req->num_outstanding_cmd...
29e222085d8907ccff18ecd931bdd4c6b1f11b92
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix flash read failure
Problem Details: Link up failure is observed as a result of flash read failure. Current code does not check flash read return code where it relies on FW checksum to detect the problem. Add check of flash read failure to detect the problem sooner. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpen...
```diff diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index d88f05ea55cb..5ff017546540 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -8221,15 +8221,21 @@ qla28xx_get_aux_images( struct qla27xx_image_status pri_aux_image_status, sec_aux_image_sta...
ce2065c4cc4f05635413f63f6dc038d7d4842e31
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds
Problem Details: Firmware only supports single DSDs in ELS Pass-through IOCB (0x53h), sg cnt is decided by the SCSI ML. User is not aware of the cause of an acutal error. Return the appropriate return code that will be decoded by API and application and proper error message will be displayed to user. Fixes: 6e98016ca...
```diff diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 19bb64bdd88b..8d1e45b883cd 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -324,7 +324,7 @@ qla2x00_process_els(struct bsg_job *bsg_job) "request_sg_cnt=%x reply_sg_cnt=%x.\n", bs...
c03d740152f78e86945a75b2ad541bf972fab92a
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Fix for possible memory corruption
Problem Details: Init Control Block is dereferenced incorrectly. Correctly dereference ICB Cc: stable@vger.kernel.org Signed-off-by: Shreyas Deodhar <sdeodhar@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Link: https://lore.kernel.org/r/20240710171057.35066-4-njavali@marvell.com Reviewed-by: Himansh...
```diff diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index fcb06df2ce4e..70f43eab3f01 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4689,7 +4689,7 @@ static void qla2x00_number_of_exch(scsi_qla_host_t *vha, u32 *ret_cnt, u16 max_cnt) { u32 temp; - s...
eb1d4ce2609584eeb7694866f34d4b213caa3af9
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: validate nvme_local_port correctly
Problem Details: The driver load failed with error message, qla2xxx [0000:04:00.0]-ffff:0: register_localport failed: ret=ffffffef and with a kernel crash, BUG: unable to handle kernel NULL pointer dereference at 0000000000000070 Workqueue: events_unbound qla_register_fcport_fn [qla2xxx] RIP: 0010:nvme_fc_registe...
```diff diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index a8ddf356e662..8f4cc136a9c9 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -49,7 +49,10 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return 0; } ...
c3d98b12eef8db436e32f1a8c5478be57dc15621
Analyze and fix the following issue in the Linux kernel code: scsi: qla2xxx: Unable to act on RSCN for port online
Problem Details: The device does not come online when the target port is online. There were multiple RSCNs indicating multiple devices were affected. Driver is in the process of finishing a fabric scan. A new RSCN (device up) arrived at the tail end of the last fabric scan. Driver mistakenly thinks the new RSCN is bein...
```diff diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 2f49baf131e2..ba134f6237b8 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3312,6 +3312,8 @@ struct fab_scan_rp { struct fab_scan { struct fab_scan_rp *l; u32 size; + u32 rscn_gen_start; ...
70838938e89c759586eb4f3b5ce29ca252c8240d
Analyze and fix the following issue in the Linux kernel code: ice: Implement driver functionality to dump serdes equalizer values
Problem Details: To debug link issues in the field, serdes Tx/Rx equalizer values help to determine the health of serdes lane. Extend 'ethtool -d' option to dump serdes Tx/Rx equalizer. The following list of equalizer param is supported a. rx_equalization_pre2 b. rx_equalization_pre1 c. rx_equalization_pos...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h index 621a2ca7093e..b70d4ca43443 100644 --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h @@ -1461,6 +1461,55 @@ struct ice_aqc_get_sensor_read...
ac21add2540e1a6ed27abea47fd2234ab05c71eb
Analyze and fix the following issue in the Linux kernel code: ice: Implement driver functionality to dump fec statistics
Problem Details: To debug link issues in the field, it is paramount to dump fec corrected/uncorrected block counts from firmware. Firmware requires PCS quad number and PCS port number to read FEC statistics. Current driver implementation does not maintain above physical properties of a port. Add new driver API to deri...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 9fa9d914ae46..a4f175cf5c61 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -3371,6 +3371,63 @@ int ice_update_link_info(struct ice_port_info ...
76a0a3f9cc2fbd0e56671706bb74a9a988397898
Analyze and fix the following issue in the Linux kernel code: e1000e: fix force smbus during suspend flow
Problem Details: Commit 861e8086029e ("e1000e: move force SMBUS from enable ulp function to avoid PHY loss issue") resolved a PHY access loss during suspend on Meteor Lake consumer platforms, but it affected corporate systems incorrectly. A better fix, working for both consumer and corporate systems, was proposed in c...
```diff diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 2e98a2a0bead..ce227b56cf72 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c @@ -1108,6 +1108,46 @@ static s32 e1000_platform_pm_pch_lpt(struct e1...
97a9063518f198ec0adb2ecb89789de342bb8283
Analyze and fix the following issue in the Linux kernel code: tcp: avoid too many retransmit packets
Problem Details: If a TCP socket is using TCP_USER_TIMEOUT, and the other peer retracted its window to zero, tcp_retransmit_timer() can retransmit a packet every two jiffies (2 ms for HZ=1000), for about 4 minutes after TCP_USER_TIMEOUT has 'expired'. The fix is to make sure tcp_rtx_probe0_timed_out() takes icsk->icsk...
```diff diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index db9d826560e5..892c86657fbc 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -483,15 +483,26 @@ static bool tcp_rtx_probe0_timed_out(const struct sock *sk, const struct sk_buff *skb, u32 rtx_delta) { + const struct...
3a8617c7df6eb351227aad9b0df647f34a7ef423
Analyze and fix the following issue in the Linux kernel code: cxl/test: Replace ENXIO with EBUSY for inject poison limit reached
Problem Details: The CXL driver was recently updated to return EBUSY rather than ENXIO when the device reports that an injection request exceeds the device's limit. That change to EBUSY allows debug users to differentiate between limit reached and inject failures for any other reason. Change cxl-test to also return EB...
```diff diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c index 94de2cf60f4f..129f179b0ac5 100644 --- a/tools/testing/cxl/test/mem.c +++ b/tools/testing/cxl/test/mem.c @@ -1135,27 +1135,28 @@ static bool mock_poison_dev_max_injected(struct cxl_dev_state *cxlds) return (count >= poison_inject_de...
8ecef8e01a08c7e3e4ffc8f08d9f9663984f334b
Analyze and fix the following issue in the Linux kernel code: cxl/core: Fix incorrect vendor debug UUID define
Problem Details: When user send a mbox command whose opcode is CXL_MBOX_OP_CLEAR_LOG and the in_payload is normal vendor debug log UUID according to the CXL specification cxl_payload_from_user_allowed() will return false unexpectedly, Sending mbox cmd operation fails and the kernel log will print: Clear Log: input payl...
```diff diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h index 19aba81cdf13..f55141c6d64e 100644 --- a/drivers/cxl/cxlmem.h +++ b/drivers/cxl/cxlmem.h @@ -562,7 +562,7 @@ enum cxl_opcode { 0x3b, 0x3f, 0x17) #define DEFINE_CXL_VENDOR_DEBUG_UUID \ - UUID_INIT(0xe1...
a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69
Analyze and fix the following issue in the Linux kernel code: bpf: Defer work in bpf_timer_cancel_and_free
Problem Details: Currently, the same case as previous patch (two timer callbacks trying to cancel each other) can be invoked through bpf_map_update_elem as well, or more precisely, freeing map elements containing timers. Since this relies on hrtimer_cancel as well, it is prone to the same deadlock situation as the prev...
```diff diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 22e779ca50d5..3243c83ef3e3 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -1084,7 +1084,10 @@ struct bpf_async_cb { struct bpf_prog *prog; void __rcu *callback_fn; void *value; - struct rcu_head rcu; + union { + struct rcu_he...
d4523831f07a267a943f0dde844bf8ead7495f13
Analyze and fix the following issue in the Linux kernel code: bpf: Fail bpf_timer_cancel when callback is being cancelled
Problem Details: Given a schedule: timer1 cb timer2 cb bpf_timer_cancel(timer2); bpf_timer_cancel(timer1); Both bpf_timer_cancel calls would wait for the other callback to finish executing, introducing a lockup. Add an atomic_t count named 'cancelling' in bpf_hrtimer. This keeps track of all in-flight cancellatio...
```diff diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 2a69a9a36c0f..22e779ca50d5 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -1107,6 +1107,7 @@ struct bpf_async_cb { struct bpf_hrtimer { struct bpf_async_cb cb; struct hrtimer timer; + atomic_t cancelling; }; struct bpf_work...
f18d0076933689775fe7faeeb10ee93ff01be6ab
Analyze and fix the following issue in the Linux kernel code: f2fs: use meta inode for GC of COW file
Problem Details: In case of the COW file, new updates and GC writes are already separated to page caches of the atomic file and COW file. As some cases that use the meta inode for GC, there are some race issues between a foreground thread and GC thread. To handle them, we need to take care when to invalidate and wait ...
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 1e4937af50f3..6457e5bca9c9 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2608,7 +2608,7 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) return true; if (IS_NOQUOTA(inode)) return true; - if (f2fs_is_atomic_file(...
b40a2b00370931b0c50148681dd7364573e52e6b
Analyze and fix the following issue in the Linux kernel code: f2fs: use meta inode for GC of atomic file
Problem Details: The page cache of the atomic file keeps new data pages which will be stored in the COW file. It can also keep old data pages when GCing the atomic file. In this case, new data can be overwritten by old data if a GC thread sets the old data page as dirty after new data page was evicted. Also, since all...
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 1aa7eefa659c..1e4937af50f3 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2695,7 +2695,7 @@ got_it: } /* wait for GCed page writeback via META_MAPPING */ - if (fio->post_read) + if (fio->meta_gc) f2fs_wait_on_block_writeback(inode, fio->old_blkad...
f06c0f82e38bbda7264d6ef3c90045ad2810e0f3
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to update user block counts in block_operations()
Problem Details: Commit 59c9081bc86e ("f2fs: allow write page cache when writting cp") allows write() to write data to page cache during checkpoint, so block count fields like .total_valid_block_count, .alloc_valid_block_count and .rf_node_block_count may encounter race condition as below: CP Thread A - write_check...
```diff diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 7cfe4e01dd7e..bdd96329dddd 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1186,6 +1186,11 @@ static void __prepare_cp_block(struct f2fs_sb_info *sbi) ckpt->valid_node_count = cpu_to_le32(valid_node_count(sbi)); ckpt->valid_inod...
c82bc1ab2a8a5e73d9728e80c4c2ed87e8921a38
Analyze and fix the following issue in the Linux kernel code: f2fs: fix null reference error when checking end of zone
Problem Details: This patch fixes a potentially null pointer being accessed by is_end_zone_blkaddr() that checks the last block of a zone when f2fs is mounted as a single device. Fixes: e067dc3c6b9c ("f2fs: maintain six open zones for zoned devices") Signed-off-by: Daejun Park <daejun7.park@samsung.com> Reviewed-by: C...
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b6dcb3bcaef7..1aa7eefa659c 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -925,6 +925,7 @@ alloc_new: #ifdef CONFIG_BLK_DEV_ZONED static bool is_end_zone_blkaddr(struct f2fs_sb_info *sbi, block_t blkaddr) { + struct block_device *bdev = sbi->sb->s_bdev;...
af253aef183a31ce62d2e39fc520b0ebfb562bb9
Analyze and fix the following issue in the Linux kernel code: bpf: fix order of args in call to bpf_map_kvcalloc
Problem Details: The original function call passed size of smap->bucket before the number of buckets which raises the error 'calloc-transposed-args' on compilation. Vlastimil Babka added: The order of parameters can be traced back all the way to 6ac99e8f23d4 ("bpf: Introduce bpf sk local storage") accross several ref...
```diff diff --git a/kernel/bpf/bpf_local_storage.c b/kernel/bpf/bpf_local_storage.c index 976cb258a0ed..c938dea5ddbf 100644 --- a/kernel/bpf/bpf_local_storage.c +++ b/kernel/bpf/bpf_local_storage.c @@ -782,8 +782,8 @@ bpf_local_storage_map_alloc(union bpf_attr *attr, nbuckets = max_t(u32, 2, nbuckets); smap->bucke...
00c7ded68012c5a6adb0b14635a9aae573eb81c6
Analyze and fix the following issue in the Linux kernel code: clk: sophgo: Avoid -Wsometimes-uninitialized in sg2042_clk_pll_set_rate()
Problem Details: Clang warns (or errors with CONFIG_WERROR=y): drivers/clk/sophgo/clk-sg2042-pll.c:396:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 396 | if (sg2042_pll_enable(pll, 0)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~ ...
```diff diff --git a/drivers/clk/sophgo/clk-sg2042-pll.c b/drivers/clk/sophgo/clk-sg2042-pll.c index aa142897aa5e..9695e64fc23b 100644 --- a/drivers/clk/sophgo/clk-sg2042-pll.c +++ b/drivers/clk/sophgo/clk-sg2042-pll.c @@ -103,7 +103,7 @@ static inline void sg2042_pll_ctrl_decode(unsigned int reg_value, ctrl->postdiv...
1f7a04a0e673c19cc10bf4039047e11367ac5735
Analyze and fix the following issue in the Linux kernel code: clk/sophgo: Using BUG() instead of unreachable() in mmux_get_parent_id()
Problem Details: In general it's a good idea to avoid using bare unreachable() because it introduces undefined behavior in compiled code. but it caused a compilation warning, Using BUG() instead of unreachable() to resolve compilation warnings. Fixes the following warnings: drivers/clk/sophgo/clk-cv18xx-ip.o: warn...
```diff diff --git a/drivers/clk/sophgo/clk-cv18xx-ip.c b/drivers/clk/sophgo/clk-cv18xx-ip.c index 805f561725ae..b186e64d4813 100644 --- a/drivers/clk/sophgo/clk-cv18xx-ip.c +++ b/drivers/clk/sophgo/clk-cv18xx-ip.c @@ -613,7 +613,7 @@ static u8 mmux_get_parent_id(struct cv1800_clk_mmux *mmux) return i; } - unre...
fea6b5ebb71a2830b042e42de7ae255017ac3ce8
Analyze and fix the following issue in the Linux kernel code: i2c: rcar: clear NO_RXDMA flag after resetting
Problem Details: We should allow RXDMA only if the reset was really successful, so clear the flag after the reset call. Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
```diff diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index ec73463ea9b5..f0724c8e4b21 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -911,10 +911,10 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, /* Gen3+ needs a reset. That also allows ...
77aeb1b685f9db73d276bad4bb30d48505a6fd23
Analyze and fix the following issue in the Linux kernel code: smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu()
Problem Details: For CONFIG_DEBUG_OBJECTS_WORK=y kernels sscs.work defined by INIT_WORK_ONSTACK() is initialized by debug_object_init_on_stack() for the debug check in __init_work() to work correctly. But this lacks the counterpart to remove the tracked object from debug objects again, which will cause a debug object ...
```diff diff --git a/kernel/smp.c b/kernel/smp.c index 18483570cc5f..aaffecdad319 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -1119,6 +1119,7 @@ int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys) queue_work_on(cpu, system_wq, &sscs.work); wait_for_completion(&sscs.done); + destro...
52b49ec1b2c78deb258596c3b231201445ef5380
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Close obj in error path in xdp_adjust_tail
Problem Details: If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj" opened before this should be closed. So use "goto out" to close it instead of using "return" here. Fixes: 110221081aac ("bpf: selftests: update xdp_adjust_tail selftest to include xdp frags") Signed-off-by: Geliang Tang <tanggelia...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c index f09505f8b038..53d6ad8c2257 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c @@ -222,7 +222,7 ...
eef0532e900c20a6760da829e82dac3ee18688c5
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Null checks for links in bpf_tcp_ca
Problem Details: Run bpf_tcp_ca selftests (./test_progs -t bpf_tcp_ca) on a Loongarch platform, some "Segmentation fault" errors occur: ''' test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -524 #29/1 bpf_tcp_ca/dctcp:FAIL test_cubic:PASS:bpf_cubic__ope...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c index bceff5900016..63422f4f3896 100644 --- a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c +++ b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c @@ -411,7 +411,8 @@ static void test_...
259043e3b730e0aa6408bff27af7edf7a5c9101c
Analyze and fix the following issue in the Linux kernel code: mm: zswap: fix zswap_never_enabled() for CONFIG_ZSWAP==N
Problem Details: If CONFIG_ZSWAP is set to N, it means zswap cannot be enabled. zswap_never_enabled() should return true. The only effect of this issue is that with Barry's latest large folio swapin patches for zram ("mm: support mTHP swap-in for zRAM-like swapfile"), we will always fallback to order-0 swapin, even m...
```diff diff --git a/include/linux/zswap.h b/include/linux/zswap.h index bf83ae5e285d..6cecb4a4f68b 100644 --- a/include/linux/zswap.h +++ b/include/linux/zswap.h @@ -68,7 +68,7 @@ static inline bool zswap_is_enabled(void) static inline bool zswap_never_enabled(void) { - return false; + return true; } #endif ``...
efeacc2cb6b7a0f44757d7d50069189d592c2d5c
Analyze and fix the following issue in the Linux kernel code: Docs/mm/damon/design: fix two typos
Problem Details: Patch series "Docs/damon: minor fixups and improvements". Fixup typos, clarify regions merging operation design with recent change, add access pattern snapshot example use case, and improve readability of the design document and subsystem documents index by reorganizing/wordsmithing and adding links t...
```diff diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 3f12c884eb3a..6beb245cbb62 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -25,7 +25,7 @@ DAMON subsystem is configured with three layers including - Operations Set: Implements fun...
843a2e24c24c5311831860c6b78ceacdd4627000
Analyze and fix the following issue in the Linux kernel code: mm/shmem: fix input and output inconsistencies
Problem Details: Commit 19eaf44954df ("mm: thp: support allocation of anonymous multi-size THP") added mTHP support for anonymous shmem. We can configure different policies through the multi-size THP sysfs interface for anonymous shmem. But when we configure the "advise" policy of /sys/kernel/mm/transparent_hugepage/...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 426b09d8cc55..f24177e9d5cc 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -4983,7 +4983,7 @@ static ssize_t thpsize_shmem_enabled_store(struct kobject *kobj, clear_bit(order, &huge_shmem_orders_madvise); set_bit(order, &huge_shmem_orders_within_size); spin_unlock...
adae187ebedcd95d02f045bc37dfecfd5b29434b
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Close fd in error path in drop_on_reuseport
Problem Details: In the error path when update_lookup_map() fails in drop_on_reuseport in prog_tests/sk_lookup.c, "server1", the fd of server 1, should be closed. This patch fixes this by using "goto close_srv1" lable instead of "detach" to close "server1" in this case. Fixes: 0ab5539f8584 ("selftests/bpf: Tests for B...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c index 597d0467a926..de2466547efe 100644 --- a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c +++ b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c @@ -994,7 +994,7 @@ static void drop_on_r...
eeb23b54e447ea62b247d89681f0140abab00d7f
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: fix compilation failure when CONFIG_NF_FLOW_TABLE=m
Problem Details: In many cases, kernel netfilter functionality is built as modules. If CONFIG_NF_FLOW_TABLE=m in particular, progs/xdp_flowtable.c (and hence selftests) will fail to compile, so add a ___local version of "struct flow_ports". Fixes: c77e572d3a8c ("selftests/bpf: Add selftest for bpf_xdp_flow_lookup kfun...
```diff diff --git a/tools/testing/selftests/bpf/progs/xdp_flowtable.c b/tools/testing/selftests/bpf/progs/xdp_flowtable.c index 15209650f73b..7fdc7b23ee74 100644 --- a/tools/testing/selftests/bpf/progs/xdp_flowtable.c +++ b/tools/testing/selftests/bpf/progs/xdp_flowtable.c @@ -58,6 +58,10 @@ static bool xdp_flowtable_...
b5ef17917f3a797a7b12d1edd51f676554e44a07
Analyze and fix the following issue in the Linux kernel code: mailbox: imx: fix TXDB_V2 channel race condition
Problem Details: Two TXDB_V2 channels are used between Linux and System Manager(SM). Channel0 for normal TX, Channel 1 for notification completion. The TXDB_V2 trigger logic is using imx_mu_xcr_rmw which uses read/modify/update logic. Note: clear MUB GSR BITs, the MUA side GCR BITs will also got cleared per hardware d...
```diff diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 933727f89431..d17efb1dd0cb 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -225,6 +225,8 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv, void *data) { u32 *arg = data; + u32 v...
0a02bc0a34cd53c7fe5bf4bae6efb56ad47677fa
Analyze and fix the following issue in the Linux kernel code: mailbox: omap: Fix mailbox interrupt sharing
Problem Details: Multiple mailbox users can share one interrupt line. This flag was mistakenly dropped as part of the FIFO removal. Mark the IRQ as shared. Reported-by: Beleswar Padhi <b-padhi@ti.com> Fixes: 3f58c1f4206f ("mailbox: omap: Remove kernel FIFO message queuing") Signed-off-by: Andrew Davis <afd@ti.com> Tes...
```diff diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c index 46747559b438..7a87424657a1 100644 --- a/drivers/mailbox/omap-mailbox.c +++ b/drivers/mailbox/omap-mailbox.c @@ -230,7 +230,8 @@ static int omap_mbox_startup(struct omap_mbox *mbox) int ret = 0; ret = request_threaded_irq(mb...
471e45a33302852bf79bc140fe418782f50734f6
Analyze and fix the following issue in the Linux kernel code: watchdog: rzg2l_wdt: Check return status of pm_runtime_put()
Problem Details: pm_runtime_put() may return an error code. Check its return status. Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of rzg2l_wdt_stop() to its caller. Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Claudiu Beznea <claudiu.b...
```diff diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index d87d4f50180c..7bce093316c4 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -144,9 +144,13 @@ static int rzg2l_wdt_start(struct watchdog_device *wdev) static int rzg2l_wdt_stop(struct watchdog_device *...
f0ba0fcdd19943809b1a7f760f77f6673c6aa7f7
Analyze and fix the following issue in the Linux kernel code: watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
Problem Details: pm_runtime_get_sync() may return with error. In case it returns with error dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get() takes care of this. Thus use it. Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of rzg2l_wdt_start() to its cal...
```diff diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 1741f98ca67c..d87d4f50180c 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct watchdog_device *wdev) static int rzg2l_wdt_start(struct watchdog...
c62bec0fe36873ab6c87c9ae84a6b661d09244c4
Analyze and fix the following issue in the Linux kernel code: ASoC: cs530x: Calculate proper bclk rate using TDM
Problem Details: Calculate the proper bclk rate using the number of tdm slots and the width of the tdm data. Fixes: 2884c29152c0 ("ASoC: cs530x: Support for cs530x ADCs") Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240710160416.2617173-1-paulha@opensource.cirrus.com S...
```diff diff --git a/sound/soc/codecs/cs530x.c b/sound/soc/codecs/cs530x.c index 036d0f45e3ba..195739657f4e 100644 --- a/sound/soc/codecs/cs530x.c +++ b/sound/soc/codecs/cs530x.c @@ -526,13 +526,15 @@ static int cs530x_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(regmap, CS530X_CLK_CFG_1, ...
fd80d14005250652e7500a97eedd68797de0b797
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix scheduling while atomic in break_cycle()
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_locking.c b/fs/bcachefs/btree_locking.c index d66fff22109a..191d9a50378a 100644 --- a/fs/bcachefs/btree_locking.c +++ b/fs/bcachefs/btree_locking.c @@ -231,7 +231,7 @@ static noinline int break_cycle(struct lock_graph *g, struct printbuf *cycle) prt_newline(&buf); } - bc...
c13fda93aca118b8e5cd202e339046728ee7dddb
Analyze and fix the following issue in the Linux kernel code: bpf: Remove tst_run from lwt_seg6local_prog_ops.
Problem Details: The syzbot reported that the lwt_seg6 related BPF ops can be invoked via bpf_test_run() without without entering input_action_end_bpf() first. Martin KaFai Lau said that self test for BPF_PROG_TYPE_LWT_SEG6LOCAL probably didn't work since it was introduced in commit 04d4b274e2a ("ipv6: sr: Add seg6loc...
```diff diff --git a/net/core/filter.c b/net/core/filter.c index d767880c276d..4cf1d34f7617 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -11053,7 +11053,6 @@ const struct bpf_verifier_ops lwt_seg6local_verifier_ops = { }; const struct bpf_prog_ops lwt_seg6local_prog_ops = { - .test_run = bpf_prog_test...
6f692b1672bdd279832a1c5227afb58fbbfbd0be
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix RCU splat
Problem Details: Reported-by: syzbot+e74fea078710bbca6f4b@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 743d57eba760..314ee3e0187f 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -805,7 +805,7 @@ int bch2_bucket_ref_update(struct btree_trans *trans, struct bch_dev *ca, "bucket %u:%zu gen %u (mem gen %u) data type %s: stale dirt...
6ed9a85f1c44d7049cf2d488bfe71252ce467dc2
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: h616: add crypto engine node
Problem Details: The Allwinner H616 SoC contains a crypto engine very similar to the H6 version, but with all base addresses in the DMA descriptors shifted by two bits. This requires a new compatible string. Also the H616 CE relies on the internal osciallator for the TRNG operation, so we need to reference this clock. ...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi index bf4d41ecbfdc..b29ce7321317 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi @@ -150,6 +150,16 @@ #size-cells = <1>; ranges = <0...
04aee7a847795ff64d4a5fab285dd2764ff22b85
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Support Transmit DE stats
Problem Details: Add support to request transmit DE stats from firmware through HTT stats type 8. These stats give information about enqueued packets, discarded packets, failed packets and other information such as power, bandwidth information, number of retries, etc. Sample output: ------------- echo 8 > /sys/kernel/...
```diff diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c index ce80e7b5175b..f1b7e74aefe4 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c @@ -1117,6 +1117,336 @@ ath12k_htt_pr...
69f253e46af98af17e3efa3e5dfa72fcb7d1983d
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix array out-of-bound access in SoC stats
Problem Details: Currently, the ath11k_soc_dp_stats::hal_reo_error array is defined with a maximum size of DP_REO_DST_RING_MAX. However, the ath11k_dp_process_rx() function access ath11k_soc_dp_stats::hal_reo_error using the REO destination SRNG ring ID, which is incorrect. SRNG ring ID differ from normal ring ID, and ...
```diff diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 86485580dd89..c087d8a0f5b2 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -2697,7 +2697,7 @@ try_again: if (unlikely(push_reason != HAL_REO_DEST...
e106b7ad13c1d246adaa57df73edb8f8b8acb240
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix array out-of-bound access in SoC stats
Problem Details: Currently, the ath12k_soc_dp_stats::hal_reo_error array is defined with a maximum size of DP_REO_DST_RING_MAX. However, the ath12k_dp_rx_process() function access ath12k_soc_dp_stats::hal_reo_error using the REO destination SRNG ring ID, which is incorrect. SRNG ring ID differ from normal ring ID, and ...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index 14236d0a0c89..91e3393f7b5f 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -2681,7 +2681,7 @@ try_again: if (push_reason != HAL_REO_DEST_RING_PUSH_...
177b49dbf9c1d8f9f25a22ffafa416fc2c8aa6a3
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: use work queue to process beacon tx event
Problem Details: Commit 3a415daa3e8b ("wifi: ath11k: add P2P IE in beacon template") from Feb 28, 2024 (linux-next), leads to the following Smatch static checker warning: drivers/net/wireless/ath/ath11k/wmi.c:1742 ath11k_wmi_p2p_go_bcn_ie() warn: sleeping in atomic context The reason is that ath11k_bcn_tx_status_even...
```diff diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index df24f0e409af..7122176dd91e 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -399,6 +399,7 @@ struct ath11k_vif { u8 bssid[ETH_ALEN]; struct cfg80211_bitrate_m...
44ee95184e785c64e301498dec112bb1582bffd2
Analyze and fix the following issue in the Linux kernel code: pwm: Register debugfs operations after the pwm class
Problem Details: While the debugfs operations don't technically depend on an initialized class, they loop over the idr that only can get entries when the class is properly initialized. This also fixes the ugly (but harmless) corner case that the debugfs file stays around after the pwm class failed to initialize. Whil...
```diff diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 5c1d20985148..84ca846120a2 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1705,9 +1705,17 @@ DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); static int __init pwm_init(void) { + int ret; + + ret = class_register(&pwm_class); + if (ret) { + pr_err(...
a96d3659c9437673dbef5c05cba31a3c0b5a0a7b
Analyze and fix the following issue in the Linux kernel code: pwm: Remove wrong implementation details from pwm_ops's documentation
Problem Details: When .get_state() is called is an implementation detail that implementors and users shouldn't care about and rely on. Additionally it's wrong, because with PWM_DEBUG enabled it is called more often. Just drop the wrong statement. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: ht...
```diff diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 2e225f3b4282..75ad0d2fd949 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -252,9 +252,7 @@ struct pwm_capture { * @free: optional hook for freeing a PWM * @capture: capture and report PWM signal * @apply: atomically apply a new PW...
37f7707077f5ea2515bf4b1dc7fad43f8e12993e
Analyze and fix the following issue in the Linux kernel code: pwm: atmel-tcb: Fix race condition and convert to guards
Problem Details: The hardware only supports a single period length for both PWM outputs. So atmel_tcb_pwm_config() checks the configuration of the other output if it's compatible with the currently requested setting. The register values are then actually updated in atmel_tcb_pwm_enable(). To make this race free the loc...
```diff diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c index 528e54c5999d..aca11493239a 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -81,7 +81,8 @@ static int atmel_tcb_pwm_request(struct pwm_chip *chip, tcbpwm->period = 0; tcbpwm->div = 0; - spin_lock(&tcb...
5a88a3f67e37e39f933b38ebb4985ba5822e9eca
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Init the count variable in collecting hot-reset devices
Problem Details: The count variable is used without initialization, it results in mistakes in the device counting and crashes the userspace if the get hot reset info path is triggered. Fixes: f6944d4a0b87 ("vfio/pci: Collect hot-reset devices to local buffer") Link: https://bugzilla.kernel.org/show_bug.cgi?id=219010 R...
```diff diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 987c7921affa..ba0ce0075b2f 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -1260,7 +1260,7 @@ static int vfio_pci_ioctl_get_pci_hot_reset_info( struct vfio_pci_hot_reset_info hdr; s...
708f220567d4a398ee1553ee6519f7e73ae5ed6c
Analyze and fix the following issue in the Linux kernel code: drm/amd/pm: Ignore initial value in smu response register
Problem Details: Why: If the reg mmMP1_SMN_C2PMSG_90 is being written to during amdgpu driver load or driver unload, subsequent amdgpu driver load will fail at smu_hw_init. The default of mmMP1_SMN_C2PMSG_90 register at a clean environment is 0x1 and if value differs from expected, amdgpu driver load will fail. How to...
```diff diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index d79bdb1e8cdf..fb8643d25d1b 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1755,6 +1755,8 @@ static int smu_start_smc_engine(struct smu_context *smu...
5d64af40e3a99c3bbe7a66c3cfe23295f8e97130
Analyze and fix the following issue in the Linux kernel code: drm/amd/amdgpu: fix SDMA IRQ client ID <-> req mapping.
Problem Details: sdma has 2 instances in SRIOV cpx mode. Odd numbered VFs have sdma0/sdma1 instances. Even numbered vfs have sdma2/sdma3. For Even numbered vfs, the sdma2 & sdma3 (irq srouce id CLIENTID_SDMA2 and CLIENTID_SDMA3) should map to irq seq 0 & 1. Signed-off-by: Gavin Wan <Gavin.Wan@amd.com> Reviewed-by: Haw...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c index 01644a869738..2c55bfd935bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c @@ -83,7 +83,7 @@ static unsigned sdma_v4_4_2_seq_to_irq_id(int seq_num) } } ...
89d568ab9037e77964281cb5e916e8aa219802cf
Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: fix Xinhui's name
Problem Details: Switch to fist last for consistency. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Xinhui Pan <Xinhui.Pan@amd.com>
```diff diff --git a/MAINTAINERS b/MAINTAINERS index f930832b2aa8..ed2d2dbcec81 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18656,7 +18656,7 @@ F: drivers/net/wireless/quantenna RADEON and AMDGPU DRM DRIVERS M: Alex Deucher <alexander.deucher@amd.com> M: Christian König <christian.koenig@amd.com> -M: Pan, Xinhui ...
b6e02c6b0377d4339986e07aeb696c632cd392aa
Analyze and fix the following issue in the Linux kernel code: platform/x86: toshiba_acpi: Fix array out-of-bounds access
Problem Details: In order to use toshiba_dmi_quirks[] together with the standard DMI matching functions, it must be terminated by a empty entry. Since this entry is missing, an array out-of-bounds access occurs every time the quirk list is processed. Fix this by adding the terminating empty entry. Reported-by: kerne...
```diff diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 10d0ce6c8342..78a5aac2dcfd 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -3299,6 +3299,7 @@ static const struct dmi_system_id toshiba_dmi_quirks[] __initconst = { }, ...
7d7f71cd8763a296d02dff9514447aa3de199c47
Analyze and fix the following issue in the Linux kernel code: bcachefs: Add missing bch2_trans_begin()
Problem Details: this fixes a 'transaction should be locked' error in backpointers fsck Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index e8037b5d8332..6d8b1bc90be0 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -770,6 +770,8 @@ static int bch2_get_btree_in_memory_pos(struct btree_trans *trans, !((1U << btree) & btree_interior_mask)) ...
0f6f8f76936b22e9a466ca6bd49aa0261f698276
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix missing error check in journal_entry_btree_keys_validate()
Problem Details: Closes: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index f17c478a18e8..2326e2cb9cd2 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -415,6 +415,8 @@ static int journal_entry_btree_keys_validate(struct bch_fs *c, flags|BCH_VALIDATE_journal); if (ret == FSCK_D...
8ed58789fc43343d5a55565b204db40a514c06fc
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix undefined behaviour in eytzinger1_first()
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/eytzinger.h b/fs/bcachefs/eytzinger.h index 24840aee335c..795f4fc0bab1 100644 --- a/fs/bcachefs/eytzinger.h +++ b/fs/bcachefs/eytzinger.h @@ -48,7 +48,7 @@ static inline unsigned eytzinger1_right_child(unsigned i) static inline unsigned eytzinger1_first(unsigned size) { - return rou...
b02f973e67589cf617f229250e2a738ab62ca666
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_inode_insert() race path for tmpfiles
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index f9c9a95d7d4c..1768b2678b38 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -194,6 +194,12 @@ static struct bch_inode_info *bch2_inode_insert(struct bch_fs *c, struct bch_ino * discard_new_inode() expects it to be set... */ inode->v.i_flag...
29f1c1ae6d2fff3bf4f89d265f4a1a7c8ab78a8e
Analyze and fix the following issue in the Linux kernel code: closures: fix closure_sync + closure debugging
Problem Details: originally, stack closures were only used synchronously, and with the original implementation of closure_sync() the ref never hit 0; thus, closure_put_after_sub() assumes that if the ref hits 0 it's on the debug list, in debug mode. that's no longer true with the current implementation of closure_sync...
```diff diff --git a/include/linux/closure.h b/include/linux/closure.h index 59b8c06b11ff..2af44427107d 100644 --- a/include/linux/closure.h +++ b/include/linux/closure.h @@ -159,6 +159,7 @@ struct closure { #ifdef CONFIG_DEBUG_CLOSURES #define CLOSURE_MAGIC_DEAD 0xc054dead #define CLOSURE_MAGIC_ALIVE 0xc054a11e +#d...
0435773239b5afe25801e83c8252e04299a0e306
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix journal getting stuck on a flush commit
Problem Details: silly race Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index db24ce21b2ac..f17c478a18e8 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -1762,11 +1762,13 @@ static CLOSURE_CALLBACK(journal_write_preflush) if (j->seq_ondisk + 1 != le64_to_cpu(w->data->seq)) { spin_lock(&j...
a11dda723c6493bb1853bbc61c093377f96e2d47
Analyze and fix the following issue in the Linux kernel code: iommufd: Require drivers to supply the cache_invalidate_user ops
Problem Details: If drivers don't do this then iommufd will oops invalidation ioctls with something like: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Mem abort info: ESR = 0x0000000086000004 EC = 0x21: IABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0,...
```diff diff --git a/drivers/iommu/iommufd/hw_pagetable.c b/drivers/iommu/iommufd/hw_pagetable.c index e63f80f087d1..d90f1c30cf8a 100644 --- a/drivers/iommu/iommufd/hw_pagetable.c +++ b/drivers/iommu/iommufd/hw_pagetable.c @@ -243,7 +243,8 @@ iommufd_hwpt_nested_alloc(struct iommufd_ctx *ictx, } hwpt->domain->owner...
e60284b63245b84c3ae352427ed5ff8b79266b91
Analyze and fix the following issue in the Linux kernel code: usb: gadget: f_uac2: fix non-newline-terminated function name
Problem Details: Most writes to configfs handle an optional newline, but do not require it. By using the number of bytes written as the limit for scnprintf() it is guaranteed that the final character in the buffer will be overwritten. This is expected if it is a newline but is undesirable when a string is written "as...
```diff diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index f85ffa24a5cd..2d6d3286ffde 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -2063,7 +2063,10 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item, \ g...
af46fe8c41de5b79358c3007e3854dda9c61c7dc
Analyze and fix the following issue in the Linux kernel code: dio: Have dio_bus_match() callback take a const *
Problem Details: drivers/dio/dio-driver.c:128:11: error: initialization of ‘int (*)(struct device *, const struct device_driver *)’ from incompatible pointer type ‘int (*)(struct device *, struct device_driver *)’ [-Werror=incompatible-pointer-types] 128 | .match = dio_bus_match, | ^~~~~~~~~~~~~ driv...
```diff diff --git a/drivers/dio/dio-driver.c b/drivers/dio/dio-driver.c index 2d9fa6011945..12fa2d209dab 100644 --- a/drivers/dio/dio-driver.c +++ b/drivers/dio/dio-driver.c @@ -110,10 +110,10 @@ void dio_unregister_driver(struct dio_driver *drv) * and 0 if there is no match. */ -static int dio_bus_match(struct...
acc3815db1a02d654fbc19726ceaadca0d7dd81c
Analyze and fix the following issue in the Linux kernel code: ARM: davinci: Convert comma to semicolon
Problem Details: Replace a comma between expression statements by a semicolon. Fixes: efc1bb8a6fd5 ("davinci: add power management support") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
```diff diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c index 8aa39db095d7..2c5155bd376b 100644 --- a/arch/arm/mach-davinci/pm.c +++ b/arch/arm/mach-davinci/pm.c @@ -61,7 +61,7 @@ static void davinci_pm_suspend(void) /* Configure sleep count in deep sleep register */ val = __raw_readl(pm_conf...
ab11dac93d2d568d151b1918d7b84c2d02bacbd5
Analyze and fix the following issue in the Linux kernel code: dev/parport: fix the array out-of-bounds risk
Problem Details: Fixed array out-of-bounds issues caused by sprintf by replacing it with snprintf for safer data copying, ensuring the destination buffer is not overflowed. Below is the stack trace I encountered during the actual issue: [ 66.575408s] [pid:5118,cpu4,QThread,4]Kernel panic - not syncing: stack-protecto...
```diff diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index bd388560ed59..c2e371c50dcf 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -51,12 +51,12 @@ static int do_active_device(struct ctl_table *table, int write, for (dev = port->devices; dev ; dev = dev->next) { if...
863a756aaf49ed23d25bbb1dad999a85f09e1836
Analyze and fix the following issue in the Linux kernel code: staging: vc04_services: vchiq_core: Stop kthreads on vchiq module unload
Problem Details: The various kthreads thread functions (slot_handler_func, sync_func, recycle_func) in vchiq_core and vchiq_keepalive_thread_func in vchiq_arm should be stopped when the module is unloaded. Previous attempt were made to address this but later reverted [1] due to VC04 firmware corruption. The issue arou...
```diff diff --git a/drivers/staging/vc04_services/interface/TODO b/drivers/staging/vc04_services/interface/TODO index 05f129c0c254..dfb1ee49633f 100644 --- a/drivers/staging/vc04_services/interface/TODO +++ b/drivers/staging/vc04_services/interface/TODO @@ -16,13 +16,6 @@ some of the ones we want: to manage these b...
dfda97e37de4c2fa4a079ae77737c6b9ed021f79
Analyze and fix the following issue in the Linux kernel code: gpio: mc33880: Convert comma to semicolon
Problem Details: Replace a comma between expression statements by a semicolon. Fixes: 1e5db00687c1 ("gpio: add MC33880 driver") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20240710082813.2287329-1-nichen@iscas.ac.cn [Bartosz: fixed...
```diff diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c index cd9b16dbe1a9..ade410615a87 100644 --- a/drivers/gpio/gpio-mc33880.c +++ b/drivers/gpio/gpio-mc33880.c @@ -99,7 +99,7 @@ static int mc33880_probe(struct spi_device *spi) mc->spi = spi; - mc->chip.label = DRIVER_NAME, + mc->chip.la...
36d69c29759ec2299c1537e292a466eab3824087
Analyze and fix the following issue in the Linux kernel code: hexagon: use new system call table
Problem Details: The uapi/asm/unistd_32.h and asm/syscall_table_32.h headers can now be generated from scripts/syscall.tbl, which makes this consistent with the other architectures that have their own syscall.tbl. The time32, stat64, rlimit and renameat entries in the syscall_abis_32 line are for system calls that wer...
```diff diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index 3ece3c93fe08..8c1a78c8f527 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -1,4 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 +syscall-y += syscall_table_32.h + generic-y += extable.h gener...
1d8267bcbb7aa2176365299ad57e067f73b5174d
Analyze and fix the following issue in the Linux kernel code: gpio: virtuser: actually use the "trimmed" local variable
Problem Details: This variable is set with the intention of being passed to the subsequent strcmp() but something went wrong and it was left unused. Use it now. Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel...
```diff diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index 2ac09c6a3763..0e0d55da4f01 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -406,12 +406,12 @@ static ssize_t gpio_virtuser_direction_do_write(struct file *file, trimmed = strim(buf); - if (strcmp...
0a3f6b3463014b03f6ad10eacc4d1d9af75d54a1
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Fix aligned pages in calculate_psi_aligned_address()
Problem Details: The helper calculate_psi_aligned_address() is used to convert an arbitrary range into a size-aligned one. The aligned_pages variable is calculated from input start and end, but is not adjusted when the start pfn is not aligned and the mask is adjusted, which results in an incorrect number of pages ret...
```diff diff --git a/drivers/iommu/intel/cache.c b/drivers/iommu/intel/cache.c index 0a3bb38a5289..44e92638c0cd 100644 --- a/drivers/iommu/intel/cache.c +++ b/drivers/iommu/intel/cache.c @@ -246,6 +246,7 @@ static unsigned long calculate_psi_aligned_address(unsigned long start, */ shared_bits = ~(pfn ^ end_pfn) ...
c420a2b4e8be06f16f3305472bd25a1dd12059ec
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Limit max address mask to MAX_AGAW_PFN_WIDTH
Problem Details: Address mask specifies the number of low order bits of the address field that must be masked for the invalidation operation. Since address bits masked start from bit 12, the max address mask should be MAX_AGAW_PFN_WIDTH, as defined in Table 19 ("Invalidate Descriptor Address Mask Encodings") of the sp...
```diff diff --git a/drivers/iommu/intel/cache.c b/drivers/iommu/intel/cache.c index e8418cdd8331..0a3bb38a5289 100644 --- a/drivers/iommu/intel/cache.c +++ b/drivers/iommu/intel/cache.c @@ -245,7 +245,7 @@ static unsigned long calculate_psi_aligned_address(unsigned long start, * shared_bits are all equal in both p...
3eb27d3e32c78badbc4db6ae76614b5961e32291
Analyze and fix the following issue in the Linux kernel code: usb: gadget: midi2: Fix incorrect default MIDI2 protocol setup
Problem Details: The MIDI2 gadget driver handled the default MIDI protocol version incorrectly due to the confusion of the protocol version passed via configfs (either 1 or 2) and UMP protocol bits (0x100 / 0x200). As a consequence, the default protocol always resulted in MIDI1. This patch addresses the misunderstandi...
```diff diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index c765f54e613d..38e8ed3144f0 100644 --- a/drivers/usb/gadget/function/f_midi2.c +++ b/drivers/usb/gadget/function/f_midi2.c @@ -150,6 +150,9 @@ struct f_midi2 { #define func_to_midi2(f) container_of(f, struct f_mid...
d176fadb9e783c152d0820a50f84882b6c5ae314
Analyze and fix the following issue in the Linux kernel code: dm raid: fix stripes adding reshape size issues
Problem Details: Adding stripes to an existing raid4/5/6/10 mapped device grows its capacity though it'll be only made available _after_ the respective reshape finished as of MD kernel reshape semantics. Such reshaping involves moving a window forward starting at BOD reading content from previous lesser stripes and wr...
```diff diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 871e278de662..0c3323e0adb2 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -1673,7 +1673,7 @@ static int rs_set_dev_and_array_sectors(struct raid_set *rs, sector_t sectors, b if (sector_div(dev_sectors, data_stripes)) goto bad...
3708c7269593b836b1d684214cd9f5d83e4ed3fd
Analyze and fix the following issue in the Linux kernel code: dm-verity: fix dm_is_verity_target() when dm-verity is builtin
Problem Details: When CONFIG_DM_VERITY=y, dm_is_verity_target() returned true for any builtin dm target, not just dm-verity. Fix this by checking for verity_target instead of THIS_MODULE (which is NULL for builtin code). Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin") Cc: stable@vger.kernel.org Cc: Matthia...
```diff diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 0a2399d958b7..cf659c8feb29 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1521,14 +1521,6 @@ bad: return r; } -/* - * Check whether a DM target is a verity target. - */ -bool dm_is_verity_ta...
7017ded001076593e03540840a5f5b80209bab67
Analyze and fix the following issue in the Linux kernel code: dm vdo indexer: use swap() instead of open coding it
Problem Details: Use existing swap() macro rather than duplicating its implementation. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9173 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-of...
```diff diff --git a/drivers/md/dm-vdo/indexer/index.c b/drivers/md/dm-vdo/indexer/index.c index 1ba767144426..df4934846244 100644 --- a/drivers/md/dm-vdo/indexer/index.c +++ b/drivers/md/dm-vdo/indexer/index.c @@ -197,15 +197,12 @@ static int finish_previous_chapter(struct uds_index *index, u64 current_chapter_ stati...