{"id":"CVE-2025-71111","state":"PUBLISHED","title":"hwmon: (w83791d) Convert macros to functions to avoid TOCTOU","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nhwmon: (w83791d) Convert macros to functions to avoid TOCTOU\n\nThe macro FAN_FROM_REG evaluates its arguments multiple times. When used\nin lockless contexts involving shared driver data, this leads to\nTime-of-Check to Time-of-Use (TOCTOU) race conditions, potentially\ncausing divide-by-zero errors.\n\nConvert the macro to a static function. This guarantees that arguments\nare evaluated only once (pass-by-value), preventing the race\nconditions.\n\nAdditionally, in store_fan_div, move the calculation of the minimum\nlimit inside the update lock. This ensures that the read-modify-write\nsequence operates on consistent data.\n\nAdhere to the principle of minimal changes by only converting macros\nthat evaluate arguments multiple times and are used in lockless\ncontexts.","publishedAt":"2026-01-14T15:05:58.649Z","updatedAt":"2026-10-19T18:15:13.644Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"3dceb68f6ad33156032ef4da21a93d84059cca6d","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"bf5b03227f2e6d4360004886d268f9df8993ef8f","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"f2b579a0c37c0df19603d719894a942a295f634a","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"f94800fbc26ccf7c81eb791707b038a57aa39a18","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"a9fb6e8835a22f5796c1182ed612daed3fd273af","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"c8cf0c2bdcccc6634b6915ff793b844e12436680","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"670d7ef945d3a84683594429aea6ab2cdfa5ceb4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/hwmon/w83791d.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.18","versionType":"semver"},{"version":"5.10.248","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.198","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.160","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.120","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.64","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.3","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/hwmon/w83791d.c"]}],"references":["https://git.kernel.org/stable/c/3dceb68f6ad33156032ef4da21a93d84059cca6d","https://git.kernel.org/stable/c/bf5b03227f2e6d4360004886d268f9df8993ef8f","https://git.kernel.org/stable/c/f2b579a0c37c0df19603d719894a942a295f634a","https://git.kernel.org/stable/c/f94800fbc26ccf7c81eb791707b038a57aa39a18","https://git.kernel.org/stable/c/a9fb6e8835a22f5796c1182ed612daed3fd273af","https://git.kernel.org/stable/c/c8cf0c2bdcccc6634b6915ff793b844e12436680","https://git.kernel.org/stable/c/670d7ef945d3a84683594429aea6ab2cdfa5ceb4"],"weaknesses":["CWE-362"],"ingestedAt":"2026-10-29T20:10:04.440Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/71xxx/CVE-2025-71111.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-71111","state":"PUBLISHED","datePublished":"2026-01-14T15:05:58.649Z","dateUpdated":"2026-10-19T18:15:13.644Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-01-13T15:30:19.653Z"},"containers":{"cna":{"title":"hwmon: (w83791d) Convert macros to functions to avoid TOCTOU","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nhwmon: (w83791d) Convert macros to functions to avoid TOCTOU\n\nThe macro FAN_FROM_REG evaluates its arguments multiple times. When used\nin lockless contexts involving shared driver data, this leads to\nTime-of-Check to Time-of-Use (TOCTOU) race conditions, potentially\ncausing divide-by-zero errors.\n\nConvert the macro to a static function. This guarantees that arguments\nare evaluated only once (pass-by-value), preventing the race\nconditions.\n\nAdditionally, in store_fan_div, move the calculation of the minimum\nlimit inside the update lock. This ensures that the read-modify-write\nsequence operates on consistent data.\n\nAdhere to the principle of minimal changes by only converting macros\nthat evaluate arguments multiple times and are used in lockless\ncontexts."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"3dceb68f6ad33156032ef4da21a93d84059cca6d","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"bf5b03227f2e6d4360004886d268f9df8993ef8f","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"f2b579a0c37c0df19603d719894a942a295f634a","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"f94800fbc26ccf7c81eb791707b038a57aa39a18","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"a9fb6e8835a22f5796c1182ed612daed3fd273af","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"c8cf0c2bdcccc6634b6915ff793b844e12436680","versionType":"git"},{"version":"9873964d6eb24bd0205394f9b791de9eddbcb855","status":"affected","lessThan":"670d7ef945d3a84683594429aea6ab2cdfa5ceb4","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/hwmon/w83791d.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.18","versionType":"semver"},{"version":"5.10.248","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.198","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.160","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.120","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.64","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.3","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/hwmon/w83791d.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/3dceb68f6ad33156032ef4da21a93d84059cca6d"},{"url":"https://git.kernel.org/stable/c/bf5b03227f2e6d4360004886d268f9df8993ef8f"},{"url":"https://git.kernel.org/stable/c/f2b579a0c37c0df19603d719894a942a295f634a"},{"url":"https://git.kernel.org/stable/c/f94800fbc26ccf7c81eb791707b038a57aa39a18"},{"url":"https://git.kernel.org/stable/c/a9fb6e8835a22f5796c1182ed612daed3fd273af"},{"url":"https://git.kernel.org/stable/c/c8cf0c2bdcccc6634b6915ff793b844e12436680"},{"url":"https://git.kernel.org/stable/c/670d7ef945d3a84683594429aea6ab2cdfa5ceb4"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T21:55:03.314Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"5.10.248"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"5.15.198"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"6.1.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"6.6.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"6.12.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"6.18.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.18","versionEndExcluding":"6.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-71111","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-06-10T20:42:13.069072Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-362","lang":"en","type":"CWE","description":"CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-19T18:15:13.644Z"}}]}}}