id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
ba8bcb012b7d6efbac30038d82bd67b70e4597d7
Analyze and fix the following issue in the Linux kernel code: gve: Use ethtool_sprintf/puts() to fill stats strings
Problem Details: Make use of standard helpers to simplify filling in stats strings. The first two ethtool_puts() changes address the following fortification warnings flagged by W=1 builds with clang-18. (The last ethtool_puts change does not because the warning relates to writing beyond the first element of an array, ...
```diff diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c index 156b7e128b53..fe1741d482b4 100644 --- a/drivers/net/ethernet/google/gve/gve_ethtool.c +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c @@ -90,42 +90,34 @@ static const char gve_gstrings_priv_flags...
b9d5f5711dd8ea2297b952c6a35e6e918cf57948
Analyze and fix the following issue in the Linux kernel code: selftests: net: increase the delay for relative cmsg_time.sh test
Problem Details: Slow machines can delay scheduling of the packets for milliseconds. Increase the delay to 8ms if KSFT_MACHINE_SLOW. Try to limit the variability by moving setsockopts earlier (before we read time). This fixes the "TXTIME rel" failures on debug kernels, like: Case ICMPv4 - TXTIME rel returned '', e...
```diff diff --git a/tools/testing/selftests/net/cmsg_sender.c b/tools/testing/selftests/net/cmsg_sender.c index 161db24e3c40..876c2db02a63 100644 --- a/tools/testing/selftests/net/cmsg_sender.c +++ b/tools/testing/selftests/net/cmsg_sender.c @@ -260,15 +260,8 @@ cs_write_cmsg(int fd, struct msghdr *msg, char *cbuf, si...
2d3b8dfd82d76b1295167c6453d683ab99e50794
Analyze and fix the following issue in the Linux kernel code: selftests: net: fix timestamp not arriving in cmsg_time.sh
Problem Details: On slow machines the SND timestamp sometimes doesn't arrive before we quit. The test only waits as long as the packet delay, so it's easy for a race condition to happen. Double the wait but do a bit of polling, once the SND timestamp arrives there's no point to wait any longer. This fixes the "TXTIME...
```diff diff --git a/tools/testing/selftests/net/cmsg_sender.c b/tools/testing/selftests/net/cmsg_sender.c index c79e65581dc3..161db24e3c40 100644 --- a/tools/testing/selftests/net/cmsg_sender.c +++ b/tools/testing/selftests/net/cmsg_sender.c @@ -333,16 +333,17 @@ static const char *cs_ts_info2str(unsigned int info) ...
b49bd37f0bfd7bbfedd54085d5ea4e854778d283
Analyze and fix the following issue in the Linux kernel code: virtio_net: Fix memory leak in virtnet_rx_mod_work
Problem Details: The pointer delcaration was missing the __free(kfree). Fixes: ff7c7d9f5261 ("virtio_net: Remove command data from control_buf") Reported-by: Jens Axboe <axboe@kernel.dk> Closes: https://lore.kernel.org/netdev/0674ca1b-020f-4f93-94d0-104964566e3f@kernel.dk/ Signed-off-by: Daniel Jurgens <danielj@nvidia...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 218a446c4c27..ad0fb832b538 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2862,7 +2862,6 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) static int virtnet_close(struct net_device *dev)...
4c639b6a7b9db236c0907aca8e92d1537076f2cd
Analyze and fix the following issue in the Linux kernel code: selftests: net: move amt to socat for better compatibility
Problem Details: The test seems to expect that nc will exit after the first received message. This is not the case with Ncat 7.94. There are multiple versions of nc out there, switch to socat for better compatibility. Tell socat to exit after 128 bytes and pad the message. Since the test sets -e make sure we don't se...
```diff diff --git a/tools/testing/selftests/net/amt.sh b/tools/testing/selftests/net/amt.sh index 75528788cb95..5175a42cbe8a 100755 --- a/tools/testing/selftests/net/amt.sh +++ b/tools/testing/selftests/net/amt.sh @@ -210,8 +210,8 @@ check_features() test_ipv4_forward() { - RESULT4=$(ip netns exec "${LISTENER}" nc...
c499fe96d3f75a5cf50de6089dd8f1cddd1301a9
Analyze and fix the following issue in the Linux kernel code: selftests: net: add missing config for amt.sh
Problem Details: Test needs IPv6 multicast. smcroute currently crashes when trying to install a route in a kernel without IPv6 multicast. Fixes: c08e8baea78e ("selftests: add amt interface selftest script") Link: https://lore.kernel.org/r/20240509161919.3939966-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@ker...
```diff diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config index 5e4390cac17e..04de7a6ba6f3 100644 --- a/tools/testing/selftests/net/config +++ b/tools/testing/selftests/net/config @@ -30,6 +30,7 @@ CONFIG_IP_GRE=m CONFIG_NETFILTER=y CONFIG_NETFILTER_ADVANCED=y CONFIG_NF_CONNTRACK=m...
38155539a16ebb79dbb7a2e058138d70be68d245
Analyze and fix the following issue in the Linux kernel code: bnxt_en: silence clang build warning
Problem Details: Clang build brings a warning: ../drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:133:12: warning: comparison of distinct pointer types ('typeof (tmo_us) *' (aka 'unsigned int *') and 'typeof (65535) *' (aka 'int *')) [-Wcompare-distinct-pointer-types] 133 | tmo_us =...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h index 6a2bba3f9e2d..2c3415c8fc03 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h @@ -24,7 +24,7 @@ #define BNXT_PTP_DFLT_TX_TMO 1000 /* ms ...
ac0a230f719b02432d8c7eba7615ebd691da86f4
Analyze and fix the following issue in the Linux kernel code: eth: sungem: remove .ndo_poll_controller to avoid deadlocks
Problem Details: Erhard reports netpoll warnings from sungem: netpoll_send_skb_on_dev(): eth0 enabled interrupts in poll (gem_start_xmit+0x0/0x398) WARNING: CPU: 1 PID: 1 at net/core/netpoll.c:370 netpoll_send_skb+0x1fc/0x20c gem_poll_controller() disables interrupts, which may sleep. We can't sleep in netpoll, i...
```diff diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c index 9bd1df8308d2..d3a2fbb14140 100644 --- a/drivers/net/ethernet/sun/sungem.c +++ b/drivers/net/ethernet/sun/sungem.c @@ -949,17 +949,6 @@ static irqreturn_t gem_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -#ifd...
991b6bdf1b009832256f8bc3035d4bcba664657b
Analyze and fix the following issue in the Linux kernel code: f2fs: fix some ambiguous comments
Problem Details: After commit d7e9a9037de2 ("f2fs: Support Block Size == Page Size"), Some comments are confused and just correct with block size is 4KB. Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index a357287eac1e..41d1d71c36ff 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h @@ -394,7 +394,8 @@ struct f2fs_nat_block { /* * F2FS uses 4 bytes to represent block address. As a result, supported size of - * disk is 16 TB ...
a798ff17cd2dabe47d5d4ed3d509631793c36e19
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to add missing iput() in gc_data_segment()
Problem Details: During gc_data_segment(), if inode state is abnormal, it missed to call iput(), fix it. Fixes: b73e52824c89 ("f2fs: reposition unlock_new_inode to prevent accessing invalid inode") Fixes: 9056d6489f5a ("f2fs: fix to do sanity check on inode type during garbage collection") Signed-off-by: Chao Yu <chao...
```diff diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index ac4cbbe50c2f..6066c6eecf41 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1554,10 +1554,15 @@ next_step: int err; inode = f2fs_iget(sb, dni.ino); - if (IS_ERR(inode) || is_bad_inode(inode) || - special_file(inode->i_mode)) + if (IS_ERR(inode)) ...
a222a6470d7eea91193946e8162066fa88da64c2
Analyze and fix the following issue in the Linux kernel code: Revert "drm/nouveau/firmware: Fix SG_DEBUG error with nvkm_firmware_ctor()"
Problem Details: This reverts commit 52a6947bf576b97ff8e14bb0a31c5eaf2d0d96e2. This causes loading failures in [ 0.367379] nouveau 0000:01:00.0: NVIDIA GP104 (134000a1) [ 0.474499] nouveau 0000:01:00.0: bios: version 86.04.50.80.13 [ 0.474620] nouveau 0000:01:00.0: pmu: firmware unavailable [ 0.474977] nou...
```diff diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c index 141b0a513bf5..adc60b25f8e6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c @@ -205,9 +205,7 @@ nvkm_firmware_dtor(struct nvkm_firmware *fw) ...
7e6423441b36e3a03907e2df84b73c414c9c3763
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix powerpc ARCH check
Problem Details: In commit 0518dbe97fe6 ("selftests/mm: fix cross compilation with LLVM") the logic to detect the machine architecture in the Makefile was changed to use ARCH, and only fallback to uname -m if ARCH is unset. However the tests of ARCH were not updated to account for the fact that ARCH is "powerpc" for p...
```diff diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index eb5f39a2668b..410495e0a611 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -12,7 +12,7 @@ uname_M := $(shell uname -m 2>/dev/null || echo not) else uname_M := $(shell echo...
11cdc8f2bde4bc548da6f995556c4b7183431088
Analyze and fix the following issue in the Linux kernel code: drm: use "0" instead of "" for deprecated driver date
Problem Details: libdrm does not like the empty string for driver date. Use "0" instead, which has been used by virtio previously. Reported-by: Steven Price <steven.price@arm.com> Closes: https://lore.kernel.org/r/9d0cff47-308e-4b11-a9f3-4157dc26b6fa@arm.com Fixes: 7fb8af6798e8 ("drm: deprecate driver date") Signed-of...
```diff diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 89feb7306e47..51f39912866f 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -530,9 +530,9 @@ int drm_version(struct drm_device *dev, void *data, err = drm_copy_field(version->name, &version->name_len, ...
8d2c930735f850e5be6860aeb39b27ac73ca192f
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible
Problem Details: It incorrectly claimed a resource isn't CPU visible if it's located at the very end of CPU visible VRAM. Fixes: a6ff969fe9cb ("drm/amdgpu: fix visible VRAM handling during faults") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3343 Reviewed-by: Christian König <christian.koenig@amd.com> Revi...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 109fe557a02b..29c197c00018 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -427,7 +427,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev, amdgp...
be4a2a81b6b90d1a47eaeaace4cc8e2cb57b96c7
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: don't allow mapping the MMIO HDP page with large pages
Problem Details: We don't get the right offset in that case. The GPU has an unused 4K area of the register BAR space into which you can remap registers. We remap the HDP flush registers into this space to allow userspace (CPU or GPU) to flush the HDP when it updates VRAM. However, on systems with >4K pages, we end u...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 55aa74cbc532..1e6cc0bfc432 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -1139,7 +1139,7 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep...
3dd384108d53834002be5630132ad5c3f32166ad
Analyze and fix the following issue in the Linux kernel code: apparmor: fix possible NULL pointer dereference
Problem Details: profile->parent->dents[AAFS_PROF_DIR] could be NULL only if its parent is made from __create_missing_ancestors(..) and 'ent->old' is NULL in aa_replace_profiles(..). In that case, it must return an error code and the code, -ENOENT represents its state that the path of its parent is not existed yet. BU...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index bcfea073e3f2..01b923d97a44 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -1692,6 +1692,10 @@ int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent) struct aa_profile *...
b2c858148acf96290b9a9af259a04e080a169f51
Analyze and fix the following issue in the Linux kernel code: apparmor: fix typo in kernel doc
Problem Details: Fix the typo in the function documentation to please kernel doc warnings. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: John Johansen <john.johansen@canonical.com>
```diff diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index c2f73d281724..717204fba938 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1124,7 +1124,7 @@ static int apparmor_socket_create(int family, int type, int protocol, int kern) * @sock: socket that is being setup * @fami...
5754ace3c3199c162dcee1f3f87a538c46d1c832
Analyze and fix the following issue in the Linux kernel code: x86/topology/amd: Ensure that LLC ID is initialized
Problem Details: The original topology evaluation code initialized cpu_data::topo::llc_id with the die ID initialy and then eventually overwrite it with information gathered from a CPUID leaf. The conversion analysis failed to spot that particular detail and omitted this initial assignment under the assumption that ea...
```diff diff --git a/arch/x86/kernel/cpu/topology_amd.c b/arch/x86/kernel/cpu/topology_amd.c index a7aa6eff4ae5..ce2d507c3b07 100644 --- a/arch/x86/kernel/cpu/topology_amd.c +++ b/arch/x86/kernel/cpu/topology_amd.c @@ -119,7 +119,7 @@ static bool parse_8000_001e(struct topo_scan *tscan, bool has_0xb) return true; } ...
2bc73505a5cd2a18a7a542022722f136c19e3b87
Analyze and fix the following issue in the Linux kernel code: apparmor: use kvfree_sensitive to free data->data
Problem Details: Inside unpack_profile() data->data is allocated using kvmemdup() so it should be freed with the corresponding kvfree_sensitive(). Also add missing data->data release for rhashtable insertion failure path in unpack_profile(). Found by Linux Verification Center (linuxtesting.org). Fixes: e025be0f26d5 ...
```diff diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 957654d253dd..14df15e35695 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -225,7 +225,7 @@ static void aa_free_data(void *ptr, void *arg) { struct aa_data *data = ptr; - kfree_sensitive(data->data); + kv...
f80460c5231bdd01b6836343b699caa7f190c537
Analyze and fix the following issue in the Linux kernel code: backlight: mp3309c: Fix LEDs flickering in PWM mode
Problem Details: The mp3309 has two configuration registers, named according to their address (0x00 and 0x01). In the second register (0x01), the bit DIMS (Dimming Mode Select) must be always 0 (zero), in both analog (via I2C commands) and PWM dimming mode. In the initial driver version, the DIMS bit was set in PWM mo...
```diff diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index 016c1296841c..a28036c964af 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -97,15 +97,10 @@ static int mp3309c_enable_device(struct mp3309c_chip *chip) /* * I2C register #1 -...
e962f13b1e86272a5dcdaede2dfb649152e981e9
Analyze and fix the following issue in the Linux kernel code: backlight: mp3309c: Fix signedness bug in mp3309c_parse_fwnode()
Problem Details: The "num_levels" variable is used to store error codes from device_property_count_u32() so it needs to be signed. This doesn't cause an issue at runtime because devm_kcalloc() won't allocate negative sizes. However, it's still worth fixing. Fixes: b54c828bdba9 ("backlight: mp3309c: Make use of devic...
```diff diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index 7d73e85b8c14..016c1296841c 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -205,8 +205,9 @@ static int mp3309c_parse_fwnode(struct mp3309c_chip *chip, struct mp3309c_platform_d...
ee0166b637a5e376118e9659e5b4148080f1d27e
Analyze and fix the following issue in the Linux kernel code: gpiolib: cdev: fix uninitialised kfifo
Problem Details: If a line is requested with debounce, and that results in debouncing in software, and the line is subsequently reconfigured to enable edge detection then the allocation of the kfifo to contain edge events is overlooked. This results in events being written to and read from an uninitialised kfifo. Rea...
```diff diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 46a45093d4d0..9dad67ea2597 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -1193,6 +1193,8 @@ static int edge_detector_update(struct line *line, struct gpio_v2_line_config *lc, unsigned int line_...
09541603462c399c7408d50295db99b4b8042eaa
Analyze and fix the following issue in the Linux kernel code: perf daemon: Fix file leak in daemon_session__control
Problem Details: The open() function returns -1 on error. The 'control' and 'ack' file descriptors are both initialized with open() and further validated with 'if' statement. 'if (!control)' would evaluate to 'true' if returned value on error were '0' but it is actually '-1'. Fixes: edcaa47958c7438b ("perf daemon: A...
```diff diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c index 83954af36753..de76bbc50bfb 100644 --- a/tools/perf/builtin-daemon.c +++ b/tools/perf/builtin-daemon.c @@ -523,7 +523,7 @@ static int daemon_session__control(struct daemon_session *session, session->base, SESSION_CONTROL); cont...
230a7a71f92212e723fa435d4ca5922de33ec88a
Analyze and fix the following issue in the Linux kernel code: libsubcmd: Fix parse-options memory leak
Problem Details: If a usage string is built in parse_options_subcommand, also free it. Fixes: 901421a5bdf605d2 ("perf tools: Remove subcmd dependencies on strbuf") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: ...
```diff diff --git a/tools/lib/subcmd/parse-options.c b/tools/lib/subcmd/parse-options.c index 9fa75943f2ed..d943d78b787e 100644 --- a/tools/lib/subcmd/parse-options.c +++ b/tools/lib/subcmd/parse-options.c @@ -633,11 +633,10 @@ int parse_options_subcommand(int argc, const char **argv, const struct option *o const ...
5ecab785396055c3d6f2207bf80be9feacdd7ddc
Analyze and fix the following issue in the Linux kernel code: perf lock: Avoid memory leaks from strdup()
Problem Details: Leak sanitizer complains about the strdup-ed arguments not being freed and given cmd_record doesn't modify the given strings, remove the strdups. Original discussion in this patch: https://lore.kernel.org/lkml/20240430184156.1824083-1-irogers@google.com/ Suggested-by: Namhyung Kim <namhyung@kernel...
```diff diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 230461280e45..7007d26fe654 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -2275,23 +2275,13 @@ setup_args: return -ENOMEM; for (i = 0; i < ARRAY_SIZE(record_args); i++) - rec_argv[i] = strdup(record_args[...
a2a6604e1c5836ff4121f170af1328c6a141cca4
Analyze and fix the following issue in the Linux kernel code: perf parse-events: Add new 'fake_tp' parameter for tests
Problem Details: The next commit will allow tracepoints starting with digits, but most systems do not have any available by default so tests should skip the actual "check if it exists in /sys/kernel/debug/tracing" step. In order to do that, add a new boolean flag specifying if we should actually "format" the probe or ...
```diff diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 993e482f094c..c3b77570bb57 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -2493,7 +2493,8 @@ static int test_event(const struct evlist_test *e) return TEST_FAIL; } parse_events_erro...
87988a534d8e12f2e6fc01fe63e6c1925dc5307c
Analyze and fix the following issue in the Linux kernel code: ALSA: Fix deadlocks with kctl removals at disconnection
Problem Details: In snd_card_disconnect(), we set card->shutdown flag at the beginning, call callbacks and do sync for card->power_ref_sleep waiters at the end. The callback may delete a kctl element, and this can lead to a deadlock when the device was in the suspended state. Namely: * A process waits for the power ...
```diff diff --git a/sound/core/init.c b/sound/core/init.c index 4ed5037d8693..89c8354862c4 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -516,6 +516,14 @@ void snd_card_disconnect(struct snd_card *card) } } +#ifdef CONFIG_PM + /* wake up sleepers here before other callbacks for avoiding potential + ...
7b090b6ff51b9a9f002139660672f662b95f0630
Analyze and fix the following issue in the Linux kernel code: powerpc/85xx: fix compile error without CONFIG_CRASH_DUMP
Problem Details: Since commit 5c4233cc0920 ("powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency"), crashing_cpu is not available without CONFIG_CRASH_DUMP. Fix compile error on 64-BIT 85xx owing to this change. Fixes: 5c4233cc0920 ("powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency") Cc: stable@vger.ker...
```diff diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 40aa58206888..e52b848b64b7 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c @@ -398,6 +398,7 @@ static void mpc85xx_smp_kexec_cpu_down(int crash_shutdown, int secondary) hard_irq_disa...
da55da5a42d4247d7a48b843fa5fcd9a4a10f4fe
Analyze and fix the following issue in the Linux kernel code: iommu/arm-smmu-v3: Make the kunit into a module
Problem Details: It turns out kconfig has problems ensuring the SMMU module and the KUNIT module are consistently y/m to allow linking. It will permit KUNIT to be a module while SMMU is built in. Also, Fedora apparently enables kunit on production kernels. So, put the entire kunit in its own module using the VISIBLE_...
```diff diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 66325210c8c9..c04584be3089 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -415,7 +415,7 @@ config ARM_SMMU_V3_SVA and PRI. config ARM_SMMU_V3_KUNIT_TEST - bool "KUnit tests for arm-smmu-v3 driver" if !KUNIT_ALL_TESTS + t...
3d8f874bd620ce03f75a5512847586828ab86544
Analyze and fix the following issue in the Linux kernel code: io_uring: fail NOP if non-zero op flags is passed in
Problem Details: The NOP op flags should have been checked from beginning like any other opcode, otherwise NOP may not be extended with the op flags. Given both liburing and Rust io-uring crate always zeros SQE op flags, just ignore users which play raw NOP uring interface without zeroing SQE, because NOP is just for ...
```diff diff --git a/io_uring/nop.c b/io_uring/nop.c index d956599a3c1b..1a4e312dfe51 100644 --- a/io_uring/nop.c +++ b/io_uring/nop.c @@ -12,6 +12,8 @@ int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) { + if (READ_ONCE(sqe->rw_flags)) + return -EINVAL; return 0; } ```
fce09ea314505a52f2436397608fa0a5d0934fb1
Analyze and fix the following issue in the Linux kernel code: apparmor: Fix null pointer deref when receiving skb during sock creation
Problem Details: The panic below is observed when receiving ICMP packets with secmark set while an ICMP raw socket is being created. SK_CTX(sk)->label is updated in apparmor_socket_post_create(), but the packet is delivered to the socket before that, causing the null pointer dereference. Drop the packet if label contex...
```diff diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index cef8c466af80..c2f73d281724 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1304,6 +1304,13 @@ static int apparmor_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) if (!skb->secmark) return 0; + /* + * If...
e21de1455a721a0cb4217b18589ede846f5b0686
Analyze and fix the following issue in the Linux kernel code: serial: Clear UPF_DEAD before calling tty_port_register_device_attr_serdev()
Problem Details: If a serdev_device_driver is already loaded for a serdev_tty_port when it gets registered by tty_port_register_device_attr_serdev() then that driver's probe() method will be called immediately. The serdev_device_driver's probe() method should then be able to call serdev_device_open() successfully, but...
```diff diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 84ae70d52b05..2c1a0254d3f4 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3207,6 +3207,9 @@ static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *u if (upor...
aae20f6e34cd0cbd67a1d0e5877561c40109a81b
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: protect invalidating RXDMA on shutdown
Problem Details: The to-be-fixed commit removed locking when invalidating the DMA RX descriptors on shutdown. It overlooked that there is still a rx_timer running which may still access the protected data. So, re-add the locking. Reported-by: Dirk Behme <dirk.behme@de.bosch.com> Closes: https://lore.kernel.org/r/ee6c9...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 97031db26ae4..4d34950268b9 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1270,9 +1270,14 @@ static void sci_dma_rx_chan_invalidate(struct sci_port *s) static void sci_dma_rx_release(struct sci_port *s)...
9054c46d479b55768adae31031a1afa1b7d62228
Analyze and fix the following issue in the Linux kernel code: drm/arm/komeda: Fix komeda probe failing if there are no links in the secondary pipeline
Problem Details: Since commit 4cfe5cc02e3f ("drm/arm/komeda: Remove component framework and add a simple encoder"), the devm_drm_of_get_bridge() call happens regardless of whether any remote nodes are available on the pipeline. Fix this by moving the bridge attach to its own function and calling it conditional on there...
```diff diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 9bec59cf9c06..1a57f5b0ec0a 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -5,6 +5,7 @@ * */ #include <linux/clk.h> ...
409c1cfb5a803f3cf2d17aeaf75c25c4be951b07
Analyze and fix the following issue in the Linux kernel code: usb: typec: tipd: fix event checking for tps6598x
Problem Details: The current interrupt service routine of the tps6598x only reads the first 64 bits of the INT_EVENT1 and INT_EVENT2 registers, which means that any event above that range will be ignored, leaving interrupts unattended. Moreover, those events will not be cleared, and the device will keep the interrupt e...
```diff diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 7c2f01344860..191f86da283d 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -28,6 +28,7 @@ #define TPS_REG_MODE 0x03 #define TPS_REG_CMD1 0x08 #define TPS_REG_DATA1 0x09 +#define TPS_REG_VE...
d64adb0f41e62f91fcfdf0e0d9d5bfa714db0d23
Analyze and fix the following issue in the Linux kernel code: usb: typec: tipd: fix event checking for tps25750
Problem Details: In its current form, the interrupt service routine of the tps25750 checks the event flags in the lowest 64 bits of the interrupt event register (event[0]), but also in the upper part (event[1]). Given that all flags are defined as BIT() or BIT_ULL(), they are restricted to the first 64 bits of the INT...
```diff diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 0717cfcd9f8c..7c2f01344860 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -604,11 +604,11 @@ static irqreturn_t tps25750_interrupt(int irq, void *data) if (!tps6598x_read_status(tps, &status)) ...
cbad7440672aad985573c1f8f5202137c2377b00
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: qcom,dwc3: fix interrupt max items
Problem Details: A recent commit adding the SC8280XP multiport controller to the binding failed to update the interrupt maxItems, which results it DT checker warnings like: arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb: usb@a4f8800: interrupts-extended: [[1, 0, 130, 4], [1, 0, 135, 4], [1, 0, 857, 4], [1...
```diff diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index e5f5bc19d186..cf633d488c3f 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -119,11 +119,11 @@ properties:...
514fdbdc4e34257cf6002296a53388fdf810eac5
Analyze and fix the following issue in the Linux kernel code: usb: fotg210: Use *-y instead of *-objs in Makefile
Problem Details: *-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://l...
```diff diff --git a/drivers/usb/fotg210/Makefile b/drivers/usb/fotg210/Makefile index 5aecff21f24b..8f5b0fb9b988 100644 --- a/drivers/usb/fotg210/Makefile +++ b/drivers/usb/fotg210/Makefile @@ -1,10 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -# This setup links the different object files into one single -# module s...
b791a67f68121d69108640d4a3e591d210ffe850
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: displayport: Fix potential deadlock
Problem Details: The function ucsi_displayport_work() does not access the connector, so it also must not acquire the connector lock. This fixes a potential deadlock scenario: ucsi_displayport_work() -> lock(&con->lock) typec_altmode_vdm() dp_altmode_vdm() dp_altmode_work() typec_altmode_enter() ucsi_displayport_enter...
```diff diff --git a/drivers/usb/typec/ucsi/displayport.c b/drivers/usb/typec/ucsi/displayport.c index d9d3c91125ca..8be92fc1d12c 100644 --- a/drivers/usb/typec/ucsi/displayport.c +++ b/drivers/usb/typec/ucsi/displayport.c @@ -275,8 +275,6 @@ static void ucsi_displayport_work(struct work_struct *work) struct ucsi_dp ...
1d26ba0944d398f88aaf997bda3544646cf21945
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: Wait unconditionally after issuing EndXfer command
Problem Details: Currently all controller IP/revisions except DWC3_usb3 >= 310a wait 1ms unconditionally for ENDXFER completion when IOC is not set. This is because DWC_usb3 controller revisions >= 3.10a supports GUCTL2[14: Rst_actbitlater] bit which allows polling CMDACT bit to know whether ENDXFER command is complete...
```diff diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f94f68f1e7d2..89fc690fdf34 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1699,7 +1699,6 @@ static int __dwc3_gadget_get_frame(struct dwc3 *dwc) */ static int __dwc3_stop_active_transfer(struct dwc3_ep *dep, ...
eba63df7eb1f95df6bfb67722a35372b6994928d
Analyze and fix the following issue in the Linux kernel code: Revert "media: v4l2-ctrls: show all owned controls in log_status"
Problem Details: This reverts commit 9801b5b28c6929139d6fceeee8d739cc67bb2739. This patch introduced a potential deadlock scenario: [Wed May 8 10:02:06 2024] Possible unsafe locking scenario: [Wed May 8 10:02:06 2024] CPU0 CPU1 [Wed May 8 10:02:06 2024] ---- --...
```diff diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c index c59dd691f79f..eeab6a5eb7ba 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c @@ -2507,8 +2507,7 @@ int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *h...
4ff61c4ce93677cd94a0ddefbd6f3bc3c40457c4
Analyze and fix the following issue in the Linux kernel code: media: intel/ipu6: Don't print user-triggerable errors to kernel log
Problem Details: Use dev_dbg() for printing messages on user-triggerable conditions that have no relation to driver or hardware issues. Fixes: 3c1dfb5a69cf ("media: intel/ipu6: input system video nodes and buffer queues") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Bingbu Cao <bingbu.cao@in...
```diff diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c index 11cd2c977abe..40a8ebfcfce2 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c @@ -34,7 +34,7 @@ static int queue_setup(struct vb2_queue...
bfbe27ba59e19e28801cc1a931a8f6d1d35b76d1
Analyze and fix the following issue in the Linux kernel code: crypto: iaa - Use kmemdup() instead of kzalloc() and memcpy()
Problem Details: Fixes the following two Coccinelle/coccicheck warnings reported by memdup.cocci: iaa_crypto_main.c:350:19-26: WARNING opportunity for kmemdup iaa_crypto_main.c:358:18-25: WARNING opportunity for kmemdup Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: Tom Zanussi <tom.zanussi@li...
```diff diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index 814fb2c31626..e810d286ee8c 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -347,18 +347,16 @@ int add_iaa_compression_mode(const char *name, g...
246014876d782bbf2e652267482cd2e799fb5fcd
Analyze and fix the following issue in the Linux kernel code: fuse: clear FR_SENT when re-adding requests into pending list
Problem Details: The following warning was reported by lee bruce: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 8264 at fs/fuse/dev.c:300 fuse_request_end+0x685/0x7e0 fs/fuse/dev.c:300 Modules linked in: CPU: 0 PID: 8264 Comm: ab2 Not tainted 6.9.0-rc7 Hardware name: QEMU Standard PC (i440FX + ...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 8eb2ce7c0b01..9eb191b5c4de 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1814,6 +1814,7 @@ static void fuse_resend(struct fuse_conn *fc) list_for_each_entry_safe(req, next, &to_queue, list) { set_bit(FR_PENDING, &req->flags); + clear_bit(FR_SENT, &re...
42815f8ac54c5113bf450ec4b7ccc5b62af0f6a7
Analyze and fix the following issue in the Linux kernel code: fuse: set FR_PENDING atomically in fuse_resend()
Problem Details: When fuse_resend() moves the requests from processing lists to pending list, it uses __set_bit() to set FR_PENDING bit in req->flags. Using __set_bit() is not safe, because other functions may update req->flags concurrently (e.g., request_wait_answer() may call set_bit(FR_INTERRUPTED, &flags)). Fix i...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 3ec8bb5e68ff..8eb2ce7c0b01 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1813,7 +1813,7 @@ static void fuse_resend(struct fuse_conn *fc) spin_unlock(&fc->lock); list_for_each_entry_safe(req, next, &to_queue, list) { - __set_bit(FR_PENDING, &req->flags...
e54f128b0c2fe543816941342e085e21f49c5b6c
Analyze and fix the following issue in the Linux kernel code: ASoC: audio-graph-card2: call of_node_get() before of_get_next_child()
Problem Details: commit c6f597bc598a8 ("ASoC: audio-graph-card2: remove unneeded of_node_get()") removed of_node_get(), but it need to keep original reference, so of_node_get() itself is needed. Because of_get_next_child() will call of_node_put() inside, if the reference count dropped to zero, then of_node_get() after...
```diff diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 62606e20be9a..0148688b7152 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -1197,7 +1197,7 @@ static int graph_count_c2c(struct simple_util_priv *priv, { struct d...
1cd354fe1e4864eeaff62f66ee513080ec946f20
Analyze and fix the following issue in the Linux kernel code: net: ipv6: fix wrong start position when receive hop-by-hop fragment
Problem Details: In IPv6, ipv6_rcv_core will parse the hop-by-hop type extension header and increase skb->transport_header by one extension header length. But if there are more other extension headers like fragment header at this time, the skb->transport_header points to the second extension header, not the transport l...
```diff diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 439f93512b0a..327caca64257 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -369,7 +369,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) * the source of the fragment, with the Pointer field set to zero. */ nexthdr = hdr-...
6a3691ca4799997b90da50883c170edb67bd6c49
Analyze and fix the following issue in the Linux kernel code: drm/i915/hdcp: Disable HDCP Line Rekeying for HDCP2.2 on HDMI
Problem Details: Disable HDCP Line Rekeying when HDCP ver > 1.4 and when we are on HDMI TMDS operation for DISPLAY_VER >= 14. --v2 -Wa to be mentioned in comments not in commit message [Jani] -Remove blankline [Jani] --v3 -No need to write what is being done in comments when code is self explanatory [Jani] --v4 -Add...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index d5ed4c7dfbc0..02cbbbfd8e25 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -30,6 +30,27 @@ #define KEY_LOAD_TRIES 5 #define HDCP2_LC_RETRY_CNT 3 ...
65ade5653f5ab5a21635e51d0c65e95f490f5b6f
Analyze and fix the following issue in the Linux kernel code: iommu/arm-smmu: Use the correct type in nvidia_smmu_context_fault()
Problem Details: This was missed because of the function pointer indirection. nvidia_smmu_context_fault() is also installed as a irq function, and the 'void *' was changed to a struct arm_smmu_domain. Since the iommu_domain is embedded at a non-zero offset this causes nvidia_smmu_context_fault() to miscompute the offs...
```diff diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c b/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c index 87bf522b9d2e..957d988b6d83 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c @@ -221,11 +221,9 @@ static irqreturn_t nvidia_smmu_context_fault...
8b80549f1bc692cf9130af8555b6c89cec24e1a6
Analyze and fix the following issue in the Linux kernel code: arm64: Properly clean up iommu-dma remnants
Problem Details: Thanks to the somewhat asymmetrical nature, while removing iommu_setup_dma_ops() from the arch_setup_dma_ops() flow, I managed to forget that arm64's teardown path was also specific to iommu-dma. Clean that up to match, otherwise probe deferral will lead to the arch code erroneously removing DMA ops se...
```diff diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7b11c98b3e84..8fe59fb9cb35 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -46,7 +46,6 @@ config ARM64 select ARCH_HAS_SYNC_DMA_FOR_DEVICE select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYSCALL_WRAPPER - select ARCH_HAS_TEARDOWN_DMA_...
da0e01cc7079124cb1e86a2c35dd90ba12897e1a
Analyze and fix the following issue in the Linux kernel code: afs: Fix fileserver rotation getting stuck
Problem Details: Fix the fileserver rotation code in a couple of ways: (1) op->server_states is an array, not a pointer to a single record, so fix the places that access it to index it. (2) In the places that go through an address list to work out which one has the best priority, fix the loops to skip kno...
```diff diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c index ed04bd1eeae8..ed09d4d4c211 100644 --- a/fs/afs/rotate.c +++ b/fs/afs/rotate.c @@ -541,11 +541,13 @@ pick_server: test_bit(AFS_SE_EXCLUDED, &se->flags) || !test_bit(AFS_SERVER_FL_RESPONDING, &s->flags)) continue; - es = op->server_states->en...
c8bdf9e727acb6e1b37febf422ef1751e5a2c7d1
Analyze and fix the following issue in the Linux kernel code: ASoC: rt715-sdca-sdw: Fix wrong complete waiting in rt715_dev_resume()
Problem Details: enumeration_complete will be completed when a peripheral is attached. And initialization_complete will be completed when a peripheral is initialized. rt715_dev_resume() should wait for initialization_complete instead of enumeration_complete. the issue exists since commit 20d17057f0a8 ("ASoC: rt715-sdc...
```diff diff --git a/sound/soc/codecs/rt715-sdca-sdw.c b/sound/soc/codecs/rt715-sdca-sdw.c index d3fb02e8f31a..c8dabb9b16b5 100644 --- a/sound/soc/codecs/rt715-sdca-sdw.c +++ b/sound/soc/codecs/rt715-sdca-sdw.c @@ -234,10 +234,10 @@ static int __maybe_unused rt715_dev_resume(struct device *dev) if (!slave->unattach_r...
9a9d31b149f3a71ad0835ea295743482601dd322
Analyze and fix the following issue in the Linux kernel code: ASoC: Intel: sof_sdw_rt_sdca_jack_common: remove -sdca for new codecs
Problem Details: Realtek new SoundWire codecs are all -sdca version. No need to add -sdca to distinguish the non-sdca version. To be consistent with "spk:" and "mic:" components string, remove "-sdca" suffix from "hs:" components string. Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Bard ...
```diff diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index 85c09513bc35..69161ea5b290 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -88,6 +88,15 @@ static const c...
b7bd96ec1b709f5079fd203b680261dabc0050aa
Analyze and fix the following issue in the Linux kernel code: selftests/ftrace: Fix required features for VFS type test case
Problem Details: Since the VFS type argument test case uses fprobe events, it must check the availablity of dynamic_events file and fprobe events syntax in README. Without this fix, the test fails if CONFIG_FPROBE_EVENTS=n. Link: https://lore.kernel.org/all/171478301645.110267.464634740467398506.stgit@devnote2/ Fixes...
```diff diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc index 49a833bf334c..c6a9d2466a71 100644 --- a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc +++ b/tools/testing/selftests/ftrace/test.d/dynevent/...
29ed2b5dd521ce7c5d8466cd70bf0cc9d07afeee
Analyze and fix the following issue in the Linux kernel code: f2fs: compress: don't allow unaligned truncation on released compress inode
Problem Details: f2fs image may be corrupted after below testcase: - mkfs.f2fs -O extra_attr,compression -f /dev/vdb - mount /dev/vdb /mnt/f2fs - touch /mnt/f2fs/file - f2fs_io setflags compression /mnt/f2fs/file - dd if=/dev/zero of=/mnt/f2fs/file bs=4k count=4 - f2fs_io release_cblocks /mnt/f2fs/file - truncate -s 81...
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 2a9de84d2a71..ef4cfb4436ef 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -952,9 +952,14 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, ATTR_GID | ATTR_TIMES_SET)))) return -EPERM; - if ((attr->ia_valid & ATTR_SIZE) && - !...
0fa4e57c1db263effd72d2149d4e21da0055c316
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to release node block count in error path of f2fs_new_node_page()
Problem Details: It missed to call dec_valid_node_count() to release node block count in error path, fix it. Fixes: 141170b759e0 ("f2fs: fix to avoid use f2fs_bug_on() in f2fs_new_node_page()") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 95cecf08cb37..b72ef96f7e33 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1329,6 +1329,7 @@ struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs) } if (unlikely(new_ni.blk_addr != NULL_ADDR)) { err = -EFSCORRUPTED; + dec_vali...
0a4ed2d97cb6d044196cc3e726b6699222b41019
Analyze and fix the following issue in the Linux kernel code: f2fs: compress: fix to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock
Problem Details: It needs to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock to avoid racing with checkpoint, otherwise, filesystem metadata including blkaddr in dnode, inode fields and .total_valid_block_count may be corrupted after SPO case. Fixes: ef8d563f184e ("f2fs: introduce F2FS_IOC_RELEASE_COMPRESS_...
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f03ae3d952cc..2a9de84d2a71 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3593,9 +3593,12 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg) struct dnode_of_data dn; pgoff_t end_offset, count; + f2fs_lock_op(sbi); + ...
043c832371cd9023fbd725138ddc6c7f288dc469
Analyze and fix the following issue in the Linux kernel code: f2fs: compress: fix error path of inc_valid_block_count()
Problem Details: If inc_valid_block_count() can not allocate all requested blocks, it needs to release block count in .total_valid_block_count and resevation blocks in inode. Fixes: 54607494875e ("f2fs: compress: fix to avoid inconsistence bewteen i_blocks and dnode") Signed-off-by: Chao Yu <chao@kernel.org> Signed-of...
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 30058e16a5d0..ef7de97be647 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2306,7 +2306,7 @@ static inline void f2fs_i_blocks_write(struct inode *, block_t, bool, bool); static inline int inc_valid_block_count(struct f2fs_sb_info *sbi, struct inode ...
a3a0bc6c223908a2a06736bcd43db962e0657c67
Analyze and fix the following issue in the Linux kernel code: f2fs: compress: fix typo in f2fs_reserve_compress_blocks()
Problem Details: s/released/reserved. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 13b430b54299..f03ae3d952cc 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3810,7 +3810,7 @@ unlock_inode: } else if (reserved_blocks && atomic_read(&F2FS_I(inode)->i_compr_blocks)) { set_sbi_flag(sbi, SBI_NEED_FSCK); - f2fs_warn(sbi, "%s: partia...
186e7d71534df4589405925caca5597af7626c12
Analyze and fix the following issue in the Linux kernel code: f2fs: compress: fix to update i_compr_blocks correctly
Problem Details: Previously, we account reserved blocks and compressed blocks into @compr_blocks, then, f2fs_i_compr_blocks_update(,compr_blocks) will update i_compr_blocks incorrectly, fix it. Meanwhile, for the case all blocks in cluster were reserved, fix to update dn->ofs_in_node correctly. Fixes: eb8fbaa53374 ("...
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 72ce1a522fb2..13b430b54299 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3666,7 +3666,8 @@ static int reserve_compress_blocks(struct dnode_of_data *dn, pgoff_t count, while (count) { int compr_blocks = 0; - blkcnt_t reserved; + blkcnt_t reserved...
a2c78977950da00aca83a3f8865d1f54e715770d
Analyze and fix the following issue in the Linux kernel code: ptp: ocp: fix DPLL functions
Problem Details: In ptp_ocp driver pin actions assume sma_nr starts with 1, but for DPLL subsystem callback 0-based index was used. Fix it providing proper index. Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops") Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://lore.kernel.org/r/2024050813211...
```diff diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index 6506cfb89aa9..ee2ced88ab34 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -4562,7 +4562,7 @@ static int ptp_ocp_dpll_direction_set(const struct dpll_pin *pin, return -EOPNOTSUPP; mode = direction == DPLL_PIN_DIRECTION_INPUT...
ed325ac38e0c0e371f128db0978357453a0c362c
Analyze and fix the following issue in the Linux kernel code: drm/arm/komeda: don't use confusing 'timeout' variable name
Problem Details: There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Check the return value directly to dro...
```diff diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 2c661f28410e..9bec59cf9c06 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -294,7 +294,6 @@ komeda_crtc_flush_and_wait_fo...
33108abc0e22f6f5d1209f4ba2b53cc94328f633
Analyze and fix the following issue in the Linux kernel code: media: bcm2835-unicam: Fix driver path in MAINTAINERS
Problem Details: The MAINTAINERS file entry for the bcm2835-unicam driver incorrectly references the non-existing drivers/media/platform/bcm2835/ path. Fix it. Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface") Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Link: https://lo...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 01b86927a7ad..ef6be9d95143 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4039,7 +4039,7 @@ M: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com> L: linux-media@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam...
b6041c9e9f2d85514358ed478c53dfabd4015e3b
Analyze and fix the following issue in the Linux kernel code: media: bcm2835-unicam: Fix a NULL vs IS_ERR() check
Problem Details: The media_pad_remote_pad_unique() function returns error pointers, not NULL. Update the check accordingly. Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@...
```diff diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index bdcb04d63338..a1d93c14553d 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2433,9 +2433,9 @@ static int unicam_async_bou...
0cc50ced282a3236c0cac72f72c6b027beaa2660
Analyze and fix the following issue in the Linux kernel code: media: bcm2835-unicam: Do not print error when irq not found
Problem Details: platform_get_irq() already prints an error for us. Fix this cocci warning: drivers/media/platform/broadcom/bcm2835-unicam.c:2664:2-9: line 2664 is redundant because platform_get_irq() already prints an error Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ricardo Riba...
```diff diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index 94cd66255b7e..bdcb04d63338 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2661,10 +2661,8 @@ static int unicam_probe(st...
05b0b07953b7630705e364fe342689c9af340b32
Analyze and fix the following issue in the Linux kernel code: media: bcm2835-unicam: Do not replace IRQ retcode during probe
Problem Details: platform_get_irq() cannot return the value 0. It will either return a non-zero irq or a errcode. If a errcode is returned, we need to populate the error code upwards. It will give a more accurate reason of why it failed to the caller, who might decide to retry later. Signed-off-by: Ricardo Ribalda <r...
```diff diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index b11bcec5b225..94cd66255b7e 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2661,9 +2661,8 @@ static int unicam_probe(str...
25626e19ae6df34f336f235b6b3dbd1b566d2738
Analyze and fix the following issue in the Linux kernel code: perf symbols: Fix ownership of string in dso__load_vmlinux()
Problem Details: The linked commit updated dso__load_vmlinux() to call dso__set_long_name() before loading the symbols. Loading the symbols may not succeed but dso__set_long_name() takes ownership of the string. The two callers of this function free the string themselves on failure cases, resulting in the following err...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index f21fe5772bd8..9e5940b5bc59 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1978,6 +1978,10 @@ out: return ret; } +/* + * Always takes ownership of vmlinux when vmlinux_allocated == true, even if + * it returns a...
f30232b20fadea8c0f2f43f764bc06e51e8cfcdf
Analyze and fix the following issue in the Linux kernel code: perf symbols: Update kcore map before merging in remaining symbols
Problem Details: When loading kcore, the main vmlinux map is updated in the same loop that merges the remaining maps. If a map that overlaps is merged in before kcore, the list can become unsortable when the main map addresses are updated. This will later trigger the check_invariants() assert: $ perf record $ perf...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 0d4de786358d..f21fe5772bd8 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1290,7 +1290,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map, { struct maps *kmaps = map__kmaps(map); struct kcore_mapf...
9fe410a7ef483a9aca08bf620d8ddfd35ac99bc7
Analyze and fix the following issue in the Linux kernel code: perf symbols: Remove map from list before updating addresses
Problem Details: Make the order of operations remove, update, add. Updating addresses before the map is removed causes the ordering check to fail when the map is removed. This can be reproduced when running Perf on an Arm system with a static kernel and Perf uses kcore rather than other sources: $ perf record -- ls ...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index eb3319baa1b5..0d4de786358d 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1378,13 +1378,15 @@ static int dso__load_kcore(struct dso *dso, struct map *map, if (RC_CHK_EQUAL(new_map, replacement_map)) { struct ...
c9d492378faec5c1fb8ea1534c620f7320bbb23a
Analyze and fix the following issue in the Linux kernel code: perf dwarf-aux: Fix build with HAVE_DWARF_CFI_SUPPORT
Problem Details: check_allowed_ops() is used from both HAVE_DWARF_GETLOCATIONS_SUPPORT and HAVE_DWARF_CFI_SUPPORT sections, so move it into the right place so that it's available when either are defined. This shows up when doing a static cross compile for arm64: $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LDF...
```diff diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index ec988f294497..44ef968a7ad3 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -1217,6 +1217,34 @@ static int offset_from_dwarf_op(Dwarf_Op *op) } return -1; } + +static bool check_allowed_ops(Dwarf_Op *o...
3536c2575e88a890cf696b4ccd3da36bc937853b
Analyze and fix the following issue in the Linux kernel code: perf thread: Fixes to thread__new() related to initializing comm
Problem Details: Freeing the thread on failure won't work with reference count checking, use thread__delete(). Don't allocate the comm_str, use a stack allocation instead. Fixes: f6005cafebab72f8 ("perf thread: Add reference count checking") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hun...
```diff diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 0a473112f881..87c59aa9fe38 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -39,12 +39,13 @@ int thread__init_maps(struct thread *thread, struct machine *machine) struct thread *thread__new(pid_t pid, pid_t tid) { ...
45b4f402a6b782352c4bafcff682bfb01da9ca05
Analyze and fix the following issue in the Linux kernel code: perf report: Avoid SEGV in report__setup_sample_type()
Problem Details: In some cases evsel->name is lazily initialized in evsel__name(). If not initialized passing NULL to strstr() leads to a SEGV. Fixes: ccb17caecfbd542f ("perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.c...
```diff diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0892b6e3e5e7..69618fb0110b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -429,7 +429,7 @@ static int report__setup_sample_type(struct report *rep) * compatibility, set the bit if it's an old perf dat...
de6a908384fb1a8327ba46a2baec67d1dfe9a3e1
Analyze and fix the following issue in the Linux kernel code: perf comm: Fix comm_str__put() for reference count checking
Problem Details: Searching for the entry in the array needs to avoid the intermediate pointer with reference count checking. Refactor the array removal to binary search for the entry. Change the array to hold an entry with a reference count (so the intermediate pointer can work) and remove from the array when the ref...
```diff diff --git a/tools/perf/util/comm.c b/tools/perf/util/comm.c index 1aa9a08e5b03..233f2b6edf52 100644 --- a/tools/perf/util/comm.c +++ b/tools/perf/util/comm.c @@ -19,6 +19,8 @@ static struct comm_strs { int capacity; } _comm_strs; +static void comm_strs__remove_if_last(struct comm_str *cs); + static void ...
90f01afb0dfafbc9b094bb61e61a4ac297d9d0d2
Analyze and fix the following issue in the Linux kernel code: perf ui browser: Avoid SEGV on title
Problem Details: If the title is NULL then it can lead to a SEGV. Fixes: 769e6a1e15bdbbaf ("perf ui browser: Don't save pointer to stack memory") Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo...
```diff diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index c4cdf2ea69b7..19503e838738 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c @@ -203,7 +203,7 @@ void ui_browser__refresh_dimensions(struct ui_browser *browser) void ui_browser__handle_resize(struct ui_browser *browser) { ...
f6944d4a0b87c16bc34ae589169e1ded3d4db08e
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Collect hot-reset devices to local buffer
Problem Details: Lockdep reports the below circular locking dependency issue. The mmap_lock acquisition while holding pci_bus_sem is due to the use of copy_to_user() from within a pci_walk_bus() callback. Building the devices array directly into the user buffer is only for convenience. Instead we can allocate a loca...
```diff diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index d94d61b92c1a..d8c95cc16be8 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -778,25 +778,26 @@ static int vfio_pci_count_devs(struct pci_dev *pdev, void *data) } struct vfio_pci_fill...
692aa7a54b2b28d59f24b3bf8250837805484b99
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix sb_field_downgrade validation
Problem Details: - bch2_sb_downgrade_validate() wasn't checking for a downgrade entry extending past the end of the superblock section - for_each_downgrade_entry() is used in to_text() and needs to work on malformed input; it also was missing a check for a field extending past the end of the section Reported-by...
```diff diff --git a/fs/bcachefs/sb-downgrade.c b/fs/bcachefs/sb-downgrade.c index 7d2abadbd6e3..390a1bbd2567 100644 --- a/fs/bcachefs/sb-downgrade.c +++ b/fs/bcachefs/sb-downgrade.c @@ -134,7 +134,8 @@ downgrade_entry_next_c(const struct bch_sb_field_downgrade_entry *e) #define for_each_downgrade_entry(_d, _i) \...
91ffdecfc796e79ce9d6ae1cf052afebbda8b01e
Analyze and fix the following issue in the Linux kernel code: bcachefs: bch2_dev_get_ioref2(); debug.c
Problem Details: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index b5aa4e5b224b..d75735aad27e 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -37,11 +37,11 @@ static bool bch2_btree_verify_replica(struct bch_fs *c, struct btree *b, struct btree_node *n_ondisk = c->verify_ondisk; struct btree_node *n...
a7efb160f6c11ec1a72b8f69bd844e01753c769d
Analyze and fix the following issue in the Linux kernel code: kconfig: gconf: remove debug code
Problem Details: This is not so useful. If necessary, you can insert printf() or whatever during debugging. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
```diff diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 12b55f2e369b..89614f1e49e6 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -18,8 +18,6 @@ #include <unistd.h> #include <time.h> -//#define DEBUG - enum { SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW }; @@ -71,33 +69,6 @@ st...
1c369b6c9492756c58ad4abb92a9433a59f31f7d
Analyze and fix the following issue in the Linux kernel code: kbuild: simplify generic vdso installation code
Problem Details: With commit 4b0bf9a01270 ("riscv: compat_vdso: install compat_vdso.so.dbg to /lib/modules/*/vdso/") applied, all debug VDSO files are installed in $(MODLIB)/vdso/. Simplify the installation rule. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
```diff diff --git a/scripts/Makefile.vdsoinst b/scripts/Makefile.vdsoinst index c477d17b0aa5..bf72880c50d0 100644 --- a/scripts/Makefile.vdsoinst +++ b/scripts/Makefile.vdsoinst @@ -13,16 +13,15 @@ install-dir := $(MODLIB)/vdso define gen_install_rules -src := $$(firstword $$(subst :,$(space),$(1))) -dest := $(in...
9a0ebe5011f49e932bb0a2cea2034fd65e6e567e
Analyze and fix the following issue in the Linux kernel code: kbuild: use $(obj)/ instead of $(src)/ for common pattern rules
Problem Details: Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for checked-in source files. It is merely a convention without any functional difference. In fact, $(obj) and $(src) are exactly the same, as defined in scripts/Makefile.build: src := $(obj) Before changing the semantics of $(src) ...
```diff diff --git a/scripts/Makefile.build b/scripts/Makefile.build index baf86c0880b6..41138346afb0 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -113,13 +113,13 @@ endif quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ cmd_cc_s_c = $(CC) $(filter-out $(DEBUG_CFLAGS) $(CC_FLAGS_LTO), $(c_flags)...
1d479e3cd6520085832a6b432d521eeead2691ba
Analyze and fix the following issue in the Linux kernel code: Documentation: tpm: Add TPM security docs toctree entry
Problem Details: Stephen Rothwell reports htmldocs warning when merging tpmdd tree for linux-next: Documentation/security/tpm/tpm-security.rst: WARNING: document isn't included in any toctree Add toctree entry for TPM security docs to fix above warning. Fixes: ddfb3687c538 ("Documentation: add tpm-security.rst") Rep...
```diff diff --git a/Documentation/security/tpm/index.rst b/Documentation/security/tpm/index.rst index f27a17f60a96..fa593d960040 100644 --- a/Documentation/security/tpm/index.rst +++ b/Documentation/security/tpm/index.rst @@ -5,6 +5,7 @@ Trusted Platform Module documentation .. toctree:: tpm_event_log + tpm-s...
8516b23aa212a3ed6f6052418e66f22a83c7ee74
Analyze and fix the following issue in the Linux kernel code: char: tpm: Keep TPM_INF_IO_PORT define for HAS_IOPORT=n
Problem Details: The recent change to handle HAS_IOPORT removed the TPM_INF_IO_PORT define for the HAS_IOPORT=n case despite the define being used in sections of code not covered by the same ifdef check. This was missed because at the moment TCG_INFINEON indirectly depends on HAS_IOPORT via PNP which depends on ACPI ||...
```diff diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 418c9ed59ffd..852bb9344788 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig @@ -157,7 +157,7 @@ config TCG_ATMEL config TCG_INFINEON tristate "Infineon Technologies TPM Interface" - depends on PNP + depends on PNP ||...
b1d87ae9b0d3d91767d85183e40c96f4229a6c21
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Rename tcp-cc private struct in bpf_cubic and bpf_dctcp
Problem Details: The "struct bictcp" and "struct dctcp" are private to the bpf prog and they are stored in the private buffer in inet_csk(sk)->icsk_ca_priv. Hence, there is no bpf CO-RE required. The same struct name exists in the vmlinux.h. To reuse vmlinux.h, they need to be renamed such that the bpf prog logic will...
```diff diff --git a/tools/testing/selftests/bpf/progs/bpf_cubic.c b/tools/testing/selftests/bpf/progs/bpf_cubic.c index 53a98b609e5f..53872e2d2c52 100644 --- a/tools/testing/selftests/bpf/progs/bpf_cubic.c +++ b/tools/testing/selftests/bpf/progs/bpf_cubic.c @@ -70,7 +70,7 @@ static const __u64 cube_factor = (__u64)(1u...
a6016aac5252da9d22a4dc0b98121b0acdf6d2f5
Analyze and fix the following issue in the Linux kernel code: dma: fix DMA sync for drivers not calling dma_set_mask*()
Problem Details: There are several reports that the DMA sync shortcut broke non-coherent devices. dev->dma_need_sync is false after the &device allocation and if a driver didn't call dma_set_mask*(), it will still be false even if the device is not DMA-coherent and thus needs synchronizing. Due to historical reasons, t...
```diff diff --git a/include/linux/device.h b/include/linux/device.h index ed95b829f05b..d4b50accff26 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -691,7 +691,7 @@ struct device_physical_location { * and optionall (if the coherent mask is large enough) also * for dma allocations. This flag...
26e8383b116d0dbe74e28f86646563ab46d66d83
Analyze and fix the following issue in the Linux kernel code: hwmon: (pmbus/ucd9000) Increase delay from 250 to 500us
Problem Details: Following the failure observed with a delay of 250us, experiments were conducted with various delays. It was found that a delay of 350us effectively mitigated the issue. To provide a more optimal solution while still allowing a margin for stability, the delay is being adjusted to 500us. Signed-off-by...
```diff diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c index 8d9d422450e5..d817c719b90b 100644 --- a/drivers/hwmon/pmbus/ucd9000.c +++ b/drivers/hwmon/pmbus/ucd9000.c @@ -80,11 +80,11 @@ struct ucd9000_debugfs_entry { * It has been observed that the UCD90320 randomly fails register access ...
1dd719a959794467c2a75b3813df86cc6f55f5e3
Analyze and fix the following issue in the Linux kernel code: isofs: Use *-y instead of *-objs in Makefile
Problem Details: *-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: ...
```diff diff --git a/fs/isofs/Makefile b/fs/isofs/Makefile index 6498fd2b0f60..b25bc542a22b 100644 --- a/fs/isofs/Makefile +++ b/fs/isofs/Makefile @@ -5,7 +5,6 @@ obj-$(CONFIG_ISO9660_FS) += isofs.o -isofs-objs-y := namei.o inode.o dir.o util.o rock.o export.o -isofs-objs-$(CONFIG_JOLIET) += joliet.o -isofs-obj...
d69c3d4b53829097b8948d6791ea32c07de3faab
Analyze and fix the following issue in the Linux kernel code: drm/xe/ads: Use flexible-array
Problem Details: Zero-length arrays are deprecated and flexible arrays should be used instead: https://www.kernel.org/doc/html/v6.9-rc7/process/deprecated.html#zero-length-and-one-element-arrays Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@inria.fr> Closes: https://lore.kernel...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c index 1aafa486edec..7f5a523795c8 100644 --- a/drivers/gpu/drm/xe/xe_guc_ads.c +++ b/drivers/gpu/drm/xe/xe_guc_ads.c @@ -107,7 +107,7 @@ struct __guc_ads_blob { struct guc_engine_usage engine_usage; struct guc_um_init_params um_in...
2d9c72f676e6f79a021b74c6c1c88235e7d5b722
Analyze and fix the following issue in the Linux kernel code: drm/xe: Use ordered WQ for G2H handler
Problem Details: System work queues are shared, use a dedicated work queue for G2H processing to avoid G2H processing getting block behind system tasks. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: <stable@vger.kernel.org> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index 8ac819a7061e..0151d29b3c58 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -121,6 +121,7 @@ static void guc_ct_fini(struct drm_device *drm, void *arg) { struct xe_guc_ct *ct = arg; + destr...
2a4b49bb58123bad6ec0e07b02845f74c23d5e04
Analyze and fix the following issue in the Linux kernel code: regulator: core: fix debugfs creation regression
Problem Details: regulator_get() may sometimes be called more than once for the same consumer device, something which before commit dbe954d8f163 ("regulator: core: Avoid debugfs: Directory ... already present! error") resulted in errors being logged. A couple of recent commits broke the handling of such cases so that...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index dabac9772741..2c33653ffdea 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1911,19 +1911,24 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, } } - if (err != -EEXIST) + if (err != -EEXI...
a85ed162f0efcfdd664954414a05d1d560cc95dc
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8192: fix register configuration for tdm
Problem Details: For DSP_A, data is a BCK cycle behind LRCK trigger edge. For DSP_B, this delay doesn't exist. Fix the delay configuration to match the standard. Fixes: 52fcd65414abfc ("ASoC: mediatek: mt8192: support tdm in platform driver") Signed-off-by: Hsin-Te Yuan <yuanhsinte@chromium.org> Reviewed-by: AngeloGio...
```diff diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c b/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c index 9ce06821c7d0..49440db370af 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c @@ -566,10 +566,10 @@ static int mtk_dai_tdm_hw_params(struct snd_pcm_sub...
26770a717cac57041d9414725e3e01dd19b08dd2
Analyze and fix the following issue in the Linux kernel code: jbd2: add prefix 'jbd2' for 'shrink_type'
Problem Details: As 'shrink_type' is exported. The module prefix 'jbd2' is added to distinguish from memory reclamation. Signed-off-by: Ye Bin <yebin10@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Link: https://lore.kernel.org/r/20240407065355.1528580-3-yebin10@huawei.co...
```diff diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 80c0ab98bc63..951f78634adf 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -348,7 +348,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) * Called with j_list_lock held. */ static unsigned long journal_shrink_one_cp_list(str...
cb67ea121cdd3e4ecea306fbb0058d031d5ad950
Analyze and fix the following issue in the Linux kernel code: arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2
Problem Details: The recent change to use pud_valid() as part of the implementation of pud_user_accessible_page() fails to build when PGTABLE_LEVELS <= 2 because pud_valid() is not defined in that case. Fix this by defining pud_valid() to false for this case. This means that pud_user_accessible_page() will correctly a...
```diff diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 78fd3e2ef8c6..bde9fd179388 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -814,6 +814,7 @@ static inline pmd_t *pud_pgtable(pud_t pud) #else +#define pud_valid(pud) false #defin...
c002bfe644a29ba600c571f2abba13a155a12dcd
Analyze and fix the following issue in the Linux kernel code: drm/xe: Use ordered WQ for G2H handler
Problem Details: System work queues are shared, use a dedicated work queue for G2H processing to avoid G2H processing getting block behind system tasks. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: <stable@vger.kernel.org> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index c62dbd6420db..8bbfa45798e2 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -120,6 +120,7 @@ static void guc_ct_fini(struct drm_device *drm, void *arg) { struct xe_guc_ct *ct = arg; + destr...
b4b4fda34e535756f9e774fb2d09c4537b7dfd1c
Analyze and fix the following issue in the Linux kernel code: ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()
Problem Details: In the following concurrency we will access the uninitialized rs->lock: ext4_fill_super ext4_register_sysfs // sysfs registered msg_ratelimit_interval_ms // Other processes modify rs->interval to // non-zero via msg_ratelimit_interval_ms ...
```diff diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f9b2b18374f3..f9a4a4e89dac 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5550,19 +5550,15 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) if (err) goto failed_mount6; - err = ext4_register_sysfs(sb); - if (err) -...
2d4b74a619de70e1b87683fa2fa23affa5315f7f
Analyze and fix the following issue in the Linux kernel code: drm/xe/ads: Use flexible-array
Problem Details: Zero-length arrays are deprecated and flexible arrays should be used instead: https://www.kernel.org/doc/html/v6.9-rc7/process/deprecated.html#zero-length-and-one-element-arrays Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@inria.fr> Closes: https://lore.kernel...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c index 6ad4c1a90a78..5339f8a49004 100644 --- a/drivers/gpu/drm/xe/xe_guc_ads.c +++ b/drivers/gpu/drm/xe/xe_guc_ads.c @@ -100,7 +100,7 @@ struct __guc_ads_blob { struct guc_engine_usage engine_usage; struct guc_um_init_params um_in...
02f6b0e1ec7e0e7d059dddc893645816552039da
Analyze and fix the following issue in the Linux kernel code: gpiolib: cdev: Fix use after free in lineinfo_changed_notify
Problem Details: The use-after-free issue occurs as follows: when the GPIO chip device file is being closed by invoking gpio_chrdev_release(), watched_lines is freed by bitmap_free(), but the unregistration of lineinfo_changed_nb notifier chain failed due to waiting write rwsem. Additionally, one of the GPIO chip's lin...
```diff diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index fea149ae7774..46a45093d4d0 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -2799,11 +2799,11 @@ static int gpio_chrdev_release(struct inode *inode, struct file *file) struct gpio_chardev_data *cdev = fil...
7be835694daebbb4adffbc461519081aa0cf28e1
Analyze and fix the following issue in the Linux kernel code: block: fix that util can be greater than 100%
Problem Details: util means the percentage that disk has IO, and theoretically it should not be greater than 100%. However, there is a gap for rq-based disk: io_ticks will be updated when rq is allocated, however, before such rq dispatch to driver, it will not be account as inflight from blk_mq_start_request() hence d...
```diff diff --git a/block/genhd.c b/block/genhd.c index 8f1163d2d171..7f39fbe60753 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -951,15 +951,10 @@ ssize_t part_stat_show(struct device *dev, struct device_attribute *attr, char *buf) { struct block_device *bdev = dev_to_bdev(dev); - struct request_queu...
99dc422335d8b2bd4d105797241d3e715bae90e9
Analyze and fix the following issue in the Linux kernel code: block: support to account io_ticks precisely
Problem Details: Currently, io_ticks is accounted based on sampling, specifically update_io_ticks() will always account io_ticks by 1 jiffies from bdev_start_io_acct()/blk_account_io_start(), and the result can be inaccurate, for example(HZ is 250): Test script: fio -filename=/dev/sda -bs=4k -rw=write -direct=1 -name=...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 8efee8faa4b6..8566bbd8aeba 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -984,10 +984,11 @@ void update_io_ticks(struct block_device *part, unsigned long now, bool end) unsigned long stamp; again: stamp = READ_ONCE(part->bd_stamp); - if (unli...
628bc3e5a1beae395b5b515998396c60559ed3a9
Analyze and fix the following issue in the Linux kernel code: l2tp: Support several sockets with same IP/port quadruple
Problem Details: Some l2tp providers will use 1701 as origin port and open several tunnels for the same origin and target. On the Linux side, this may mean opening several sockets, but then trafic will go to only one of them, losing the trafic for the tunnel of the other socket (or leaving it up to userland, consuming ...
```diff diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 8d21ff25f160..2ab45e3f48bf 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -794,6 +794,7 @@ static void l2tp_session_queue_purge(struct l2tp_session *session) static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff ...
d927752f287fe10965612541593468ffcfa9231f
Analyze and fix the following issue in the Linux kernel code: livepatch: Rename KLP_* to KLP_TRANSITION_*
Problem Details: The original macros of KLP_* is about the state of the transition. Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing description of klp transition state. Signed-off-by: Wardenjohn <zhangwarden@gmail.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Tested-by: Petr Mladek <pmladek@suse.com...
```diff diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index 9b9b38e89563..51a258c24ff5 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -18,9 +18,9 @@ #if IS_ENABLED(CONFIG_LIVEPATCH) /* task patch states */ -#define KLP_UNDEFINED -1 -#define KLP_UNPATCHED 0 -#define K...