Skip to content

Thermald next#566

Merged
spandruvada merged 18 commits into
masterfrom
thermald_next
May 13, 2026
Merged

Thermald next#566
spandruvada merged 18 commits into
masterfrom
thermald_next

Conversation

@spandruvada
Copy link
Copy Markdown
Contributor

No description provided.

gaul and others added 18 commits May 13, 2026 09:00
This avoids unneeded system calls.

Signed-off-by: Andrew Gaul <andrew@gaul.org>
Use O_NOFOLLOW to avoid symbolic links.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
The loop had no termination condition, so when no trip point of the
requested type existed, the unsigned index underflowed past 0 to
UINT_MAX and the loop read trip_points out of bounds indefinitely.
Bound the loop with j >= 0 so it exits cleanly when no match is found.

Signed-off-by: Andrew Gaul <andrew@gaul.org>

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrew Gaul <andrew@gaul.org>
When in the config directory the file "thermald-features.xml" is
present, it gives ability to disable some features. Currently
it allows
DbusControl
XMLThermalConfig
DataVaultFromFileSystem
KobjectUeventSupport

When 0 that feature is disabled.

If the file is absent all features are enabled.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Use feature configs to enable/disable a feature.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
thd_sys_fs.cpp:203:4: warning: Value stored to 'ret' is never
read [clang-analyzer-deadcode.DeadStores]
  203 |                         ret = -EIO;

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Use O_NOFOLLOW when opening lock file. Also replace
std::ofstream fout with open with O_NOFOLLOW.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Read one less than size of string via pread and foce NULL
characted at the last character.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
No need for static for pref_str.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Move to TDRUNDIR instead of /tmp.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Although data vault source is BIOS, check for buffer overflows.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Add get_string_obj() which checks for bounds in GDDV.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
When reading from file system use sysfs class, so that all file
operations uses same method.

Signed-off-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Found via bugprone-throwing-static-initialization.

Signed-off-by: Andrew Gaul <andrew@gaul.org>
This is sufficient to compile warning-free with clang-tidy 22.

Signed-off-by: Andrew Gaul <andrew@gaul.org>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andrew Gaul <andrew@gaul.org>
@spandruvada spandruvada merged commit a125039 into master May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants