id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
e94891641c21f607e4d6887bcd3beff882fcc483
Analyze and fix the following issue in the Linux kernel code: tracing: Fix ftrace_boot_snapshot command line logic
Problem Details: The kernel command line ftrace_boot_snapshot by itself is supposed to trigger a snapshot at the end of boot up of the main top level trace buffer. A ftrace_boot_snapshot=foo will do the same for an instance called foo that was created by trace_instance=foo,... The logic was broken where if ftrace_boot...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ed1d1093f5e9..4686473b8497 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -10393,19 +10393,20 @@ out: void __init ftrace_boot_snapshot(void) { +#ifdef CONFIG_TRACER_MAX_TRACE struct trace_array *tr; - if (snapshot_at_boot) {...
9d52727f8043cfda241ae96896628d92fa9c50bb
Analyze and fix the following issue in the Linux kernel code: tracing: Have tracing_snapshot_instance_cond() write errors to the appropriate instance
Problem Details: If a trace instance has a failure with its snapshot code, the error message is to be written to that instance's buffer. But currently, the message is written to the top level buffer. Worse yet, it may also disable the top level buffer and not the instance that had the issue. Link: https://lkml.kernel....
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 937e9676dfd4..ed1d1093f5e9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1149,22 +1149,22 @@ static void tracing_snapshot_instance_cond(struct trace_array *tr, unsigned long flags; if (in_nmi()) { - internal_trace_puts("***...
054fbf7ff8143d35ca7d3bb5414bb44ee1574194
Analyze and fix the following issue in the Linux kernel code: net: qrtr: correct types of trace event parameters
Problem Details: The arguments passed to the trace events are of type unsigned int, however the signature of the events used __le32 parameters. I may be missing the point here, but sparse flagged this and it does seem incorrect to me. net/qrtr/ns.c: note: in included file (through include/trace/trace_events.h, incl...
```diff diff --git a/include/trace/events/qrtr.h b/include/trace/events/qrtr.h index b1de14c3bb93..441132c67133 100644 --- a/include/trace/events/qrtr.h +++ b/include/trace/events/qrtr.h @@ -10,15 +10,16 @@ TRACE_EVENT(qrtr_ns_service_announce_new, - TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 po...
3ce9345580974863c060fa32971537996a7b2d57
Analyze and fix the following issue in the Linux kernel code: gve: Secure enough bytes in the first TX desc for all TCP pkts
Problem Details: Non-GSO TCP packets whose SKBs' linear portion did not include the entire TCP header were not populating the first Tx descriptor with as many bytes as the vNIC expected. This change ensures that all TCP packets populate the first descriptor with the correct number of bytes. Fixes: 893ce44df565 ("gve: ...
```diff diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h index 64eb0442c82f..005cb9dfe078 100644 --- a/drivers/net/ethernet/google/gve/gve.h +++ b/drivers/net/ethernet/google/gve/gve.h @@ -47,6 +47,8 @@ #define GVE_RX_BUFFER_SIZE_DQO 2048 +#define GVE_GQ_TX_MIN_PKT_DESC_BY...
a1865f2e7d10dde00d35a2122b38d2e469ae67ed
Analyze and fix the following issue in the Linux kernel code: netlink: annotate lockless accesses to nlk->max_recvmsg_len
Problem Details: syzbot reported a data-race in data-race in netlink_recvmsg() [1] Indeed, netlink_recvmsg() can be run concurrently, and netlink_dump() also needs protection. [1] BUG: KCSAN: data-race in netlink_recvmsg / netlink_recvmsg read to 0xffff888141840b38 of 8 bytes by task 23057 on cpu 0: netlink_recvmsg+...
```diff diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index c64277659753..f365dfdd672d 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1952,7 +1952,7 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, struct scm_cookie scm; struct sock *sk ...
e847c7675e19ef344913724dc68f83df31ad6a17
Analyze and fix the following issue in the Linux kernel code: ethtool: reset #lanes when lanes is omitted
Problem Details: If the number of lanes was forced and then subsequently the user omits this parameter, the ksettings->lanes is reset. The driver should then reset the number of lanes to the device's default for the specified speed. However, although the ksettings->lanes is set to 0, the mod variable is not set to tru...
```diff diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c index fab66c169b9f..20165e07ef90 100644 --- a/net/ethtool/linkmodes.c +++ b/net/ethtool/linkmodes.c @@ -270,11 +270,12 @@ static int ethnl_update_linkmodes(struct genl_info *info, struct nlattr **tb, "lanes configuration not supported by d...
ab5fb73ffa01072b4d8031cc05801fa1cb653bee
Analyze and fix the following issue in the Linux kernel code: ping: Fix potentail NULL deref for /proc/net/icmp.
Problem Details: After commit dbca1596bbb0 ("ping: convert to RCU lookups, get rid of rwlock"), we use RCU for ping sockets, but we should use spinlock for /proc/net/icmp to avoid a potential NULL deref mentioned in the previous patch. Let's go back to using spinlock there. Note we can convert ping sockets to use hli...
```diff diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 409ec2a1f95b..5178a3f3cb53 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -1089,13 +1089,13 @@ static struct sock *ping_get_idx(struct seq_file *seq, loff_t pos) } void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family) - __acqu...
0a78cf7264d29abeca098eae0b188a10aabc8a32
Analyze and fix the following issue in the Linux kernel code: raw: Fix NULL deref in raw_get_next().
Problem Details: Dae R. Jeong reported a NULL deref in raw_get_next() [0]. It seems that the repro was running these sequences in parallel so that one thread was iterating on a socket that was being freed in another netns. unshare(0x40060200) r0 = syz_open_procfs(0x0, &(0x7f0000002080)='net/raw\x00') socket$ine...
```diff diff --git a/include/net/raw.h b/include/net/raw.h index 2c004c20ed99..3af5289fdead 100644 --- a/include/net/raw.h +++ b/include/net/raw.h @@ -37,7 +37,7 @@ int raw_rcv(struct sock *, struct sk_buff *); struct raw_hashinfo { spinlock_t lock; - struct hlist_nulls_head ht[RAW_HTABLE_SIZE] ____cacheline_align...
d099f594ad5650e8d8232b5f31f5f90104e65def
Analyze and fix the following issue in the Linux kernel code: kallsyms: Disable preemption for find_kallsyms_symbol_value
Problem Details: Artem reported suspicious RCU usage [1]. The reason is that verifier calls find_kallsyms_symbol_value with preemption enabled which will trigger suspicious RCU usage warning in rcu_dereference_sched call. Disabling preemption in find_kallsyms_symbol_value and adding __find_kallsyms_symbol_value functi...
```diff diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index ab2376a1be88..bdc911dbcde5 100644 --- a/kernel/module/kallsyms.c +++ b/kernel/module/kallsyms.c @@ -442,7 +442,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, } /* Given a module and name of symbol, fin...
afeebf9f57a4965e0be90e4dc87f8f3a1417376d
Analyze and fix the following issue in the Linux kernel code: bpf: Undo strict enforcement for walking untagged fields.
Problem Details: The commit 6fcd486b3a0a ("bpf: Refactor RCU enforcement in the verifier.") broke several tracing bpf programs. Even in clang compiled kernels there are many fields that are not marked with __rcu that are safe to read and pass into helpers, but the verifier doesn't know that they're safe. Aggressively m...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index fd90ba498ccc..56f569811f70 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -4974,6 +4974,11 @@ static bool is_rcu_reg(const struct bpf_reg_state *reg) return reg->type & MEM_RCU; } +static void clear_trusted_flags(enum bpf_t...
91571a515d1bcdc280bb46423bb697ea7eb42ff3
Analyze and fix the following issue in the Linux kernel code: bpf: Teach verifier that certain helpers accept NULL pointer.
Problem Details: bpf_[sk|inode|task|cgrp]_storage_[get|delete]() and bpf_get_socket_cookie() helpers perform run-time check that sk|inode|task|cgrp pointer != NULL. Teach verifier about this fact and allow bpf programs to pass PTR_TO_BTF_ID | PTR_MAYBE_NULL into such helpers. It will be used in the subsequent patch tha...
```diff diff --git a/kernel/bpf/bpf_cgrp_storage.c b/kernel/bpf/bpf_cgrp_storage.c index d17d5b694668..d44fe8dd9732 100644 --- a/kernel/bpf/bpf_cgrp_storage.c +++ b/kernel/bpf/bpf_cgrp_storage.c @@ -224,7 +224,7 @@ const struct bpf_func_proto bpf_cgrp_storage_get_proto = { .gpl_only = false, .ret_type = RET_PTR_TO_...
8fc59c26d212c23d6fd5ad47a10651cf72d83b4a
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add RESOLVE_BTFIDS dependency to bpf_testmod.ko
Problem Details: bpf_testmod.ko sometimes fails to build from a clean checkout: BTF [M] linux/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.ko /bin/sh: 1: linux-build//tools/build/resolve_btfids/resolve_btfids: not found The reason is that RESOLVE_BTFIDS may not yet be built. Fix by adding a dependency....
```diff diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 4a8ef118fd9d..febd1dae6c88 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -201,7 +201,7 @@ $(OUTPUT)/sign-file: ../../../../scripts/sign-file.c $< -o $@ \ $(s...
24b18197184ac39bb8566fb82c0bf788bcd0d45b
Analyze and fix the following issue in the Linux kernel code: cxl/hdm: Extend DVSEC range register emulation for region enumeration
Problem Details: One motivation for mapping range registers to decoder objects is to use those settings for region autodiscovery. The need to map a region for devices programmed to use range registers is especially urgent now that the kernel no longer routes "Soft Reserved" ranges in the memory map to device-dax by de...
```diff diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index 9884b6d4d930..02cc2c38b44b 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -738,14 +738,20 @@ static int cxl_decoder_reset(struct cxl_decoder *cxld) return 0; } -static int cxl_setup_hdm_decoder_from_dvsec(struct cxl_por...
52cc48ad2a76a5fe82d239044d67944bbb928de6
Analyze and fix the following issue in the Linux kernel code: cxl/hdm: Limit emulation to the number of range registers
Problem Details: Recall that range register emulation seeks to treat the 2 potential range registers as Linux CXL "decoder" objects. The number of range registers can be 1 or 2, while HDM decoder ranges can include more than 2. Be careful not to confuse DVSEC range count with HDM capability decoder count. Commit to ra...
```diff diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index cc123996b1a4..9884b6d4d930 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -101,6 +101,42 @@ static int map_hdm_decoder_regs(struct cxl_port *port, void __iomem *crb, BIT(CXL_CM_CAP_CAP_ID_HDM)); } +static bool ...
9ff3eec958cf365857ae8a630237ece4f83bb337
Analyze and fix the following issue in the Linux kernel code: cxl/region: Move coherence tracking into cxl_region_attach()
Problem Details: Each time the contents of a given HPA are potentially changed in a cache incoherent manner the CXL core sets CXL_REGION_F_INCOHERENT to invalidate CPU caches before the region is used. Successful invocation of attach_target() indicates that DPA has been newly assigned to a given HPA in the dynamic reg...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 52bbf6268d5f..b2fd67fcebfb 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1674,6 +1674,7 @@ static int cxl_region_attach(struct cxl_region *cxlr, if (rc) goto err_decrement; p->state = CXL_CONFIG_ACTIV...
030f880342b875c7d714d06d3ca4058ae9f13fee
Analyze and fix the following issue in the Linux kernel code: cxl/region: Fix region setup/teardown for RCDs
Problem Details: RCDs (CXL memory devices that link train without VH capability and show up as root complex integrated endpoints), hide the presence of the link between the endpoint and the host-bridge. The CXL region setup/teardown paths assume that a link hop is present and go looking for at least one 'struct cxl_por...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 808f23ec4e2b..52bbf6268d5f 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -134,9 +134,13 @@ static int cxl_region_decode_reset(struct cxl_region *cxlr, int count) struct cxl_endpoint_decoder *cxled = p->target...
d35b495ddf92c964eedf2ac86fdbf88dc3e5cbc9
Analyze and fix the following issue in the Linux kernel code: cxl/port: Fix find_cxl_root() for RCDs and simplify it
Problem Details: The find_cxl_root() helper is used to lookup root decoders and other CXL platform topology information for a given endpoint. It turns out that for RCDs it has never worked. The result of find_cxl_root(&cxlmd->dev) is always NULL for the RCH topology case because it expects to find a cxl_port at the hos...
```diff diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c index c2e4b1093788..f8c38d997252 100644 --- a/drivers/cxl/core/pmem.c +++ b/drivers/cxl/core/pmem.c @@ -62,9 +62,9 @@ static int match_nvdimm_bridge(struct device *dev, void *data) return is_cxl_nvdimm_bridge(dev); } -struct cxl_nvdimm_bridge *...
b70c2cf95ee1ca2806cb7191504920f8f5b4454e
Analyze and fix the following issue in the Linux kernel code: cxl/hdm: Skip emulation when driver manages mem_enable
Problem Details: If the driver is allowed to enable memory operation itself then it can also turn on HDM decoder support at will. With this the second call to cxl_setup_hdm_decoder_from_dvsec(), when an HDM decoder is not committed, is not needed. Fixes: b777e9bec960 ("cxl/hdm: Emulate HDM decoder from DVSEC range re...
```diff diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index 038f88eae226..cc123996b1a4 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -717,19 +717,29 @@ static int cxl_setup_hdm_decoder_from_dvsec(struct cxl_port *port, return 0; } -static bool should_emulate_decoders(struct cxl...
82f0832af26a30ae5f21b335c5f68b538e710c29
Analyze and fix the following issue in the Linux kernel code: cxl/hdm: Fix double allocation of @cxlhdm
Problem Details: devm_cxl_setup_emulated_hdm() reallocates an instance of @cxlhdm that was already allocated at the start of devm_cxl_setup_hdm(). Only one is needed and devm_cxl_setup_emulated_hdm() does not do enough to warrant being an explicit helper. Fixes: 4474ce565ee4 ("cxl/hdm: Create emulated cxl_hdm for devi...
```diff diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index 45deda18ed32..038f88eae226 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -101,27 +101,6 @@ static int map_hdm_decoder_regs(struct cxl_port *port, void __iomem *crb, BIT(CXL_CM_CAP_CAP_ID_HDM)); } -static struc...
da6ea0b050fa720302b56fbb59307e7c7531a342
Analyze and fix the following issue in the Linux kernel code: f2fs: fix null pointer panic in tracepoint in __replace_atomic_write_block
Problem Details: We got a kernel panic if old_addr is NULL. https://bugzilla.kernel.org/show_bug.cgi?id=217266 BUG: kernel NULL pointer dereference, address: 0000000000000000 Call Trace: <TASK> f2fs_commit_atomic_write+0x619/0x990 [f2fs a1b985b80f5babd6f3ea778384908880812bfa43] __f2fs_ioctl+0xd8e/0x4080 [f2fs ...
```diff diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index f88828987924..45128694eefa 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -257,7 +257,7 @@ retry: f2fs_put_dnode(&dn); trace_f2fs_replace_atomic_write_block(inode, F2FS_I(inode)->cow_inode, - index, *old_addr, new_addr, recover); + ...
144f1cd40bf91fb3ac1d41806470756ce774f389
Analyze and fix the following issue in the Linux kernel code: f2fs: fix iostat lock protection
Problem Details: Made iostat lock irq safe to avoid potentinal deadlock. Deadlock scenario: f2fs_attr_store -> f2fs_sbi_store -> _sbi_store -> spin_lock(sbi->iostat_lock) <interrupt request> -> scsi_end_request -> bio_endio -> f2fs_dio_read_end_io -> f2fs_update_iostat -> spin_lock_irqsav...
```diff diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..fefc6b728590 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -575,9 +575,9 @@ out: if (!strcmp(a->attr.name, "iostat_period_ms")) { if (t < MIN_IOSTAT_PERIOD_MS || t > MAX_IOSTAT_PERIOD_MS) return -EINVAL; - spin_lock(&sbi->iosta...
f26aaee60a9f14035c1a659b5b00a6c8767b4126
Analyze and fix the following issue in the Linux kernel code: f2fs: fix align check for npo2
Problem Details: Fix alignment check to be correct in npo2 as well Signed-off-by: Yohan Joung <yohan.joung@sk.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 61394346febe..f88828987924 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1845,6 +1845,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi, sector_t sector, nr_sects; block_t lblkstart = blkstart; int devi = 0; + u64 remai...
e0e3aca997f7f2b9b5b5e27f878e9bf5b573720a
Analyze and fix the following issue in the Linux kernel code: clk: mediatek: Use right match table, include mod_devicetable
Problem Details: This is copy/pasta that breaks modular builds. Fix the match table to use the right pointer, or the right device table type. And while we're including the header, fix the order to be linux, dt-bindings, and finally local. Cc: Garmin.Chang <Garmin.Chang@mediatek.com> Cc: Chen-Yu Tsai <wenst@chromium.or...
```diff diff --git a/drivers/clk/mediatek/clk-mt8188-adsp_audio26m.c b/drivers/clk/mediatek/clk-mt8188-adsp_audio26m.c index b3c31ffff931..808f2ad3b7ee 100644 --- a/drivers/clk/mediatek/clk-mt8188-adsp_audio26m.c +++ b/drivers/clk/mediatek/clk-mt8188-adsp_audio26m.c @@ -4,10 +4,12 @@ * Author: Garmin Chang <garmin.ch...
6f1ccbf07453eb1ee6bb24d6b531b88dd44ad229
Analyze and fix the following issue in the Linux kernel code: drm/vblank: Fix for drivers that do not drm_vblank_init()
Problem Details: This should fix a crash that was reported on ast (and possibly other drivers which do not initialize vblank). fbcon: Taking over console Unable to handle kernel NULL pointer dereference at virtual address 0000000000000074 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (cur...
```diff diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 299fa2a19a90..877e2067534f 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -996,10 +996,16 @@ EXPORT_SYMBOL(drm_crtc_vblank_count_and_time); int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime...
0b7cc2547d5329b996b6687e04a82ed4eef1adda
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Remove "record_acc_track" in __tdp_mmu_set_spte()
Problem Details: Remove bool parameter "record_acc_track" from __tdp_mmu_set_spte() and refactor the code. This variable is always set to true by its caller. Remove single and double underscore prefix from tdp_mmu_set_spte() related APIs: 1. Change __tdp_mmu_set_spte() to tdp_mmu_set_spte() 2. Change _tdp_mmu_set_spte...
```diff diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index cdfb67ef5800..9649e0fe4302 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -695,7 +695,7 @@ static inline int tdp_mmu_zap_spte_atomic(struct kvm *kvm, /* - * __tdp_mmu_set_spte - Set a TDP MMU SPTE and ha...
891f115960682b84440bdfb1ea72ab2824206db7
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Bypass __handle_changed_spte() when aging TDP MMU SPTEs
Problem Details: Drop everything except the "tdp_mmu_spte_changed" tracepoint part of __handle_changed_spte() when aging SPTEs in the TDP MMU, as clearing the accessed status doesn't affect the SPTE's shadow-present status, whether or not the SPTE is a leaf, or change the PFN. I.e. none of the functional updates handl...
```diff diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index 29bb97ff266e..cdfb67ef5800 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -1275,8 +1275,8 @@ static bool age_gfn_range(struct kvm *kvm, struct tdp_iter *iter, iter->level); } - __handle_changed_sp...
1e0f42985ffad5c60e7a0a627405e1ff00208289
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Bypass __handle_changed_spte() when clearing TDP MMU dirty bits
Problem Details: Drop everything except marking the PFN dirty and the relevant tracepoint parts of __handle_changed_spte() when clearing the dirty status of gfns in the TDP MMU. Clearing only the Dirty (or Writable) bit doesn't affect the SPTEs shadow-present status, whether or not the SPTE is a leaf, or change the SP...
```diff diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index 950c5d23ecee..467931c43968 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -517,7 +517,6 @@ static void handle_removed_pt(struct kvm *kvm, tdp_ptep_t pt, bool shared) * threads that might be modifying SP...
452c165e3597691a953e3f4c4c0442c41c8e02f4
Analyze and fix the following issue in the Linux kernel code: soc: qcom: icc-bwmon: Remove unused struct member
Problem Details: bwmon->regmap was never used, as the regmap for bwmon is registered through devres and accessed through bwmon's regmap_field members. Remove it Fixes: ec63dcd3c863 ("soc: qcom: icc-bwmon: use regmap and prepare for BWMON v5") Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off...
```diff diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c index d07be3700db6..d45caf512e2d 100644 --- a/drivers/soc/qcom/icc-bwmon.c +++ b/drivers/soc/qcom/icc-bwmon.c @@ -164,7 +164,6 @@ struct icc_bwmon { const struct icc_bwmon_data *data; int irq; - struct regmap *regmap; struct regmap...
ec57cbce1a6d9384f8ac1ff966b204dc262f4927
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: apq8096-db820c: drop unit address from PMI8994 regulator
Problem Details: The PMIC regulators are not supposed to have unit addresses. Fixes: 2317b87a2a6f ("arm64: dts: qcom: db820c: Add vdd_gfx and tie it into mmcc") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <ande...
```diff diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts index c965a8c81d9b..b599909c4463 100644 --- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts +++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts @@ -703,8 +703,7 @@ &pmi8994_spmi_regulators { vdd_s2-supply = <&v...
7a202df0f3eed006e4a9e7c06d62cf67be56c14c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8994-msft-lumia-octagon: drop unit address from PMI8994 regulator
Problem Details: The PMIC regulators are not supposed to have unit addresses. Fixes: 60b214effb80 ("arm64: dts: qcom: msm8994-octagon: Configure regulators") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <anderss...
```diff diff --git a/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi b/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi index e9480c4208f6..2861bcdf87b7 100644 --- a/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi @@ -540,8 +540,7 ...
3555dd528ba9c08d6ccd56239c695dbeac3b63e3
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8994-kitakami: drop unit address from PMI8994 regulator
Problem Details: The PMIC regulators are not supposed to have unit addresses. Fixes: e9783584c9b7 ("arm64: dts: qcom: msm8994-kitakami: Add VDD_GFX regulator") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <ander...
```diff diff --git a/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi b/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi index 3ceb86b06209..26059f861250 100644 --- a/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi @@ -173,8...
97b4fdc6b82d6d5cfb92a9b164540278720fb700
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: msm8998-oneplus-cheeseburger: revert "fix backlight pin function"
Problem Details: This reverts commit 46546f28825cf3a5ef6873b9cf947cd85c8a7258 because it mistakenly took PMIC pinctrl/GPIO as TLMM. The TLMM pinctrl uses "gpio" function, but PMIC uses "normal", so original code was correct: msm8998-oneplus-cheeseburger.dtb: pmic@2: gpio@c000:button-backlight-state: 'oneOf' conditi...
```diff diff --git a/arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts b/arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts index d36b36af49d0..fac8b3510cd3 100644 --- a/arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts +++ b/arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts @@ -34,7 +34,...
24f39eec6a70768e7c2eb2f3d8158f45050ff75a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc7180-trogdor-pazquel: correct trackpad supply
Problem Details: The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other boards which use elan,ekth3000 with valid VCC: sc7180-trogdor-pazquel360-lte.dtb: trackpad@15: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: fb69f6adaf88 ("arm64: dts: qcom: sc7180: Add pazquel dts file...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi index d06cc4ea3375..8823edbb4d6e 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi @@ -39,7 +39,7 @@ interrupt-pa...
52e2996f253d82520011340d40dbc1c76ea79208
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc7180-trogdor-lazor: correct trackpad supply
Problem Details: The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other boards which use elan,ekth3000 with valid VCC: sc7180-trogdor-lazor-limozeen-nots-r4.dtb: trackpad@2c: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: 2c26adb8dbab ("arm64: dts: qcom: Add sc7180-lazor-lim...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts index 850776c5323d..70d5a7aa8873 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazo...
de88b1759b35086d5e63736fb604ea2d06486b1a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc7280-herobrine-villager: correct trackpad supply
Problem Details: The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other Herobrine boards which use elan,ekth3000 with valid VCC: sc7280-herobrine-villager-r1-lte.dtb: trackpad@2c: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: ee2a62116015 ("arm64: dts: qcom: sc7280: Add dev...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi index 818d4046d2c7..38c8a3679fcb 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi @@ -33,7 +33,7 @@ ap_...
0d8d77228aa1efec69f92ef92e1cd9270c1151c4
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sda660-inforce: correct key node name
Problem Details: gpio-key bindings expect children to be named with generic prefix: sda660-inforce-ifc6560.dtb: gpio-keys: 'volup' does not match any of the regexes: ... Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn And...
```diff diff --git a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts index 7c81918eee66..7459525d9982 100644 --- a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts +++ b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts @@ -29,7 +29,7 @@ gpio-keys { co...
d27580366db0fb6fa1f6b6ca94bc89dcbf9fd496
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: Add Henan Yiming Technology Co., Ltd.
Problem Details: Henan Yiming Technology Co., Ltd. was established in 2021. The business scope of the company includes: communication equipment (excluding radio control equipment). Link: https://gw.yimingkeji.net Signed-off-by: Yang Xiwen <forbidden405@foxmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@li...
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index ed64e06ecca4..d6ec61904d6b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1528,6 +1528,8 @@ pat...
d82dcd9e21b77d338dc4875f3d4111f0db314a7c
Analyze and fix the following issue in the Linux kernel code: reiserfs: Add security prefix to xattr name in reiserfs_security_write()
Problem Details: Reiserfs sets a security xattr at inode creation time in two stages: first, it calls reiserfs_security_init() to obtain the xattr from active LSMs; then, it calls reiserfs_security_write() to actually write that xattr. Unfortunately, it seems there is a wrong expectation that LSMs provide the full xat...
```diff diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c index 6bffdf9a4fd2..6e0a099dd788 100644 --- a/fs/reiserfs/xattr_security.c +++ b/fs/reiserfs/xattr_security.c @@ -95,11 +95,15 @@ int reiserfs_security_write(struct reiserfs_transaction_handle *th, struct inode *inode, stru...
9da667e50c7e62266f3c2f8ad57b32fca40716b1
Analyze and fix the following issue in the Linux kernel code: vdpa_sim_net: complete the initialization before register the device
Problem Details: Initialization must be completed before calling _vdpa_register_device() since it can connect the device to the vDPA bus, so requests can arrive after that call. So for example vdpasim_net_work(), which uses the net->*_stats variables, can be scheduled before they are initialized. Let's move _vdpa_reg...
```diff diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c index 862f405362de..dfe2ce341803 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c @@ -466,16 +466,21 @@ static int vdpasim_net_dev_add(struct vdpa_mgmt_dev *mdev, const char *name...
c0d0ce9b5a851895f34fd401c9dddc70616711a4
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Remove a duplicate definition of VMCB_AVIC_APIC_BAR_MASK
Problem Details: VMCB_AVIC_APIC_BAR_MASK is defined twice with the same value in svm.h, which is meaningless. Delete the duplicate one. Fixes: 391503528257 ("KVM: x86: SVM: move avic definitions from AMD's spec to svm.h") Signed-off-by: Xinghui Li <korantli@tencent.com> Reviewed-by: Like Xu <likexu@tencent.com> Link: ...
```diff diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 25306a420b84..e7c7379d6ac7 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -287,7 +287,6 @@ static_assert((AVIC_MAX_PHYSICAL_ID & AVIC_PHYSICAL_MAX_INDEX_MASK) == AVIC_MAX_ static_assert((X2AVIC_MAX_PHYSICAL_...
fb5015bc8b733323b58f015b88e4f316010ec856
Analyze and fix the following issue in the Linux kernel code: docs: kvm: x86: Fix broken field list
Problem Details: Add a missing ":" to fix a broken field list. Signed-off-by: Takahiro Itazuri <itazur@amazon.com> Fixes: ba7bb663f554 ("KVM: x86: Provide per VM capability for disabling PMU virtualization") Message-Id: <20230331093116.99820-1-itazur@amazon.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
```diff diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 62de0768d6aa..a5c803f39832 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -8296,11 +8296,11 @@ ENOSYS for the others. 8.35 KVM_CAP_PMU_CAPABILITY --------------------------- -:Capability K...
65b6b046e2b4cec2bd9d4849324d319122d6f2b2
Analyze and fix the following issue in the Linux kernel code: of: address: Fix documented return value of of_pci_range_to_resource()
Problem Details: of_pci_range_to_resource() returns a negative instead of a positive error code. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/bcdaa9332e9c6dfa27af68d79fda121eac2975dc.1680248888.git.geert+renesas@glider.be Signed-off-by: Rob Herring <robh@kernel.org>
```diff diff --git a/drivers/of/address.c b/drivers/of/address.c index 3fda1f33e09c..b8a43fd4456b 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -213,7 +213,7 @@ EXPORT_SYMBOL_GPL(of_pci_address_to_resource); * @res: pointer to a valid resource that will be updated to * reflect the val...
dc8ea9204b242cd93e63585396ac7d13f622802d
Analyze and fix the following issue in the Linux kernel code: dt-bindings: move cache controller bindings to a cache directory
Problem Details: There's a bunch of bindings for (mostly l2) cache controllers scattered to the four winds, move them to a common directory. I renamed the freescale l2cache.txt file, as while that might make sense when the parent dir is fsl, it's confusing after the move. The two Marvell bindings have had a "marvell," ...
```diff diff --git a/Documentation/devicetree/bindings/memory-controllers/baikal,bt1-l2-ctl.yaml b/Documentation/devicetree/bindings/cache/baikal,bt1-l2-ctl.yaml similarity index 95% rename from Documentation/devicetree/bindings/memory-controllers/baikal,bt1-l2-ctl.yaml rename to Documentation/devicetree/bindings/cache...
41d7e4f257f328d0131c46fb6092b08087721efd
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: document Novatek
Problem Details: Document Novatek vendor prefix already used for Novatek nt36672a panel. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230326155719.91780-1-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index ed64e06ecca4..72c32f32a204 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -933,6 +933,8 @@ patte...
83720209961f5cfed17214bc78978a02e3414a41
Analyze and fix the following issue in the Linux kernel code: perf map: Move map list node into symbol
Problem Details: Using a perf map as a list node is only done in symbol. Move the list_node struct into symbol as a single pointer to the map. This makes reference count behavior more obvious and easy to check. Committer notes: Some changes to reduce the number of lines touched by keeping, for instance, the 'new_map'...
```diff diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 3dcfe06db6b3..2879cae05ee0 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h @@ -16,10 +16,7 @@ struct maps; struct machine; struct map { - union { - struct rb_node rb_node; - struct list_head node; - }; + struct rb_node rb_nod...
cfea9bc78bc3f99abcef3efbe7631d3ed3b70406
Analyze and fix the following issue in the Linux kernel code: s390/stack: set lowcore kernel stack pointer early
Problem Details: Make sure the lowcore kernel stack pointer reflects the kernel stack of the current task as early as possible, instead of having a NULL pointer there. Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
```diff diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index 82399b4b5f8a..f67982f562db 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S @@ -25,6 +25,7 @@ ENTRY(startup_continue) larl %r14,init_task stg %r14,__LC_CURRENT larl %r15,init_thread_union+STACK_INIT_OFFSET + stg...
7f65d18329a2546ce6f64ac6bf141c38b15c2ab3
Analyze and fix the following issue in the Linux kernel code: s390/uaccess: rename tmp1 and tmp2 variables
Problem Details: Rename tmp1 and tmp2 variables to more meaningful val (for value) and rem (for remainder). Except for debug sections the output of "objdump -Dr" of the uaccess object file is identical before/after this change. Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-off-by: Heiko Carstens...
```diff diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c index 7f33eb4dffba..a89f6639818a 100644 --- a/arch/s390/lib/uaccess.c +++ b/arch/s390/lib/uaccess.c @@ -34,7 +34,7 @@ void debug_user_asce(int exit) static unsigned long raw_copy_from_user_key(void *to, const void __user *from, unsigned l...
4e0b0ad45c6616d85564cb27dbae04a962d068bd
Analyze and fix the following issue in the Linux kernel code: s390/uaccess: rename/sort labels in inline assemblies
Problem Details: Rename and sort labels in uaccess inline assemblies to increase readability. In addition have only one EX_TABLE entry per line - also to increase readability. Except for debug sections the output of "objdump -Dr" of the uaccess object file is identical before/after this change. Reviewed-by: Gerald Sc...
```diff diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c index d0bbdcbd7baf..4dec9fc12f73 100644 --- a/arch/s390/lib/uaccess.c +++ b/arch/s390/lib/uaccess.c @@ -46,7 +46,7 @@ static unsigned long raw_copy_from_user_key(void *to, const void __user *from, asm volatile( " lr 0,%[spec]\n" "0: mvcos 0(...
10679e4d9848a04694eb99ec7390a6585d1b7ca9
Analyze and fix the following issue in the Linux kernel code: s390/uaccess: use symbolic names for inline assembly operands
Problem Details: Improve readability of the uaccess inline assemblies by using symbolic names for all input and output operands. Except for debug sections the output of "objdump -Dr" of the uaccess object file is identical before/after this change. Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-o...
```diff diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c index d44214072779..0ebd522ccd6f 100644 --- a/arch/s390/lib/uaccess.c +++ b/arch/s390/lib/uaccess.c @@ -44,25 +44,26 @@ static unsigned long raw_copy_from_user_key(void *to, const void __user *from, tmp1 = -4096UL; asm volatile( - " lr 0,...
dc67c7837a832952459c4f7829e89b9d8d15f420
Analyze and fix the following issue in the Linux kernel code: perf jit: Fix a few memory leaks
Problem Details: As reported by leak sanitizer. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Brian Robbins <brianrob@linux.microsoft.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc:...
```diff diff --git a/tools/perf/util/genelf_debug.c b/tools/perf/util/genelf_debug.c index dd40683bd4c0..8786c366566e 100644 --- a/tools/perf/util/genelf_debug.c +++ b/tools/perf/util/genelf_debug.c @@ -87,6 +87,12 @@ buffer_ext_init(struct buffer_ext *be) be->max_sz = 0; } +static void +buffer_ext_exit(struct buf...
66c9598bd8916c6c1319d0100ac916cac89d4b0e
Analyze and fix the following issue in the Linux kernel code: perf tools: Fix a asan issue in parse_events_multi_pmu_add()
Problem Details: In the parse_events_multi_pmu_add() it passes the 'config' variable twice to parse_events_term__num() - one for config and another for loc_term. I'm not sure about the second one as it's converted to YYLTYPE variable. Asan reports it like below: In function ‘parse_events_term__num’, inlined ...
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index cc8e8766ca30..0010e5e0ee68 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1601,7 +1601,7 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state, if (parse_events_term__n...
00462d8eaca4eb48e4c07a9a9b49cea2a871fd35
Analyze and fix the following issue in the Linux kernel code: perf list: Use relative path for tracepoint scan
Problem Details: Committer notes: Added missing #include <unistd.h> for the close() prototype to fix this on Alma Linux 8: 1 21.54 almalinux:8 : FAIL gcc version 8.5.0 20210514 (Red Hat 8.5.0-16) (GCC) util/print-events.c: In function 'print_tracepoint_events': util/print-events.c:103:...
```diff diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c index 62e9ea7dcf40..386b1ab0b60e 100644 --- a/tools/perf/util/print-events.c +++ b/tools/perf/util/print-events.c @@ -4,7 +4,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <fcntl.h> #include <sys/param.h>...
13fcbcb97d05be14c5ada46b5b6cf71f8c96ad50
Analyze and fix the following issue in the Linux kernel code: drm/tegra: dc: Remove set but unused variable 'state'
Problem Details: Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/tegra/dc.c: In function ‘tegra_crtc_calculate_memory_bandwidth’: drivers/gpu/drm/tegra/dc.c:2384:38: warning: variable ‘old_state’ set but not used [-Wunused-but-set-variable] Cc: Thierry Reding <thierry.reding@gmail.com> Cc: David Ai...
```diff diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 53630b673029..6e78416e64b0 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -2381,7 +2381,6 @@ static int tegra_crtc_calculate_memory_bandwidth(struct drm_crtc *crtc, const struct tegra_plane_state *tegra_sta...
f75d19827b731c6f24930ef77e5a46cf2242bc68
Analyze and fix the following issue in the Linux kernel code: drm/tegra: Allow compile test on !ARM v2
Problem Details: This compile tests on x86 just perfectly fine. v2: fix missing include complained by kernel test robot Signed-off-by: Christian König <christian.koenig@amd.com> CC: Thierry Reding <thierry.reding@gmail.com> CC: Jonathan Hunter <jonathanh@nvidia.com> CC: linux-tegra@vger.kernel.org Signed-off-by: Thie...
```diff diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig index c36323f1c7e6..56453ca277c2 100644 --- a/drivers/gpu/drm/tegra/Kconfig +++ b/drivers/gpu/drm/tegra/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config DRM_TEGRA tristate "NVIDIA Tegra DRM" - depends on ARCH_TE...
656e9007ef5862746cdf7ac16267c8e06e7b0989
Analyze and fix the following issue in the Linux kernel code: asm-generic: avoid __generic_cmpxchg_local warnings
Problem Details: Code that passes a 32-bit constant into cmpxchg() produces a harmless sparse warning because of the truncation in the branch that is not taken: fs/erofs/zdata.c: note: in included file (through /home/arnd/arm-soc/arch/arm/include/asm/cmpxchg.h, /home/arnd/arm-soc/arch/arm/include/asm/atomic.h, /home/a...
```diff diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 04b8be9f1a77..e271d6708c87 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h @@ -130,7 +130,7 @@ ATOMIC_OP(xor, ^) #define arch_atomic_read(v) READ_ONCE((v)->counter) #define arch_atomic_set(v, i) WRI...
d564fa1ff19e893e2971d66e5c8f49dc1cdc8ffc
Analyze and fix the following issue in the Linux kernel code: asm-generic/io.h: suppress endianness warnings for readq() and writeq()
Problem Details: Commit c1d55d50139b ("asm-generic/io.h: Fix sparse warnings on big-endian architectures") missed fixing the 64-bit accessors. Arnd explains in the attached link why the casts are necessary, even if __raw_readq() and __raw_writeq() do not take endian-specific types. Link: https://lore.kernel.org/lkml/...
```diff diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 4c44a29b5e8e..d78c3056c98f 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -236,7 +236,7 @@ static inline u64 readq(const volatile void __iomem *addr) log_read_mmio(64, addr, _THIS_IP_, _RET_IP_); __io_br(); - v...
e81625218bf7986ba1351a98c43d346b15601d26
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV2/3 to protected VMs
Problem Details: The existing pKVM code attempts to advertise CSV2/3 using values initialized to 0, but never set. To advertise CSV2/3 to protected guests, pass the CSV2/3 values to hyp when initializing hyp's view of guests' ID_AA64PFR0_EL1. Similar to non-protected KVM, these are system-wide, rather than per cpu, fo...
```diff diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 3bd732eaf087..e850aeccebb9 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -1889,9 +1889,33 @@ static int __init do_pkvm_init(u32 hyp_va_bits) return ret; } +static u64 get_hyp_id_aa64pfr0_el1(void) +{ + /* + * Track whether th...
cefc0a599b19d8dd0e26d0b2e43311bae7530ca1
Analyze and fix the following issue in the Linux kernel code: srcu: Fix long lines in srcu_funnel_gp_start()
Problem Details: This commit creates an srcu_usage pointer named "sup" as a shorter synonym for the "ssp->srcu_sup" that was bloating several lines of code. Cc: Christoph Hellwig <hch@lst.de> Tested-by: Sachin Sant <sachinp@linux.ibm.com> Tested-by: "Zhang, Qiang1" <qiang1.zhang@intel.com> Tested-by: Joel Fernandes (G...
```diff diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index f661a0f6bc0d..a887cfc89894 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -1004,9 +1004,10 @@ static void srcu_funnel_gp_start(struct srcu_struct *ssp, struct srcu_data *sdp, struct srcu_node *snp; struct srcu_node *snp_leaf...
6c366522e10f2b5e916b3f08ac042df1a1cd512a
Analyze and fix the following issue in the Linux kernel code: srcu: Fix long lines in srcu_gp_end()
Problem Details: This commit creates an srcu_usage pointer named "sup" as a shorter synonym for the "ssp->srcu_sup" that was bloating several lines of code. Cc: Christoph Hellwig <hch@lst.de> Tested-by: Sachin Sant <sachinp@linux.ibm.com> Tested-by: "Zhang, Qiang1" <qiang1.zhang@intel.com> Tested-by: Joel Fernandes (G...
```diff diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 11a08201ca0a..f661a0f6bc0d 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -862,28 +862,29 @@ static void srcu_gp_end(struct srcu_struct *ssp) unsigned long sgsne; struct srcu_node *snp; int ss_state; + struct srcu_usage *s...
5ff8319f07db11c3b9347ce1dc0a6d951ae96d29
Analyze and fix the following issue in the Linux kernel code: srcu: Fix long lines in cleanup_srcu_struct()
Problem Details: This commit creates an srcu_usage pointer named "sup" as a shorter synonym for the "ssp->srcu_sup" that was bloating several lines of code. Cc: Christoph Hellwig <hch@lst.de> Tested-by: Sachin Sant <sachinp@linux.ibm.com> Tested-by: "Zhang, Qiang1" <qiang1.zhang@intel.com> Tested-by: Joel Fernandes (G...
```diff diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 9699bcab7215..11a08201ca0a 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -644,12 +644,13 @@ static unsigned long srcu_get_delay(struct srcu_struct *ssp) void cleanup_srcu_struct(struct srcu_struct *ssp) { int cpu; + struct ...
eabe7625f053050e4cecbbe98bd944f7e8eb14f5
Analyze and fix the following issue in the Linux kernel code: srcu: Fix long lines in srcu_get_delay()
Problem Details: This commit creates an srcu_usage pointer named "sup" as a shorter synonym for the "ssp->srcu_sup" that was bloating several lines of code. Tested-by: Sachin Sant <sachinp@linux.ibm.com> Tested-by: "Zhang, Qiang1" <qiang1.zhang@intel.com> Cc: Christoph Hellwig <hch@lst.de> Tested-by: Joel Fernandes (G...
```diff diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index f9dd6ed5503e..9699bcab7215 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -616,17 +616,18 @@ static unsigned long srcu_get_delay(struct srcu_struct *ssp) unsigned long gpstart; unsigned long j; unsigned long jbase = SRCU_I...
a7bf4d7c16c1cf9753873879630a5d5169eb3206
Analyze and fix the following issue in the Linux kernel code: srcu: Check for readers at module-exit time
Problem Details: If a given statically allocated in-module srcu_struct structure was ever used for updates, srcu_module_going() will invoke cleanup_srcu_struct() at module-exit time. This will check for the error case of SRCU readers persisting past module-exit time. On the other hand, if this srcu_struct structure n...
```diff diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 169a6513b739..f9dd6ed5503e 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -1911,7 +1911,8 @@ static void srcu_module_going(struct module *mod) if (!rcu_seq_state(smp_load_acquire(&ssp->srcu_sup->srcu_gp_seq_needed)) && ...
95433f7263011e0e6e83caef85d98896dd99cab7
Analyze and fix the following issue in the Linux kernel code: srcu: Begin offloading srcu_struct fields to srcu_update
Problem Details: The current srcu_struct structure is on the order of 200 bytes in size (depending on architecture and .config), which is much better than the old-style 26K bytes, but still all too inconvenient when one is trying to achieve good cache locality on a fastpath involving SRCU readers. However, only a few ...
```diff diff --git a/include/linux/notifier.h b/include/linux/notifier.h index aef88c2d1173..2aba75145144 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -73,6 +73,9 @@ struct raw_notifier_head { struct srcu_notifier_head { struct mutex mutex; +#ifdef CONFIG_TREE_SRCU + struct srcu_usage sr...
83c911dc5e0e8e6eaa6431c06972a8f159bfe2fc
Analyze and fix the following issue in the Linux kernel code: ice: Reset FDIR counter in FDIR init stage
Problem Details: Reset the FDIR counters when FDIR inits. Without this patch, when VF initializes or resets, all the FDIR counters are not cleaned, which may cause unexpected behaviors for future FDIR rule create (e.g., rule conflict). Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF") Signed-off-by: Junfeng G...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c index 4d007d8c2540..daa6a1e894cf 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c @@ -541,6 +541,21 @@ static void ice_vc_f...
b4a01ace20f5c93c724abffc0a83ec84f514b98d
Analyze and fix the following issue in the Linux kernel code: ice: fix wrong fallback logic for FDIR
Problem Details: When adding a FDIR filter, if ice_vc_fdir_set_irq_ctx returns failure, the inserted fdir entry will not be removed and if ice_vc_fdir_write_fltr returns failure, the fdir context info for irq handler will not be cleared which may lead to inconsistent or memory leak issue. This patch refines failure cas...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c index 5fd75e75772e..4d007d8c2540 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c @@ -1871,7 +1871,7 @@ int ice_vc_add_fdir...
2b4be54830681cc023877d3b33a9b7ae9122e551
Analyze and fix the following issue in the Linux kernel code: rcu-tasks: Fix warning for unused tasks_rcu_exit_srcu
Problem Details: The tasks_rcu_exit_srcu variable is used only by kernels built with CONFIG_TASKS_RCU=y, but is defined for all kernesl with CONFIG_TASKS_RCU_GENERIC=y. Therefore, in kernels built with CONFIG_TASKS_RCU_GENERIC=y but CONFIG_TASKS_RCU=n, this gives a "defined but not used" warning. This commit therefor...
```diff diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index bfb5e1549f2b..185358c2f08d 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -136,8 +136,10 @@ static struct rcu_tasks rt_name = \ .kname = #rt_name, \ } +#ifdef CONFIG_TASKS_RCU /* Track exiting tasks in order to allow them...
49aba1c5896b745a093318914f3fd128f5c9191e
Analyze and fix the following issue in the Linux kernel code: EDAC/amd64: Fix indentation in umc_determine_edac_cap()
Problem Details: Use consistent indentation to improve the readability and fix: drivers/edac/amd64_edac.c:1279 umc_determine_edac_cap() warn: inconsistent indenting Fixes: f6a4b4a1aa16 ("EDAC/amd64: Split determine_edac_cap() into dct/umc functions") Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:...
```diff diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 85b460b67838..b55129425c81 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -1276,19 +1276,19 @@ static unsigned long umc_determine_edac_cap(struct amd64_pvt *pvt) u8 i, umc_en_mask = 0, dimm_ecc_en_mask = 0; u...
f0417e72add5aed5997092b6eb76298290d866c9
Analyze and fix the following issue in the Linux kernel code: vdpa/mlx5: Add and remove debugfs in setup/teardown driver
Problem Details: The right place to add the debugfs create is in setup_driver() and remove it in teardown_driver(). Current code adds the debugfs when creating the device but resetting a device will remove the debugfs subtree and subsequent set_driver will not be able to create the files since the debugfs pointer is N...
```diff diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 520646ae7fa0..195963b82b63 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -2467,10 +2467,11 @@ static int setup_driver(struct mlx5_vdpa_dev *mvdev) err = 0; goto out; } + m...
e8c5d45f82ce0c238a4817739892fe8897a3dcc3
Analyze and fix the following issue in the Linux kernel code: dm verity: fix error handling for check_at_most_once on FEC
Problem Details: In verity_end_io(), if bi_status is not BLK_STS_OK, it can be return directly. But if FEC configured, it is desired to correct the data page through verity_verify_io. And the return value will be converted to blk_status and passed to verity_finish_io(). BTW, when a bit is set in v->validated_blocks, v...
```diff diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index ade83ef3b439..9316399b920e 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -523,7 +523,7 @@ static int verity_verify_io(struct dm_verity_io *io) sector_t cur_block = io->block + b; struct aha...
9513c55ce3e8f0f118c47423452c4a4bdaa80222
Analyze and fix the following issue in the Linux kernel code: tools/virtio: fix typo in README instructions
Problem Details: We need to have a unique chardev for each data path, else the chardevs will collide and qemu will die with this message: qemu-system-x86_64: -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel0, id=channel1,name=trace-path-cpu0: Property 'virtserialport.chardev' can't take val...
```diff diff --git a/tools/virtio/virtio-trace/README b/tools/virtio/virtio-trace/README index b64845b823ab..4fb9368bf751 100644 --- a/tools/virtio/virtio-trace/README +++ b/tools/virtio/virtio-trace/README @@ -61,7 +61,7 @@ and id=channel0,name=agent-ctl-path\ ##data path## -chardev pipe,id=charchannel1...
4c363c81f66c77e0a2394b9a4efa707d122dc544
Analyze and fix the following issue in the Linux kernel code: vhost-scsi: Fix crash during LUN unmapping
Problem Details: We normally clear the endpoint then unmap LUNs so the devices are fully shutdown when the LUN is unmapped, but it's legal to unmap before clearing. If the user does that while TMFs are running then we can end up crashing. vhost_scsi_port_unlink assumes that the LUN's tmf struct will always be on the t...
```diff diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 5875241e1654..32d0be968103 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -125,7 +125,6 @@ struct vhost_scsi_tpg { struct se_portal_group se_tpg; /* Pointer back to vhost_scsi, protected by tv_tpg_mutex */ struct vhost_scsi *v...
e508efc3ae7e44eb3caf595a086bfd3824da5b9a
Analyze and fix the following issue in the Linux kernel code: vhost-scsi: Fix vhost_scsi struct use after free
Problem Details: If vhost_scsi_setup_vq_cmds fails we leave the tpg->vhost_scsi pointer set. If the device is freed and then the user unmaps the LUN, the call to vhost_scsi_port_unlink -> vhost_scsi_hotunplug will see the that tpg->vhost_scsi is still set and try to use it. This has us clear the vhost_scsi pointer in ...
```diff diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index b244e7c0f514..5875241e1654 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1658,7 +1658,10 @@ undepend: for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) { tpg = vs_tpg[i]; if (tpg) { + mutex_lock(&tpg->tv_tpg_mutex); + tpg->v...
10805eb5d6d15fd4f61b05cc7aa269e12ab99848
Analyze and fix the following issue in the Linux kernel code: virtio-blk: fix ZBD probe in kernels without ZBD support
Problem Details: When the kernel is built without support for zoned block devices, virtio-blk probe needs to error out any host-managed device scans to prevent such devices from appearing in the system as non-zoned. The current virtio-blk code simply bypasses all ZBD checks if CONFIG_BLK_DEV_ZONED is not defined and th...
```diff diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 4f0dbbb3d4a5..2b918e28acaa 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -866,16 +866,12 @@ static int virtblk_probe_zoned_device(struct virtio_device *vdev, return ret; } -static inline bool virtblk_ha...
f1ba4e674febf5c0e9f725a75ca43b7722b4e963
Analyze and fix the following issue in the Linux kernel code: virtio-blk: fix to match virtio spec
Problem Details: The merged patch series to support zoned block devices in virtio-blk is not the most up to date version. The merged patch can be found at https://lore.kernel.org/linux-block/20221016034127.330942-3-dmitry.fomichev@wdc.com/ but the latest and reviewed version is https://lore.kernel.org/linux-block/20...
```diff diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 2723eede6f21..4f0dbbb3d4a5 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -96,16 +96,14 @@ struct virtblk_req { /* * The zone append command has an extended in header. - * The status field in zone_...
8e85d550c127d8c559d94c8a2bb7b48e1d75432d
Analyze and fix the following issue in the Linux kernel code: can: rcar_canfd: rcar_canfd_probe(): fix plain integer in transceivers[] init
Problem Details: Fix the following compile warning with C=1: | drivers/net/can/rcar/rcar_canfd.c:1852:59: warning: Using plain integer as NULL pointer Fixes: a0340df7eca4f28e ("can: rcar_canfd: Add transceiver support") Reported-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230328145658.7fdbc...
```diff diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index 701311dabab3..963c42f43755 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -1848,7 +1848,7 @@ static void rcar_canfd_channel_remove(struct rcar_canfd_global *gpriv, u32 ch) stati...
c52159b5be7894540acdc7a35791c0b57097fa4c
Analyze and fix the following issue in the Linux kernel code: iommufd/selftest: Set varaiable mock_iommu_device storage-class-specifier to static
Problem Details: smatch reports: drivers/iommu/iommufd/selftest.c:295:21: warning: symbol 'mock_iommu_device' was not declared. Should it be static? This variable is only used in one file so it should be static. Fixes: 65c619ae0680 ("iommufd/selftest: Make selftest create a more complete mock device") Link: https:...
```diff diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c index 4463060ec84b..74c2076105d4 100644 --- a/drivers/iommu/iommufd/selftest.c +++ b/drivers/iommu/iommufd/selftest.c @@ -292,7 +292,7 @@ static const struct iommu_ops mock_ops = { }, }; -struct iommu_device mock_iommu_device...
7de82c2f36fb26aa78440bbf0efcf360b691d98b
Analyze and fix the following issue in the Linux kernel code: NFSD: callback request does not use correct credential for AUTH_SYS
Problem Details: Currently callback request does not use the credential specified in CREATE_SESSION if the security flavor for the back channel is AUTH_SYS. Problem was discovered by pynfs 4.1 DELEG5 and DELEG7 test with error: DELEG5 st_delegation.testCBSecParms : FAILURE expected callback with uid, ...
```diff diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 2a815f5a52c4..4039ffcf90ba 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -946,8 +946,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r if (!kcred) return NULL; - kcred->uid = se...
8be8f170e8383fd1421e8b87950e90d7dd45be07
Analyze and fix the following issue in the Linux kernel code: NFS: Remove "select RPCSEC_GSS_KRB5
Problem Details: If CONFIG_CRYPTO=n (e.g. arm/shmobile_defconfig): WARNING: unmet direct dependencies detected for RPCSEC_GSS_KRB5 Depends on [n]: NETWORK_FILESYSTEMS [=y] && SUNRPC [=y] && CRYPTO [=n] Selected by [y]: - NFS_V4 [=y] && NETWORK_FILESYSTEMS [=y] && NFS_FS [=y] As NFSv4 can work withou...
```diff diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index 450d6c3bc05e..c1c7ed2fd860 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig @@ -75,7 +75,6 @@ config NFS_V3_ACL config NFS_V4 tristate "NFS client support for NFS version 4" depends on NFS_FS - select RPCSEC_GSS_KRB5 select KEYS help This option en...
5085e41f9e83a1bec51da1f20b54f2ec3a13a3fe
Analyze and fix the following issue in the Linux kernel code: sunrpc: only free unix grouplist after RCU settles
Problem Details: While the unix_gid object is rcu-freed, the group_info list that it contains is not. Ensure that we only put the group list reference once we are really freeing the unix_gid object. Reported-by: Zhi Li <yieli@redhat.com> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2183056 Signed-off-by: Jeff Lay...
```diff diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 983c5891cb56..4246363cb095 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -416,14 +416,23 @@ static int unix_gid_hash(kuid_t uid) return hash_long(from_kuid(&init_user_ns, uid), GID_HASHBITS); } -static void...
218c597325f4faf7b7a6049233a30d7842b5b2dc
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix up RX flow hash indirection table when setting channels
Problem Details: stmmac_reinit_queues() fails to fix up the RX hash. Even if the number of channels gets restricted, the output of `ethtool -x' indicates that all RX queues are used: $ ethtool -l enp0s29f2 Channel parameters for enp0s29f2: Pre-set maximums: RX: 8 TX: 8 Other: n/a Combined: n/a Curr...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d41a5f92aee7..59cbf3597eb4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6950,7 +6950,7 @@ static void stmmac_napi...
9b539c4d1b921bc9c8c578d4d50f0a7e7874d384
Analyze and fix the following issue in the Linux kernel code: fbdev/radeon: use pci aperture helpers
Problem Details: It's not exactly the same since the open coded version doesn't set primary correctly. But that's a bugfix, so shouldn't hurt really. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: linux-fbdev@vger.kernel.org Reviewed-by: Thomas Zimmerman...
```diff diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 657064227de8..972c4bbedfa3 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -2238,14 +2238,6 @@ static const struct bin_attribute edid2_attr = { .read = radeon_show...
430635a0ef1ce958b7b4311f172694ece2c692b8
Analyze and fix the following issue in the Linux kernel code: perf intel-pt: Fix CYC timestamps after standalone CBR
Problem Details: After a standalone CBR (not associated with TSC), update the cycles reference timestamp and reset the cycle count, so that CYC timestamps are calculated relative to that point with the new frequency. Fixes: cc33618619cefc6d ("perf tools: Add Intel PT support for decoding CYC packets") Signed-off-by: A...
```diff diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c index 0ac860c8dd2b..7145c5890de0 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c @@ -1998,6 +1998,8 @@ static void int...
1f9f33ccf0320be21703d9195dd2b36a1c9a07cb
Analyze and fix the following issue in the Linux kernel code: perf auxtrace: Fix address filter entire kernel size
Problem Details: kallsyms is not completely in address order. In find_entire_kern_cb(), calculate the kernel end from the maximum address not the last symbol. Example: Before: $ sudo cat /proc/kallsyms | grep ' [twTw] ' | tail -1 ffffffffc00b8bd0 t bpf_prog_6deef7357e7b4530 [bpf] $ sudo cat /proc/ka...
```diff diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 498ff7f24463..b2a5e5397bad 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -2449,6 +2449,7 @@ static int find_entire_kern_cb(void *arg, const char *name __maybe_unused, char type, u64 start) { st...
84c3a2bb4c513ca9fd1326cf24d3729b769d9cf1
Analyze and fix the following issue in the Linux kernel code: perf lock contention: Show detail failure reason for BPF
Problem Details: It can fail to collect lock stat from BPF for various reasons. For example, I've got a report that sometimes time calculation seems wrong in case of contended spinlocks. I suspect the time delta went negative for some reason. Count them separately and show in the output like below: $ sudo perf lock...
```diff diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 82dd2dfe5692..32ec58fb80e4 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -1619,6 +1619,24 @@ static void sort_contention_result(void) sort_result(); } +static void print_bpf_events(int total, struct lock_co...
35bf007e2ee0447166081646c0797bfa831b062f
Analyze and fix the following issue in the Linux kernel code: perf lock contention: Fix debug stat if no contention
Problem Details: It should not divide if the total number is 0. Otherwise it'd show NaN in the bad rate output. Also add a whitespace in the "output for debug" message. $ sudo perf lock contention -abv true Looking at the vmlinux_path (8 entries long) symsrc__init: cannot get elf header. Using /proc/kcore fo...
```diff diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 3c8a19ebc496..82dd2dfe5692 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -1323,10 +1323,10 @@ static void print_bad_events(int bad, int total) for (i = 0; i < BROKEN_MAX; i++) broken += bad_hist[i]; - if ...
337fa2db04785c60fc3aa736af98ce8358f87d34
Analyze and fix the following issue in the Linux kernel code: perf bench numa: Fix type of loop iterator in do_work, it should be 'long'
Problem Details: 'j' is of type int and start/end are of type 'long'. Thus 'j' might become negative and cause segfault in access_data(). Fix it by using 'long' for 'j' as well. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Andreas Herrmann <aherrmann@suse.de> Link: https://lore.kernel.org/r/2023033007...
```diff diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 9717c6c17433..1fbd7c947abc 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -847,7 +847,7 @@ static u64 do_work(u8 *__data, long bytes, int nr, int nr_max, int loop, u64 val if (g->p.data_rand_walk) { u32 lfsr = nr ...
616b14b47a86d880ba21a363440f20f82152d8f2
Analyze and fix the following issue in the Linux kernel code: perf build: Conditionally define NDEBUG
Problem Details: When a build is done without DEBUG=1 then define NDEBUG. This will compile out asserts and other debug code. 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@redhat.com> Cc: Jir...
```diff diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 3066d0c318c3..236d763181c5 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -228,6 +228,7 @@ ifndef DEBUG endif ifeq ($(DEBUG),0) +CORE_CFLAGS += -DNDEBUG=1 ifeq ($(CC_NO_CLANG), 0) CORE_CFLAGS += -O3 ...
984a785f25e5b5db5fa673130b60dca6ca794406
Analyze and fix the following issue in the Linux kernel code: perf block-range: Move debug code behind ifndef NDEBUG
Problem Details: Make good on a comment and avoid a unused-but-set-variable warning. 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@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutlan...
```diff diff --git a/tools/perf/util/block-range.c b/tools/perf/util/block-range.c index 1be432657501..680e92774d0c 100644 --- a/tools/perf/util/block-range.c +++ b/tools/perf/util/block-range.c @@ -11,11 +11,7 @@ struct { static void block_range__debug(void) { - /* - * XXX still paranoid for now; see if we can ma...
d1babea9c38282b58a6f822ab95027cba3165a42
Analyze and fix the following issue in the Linux kernel code: perf bench: Avoid NDEBUG warning
Problem Details: With NDEBUG set the asserts are compiled out. This yields "unused-but-set-variable" variables. Move these variables behind NDEBUG to avoid the warning. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>...
```diff diff --git a/tools/perf/bench/find-bit-bench.c b/tools/perf/bench/find-bit-bench.c index d103c3136983..7e25b0e413f6 100644 --- a/tools/perf/bench/find-bit-bench.c +++ b/tools/perf/bench/find-bit-bench.c @@ -61,7 +61,6 @@ static int do_for_each_set_bit(unsigned int num_bits) double time_average, time_stddev; ...
217b7d41ea2038e52991b7a600a0b958330d8ae6
Analyze and fix the following issue in the Linux kernel code: perf annotate: Add init/exit to annotation_options remove default
Problem Details: The annotation__default_options global variable was used to initialize annotation_options. Switch to the init/exit pattern as later changes will give ownership over strings and this will be necessary to avoid memory leaks. Committer note: Fix the GTK2=1 build, hist_entry__gtk_annotate() needs to rec...
```diff diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 98d1b6379230..997a1e65d090 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -352,6 +352,7 @@ find_next: int ret; int (*annotate)(struct hist_entry *he, struct evsel *evsel, + struc...
8f08c363fd6c682d10f2b055d4287ad1e54e76ea
Analyze and fix the following issue in the Linux kernel code: perf report: Additional config warnings
Problem Details: If the default_sort_order isn't correctly strdup-ed warn and return an error. Debug warn if no option is matched. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> C...
```diff diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 6400615b5e98..500f9d8902e7 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -143,6 +143,10 @@ static int report__config(const char *var, const char *value, void *cb) if (!strcmp(var, "report.sort_order"...
333b1b11179b7908e3f3a06a2208dcecb0c971ef
Analyze and fix the following issue in the Linux kernel code: perf annotate: Delete session for debug builds
Problem Details: Use the debug build indicator as the guide to free the session. This implements a behavior described in a comment, which is consequentially removed. 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/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 4750fac7bf93..98d1b6379230 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -692,16 +692,12 @@ int cmd_annotate(int argc, const char **argv) out_delete: /* - * Speed up the exit process, for l...
a2410b579c72242ac0f77b3768093d8c1b48012e
Analyze and fix the following issue in the Linux kernel code: perf symbols: Fix unaligned access in get_x86_64_plt_disp()
Problem Details: Use memcpy() to avoid unaligned access. Discovered using EXTRA_CFLAGS="-fsanitize=undefined -fsanitize=address". Fixes: ce4c8e7966f317ef ("perf symbols: Get symbols for .plt.got for x86-64") Reported-by: kernel test robot <yujie.liu@intel.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Ac...
```diff diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 7ef5f6d7d415..ae810d4cf3cd 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -542,9 +542,12 @@ static u32 get_x86_64_plt_disp(const u8 *p) n += 1; /* jmp with 4-byte displacement */ if (p[n] == 0x...
c8bb2d76a40ac0ccf6303d369e536fddcde847fb
Analyze and fix the following issue in the Linux kernel code: perf symbols: Fix use-after-free in get_plt_got_name()
Problem Details: Fix use-after-free in get_plt_got_name(). Discovered using EXTRA_CFLAGS="-fsanitize=undefined -fsanitize=address". Fixes: ce4c8e7966f317ef ("perf symbols: Get symbols for .plt.got for x86-64") Reported-by: kernel test robot <yujie.liu@intel.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> ...
```diff diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index c0a2de42c51b..7ef5f6d7d415 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -557,6 +557,7 @@ static bool get_plt_got_name(GElf_Shdr *shdr, size_t i, const char *sym_name; char *demangled; GElf_Sym...
5d9df8731c0941f3add30f96745a62586a0c9d52
Analyze and fix the following issue in the Linux kernel code: perf vendor events power9: Remove UTF-8 characters from JSON files
Problem Details: Commit 3c22ba5243040c13 ("perf vendor events powerpc: Update POWER9 events") added and updated power9 PMU JSON events. However some of the JSON events which are part of other.json and pipeline.json files, contains UTF-8 characters in their brief description. Having UTF-8 character could breaks the per...
```diff diff --git a/tools/perf/pmu-events/arch/powerpc/power9/other.json b/tools/perf/pmu-events/arch/powerpc/power9/other.json index 3f69422c21f9..f10bd554521a 100644 --- a/tools/perf/pmu-events/arch/powerpc/power9/other.json +++ b/tools/perf/pmu-events/arch/powerpc/power9/other.json @@ -1417,7 +1417,7 @@ { "...
ecd4960d908e27e40b63a7046df2f942c148c6f6
Analyze and fix the following issue in the Linux kernel code: perf ftrace: Make system wide the default target for latency subcommand
Problem Details: If no target is specified for 'latency' subcommand, the execution fails because - 1 (invalid value) is written to set_ftrace_pid tracefs file. Make system wide the default target, which is the same as the default behavior of 'trace' subcommand. Before the fix: # perf ftrace latency -T schedule fa...
```diff diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 73d51ce84c3a..810e3376c7d6 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -1228,10 +1228,12 @@ int cmd_ftrace(int argc, const char **argv) goto out_delete_filters; } + /* Make system wide (-a) the ...
51ea4cb96f35ae2f31d45d9a0dbf30da13bbe441
Analyze and fix the following issue in the Linux kernel code: perf stat: Suppress warning when using cpum_cf events on s390
Problem Details: Running command perf stat -vv -e cpu_cycles -C0 -- true displays this warning: Attempting to add event pmu 'cpum_cf' with 'cpu_cycles,' that may result in non-fatal errors Make the PMU cpum_cf selectable and avoid this warning. While at it also fix this warning for PMUs pai_crypto and pai_ext. Out...
```diff diff --git a/tools/perf/arch/s390/util/Build b/tools/perf/arch/s390/util/Build index db6884086997..fa66f15a14ec 100644 --- a/tools/perf/arch/s390/util/Build +++ b/tools/perf/arch/s390/util/Build @@ -6,5 +6,6 @@ perf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-y +...
7f8d3fbe094be59a286f3b43431668221123ff30
Analyze and fix the following issue in the Linux kernel code: perf tests test_bridge_fdb_stress.sh: Fix redirection of stderr to stdin
Problem Details: It's not 2&>1, the correct is 2>&1. Signed-off-by: Patrice Duroux <patrice.duroux@gmail.com> Cc: linux-kselftest@vger.kernel.org Link: https://lore.kernel.org/r/20230303193058.21274-1-patrice.duroux@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
```diff diff --git a/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh b/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh index a1f269ee84da..92acab83fbe2 100755 --- a/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh +++ b/tools/testing/selftests/drivers/net/dsa/test_br...
9835b742ac3ee16dee361e7ccda8022f99d1cd94
Analyze and fix the following issue in the Linux kernel code: perf tests record_offcpu.sh: Fix redirection of stderr to stdin
Problem Details: It's not 2&>1, the correct is 2>&1 Fixes: ade1d0307b2fb3d9 ("perf offcpu: Update offcpu test for child process") Signed-off-by: Patrice Duroux <patrice.duroux@gmail.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20230303193058.2127...
```diff diff --git a/tools/perf/tests/shell/record_offcpu.sh b/tools/perf/tests/shell/record_offcpu.sh index 24f81ff85793..155d4856551a 100755 --- a/tools/perf/tests/shell/record_offcpu.sh +++ b/tools/perf/tests/shell/record_offcpu.sh @@ -65,7 +65,7 @@ test_offcpu_child() { # perf bench sched messaging creates 400...
5d8c0f0e11852d22fc3464c82453ddd1286f5d72
Analyze and fix the following issue in the Linux kernel code: perf lock contention: Fix msan issue in lock_contention_read()
Problem Details: I got a report of a msan failure like below: $ sudo perf lock con -ab -- sleep 1 ... ==224416==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x5651160d6c96 in lock_contention_read util/bpf_lock_contention.c:290:8 #1 0x565115f90870 in __cmd_contention builtin-lock.c:1919:3...
```diff diff --git a/tools/perf/util/bpf_lock_contention.c b/tools/perf/util/bpf_lock_contention.c index 235fc7150545..5927bf0bd92b 100644 --- a/tools/perf/util/bpf_lock_contention.c +++ b/tools/perf/util/bpf_lock_contention.c @@ -249,7 +249,7 @@ static const char *lock_contention_get_name(struct lock_contention *con, ...