id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
5a938ed9481b0c06cb97aec45e722a80568256fd
Analyze and fix the following issue in the Linux kernel code: PCI: keystone: Set mode as Root Complex for "ti,keystone-pcie" compatible
Problem Details: commit 23284ad677a9 ("PCI: keystone: Add support for PCIe EP in AM654x Platforms") introduced configuring "enum dw_pcie_device_mode" as part of device data ("struct ks_pcie_of_data"). However it failed to set the mode for "ti,keystone-pcie" compatible. Since the mode defaults to "DW_PCIE_UNKNOWN_TYPE"...
```diff diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 2219b1a866fa..b99bc4071fe9 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -1093,6 +1093,7 @@ static int ks_pcie_am654_set_mode(struct device *dev, ...
444fa5b100e5c90550d6bccfe4476efb0391b3ca
Analyze and fix the following issue in the Linux kernel code: drm/panthor: Lock XArray when getting entries for the VM
Problem Details: Similar to commit cac075706f29 ("drm/panthor: Fix race when converting group handle to group object") we need to use the XArray's internal locking when retrieving a vm pointer from there. v2: Removed part of the patch that was trying to protect fetching the heap pointer from XArray, as that operation ...
```diff diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index 5d5e25b1be95..7db2edb3374c 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -1580,7 +1580,9 @@ panthor_vm_pool_get_vm(struct panthor_vm_pool *pool, u32 handle) { s...
e329b762a31eb59da1b78cb69cbe1b9ff843e081
Analyze and fix the following issue in the Linux kernel code: dt-bindings: PCI: microchip,pcie-host: Add reg for Root Port 2
Problem Details: The PCI host controller on PolarFire SoC has multiple Root Port instances, each with their own bridge and ctrl address spaces. The original binding has an "apb" register region, and it is expected to be set to the base address of the Root Complex register space. Some defines in the Linux driver were us...
```diff diff --git a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml b/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml index 612633ba59e2..2e1547569702 100644 --- a/Documentation/devicetree/bindings/pci/microchip,pcie-host.yaml +++ b/Documentation/devicetree/bindings/pci/microchip,pcie-hos...
fe9beaaa802d44d881b165430b3239a9d7bebf30
Analyze and fix the following issue in the Linux kernel code: sched: No PREEMPT_RT=y for all{yes,mod}config
Problem Details: While PREEMPT_RT is undoubtedly totally awesome, it does not, at this time, make sense to have all{yes,mod}config select it. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 35772d627b55 ("sched: Enable PREEMPT_DYNAMIC for PREEMPT_RT") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead...
```diff diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index 7c1b29a3a491..54ea59ff8fbe 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -88,7 +88,7 @@ endchoice config PREEMPT_RT bool "Fully Preemptible Kernel (Real-Time)" - depends on EXPERT && ARCH_SUPPORTS_RT + depends on EXPER...
ed61c59139509f76d3592683c90dc3fdc6e23cd6
Analyze and fix the following issue in the Linux kernel code: media: atomisp: Add check for rgby_data memory allocation failure
Problem Details: In ia_css_3a_statistics_allocate(), there is no check on the allocation result of the rgby_data memory. If rgby_data is not successfully allocated, it may trigger the assert(host_stats->rgby_data) assertion in ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue. Fixes: a49d25364dfb ("...
```diff diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index c66ae59b68c1..0d4a936ad80f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -4172,6 +4172,8 @@ ia_css_3a_statistics_al...
08964e23783b5752da2d7be3a3f017ae917c9837
Analyze and fix the following issue in the Linux kernel code: media: atomisp: Fix spelling errors reported by codespell
Problem Details: Fixed spelling errors as follows: unkonwn ==> unknown Stablization ==> Stabilization previouly ==> previously acknowlede ==> acknowledge Signed-off-by: Everest K.C. <everestkc@everestkc.com.np> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240926222351.7116-1-eve...
```diff diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 0aaae52de6a0..1a960a01854f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -32,7 +32,7 @@ static const char *CARD = "...
d65adf351c915d8523eb06d4bb2aea0d0f416028
Analyze and fix the following issue in the Linux kernel code: media: atomisp: Fix typos in comment
Problem Details: Corrected typos: componnet->component, cofiguration->configuration, doubtfull->doubtful, consisit->consist, coppied->copied. These changes fix the typos in the comment, without affecting the functionality. Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com> Link: https://lore.kernel.org/r/202409230330...
```diff diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index c9984f1557b0..eb46ba4f4f13 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -55,7 +55,7 @@ /* G-Min addition: pull this i...
967a5ec1668e8683ca02a2ab3441439b9798e4aa
Analyze and fix the following issue in the Linux kernel code: media: atomisp: hmm_bo: Fix spelling errors in hmm_bo.h
Problem Details: Fixed spelling errors reported by codespell in drivers/staging/media/atomisp/include/hmm/hmm_bo.h as follows: increse --> increase decrese --> decrease Signed-off-by: Everest K.C. <everestkc@everestkc.com.np> Link: https://lore.kernel.org/r/20240918082203.4941-1-everestkc@everestkc.com.np Rev...
```diff diff --git a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h index b4c03e0ca9c0..6d3c74156345 100644 --- a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h +++ b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h @@ -159,12 +159,12 @@ void hmm_bo_device_...
462ed3711b1eba514591a0c7a627803733243e1a
Analyze and fix the following issue in the Linux kernel code: media: atomisp: mt9m114: Fix fmt->code not getting set on try_fmt
Problem Details: Fix mt9m114_set_fmt() not setting format.format.code when called with format.which == V4L2_SUBDEV_FORMAT_TRY. This fixes atomisp failing to start streaming with the mt9m114 on an Asus T100TA because of __media_pipeline_start() returning -EPIPE. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Revie...
```diff diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index 1a67f93a53d7..7cf543986b91 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -665,6 +665,7 @@ static int mt9m11...
f6d364dbad0407ca1bb5b476bc50b830dae0a603
Analyze and fix the following issue in the Linux kernel code: media: atomisp: mt9m114: Add missing mutex_init() call
Problem Details: The input_lock was not being initialized, fix this. Also switch to devm_kzalloc() for the main driver data struct, so that devm_mutex_init() can be used for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20241013...
```diff diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index b0b740dd3ca3..1a67f93a53d7 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -30,6 +30,7 @@ #include <linux/de...
1059f9e6cc16f1129b8d28518b05782cfffd4c94
Analyze and fix the following issue in the Linux kernel code: media: atomisp: mt9m114: Disable V4L2_CID_3A_LOCK control
Problem Details: The V4L2_CID_3A_LOCK control is causing v4l2_ctrl_new_custom() to fail with -ERANGE. It would be better to fix this control but this entire driver is going to be replaced with the drivers/media/i2c/mt9m114 standard v4l2 driver. This quick fix gets things going for now until the driver is replaced. Si...
```diff diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index 918ea4fa9f6b..b0b740dd3ca3 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -1224,6 +1224,7 @@ static struct v...
751d13a0cffb5c0420bcf8bbd7bd613f2a359d89
Analyze and fix the following issue in the Linux kernel code: media: atomisp: Fix WARN_ON() in vb2_start_streaming() triggering
Problem Details: If atomisp fails to start the stream the buffers must be returned to the VB2_BUF_STATE_QUEUED state before returning an error from atomisp_start_streaming(). This fixes the following WARN_ON(): [ 250.313554] WARNING: CPU: 3 PID: 2178 at drivers/media/common/videobuf2/videobuf2-core.c:1801 vb2_start_s...
```diff diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index d7e8a9871522..47d8a17379b0 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -881,8 +881,10 @@ int atomisp_start_stream...
bb1fb40f8beb45a3733118780a3da24fb071a2e9
Analyze and fix the following issue in the Linux kernel code: NFSD: Fix READDIR on NFSv3 mounts of ext4 exports
Problem Details: I noticed that recently, simple operations like "make" started failing on NFSv3 mounts of ext4 exports. Network capture shows that READDIRPLUS operated correctly but READDIR failed with NFS3ERR_INVAL. The vfs_llseek() call returned EINVAL when it is passed a non-zero starting directory cookie. I bisec...
```diff diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 22325b590e17..d6d4f2a0e898 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -903,11 +903,6 @@ __nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, goto out; } - if (may_flags & NFSD_MAY_64BIT_COOKIE) - file->f_mode |= FMODE_64BITHASH; - ...
d1a54ec21b8e7bca59141ff1ac6ce73e07d744f2
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: tell iwlmei when we finished suspending
Problem Details: Since we no longer shut down the device in suspend, we also no longer call iwl_mvm_mei_device_state() and this is a problem because iwlmei expects this to be called when it runs its own suspend sequence. It checks mei->device_down in iwl_mei_remove() which is called upon suspend. Fix this by telling i...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 4616a5b394c0..23ccbe7b74c0 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1237,6 +1237,7 @@ int __iwl_mvm_mac_start...
bb9df91cfe651d418719c52a4f47d4a49ac06609
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: Fix an error handling path in nl80211_start_ap()
Problem Details: All error handling paths go to "out", except this one. Before the commit in Fixes, error in the previous code would also end to "out", freeing the memory. Move the code up to avoid the leak. Fixes: 62262dd00c31 ("wifi: cfg80211: disallow SMPS in AP mode") Signed-off-by: Christophe JAILLET <christophe...
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d281568b2e2e..b8cdd844f0e6 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6123,6 +6123,10 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) !info->attrs[NL80211_ATTR_BEACON_HEAD]) return -...
9c46a3a5b394d6d123866aa44436fc2cd342eb0d
Analyze and fix the following issue in the Linux kernel code: wifi: nl80211: fix bounds checker error in nl80211_parse_sched_scan
Problem Details: The channels array in the cfg80211_scan_request has a __counted_by attribute attached to it, which points to the n_channels variable. This attribute is used in bounds checking, and if it is not set before the array is filled, then the bounds sanitizer will issue a warning or a kernel panic if CONFIG_UB...
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1ac8a196f376..d281568b2e2e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -9802,6 +9802,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev, request = kzalloc(size, GFP_KERNEL); if (!request) ...
b4ebb58cb9a4b1b5cb5278b09d6afdcd71b2a6b4
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: Remove the Medium Synchronization Delay validity check
Problem Details: Currently, when the driver attempts to connect to an AP MLD with multiple APs, the cfg80211_mlme_check_mlo_compat() function requires the Medium Synchronization Delay values from different APs of the same AP MLD to be equal, which may result in connection failures. This is because when the driver rece...
```diff diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 4dac81854721..a5eb92d93074 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -340,12 +340,6 @@ cfg80211_mlme_check_mlo_compat(const struct ieee80211_multi_link_elem *mle_a, return -EINVAL; } - if (ieee80211_mle_get_eml_med_sync_dela...
df81366b484da9618cec12cfc30ec93f7d4b6ac7
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: fix description of ieee80211_set_active_links() for new sequence
Problem Details: The sequence of calls has changed, but the description is inconsistent. So, fix the description. Fixes: 188a1bf89432 ("wifi: mac80211: re-order assigning channel in activate links") Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Link: https://patch.msgid.link/20241101082143.11138-1-kevin_yang@r...
```diff diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b4f246cdcca4..a97c9f85ae9a 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -7672,12 +7672,12 @@ static inline bool ieee80211_is_tx_data(struct sk_buff *skb) * * - change_vif_links(0x11) * - unassign_vif_chanctx(link_i...
1b1f491dac4f6ee88ec7c36c4fd27880b0a89f41
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: Intel: hda-stream: Always use at least two BDLE for transfers
Problem Details: The HDA specification states that the SDnLVI (Last Valid Index) must be at least 1 (two BDLE entry). Update the debug prints as well to provide better information. While the LVI=0 worked so far without issues, it is better to align with the specification to avoid unforeseen issues with FW loading. N...
```diff diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index 3ac63ce67ab1..519bafd3b947 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -119,13 +119,39 @@ int hda_dsp_stream_setup_bdl(struct snd_sof_dev *sdev, int remain, ioc; period_bytes ...
83e367c1a178045bf3675646aa9582a0c5a4e566
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: ipc3-loader: 'Handle' PROBE_INFO ext_manifest type when parsing
Problem Details: Every time when the firmware is loaded we see the following printed in info level: unknown sof_ext_man header type 3 size 0x30 This is the PROBE_INFO element, which is not parsed, but it is not something that we should treat as surprise, aka unknown type. Add an empty case with a debug print to 'hand...
```diff diff --git a/sound/soc/sof/ipc3-loader.c b/sound/soc/sof/ipc3-loader.c index 35b89c2b9d4c..7e9c76d5b2c9 100644 --- a/sound/soc/sof/ipc3-loader.c +++ b/sound/soc/sof/ipc3-loader.c @@ -193,6 +193,9 @@ static size_t sof_ipc3_fw_parse_ext_man(struct snd_sof_dev *sdev) case SOF_EXT_MAN_ELEM_CC_VERSION: ret = ...
ab9bc81c1cf0efc7fc5a3aa4e562aa88d09ada57
Analyze and fix the following issue in the Linux kernel code: Revert "block: pre-calculate max_zone_append_sectors"
Problem Details: This causes issue on, at least, nvme-mpath where my boot fails with: WARNING: CPU: 354 PID: 2729 at block/blk-settings.c:75 blk_validate_limits+0x356/0x380 Modules linked in: tg3(+) nvme usbcore scsi_mod ptp i2c_piix4 libphy nvme_core crc32c_intel scsi_common usb_common pps_core i2c_smbus CPU: 354 UID...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 5df4607321ca..09d10bb95fda 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -607,7 +607,7 @@ static inline blk_status_t blk_check_zone_append(struct request_queue *q, return BLK_STS_IOERR; /* Make sure the BIO is small enough and will not get ...
0a1c7a7b0adbf595ce7f218609db53749e966573
Analyze and fix the following issue in the Linux kernel code: net: arc: rockchip: fix emac mdio node support
Problem Details: The binding emac_rockchip.txt is converted to YAML. Changed against the original binding is an added MDIO subnode. This make the driver failed to find the PHY, and given the 'mdio has invalid PHY address' it is probably looking in the wrong node. Fix emac_mdio.c so that it can handle both old and new d...
```diff diff --git a/drivers/net/ethernet/arc/emac_mdio.c b/drivers/net/ethernet/arc/emac_mdio.c index 87f40c2ba904..078b1a72c161 100644 --- a/drivers/net/ethernet/arc/emac_mdio.c +++ b/drivers/net/ethernet/arc/emac_mdio.c @@ -133,6 +133,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) struct arc_emac_mdio_bus_dat...
71803c1dfa29e0d13b99e48fda11107cc8caebc7
Analyze and fix the following issue in the Linux kernel code: net: arc: fix the device for dma_map_single/dma_unmap_single
Problem Details: The ndev->dev and pdev->dev aren't the same device, use ndev->dev.parent which has dma_mask, ndev->dev.parent is just pdev->dev. Or it would cause the following issue: [ 39.933526] ------------[ cut here ]------------ [ 39.938414] WARNING: CPU: 1 PID: 501 at kernel/dma/mapping.c:149 dma_map_page_a...
```diff diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c index 31ee477dd131..8283aeee35fb 100644 --- a/drivers/net/ethernet/arc/emac_main.c +++ b/drivers/net/ethernet/arc/emac_main.c @@ -111,6 +111,7 @@ static void arc_emac_tx_clean(struct net_device *ndev) { struct arc_emac_p...
61329a1152dd1f1c7ea75f6a8fb815f63a4440ad
Analyze and fix the following issue in the Linux kernel code: net: wwan: t7xx: Add debug ports
Problem Details: Add support for userspace to enable/disable the debug ports(ADB,MIPC). - ADB port: /dev/wwan0adb0 - MIPC port: /dev/wwan0mipc0 Application can use ADB (Android Debug Bridge) port to implement functions (shell, pull, push ...) by ADB protocol commands. E.g., ADB commands: - A_OPEN: OPEN(local-id, 0,...
```diff diff --git a/Documentation/networking/device_drivers/wwan/t7xx.rst b/Documentation/networking/device_drivers/wwan/t7xx.rst index f346f5f85f15..4cf777c341cd 100644 --- a/Documentation/networking/device_drivers/wwan/t7xx.rst +++ b/Documentation/networking/device_drivers/wwan/t7xx.rst @@ -67,6 +67,28 @@ Write from...
702a47ce6dde72f6e247b3c3c00a0fc521f9b1c6
Analyze and fix the following issue in the Linux kernel code: media: videobuf2-core: copy vb planes unconditionally
Problem Details: Copy the relevant data from userspace to the vb->planes unconditionally as it's possible some of the fields may have changed after the buffer has been validated. Keep the dma_buf_put(planes[plane].dbuf) calls in the first `if (!reacquired)` case, in order to be close to the plane validation code where...
```diff diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 29a8d876e6c2..b0523fc23506 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -1482,18 +1482,23 @@ static int __prepare_dmabuf(s...
50bfcaedd78e53135ec0504302269b3b65bf1eff
Analyze and fix the following issue in the Linux kernel code: virtio_net: Update rss when set queue
Problem Details: RSS configuration should be updated with queue number. In particular, it should be updated when (1) rss enabled and (2) default rss configuration is used without user modification. During rss command processing, device updates queue_pairs using rss.max_tx_vq. That is, the device updates queue_pairs to...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index b3232b8baa25..53a038fcbe99 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3394,15 +3394,59 @@ static void virtnet_ack_link_announce(struct virtnet_info *vi) dev_warn(&vi->dev->dev, "Failed to ack link announce.\n...
dc749b7b06082ccaacc602e724445da19cd03e9f
Analyze and fix the following issue in the Linux kernel code: virtio_net: Sync rss config to device when virtnet_probe
Problem Details: During virtnet_probe, default rss configuration is initialized, but was not committed to the device. This patch fix this by sending rss command after device ready in virtnet_probe. Otherwise, the actual rss configuration used by device can be different with that read by user from driver, which may conf...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 545dda8ec077..b3232b8baa25 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -6584,6 +6584,15 @@ static int virtnet_probe(struct virtio_device *vdev) virtio_device_ready(vdev); + if (vi->has_rss || vi->has_rss_has...
3f7d9c1964fcd16d02a8a9d4fd6f6cb60c4cc530
Analyze and fix the following issue in the Linux kernel code: virtio_net: Add hash_key_length check
Problem Details: Add hash_key_length check in virtnet_probe() to avoid possible out of bound errors when setting/reading the hash key. Fixes: c7114b1249fa ("drivers/net/virtio_net: Added basic RSS support.") Signed-off-by: Philo Lu <lulie@linux.alibaba.com> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Acked-b...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 4b507007d242..545dda8ec077 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -6451,6 +6451,12 @@ static int virtnet_probe(struct virtio_device *vdev) if (vi->has_rss || vi->has_rss_hash_report) { vi->rss_key_size =...
86a48a00efdf61197b6658e52c6140463eb313dc
Analyze and fix the following issue in the Linux kernel code: virtio_net: Support dynamic rss indirection table size
Problem Details: When reading/writing virtio_net_ctrl_rss, we get the indirection table size from vi->rss_indir_table_size, which is initialized in virtnet_probe(). However, the actual size of indirection_table was set as VIRTIO_NET_RSS_MAX_TABLE_LEN=128. This collision may cause issues if the vi->rss_indir_table_size ...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 792e9eadbfc3..4b507007d242 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -368,15 +368,16 @@ struct receive_queue { * because table sizes may be differ according to the device configuration. */ #define VIRTIO_NE...
c6a75555b4b2643365a007b7162a670d69aa28fe
Analyze and fix the following issue in the Linux kernel code: selftests/powerpc: Return errors from all tests
Problem Details: Fix some tests which weren't returning an error code from main. Although these tests only ever return success, they can still fail if they time out and the harness kills them. If that happens they still return success to the shell, which is incorrect and confuses the higher level error reporting. Sig...
```diff diff --git a/tools/testing/selftests/powerpc/signal/sigfuz.c b/tools/testing/selftests/powerpc/signal/sigfuz.c index 08f9afe3b95c..c101b1391696 100644 --- a/tools/testing/selftests/powerpc/signal/sigfuz.c +++ b/tools/testing/selftests/powerpc/signal/sigfuz.c @@ -321,5 +321,5 @@ int main(int argc, char **argv) ...
d5f578f90a34d85f1cabd4c27af1b2d9fbffe64b
Analyze and fix the following issue in the Linux kernel code: selftests/powerpc: Fix 32-bit BE build errors on Ubuntu 24.04
Problem Details: Starting with Ubuntu 24.04, building the selftests with the big endian compiler (which defaults to 32-bit) fails with errors: stack_expansion_ldst.c:178:37: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'rlim_t' {aka 'long long unsigned int'} subpage_p...
```diff diff --git a/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c b/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c index ed9143990888..9c0d343d7137 100644 --- a/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c +++ b/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c @@ -175,7 +17...
340fd66c856651d8c1d29f392dd26ad674d2db0e
Analyze and fix the following issue in the Linux kernel code: arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG
Problem Details: Commit be2881824ae9 ("arm64/build: Assert for unwanted sections") introduced an assertion to ensure that the .data.rel.ro section does not exist. However, this check does not work when CONFIG_LTO_CLANG is enabled, because .data.rel.ro matches the .data.[0-9a-zA-Z_]* pattern in the DATA_MAIN macro. Mo...
```diff diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 58d89d997d05..f84c71f04d9e 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -287,6 +287,9 @@ SECTIONS __initdata_end = .; __init_end = .; + .data.rel.ro : { *(.data.rel.ro) } + ASSERT(...
c03d278fdf35e73dd0ec543b9b556876b9d9a8dc
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: wait for rcu grace period on net_device removal
Problem Details: 8c873e219970 ("netfilter: core: free hooks with call_rcu") removed synchronize_net() call when unregistering basechain hook, however, net_device removal event handler for the NFPROTO_NETDEV was not updated to wait for RCU grace period. Note that 835b803377f5 ("netfilter: nf_tables_netdev: unregister h...
```diff diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 91ae20cb7648..066a3ea33b12 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -1103,6 +1103,7 @@ struct nft_rule_blob { * @name: name of the chain * @udlen: user data length * @u...
81235ae0c846e1fb46a2c6fe9283fe2b2b24f7dc
Analyze and fix the following issue in the Linux kernel code: arm64: Kconfig: Make SME depend on BROKEN for now
Problem Details: Although support for SME was merged in v5.19, we've since uncovered a number of issues with the implementation, including issues which might corrupt the FPSIMD/SVE/SME state of arbitrary tasks. While there are patches to address some of these issues, ongoing review has highlighted additional functional...
```diff diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fd9df6dcc593..70d7f4f20225 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2214,6 +2214,7 @@ config ARM64_SME bool "ARM Scalable Matrix Extension support" default y depends on ARM64_SVE + depends on BROKEN help The Scalable Matr...
8c462d56487e3abdbf8a61cedfe7c795a54f4a78
Analyze and fix the following issue in the Linux kernel code: arm64: smccc: Remove broken support for SMCCCv1.3 SVE discard hint
Problem Details: SMCCCv1.3 added a hint bit which callers can set in an SMCCC function ID (AKA "FID") to indicate that it is acceptable for the SMCCC implementation to discard SVE and/or SME state over a specific SMCCC call. The kernel support for using this hint is broken and SMCCC calls may clobber the SVE and/or SME...
```diff diff --git a/arch/arm64/kernel/smccc-call.S b/arch/arm64/kernel/smccc-call.S index 487381164ff6..2def9d0dd3dd 100644 --- a/arch/arm64/kernel/smccc-call.S +++ b/arch/arm64/kernel/smccc-call.S @@ -7,48 +7,19 @@ #include <asm/asm-offsets.h> #include <asm/assembler.h> -#include <asm/thread_info.h> - -/* - * If ...
b2eaa1170e45dc18eb09dcc9abafbe9a7502e960
Analyze and fix the following issue in the Linux kernel code: pwm: Assume a disabled PWM to emit a constant inactive output
Problem Details: Some PWM hardwares (e.g. MC33XS2410) cannot implement a zero duty cycle but can instead disable the hardware which also results in a constant inactive output. There are some checks (enabled with CONFIG_PWM_DEBUG) to help implementing a driver without violating the normal rounding rules. Make them less...
```diff diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index ccbdd6dd1410..9c733877e98e 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -466,7 +466,7 @@ static void pwm_apply_debug(struct pwm_device *pwm, state->duty_cycle < state->period) dev_warn(pwmchip_parent(chip), ".apply ignored .polar...
45b1a1b348ec178a599323f1ce7d7932aea8c6d4
Analyze and fix the following issue in the Linux kernel code: media: venus: sync with threaded IRQ during inst destruction
Problem Details: When destroying an inst we should make sure that we don't race against threaded IRQ (or pending IRQ), otherwise we can concurrently kfree() inst context and inst itself. BUG: KASAN: slab-use-after-free in vb2_queue_error+0x80/0x90 Call trace: dump_backtrace+0x1c4/0x1f8 show_stack+0x38/0x60 dump_stack_...
```diff diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index b81439d34d90..90fd4cb4eea9 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1748,10 +1748,20 @@ static int vdec_close(struct file *file) vdec_pm_get(in...
6c9934c5a00ae722a98d1a06ed44b673514407b5
Analyze and fix the following issue in the Linux kernel code: media: venus: fix enc/dec destruction order
Problem Details: We destroy mutex-es too early as they are still taken in v4l2_fh_exit()->v4l2_event_unsubscribe()->v4l2_ctrl_find(). We should destroy mutex-es right before kfree(). Also do not vdec_ctrl_deinit() before v4l2_fh_exit(). Fixes: 7472c1c69138 ("[media] media: venus: vdec: add video decoder files") Sugg...
```diff diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index fd4c4934c910..b81439d34d90 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1750,13 +1750,14 @@ static int vdec_close(struct file *file) cancel_work_sy...
a1495a21e0b8aad92132dfcf9c6fffc1bde9d5b2
Analyze and fix the following issue in the Linux kernel code: watchdog: mediatek: Make sure system reset gets asserted in mtk_wdt_restart()
Problem Details: Clear the IRQ enable bit of WDT_MODE before asserting software reset in order to make TOPRGU issue a system reset signal instead of an IRQ. Fixes: a44a45536f7b ("watchdog: Add driver for Mediatek watchdog") Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Reviewed-by: AngeloGioacchino Del Reg...
```diff diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index c35f85ce8d69..e2d7a57d6ea2 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c @@ -225,9 +225,15 @@ static int mtk_wdt_restart(struct watchdog_device *wdt_dev, { struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(...
f6fe9b628f0ba530b02315fd23429c495b0388d6
Analyze and fix the following issue in the Linux kernel code: dt-bindings: watchdog: fsl-imx-wdt: Add missing 'big-endian' property
Problem Details: Add missing big-endian property in watchdog/fsl-imx-wdt.yaml schema. Only allow big-endian property for ls1012a and ls1043a. Fix dtbs_check errors. arch/arm64/boot/dts/freescale/fsl-ls1012a-frwy.dtb: watchdog@2ad0000: Unevaluated properties are not allowed ('big-endian' was unexpected) Cc: Daniel...
```diff diff --git a/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.yaml b/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.yaml index 36b836d0620c..0da953cb7127 100644 --- a/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.yaml @@ -4...
a5ee1ca57c157fb7b289f9377c08848dae4eb821
Analyze and fix the following issue in the Linux kernel code: docs: ABI: Fix spelling mistake in pretimeout_avaialable_governors
Problem Details: There is a spelling mistake, pretimeout_avaialable_governors should be pretimeout_available_governors. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20241030102624.3085369-1-colin.i.king@gmail.com Signed-o...
```diff diff --git a/Documentation/ABI/testing/sysfs-class-watchdog b/Documentation/ABI/testing/sysfs-class-watchdog index 94fb74615951..70eabccf0557 100644 --- a/Documentation/ABI/testing/sysfs-class-watchdog +++ b/Documentation/ABI/testing/sysfs-class-watchdog @@ -76,7 +76,7 @@ Description: timeout when the pretim...
03ab9b96959488175cbaa58bd50b9c4692a81c01
Analyze and fix the following issue in the Linux kernel code: s390/uvdevice: Fix and slightly improve kernel-doc comment
Problem Details: Fix incorrect kernel-doc comment style, add missing return statement, fix incorrect parameter name, and add some additional consistency across all kernel-doc comments. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
```diff diff --git a/drivers/s390/char/uvdevice.c b/drivers/s390/char/uvdevice.c index 735d70eaa1be..2b83fb6dc1d7 100644 --- a/drivers/s390/char/uvdevice.c +++ b/drivers/s390/char/uvdevice.c @@ -63,11 +63,13 @@ static void __init set_supp_uv_cmds(unsigned long *supp_uv_cmds) } /** - * uvio_uvdev_info() - get inform...
2b37c814aab74130bcf2573a9dc1551301283cea
Analyze and fix the following issue in the Linux kernel code: lib/Kconfig.debug: Default STRICT_DEVMEM to "y" on s390
Problem Details: virtio-mem currently depends on !DEVMEM | STRICT_DEVMEM. Let's default STRICT_DEVMEM to "y" just like we do for arm64 and x86. There could be ways in the future to filter access to virtio-mem device memory even without STRICT_DEVMEM, but for now let's just keep it simple. Tested-by: Mario Casquero <m...
```diff diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 7315f643817a..e7a917540e2a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1905,7 +1905,7 @@ config STRICT_DEVMEM bool "Filter access to /dev/mem" depends on MMU && DEVMEM depends on ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALL...
34fb045eddd300a2d1c0d7de7e83113215c422e3
Analyze and fix the following issue in the Linux kernel code: s390/kvm: Mask extra bits from program interrupt code
Problem Details: The program interrupt code has some extra bits that are sometimes set by hardware for various reasons; those bits should be ignored when the program interrupt number is needed for interrupt handling. Fixes: 05066cafa925 ("s390/mm/fault: Handle guest-related program interrupts in KVM") Reported-by: Chr...
```diff diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 5d113428b4cc..06e55f681a39 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -4737,7 +4737,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu) if (kvm_s390_cur_gmap_fault_is_write()) flags = FAULT_FLA...
25d70702142ac2115e75e01a0a985c6ea1d78033
Analyze and fix the following issue in the Linux kernel code: net: stmmac: Fix unbalanced IRQ wake disable warning on single irq case
Problem Details: Commit a23aa0404218 ("net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls") introduced checks to prevent unbalanced enable and disable IRQ wake calls. However it only initialized the auxiliary variable on one of the paths, stmmac_request_irq_multi_msi(), missing the other,...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 208dbc68aaf9..7bf275f127c9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3780,6 +3780,7 @@ static int stmmac_reque...
3791ea69a4858b81e0277f695ca40f5aae40f312
Analyze and fix the following issue in the Linux kernel code: serial: sh-sci: Clean sci_ports[0] after at earlycon exit
Problem Details: The early_console_setup() function initializes the sci_ports[0].port with an object of type struct uart_port obtained from the object of type struct earlycon_device received as argument by the early_console_setup(). It may happen that later, when the rest of the serial ports are probed, the serial por...
```diff diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index df523c744423..136e0c257af1 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3535,6 +3535,32 @@ sh_early_platform_init_buffer("earlyprintk", &sci_driver, #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON static struct...
945def49197d0131d037c7bfaec496e864e6f86e
Analyze and fix the following issue in the Linux kernel code: tty: atmel_serial: Fix typo retreives to retrieves
Problem Details: Fix typo 'retreives' to 'retrieves' in atmel_serial.c file. Signed-off-by: Shivam Chaudhary <cvam0000@gmail.com> Acked-by: Richard Genoud <richard.genoud@bootlin.com> Link: https://lore.kernel.org/r/20241106142720.41351-1-cvam0000@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org...
```diff diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 6af70c7ddbe5..0cf05ac18993 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1166,7 +1166,7 @@ static void atmel_rx_from_dma(struct uart_port *port) port->icount.rx += count; } ...
7c8a7d2f88caeaa376964b57243e26e018ad656d
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Correct check for max secondary address
Problem Details: GPIB secondary addresses can be between 0 and 31 inclusive unlike primary addresses where address 31 is not a valid device address. When 31 is used as a primary talk address it forms the UNT (Untalk) command and when used as a listener address it forms the UNL (Unlisten) commmand. The library was inco...
```diff diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index e84097ac8f69..0285180ae1f0 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -525,8 +525,6 @@ int serial_poll_all(gpib_board_t *board, unsigned int usec_timeout) * S...
0f95c181372380cf779d8c9bd3d5a23bff5c4d57
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Fix Kconfig
Problem Details: The NI_PCI_ISA driver also supports PCI and PCMCIA Correct typo COMPIlE_TEST Fixes: 2c9f5d8c6ece ("staging: gpib: add bus specific Kconfig dependencies") Signed-off-by: Dave Penkler <dpenkler@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/2024110417501...
```diff diff --git a/drivers/staging/gpib/Kconfig b/drivers/staging/gpib/Kconfig index 0ea9a276c389..95308d15a555 100644 --- a/drivers/staging/gpib/Kconfig +++ b/drivers/staging/gpib/Kconfig @@ -61,7 +61,7 @@ config GPIB_CEC_PCI config GPIB_NI_PCI_ISA tristate "NI PCI/ISA compatible boards" - depends on ISA_BUS + ...
7fa4e5bc10557fbdf459b66ce445c74c35b203a4
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Fix MODULES_DESCRIPTION
Problem Details: Use plural for adapters Fixes: ad59cf382cd5 ("staging: gpib: add module descriptions") Signed-off-by: Dave Penkler <dpenkler@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20241104175014.12317-6-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gre...
```diff diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index ca9c938284c9..02c6ec9a42a0 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -15,7 +15,7 @@ #include "tms9...
8023618a48dc8664a4493cc8279f988f9bd4ed0b
Analyze and fix the following issue in the Linux kernel code: staging: gpib: Fix buffer overflow in ni_usb_init
Problem Details: The writes buffer size was not taking into account the number of entries in the array which was causing random oopses. Fixes: 4e127de14fa7 ("staging: gpib: Add National Instruments USB GPIB driver") Signed-off-by: Dave Penkler <dpenkler@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> ...
```diff diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index 571f07800c9a..b7550a937f15 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -1726,7 +1726,7 @@ static int ni_usb_init(gpib_board_t *board) unsigned ...
a14908a9925baa043468e7c1a84d5ba0f77bb329
Analyze and fix the following issue in the Linux kernel code: media: ipu6: move the l2_unmap() up before l2_map()
Problem Details: l2_map() and l2_unmap() are better to be grouped together. l2_unmap() will soon be called from l2_map() for mapping optimization. Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com> [Sakari Ailus: Rebase on debug print fixes on 32-bit.] Signed-off-by: ...
```diff diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c index 11d69a64ad67..a87f53be5d57 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c @@ -254,6 +254,49 @@ static u32 *alloc_l2_pt(struct ipu6_mmu_info *mmu_info) return...
be7de823847bd136ff5db095cb9a4283b9630bba
Analyze and fix the following issue in the Linux kernel code: media: raspberrypi: cfe: Fix mapping of dmabuf buffers
Problem Details: When using buffers from DRM, DMA-API gives a warning about: "mapping sg segment longer than device claims to support [len=307200] [max=65536]" Add a call to vb2_dma_contig_set_max_seg_size() to tell the DMA-API about the supported segment size (which is UINT_MAX). Fixes: 6edb685abb2a ("media: raspber...
```diff diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c index 4800d9a2668a..12660087b12f 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c @@ -2340,6 +2340,10 @@ static int cfe_probe(struc...
1429826883bb18847092b2e04c6598ef34bae1d4
Analyze and fix the following issue in the Linux kernel code: media: intel/ipu6: do not handle interrupts when device is disabled
Problem Details: Some IPU6 devices have shared interrupts. We need to handle properly case when interrupt is triggered from other device on shared irq line and IPU6 itself disabled. In such case we get 0xffffffff from ISR_STATUS register and handle all irq's cases, for what we are not not prepared and usually hang the ...
```diff diff --git a/drivers/media/pci/intel/ipu6/ipu6-buttress.c b/drivers/media/pci/intel/ipu6/ipu6-buttress.c index 2cb828c87961..2e89af845166 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-buttress.c +++ b/drivers/media/pci/intel/ipu6/ipu6-buttress.c @@ -346,12 +346,16 @@ irqreturn_t ipu6_buttress_isr(int irq, void...
d5c7cc28aa9b58b8bb4ab4b501d2f7e15cc5c0e9
Analyze and fix the following issue in the Linux kernel code: media: i2c: st-mipid02: fix mipid02_stream_enable error handling
Problem Details: Following addition of cascaded s_stream call within mipid02_stream_enable and mipid02_stream_disable, the mipid02_stream_enable error handling must be fixed to simply disable the clocks & data lanes without also calling again the s_stream of the source subdev. Moreover, main control registers are rese...
```diff diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index b947a55281f0..bc637a651a22 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -480,7 +480,7 @@ static int mipid02_stream_enable(struct mipid02_dev *bridge) int ret = -EINVAL; if (!bridge->s_...
d0fef6de4f1b957e35a05a5ba4aab2a2576d6686
Analyze and fix the following issue in the Linux kernel code: media: ov08x40: Fix burst write sequence
Problem Details: It is necessary to account for I2C quirks in the burst mode path of this driver. Not all I2C controllers can accept arbitrarily long writes and this is represented in the quirks field of the adapter structure. Prior to this patch the following error message is seen on a Qualcomm X1E80100 CRD. [ 38....
```diff diff --git a/drivers/media/i2c/ov08x40.c b/drivers/media/i2c/ov08x40.c index 48df077522ad..be25e45175b1 100644 --- a/drivers/media/i2c/ov08x40.c +++ b/drivers/media/i2c/ov08x40.c @@ -1339,15 +1339,13 @@ static int ov08x40_read_reg(struct ov08x40 *ov08x, return 0; } -static int ov08x40_burst_fill_regs(struc...
d2842dec577900031826dc44e9bf0c66416d7173
Analyze and fix the following issue in the Linux kernel code: media: gspca: ov534-ov772x: Fix off-by-one error in set_frame_rate()
Problem Details: In set_frame_rate(), select a rate in rate_0 or rate_1 by checking sd->frame_rate >= r->fps in a loop, but the loop condition terminates when the index reaches zero, which fails to check the last elememt in rate_0 or rate_1. Check for >= 0 so that the last one in rate_0 or rate_1 is also checked. Fix...
```diff diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index 8b6a57f170d0..bdff64a29a33 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -847,7 +847,7 @@ static void set_frame_rate(struct gspca_dev *gspca_dev) r = rate_1; i = ARRAY_SIZE(rate_1);...
2a20869f7d798aa2b69e45b863eaf1b1ecf98278
Analyze and fix the following issue in the Linux kernel code: media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled
Problem Details: It is not valid to call pm_runtime_set_suspended() for devices with runtime PM enabled because it returns -EAGAIN if it is enabled already and working. So, call pm_runtime_disable() before to fix it. Cc: stable@vger.kernel.org Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper fun...
```diff diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 00eb98f53d47..5caa88b932b0 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -412,8 +412,8 @@ err_of_depopulate: of_platform_depopulate(dev); err_runtim...
316e74500d1c6589cba28cebe2864a0bceeb2396
Analyze and fix the following issue in the Linux kernel code: media: amphion: Fix pm_runtime_set_suspended() with runtime pm enabled
Problem Details: It is not valid to call pm_runtime_set_suspended() for devices with runtime PM enabled because it returns -EAGAIN if it is enabled already and working. So, call pm_runtime_disable() before to fix it. Cc: stable@vger.kernel.org Fixes: b50a64fc54af ("media: amphion: add amphion vpu device driver") Signe...
```diff diff --git a/drivers/media/platform/amphion/vpu_drv.c b/drivers/media/platform/amphion/vpu_drv.c index c6cbcaf433ee..efbfd2652721 100644 --- a/drivers/media/platform/amphion/vpu_drv.c +++ b/drivers/media/platform/amphion/vpu_drv.c @@ -151,8 +151,8 @@ err_add_decoder: media_device_cleanup(&vpu->mdev); v4l2_d...
d6594d50761728d09f23238cf9c368bab6260ef3
Analyze and fix the following issue in the Linux kernel code: media: i2c: dw9768: Fix pm_runtime_set_suspended() with runtime pm enabled
Problem Details: It is not valid to call pm_runtime_set_suspended() and pm_runtime_set_active() for devices with runtime PM enabled because it returns -EAGAIN if it is enabled already and working. So, adjust the order to fix it. Cc: stable@vger.kernel.org Fixes: 5f9a089b6de3 ("dw9768: Enable low-power probe on ACPI") ...
```diff diff --git a/drivers/media/i2c/dw9768.c b/drivers/media/i2c/dw9768.c index 18ef2b35c9aa..87a7c3ceeb11 100644 --- a/drivers/media/i2c/dw9768.c +++ b/drivers/media/i2c/dw9768.c @@ -471,10 +471,9 @@ static int dw9768_probe(struct i2c_client *client) * to be powered on in an ACPI system. Similarly for power off ...
8e9a03bd410d659e9ebb6a27ce2d032c7014c68b
Analyze and fix the following issue in the Linux kernel code: media: raspberrypi: Do some cleanup in probe()
Problem Details: If devm_clk_get() fails then we need to free "cfe" before returning. Fixes: 6edb685abb2a ("media: raspberrypi: Add support for RP1-CFE") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux...
```diff diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c index ac28089564b2..4800d9a2668a 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c @@ -2342,9 +2342,11 @@ static int cfe_probe(struc...
3bb5080293a3c96a41dd707db64ab8c7d8c471ae
Analyze and fix the following issue in the Linux kernel code: media: raspberrypi: Remove redundant "no IRQ" message
Problem Details: platform_get_irq() already provides a error message. This fixes the following cocci error: drivers/media/platform/raspberrypi/rp1-cfe/cfe.c:2326:2-9: line 2326 is redundant because platform_get_irq() already prints an error Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Sakari A...
```diff diff --git a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c index da9e1a1e4d0d..ac28089564b2 100644 --- a/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c +++ b/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c @@ -2323,7 +2323,6 @@ static int cfe_probe(struct...
c8e9120c2065868d97e9e94bceee777e5db08c3e
Analyze and fix the following issue in the Linux kernel code: media: ipu6: remove architecture DMA ops dependency in Kconfig
Problem Details: IPU6 driver doesn't override the dma_ops of device now, it doesn't depends on the ARCH_HAS_DMA_OPS, so remove the dependency in Kconfig. Fixes: de6c85bf918e ("dma-mapping: clearly mark DMA ops as an architecture feature") Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sa...
```diff diff --git a/drivers/media/pci/intel/ipu6/Kconfig b/drivers/media/pci/intel/ipu6/Kconfig index 4b9c207851ff..1129e2beb4be 100644 --- a/drivers/media/pci/intel/ipu6/Kconfig +++ b/drivers/media/pci/intel/ipu6/Kconfig @@ -4,12 +4,6 @@ config VIDEO_INTEL_IPU6 depends on VIDEO_DEV depends on X86 && HAS_DMA dep...
daabc5c64703432c4a8798421a3588c2c142c51b
Analyze and fix the following issue in the Linux kernel code: media: ipu6: not override the dma_ops of device in driver
Problem Details: DMA ops are a helper for architectures and not for drivers to override the DMA implementation. Driver should not override the DMA implementation. This patch removes the dma_ops override from auxiliary device and adds driver-internal helpers that use the actual DMA mapping APIs. Fixes: 9163d83573e4 ("...
```diff diff --git a/drivers/media/pci/intel/ipu6/ipu6-bus.c b/drivers/media/pci/intel/ipu6/ipu6-bus.c index 149ec098cdbf..37d88ddb6ee7 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-bus.c +++ b/drivers/media/pci/intel/ipu6/ipu6-bus.c @@ -94,8 +94,6 @@ ipu6_bus_initialize_device(struct pci_dev *pdev, struct device *par...
199c204bcc732ec18dbaec2b9d6445addbd376ea
Analyze and fix the following issue in the Linux kernel code: media: ipu6: Fix DMA and physical address debugging messages for 32-bit
Problem Details: Fix printing DMA and physical address printing on 32-bit platforms, by using correct types. Also cast DMA_BIT_MASK() result to dma_addr_t to make Clang happy. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Hans Verkuil <hverkuil...
```diff diff --git a/drivers/media/pci/intel/ipu6/ipu6-dma.c b/drivers/media/pci/intel/ipu6/ipu6-dma.c index 92530a1cc90f..801f6bd00a89 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-dma.c +++ b/drivers/media/pci/intel/ipu6/ipu6-dma.c @@ -428,11 +428,12 @@ static int ipu6_dma_map_sg(struct device *dev, struct scatterli...
c14f8046cd7c353176c53d2721d52a2bd6a648ec
Analyze and fix the following issue in the Linux kernel code: tools: testing: add additional vma_internal.h stubs
Problem Details: Patch series "fix error handling in mmap_region() and refactor", v3. The mmap_region() function is somewhat terrifying, with spaghetti-like control flow and numerous means by which issues can arise and incomplete state, memory leaks and other unpleasantness can occur. This series goes to great length...
```diff diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index c5b9da034511..e76ff579e1fd 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -44,7 +44,9 @@ #define VM_LOCKED 0x00002000 #define VM_IO 0x00004000 #define VM_DONTEXPAND 0x0004...
cf4a65539c136d78d1b3b20e94caeecb616ea9d9
Analyze and fix the following issue in the Linux kernel code: memcg-v1: no need for memcg locking for MGLRU
Problem Details: While updating the generation of the folios, MGLRU requires that the folio's memcg association remains stable. With the charge migration deprecated, there is no need for MGLRU to acquire locks to keep the folio and memcg association stable. [yuzhao@google.com: remove !rcu_read_lock_held() assertion] ...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 8d1301c0f22a..caba8e811ec5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3137,7 +3137,6 @@ static int folio_update_gen(struct folio *folio, int gen) unsigned long new_flags, old_flags = READ_ONCE(folio->flags); VM_WARN_ON_ONCE(gen >= MAX_NR_GENS); - VM_WARN_ON...
f3c7a1ede435e2e45177d7a490a85fb0a0ec96d1
Analyze and fix the following issue in the Linux kernel code: mm/damon/vaddr: fix issue in damon_va_evenly_split_region()
Problem Details: Patch series "mm/damon/vaddr: Fix issue in damon_va_evenly_split_region()". v2. According to the logic of damon_va_evenly_split_region(), currently following split case would not meet the expectation: Suppose DAMON_MIN_REGION=0x1000, Case: Split [0x0, 0x3000) into 2 pieces, then the result would...
```diff diff --git a/mm/damon/tests/vaddr-kunit.h b/mm/damon/tests/vaddr-kunit.h index 3dad8dfd9005..fcdccb614fd8 100644 --- a/mm/damon/tests/vaddr-kunit.h +++ b/mm/damon/tests/vaddr-kunit.h @@ -300,6 +300,7 @@ static void damon_test_split_evenly(struct kunit *test) damon_test_split_evenly_fail(test, 0, 100, 0); da...
8717734fdcc8472174830a647d47122b4581d62a
Analyze and fix the following issue in the Linux kernel code: mm/memcontrol: fix seq_buf size to save memory when PAGE_SIZE is large
Problem Details: Previously the seq_buf used for accumulating the memory.stat output was sized at PAGE_SIZE. But the amount of output is invariant to PAGE_SIZE; If 4K is enough on a 4K page system, then it should also be enough on a 64K page system, so we can save 60K on the static buffer used in mem_cgroup_print_oom_...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c93ecedf7a96..5fcdd25fc134 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -118,6 +118,7 @@ struct mem_cgroup *vmpressure_to_memcg(struct vmpressure *vmpr) return container_of(vmpr, struct mem_cgroup, vmpressure); } +#define SEQ_BUF_SIZE SZ_4K #de...
3f1f947a322d2bdf0b16ff9158ce6be7cc23b974
Analyze and fix the following issue in the Linux kernel code: tools/mm: free the allocated memory
Problem Details: The comm_str memory needs to be freed if the search_pattern function call fails in get_comm [akpm@linux-foundation.org: fix whitespace] Link: https://lkml.kernel.org/r/20241022012526.7597-1-liujing@cmss.chinamobile.com Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com> Signed-off-by: Andrew Morton...
```diff diff --git a/tools/mm/page_owner_sort.c b/tools/mm/page_owner_sort.c index e1f264444342..880e36df0c11 100644 --- a/tools/mm/page_owner_sort.c +++ b/tools/mm/page_owner_sort.c @@ -377,6 +377,7 @@ static char *get_comm(char *buf) if (errno != 0) { if (debug_on) fprintf(stderr, "wrong comm in follow buf:\...
722376934b6c0b8692f32784d7755bbe5be67529
Analyze and fix the following issue in the Linux kernel code: mm/memory.c: simplify pfnmap_lockdep_assert
Problem Details: Use local `mapping' to reduce the pointer chasing. akpm: extracted from a bugfix which Linus fixed with b1b46751671be ("mm: fix follow_pfnmap API lockdep assert"). Link: https://lkml.kernel.org/r/20241004-fix-null-deref-v4-1-d0a8ec01ac85@iiitd.ac.in Signed-off-by: Manas <manas18244@iiitd.ac.in> Revie...
```diff diff --git a/mm/memory.c b/mm/memory.c index 68e57b33363b..2d32023d4eb8 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6388,7 +6388,7 @@ static inline void pfnmap_lockdep_assert(struct vm_area_struct *vma) struct address_space *mapping = file ? file->f_mapping : NULL; if (mapping) - lockdep_assert(lockde...
ed265529d39ac408396c031a4fd7e1ef922b80d0
Analyze and fix the following issue in the Linux kernel code: mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub
Problem Details: alloc_tag_sub() takes bytes as opposed to number of pages as argument. Currently pgalloc_tag_copy() passes the number of pages. This fix passes the correct unit, which is the number of bytes allocated. Link: https://lkml.kernel.org/r/20241022232440.334820-1-souravpanda@google.com Fixes: e0a955bf7f61...
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index 4570f33e2429..eb070c14e309 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4207,7 +4207,7 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) /* Clear the old ref to the original allocation tag. */ clear_page_ta...
78c018e3942c5dfbab7e6edb4eb784943878504b
Analyze and fix the following issue in the Linux kernel code: maple_tree: fix outdated flag name in comment
Problem Details: MAPLE_USE_RCU was renamed to MT_FLAGS_USE_RCU at some point, fix up the comment. Link: https://lkml.kernel.org/r/20241007-maple-tree-doc-fix-v1-1-6bbf89c1153d@google.com Signed-off-by: Jann Horn <jannh@google.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Reviewed-by: Wei Yang <richard.we...
```diff diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index c2c11004085e..61c236850ca8 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -224,7 +224,7 @@ typedef struct { /* nothing */ } lockdep_map_p; * (set at tree creation time) and dynamic information set under the...
0938b1614648d5fbd832449a5a8a1b51d985323d
Analyze and fix the following issue in the Linux kernel code: mm: don't set readahead flag on a folio when lookahead_size > nr_to_read
Problem Details: The readahead flag is set on a folio based on the lookahead_size and nr_to_read. For example, when the readahead happens from index to index + nr_to_read, then the readahead `mark` offset from index is set at nr_to_read - lookahead_size. There are some scenarios where the lookahead_size > nr_to_read....
```diff diff --git a/mm/readahead.c b/mm/readahead.c index 3dc6c7a128dd..475d2940a1ed 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -206,9 +206,9 @@ void page_cache_ra_unbounded(struct readahead_control *ractl, unsigned long nr_to_read, unsigned long lookahead_size) { struct address_space *mapping = ractl->...
5a90c155defa684f3a21f68c3f8e40c056e6114c
Analyze and fix the following issue in the Linux kernel code: tmpfs: don't enable large folios if not supported
Problem Details: tmpfs can support large folios, but there are some configurable options (mount options and runtime deny/force) to enable/disable large folio allocation, so there is a performance issue when performing writes without large folios. The issue is similar to commit 4e527d5841e2 ("iomap: fault in smaller ch...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 6ad50ba60d8e..98fb539434f4 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2842,7 +2842,10 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, cache_no_acl(inode); if (sbinfo->noswap) mapping_set_unevictable(inode->i_mapping); - mapping_set_large_fol...
7146de5ff504003ed6f61c39c379b5777e7bed29
Analyze and fix the following issue in the Linux kernel code: tools: testing: fix phys_addr_t size on 64-bit systems
Problem Details: The phys_addr_t size is predicated on whether CONFIG_PHYS_ADDR_T_64BIT is set or not. In the VMA tests, virt_to_phys() from tools/include/linux casts a volatile void * pointer to phys_addr_t, if CONFIG_PHYS_ADDR_T_64BIT is not set, this will be 32-bit and trigger a warning. Obviously this might also ...
```diff diff --git a/tools/testing/shared/shared.mk b/tools/testing/shared/shared.mk index a6bc51d0b0bf..923ee2492256 100644 --- a/tools/testing/shared/shared.mk +++ b/tools/testing/shared/shared.mk @@ -69,6 +69,7 @@ generated/bit-length.h: FORCE @if ! grep -qws CONFIG_$(LONG_BIT)BIT generated/bit-length.h; then \ ...
f1001f3d3b6868998cab73d10fda1a5c99ddf963
Analyze and fix the following issue in the Linux kernel code: mm/mglru: reset page lru tier bits when activating
Problem Details: When a folio is activated, lru_gen_add_folio() moves the folio to the youngest generation. But unlike folio_update_gen()/folio_inc_gen(), lru_gen_add_folio() doesn't reset the folio lru tier bits (LRU_REFS_MASK | LRU_REFS_FLAGS). This inconsistency can affect how pages are aged via folio_mark_accesse...
```diff diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 6f801c7b36e2..355cf46a01a6 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -155,6 +155,11 @@ static inline int folio_lru_refs(struct folio *folio) return ((flags & LRU_REFS_MASK) >> LRU_REFS_PGOFF) + workingset;...
6c2625e9c2efef5272e1addf6007a1fcab1f059b
Analyze and fix the following issue in the Linux kernel code: x86/percpu: fix clang warning when dealing with unsigned types
Problem Details: Patch series "percpu: Add a test case and fix for clang", v2. Add a test case to percpu to check a corner case with the specific 64-bit unsigned value. This test case shows why the first patch is done in the way it's done. The before and after has been tested with binary comparison of the percpu_tes...
```diff diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index c55a79d5feae..e525cd85f999 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -234,9 +234,10 @@ do { \ */ #define percpu_add_op(size, qual, var, val) \ do { \ - const int pao_ID...
e4137f08816bbf91fe76d1b60fa16862a4827ac1
Analyze and fix the following issue in the Linux kernel code: mm, kasan, kmsan: instrument copy_from/to_kernel_nofault
Problem Details: Instrument copy_from_kernel_nofault() with KMSAN for uninitialized kernel memory check and copy_to_kernel_nofault() with KASAN, KCSAN to detect the memory corruption. syzbot reported that bpf_probe_read_kernel() kernel helper triggered KASAN report via kasan_check_range() which is not the expected beh...
```diff diff --git a/mm/kasan/kasan_test_c.c b/mm/kasan/kasan_test_c.c index d8fb281e439d..fe132ce3c2b3 100644 --- a/mm/kasan/kasan_test_c.c +++ b/mm/kasan/kasan_test_c.c @@ -1928,6 +1928,41 @@ static void rust_uaf(struct kunit *test) KUNIT_EXPECT_KASAN_FAIL(test, kasan_test_rust_uaf()); } +static void copy_to_ker...
5b2100f723bd5c2b5552b27208f3e7d7447910d3
Analyze and fix the following issue in the Linux kernel code: maple_tree: fix alloc node fail issue
Problem Details: In the following code, the second call to the mas_node_count will return -ENOMEM: mas_node_count(mas, MAPLE_ALLOC_SLOTS + 1); mas_node_count(mas, MAPLE_ALLOC_SLOTS * 2 + 2); This is because there may be some full maple_alloc node in current maple state. Use full maple_alloc node will make max_req ...
```diff diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a5e982e482dd..cdac15168405 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1285,7 +1285,10 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) node->node_count += count; allocated += count; - node = node->slot[0]; + /* ...
f69c2e4dc6840cf93a3370853966657aca9f13c6
Analyze and fix the following issue in the Linux kernel code: mm/vmstat: defer the refresh_zone_stat_thresholds after all CPUs bringup
Problem Details: refresh_zone_stat_thresholds function has two loops which is expensive for higher number of CPUs and NUMA nodes. Below is the rough estimation of total iterations done by these loops based on number of NUMA and CPUs. Total number of iterations: nCPU * 2 * Numa * mCPU Where: nCPU = total number of CP...
```diff diff --git a/mm/vmstat.c b/mm/vmstat.c index 1917c034c045..7b62bfb19afa 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1933,6 +1933,7 @@ static const struct seq_operations vmstat_op = { #ifdef CONFIG_SMP static DEFINE_PER_CPU(struct delayed_work, vmstat_work); int sysctl_stat_interval __read_mostly = HZ; +st...
5708d96da20b99b4665ad72395e3727016057f70
Analyze and fix the following issue in the Linux kernel code: mm: avoid zeroing user movable page twice with init_on_alloc=1
Problem Details: Commit 6471384af2a6 ("mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options") forces allocated page to be zeroed in post_alloc_hook() when init_on_alloc=1. For order-0 folios, if arch does not define vma_alloc_zeroed_movable_folio(), the default implementation again zeros the page re...
```diff diff --git a/include/linux/highmem.h b/include/linux/highmem.h index bec9bd715acf..6e452bd8e7e3 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -224,13 +224,7 @@ static inline struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma, unsigned long vaddr) { - struct...
002c5d1ca89c153e889e7fc3e0380cd807e40107
Analyze and fix the following issue in the Linux kernel code: mm/kmemleak: fix typo in object_no_scan() comment
Problem Details: Replace "corresponding to the give pointer" with "corresponding to the given pointer" Link: https://lkml.kernel.org/r/20241010155439.554416-1-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Andrew Morton <akpm@li...
```diff diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 0400f5e8ac60..17006d8a2afa 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1011,7 +1011,7 @@ static void object_set_excess_ref(unsigned long ptr, unsigned long excess_ref) } /* - * Set the OBJECT_NO_SCAN flag for the object corresponding to the give + * Se...
077c7c1e099f46b4abd0babf233d476597a4823a
Analyze and fix the following issue in the Linux kernel code: mm/memory.c: remove stray newline at top of file
Problem Details: Fixes: d61ea1cb0095 ("userfaultfd: UFFD_FEATURE_WP_ASYNC") Reported-by: Jeongjun Park <aha310510@gmail.com> Closes: https://lkml.kernel.org/r/20241007065307.4158-1-aha310510@gmail.com Cc: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: Peter Xu <peterx@redhat.com> Cc: Greg KH <gregkh@linuxfoundati...
```diff diff --git a/mm/memory.c b/mm/memory.c index 6bda739a60e8..5e9d6a22eb08 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1,4 +1,3 @@ - // SPDX-License-Identifier: GPL-2.0-only /* * linux/mm/memory.c ```
018d24539d9ed7531245a381ba24f5d9e8714682
Analyze and fix the following issue in the Linux kernel code: percpu: fix data race with pcpu_nr_empty_pop_pages
Problem Details: Fixes the data race by moving the read to be behind the pcpu_lock. This is okay because the code (initially) above it will not increase the empty populated page count because it is populating backing pages that already have allocations served out of them. Link: https://lkml.kernel.org/r/20241008001942...
```diff diff --git a/mm/percpu.c b/mm/percpu.c index da21680ff294..d1a73cf65c53 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1864,6 +1864,10 @@ restart: area_found: pcpu_stats_area_alloc(chunk, size); + + if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW) + pcpu_schedule_balance_work(); + spin_unlock_irq...
bd40b053fabe27209cb240d205a0c817cbe5fb87
Analyze and fix the following issue in the Linux kernel code: mm: consolidate common checks in hugetlb_get_unmapped_area
Problem Details: prepare_hugepage_range() performs almost the same checks for all architectures that define it, with the exception of mips and loongarch that also check for overflows. The rest checks for the addr and len to be properly aligned, so we can move that to hugetlb_get_unmapped_area() and get rid of a fair a...
```diff diff --git a/arch/loongarch/include/asm/hugetlb.h b/arch/loongarch/include/asm/hugetlb.h index 5da32c00d483..b837c65a4894 100644 --- a/arch/loongarch/include/asm/hugetlb.h +++ b/arch/loongarch/include/asm/hugetlb.h @@ -16,12 +16,7 @@ static inline int prepare_hugepage_range(struct file *file, unsigned lo...
b314e21596a48d21a88b8c6a98ecfea8d7b2d2a1
Analyze and fix the following issue in the Linux kernel code: maple_tree: do not hash pointers on dump in debug mode
Problem Details: Many maple tree values output when an mt_validate() or equivalent hits an issue utilise tagged pointers, most notably parent nodes. Also some pivots/slots contain meaningful values, output as pointers, such as the index of the last entry with data for example. All pointer values such as this are destr...
```diff diff --git a/lib/maple_tree.c b/lib/maple_tree.c index c5987244ff63..b3b1d4b8126b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -64,6 +64,21 @@ #define CREATE_TRACE_POINTS #include <trace/events/maple_tree.h> +/* + * Kernel pointer hashing renders much of the maple tree dump useless as tagged + * ...
5f5a3e9530beccce4564143eae1518dc5468bb9b
Analyze and fix the following issue in the Linux kernel code: mm/truncate: reset xa_has_values flag on each iteration
Problem Details: Currently mapping_try_invalidate() and invalidate_inode_pages2_range() traverses the xarray in batches and then for each batch, maintains and sets the flag named xa_has_values if the batch has a shadow entry to clear the entries at the end of the iteration. However they forgot to reset the flag at the...
```diff diff --git a/mm/truncate.c b/mm/truncate.c index 520c8cf8f58f..e5151703ba04 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -463,10 +463,10 @@ unsigned long mapping_try_invalidate(struct address_space *mapping, unsigned long ret; unsigned long count = 0; int i; - bool xa_has_values = false; folio_ba...
b33cc96c7020b923085046e5cf2e934f41c530ec
Analyze and fix the following issue in the Linux kernel code: mm: add PageAnonNotKsm()
Problem Details: Check that this anonymous page is really anonymous, not anonymous-or-KSM. This optimises the debug check, but its real purpose is to remove the last two users of PageKsm(). [willy@infradead.org: fix assertions] Link: https://lkml.kernel.org/r/ZwApWPER7caIA_N3@casper.infradead.org Link: https://lkml...
```diff diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index cc839e4365c1..1fcef06a2d31 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -689,6 +689,13 @@ static __always_inline bool folio_test_anon(const struct folio *folio) return ((unsigned long)folio->mapping & PAG...
0b120edb37dc9dd8ca82893d386922eb6b16f860
Analyze and fix the following issue in the Linux kernel code: scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset
Problem Details: Most drives rewind the tape when the device is reset. Reading and writing are not allowed until something is done to make the tape position match the user's expectation (e.g., rewind the tape). Add MTIOCGET and MTLOAD to operations allowed after reset. MTIOCGET is modified to not touch the tape if pos_...
```diff diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 9f480a1b4a81..4863802371a7 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -3506,6 +3506,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg) int i, cmd_nr, cmd_type, bt; int retval = 0; unsigned int blk; + ...
5bb2d6179d1a8039236237e1e94cfbda3be1ed9e
Analyze and fix the following issue in the Linux kernel code: scsi: st: Don't modify unknown block number in MTIOCGET
Problem Details: Struct mtget field mt_blkno -1 means it is unknown. Don't add anything to it. Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi> Link: https://bugzilla.kernel.org/show_bug.cgi?id=219419#c14 Link: https://lore.kernel.org/r/20241106095723.63254-2-Kai.Makisara@kolumbus.fi Reviewed-by: John Meneghini ...
```diff diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index d50bad3a2ce9..9f480a1b4a81 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -3756,7 +3756,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg) ((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK); ...
007cd6ba9aace998acab29a3b9e9b1ce02f91f5d
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Restore SM8650 support
Problem Details: Some early UFSHCI 4.0 controllers support the UFSHCI 3.0 register set. The UFSHCD_QUIRK_BROKEN_LSDBS_CAP quirk must be set for these controllers. Commit b92e5937e352 ("scsi: ufs: core: Move code out of an if-statement") changed the behavior for these controllers from working fine into "ufshcd_add_scsi_...
```diff diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index a5a0646bb80a..3b592492e152 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -874,7 +874,8 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba) if (host->hw_ver.major > 0x3) hba->quirks |= UFSH...
1f26339b2ed63d1e8e18a18674fb73a392f3660e
Analyze and fix the following issue in the Linux kernel code: net: vertexcom: mse102x: Fix possible double free of TX skb
Problem Details: The scope of the TX skb is wider than just mse102x_tx_frame_spi(), so in case the TX skb room needs to be expanded, we should free the the temporary skb instead of the original skb. Otherwise the original TX skb pointer would be freed again in mse102x_tx_work(), which leads to crashes: Internal erro...
```diff diff --git a/drivers/net/ethernet/vertexcom/mse102x.c b/drivers/net/ethernet/vertexcom/mse102x.c index a04d4073def9..2c37957478fb 100644 --- a/drivers/net/ethernet/vertexcom/mse102x.c +++ b/drivers/net/ethernet/vertexcom/mse102x.c @@ -222,7 +222,7 @@ static int mse102x_tx_frame_spi(struct mse102x_net *mse, stru...
2575897640328d218e4451d2c6f2741ae894ed27
Analyze and fix the following issue in the Linux kernel code: net: ucc_geth: fix usage with NVMEM MAC address
Problem Details: When nvmem is not ready, of_get_ethdev_address returns -EPROBE_DEFER. In such a case, return -EPROBE_DEFER to avoid not having a proper MAC address. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://patch.msgid.link/20241104210127.307420-5-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba...
```diff diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index acadebb7dd34..6663c1768089 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3732,7 +3732,9 @@ static int ucc_geth_probe(struct platform_device* ofdev...
4045de893f691f75193c606aec440c365cf7a7be
Analyze and fix the following issue in the Linux kernel code: scsi: sg: Enable runtime power management
Problem Details: In 2010, runtime power management support was implemented in the SCSI core. The description of patch "[SCSI] implement runtime Power Management" mentions that the sg driver is skipped but not why. This patch enables runtime power management even if an instance of the sg driver is held open. Enabling ...
```diff diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index f86be197fedd..84334ab39c81 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -307,10 +307,6 @@ sg_open(struct inode *inode, struct file *filp) if (retval) goto sg_put; - retval = scsi_autopm_get_device(device); - if (retval) - goto sdp_put...
95bbdca4999bc59a72ebab01663d421d6ce5775d
Analyze and fix the following issue in the Linux kernel code: scsi: qedi: Fix a possible memory leak in qedi_alloc_and_init_sb()
Problem Details: Hook "qedi_ops->common->sb_init = qed_sb_init" does not release the DMA memory sb_virt when it fails. Add dma_free_coherent() to free it. This is the same way as qedr_alloc_mem_sb() and qede_alloc_mem_sb(). Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Signed-...
```diff diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index c5aec26019d6..628d59dda20c 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -369,6 +369,7 @@ static int qedi_alloc_and_init_sb(struct qedi_ctx *qedi, ret = qedi_ops->common->sb_init(qedi->cdev, sb...
c62c30429db3eb4ced35c7fcf6f04a61ce3a01bb
Analyze and fix the following issue in the Linux kernel code: scsi: qedf: Fix a possible memory leak in qedf_alloc_and_init_sb()
Problem Details: Hook "qed_ops->common->sb_init = qed_sb_init" does not release the DMA memory sb_virt when it fails. Add dma_free_coherent() to free it. This is the same way as qedr_alloc_mem_sb() and qede_alloc_mem_sb(). Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Signed-of...
```diff diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index df756f3eef3e..d2f47dc31dbf 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -2738,6 +2738,7 @@ static int qedf_alloc_and_init_sb(struct qedf_ctx *qedf, sb_id, QED_SB_TYPE_STORAGE); if (ret...
bd65694223f7ad11c790ab63ad1af87a771192ee
Analyze and fix the following issue in the Linux kernel code: scsi: fusion: Remove unused variable 'rc'
Problem Details: The return value of scsi_device_reprobe() is currently ignored in _scsih_reprobe_lun(). Fixing the calling code to deal with the potential error is non-trivial, so for now just WARN_ON(). The handling of scsi_device_reprobe()'s return value refers to _scsih_reprobe_lun() and the following link: https...
```diff diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index a0bcb0864ecd..a798e26c6402 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -4231,10 +4231,8 @@ mptsas_find_phyinfo_by_phys_disk_num(MPT_ADAPTER *ioc, u8 phys_disk_num, static void mptsas_...
178b8f38932d635e90f5f0e9af1986c6f4a89271
Analyze and fix the following issue in the Linux kernel code: scsi: bfa: Fix use-after-free in bfad_im_module_exit()
Problem Details: BUG: KASAN: slab-use-after-free in __lock_acquire+0x2aca/0x3a20 Read of size 8 at addr ffff8881082d80c8 by task modprobe/25303 Call Trace: <TASK> dump_stack_lvl+0x95/0xe0 print_report+0xcb/0x620 kasan_report+0xbd/0xf0 __lock_acquire+0x2aca/0x3a20 lock_acquire+0x19b/0x520 _raw_spin_lock+0x2b/0x4...
```diff diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 19675a6e0780..6aa1d3a7e24b 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c @@ -1673,9 +1673,8 @@ bfad_init(void) error = bfad_im_module_init(); if (error) { - error = -ENOMEM; printk(KERN_WARNING "bfad_im_module_in...
da5aeca99dd0b6c7bf6679382756ea6bda195f72
Analyze and fix the following issue in the Linux kernel code: scsi: target: Fix incorrect function name in pscsi_create_type_disk()
Problem Details: In pr_err(), bdev_open_by_path() should be renamed to bdev_file_open_by_path() Fixes: 034f0cf8fdf9 ("target: port block device access to file") Signed-off-by: Baolin Liu <liubaolin@kylinos.cn> Link: https://lore.kernel.org/r/20241030021800.234980-1-liubaolin12138@163.com Signed-off-by: Martin K. Peter...
```diff diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index f98ebb18666b..da7017113f92 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -369,7 +369,7 @@ static int pscsi_create_type_disk(struct se_device *dev, struct scsi_device *sd) bd...