{"id":"CVE-2022-50322","state":"PUBLISHED","title":"rtc: msc313: Fix function prototype mismatch in msc313_rtc_probe()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nrtc: msc313: Fix function prototype mismatch in msc313_rtc_probe()\n\nWith clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG),\nindirect call targets are validated against the expected function\npointer prototype to make sure the call target is valid to help mitigate\nROP attacks. If they are not identical, there is a failure at run time,\nwhich manifests as either a kernel panic or thread getting killed.\n\nmsc313_rtc_probe() was passing clk_disable_unprepare() directly, which\ndid not have matching prototypes for devm_add_action_or_reset()'s\ncallback argument. Refactor to use devm_clk_get_enabled() instead.\n\nThis was found as a result of Clang's new -Wcast-function-type-strict\nflag, which is more sensitive than the simpler -Wcast-function-type,\nwhich only checks for type width mismatches.","publishedAt":"2025-09-15T14:48:55.905Z","updatedAt":"2026-05-11T19:17:04.462Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"be7d9c9161b9c76edeff15e79edc2f256568fe05","status":"affected","lessThan":"5affaaf3334c9274131dae889ed79ea0553d61b4","versionType":"git"},{"version":"be7d9c9161b9c76edeff15e79edc2f256568fe05","status":"affected","lessThan":"ba50fee6b41bcbafaeed3c51f90d37d1480ff9a0","versionType":"git"},{"version":"be7d9c9161b9c76edeff15e79edc2f256568fe05","status":"affected","lessThan":"21b8a1dd56a163825e5749b303858fb902ebf198","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/rtc/rtc-msc313.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.16","versionType":"semver"},{"version":"6.0.17","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.3","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/rtc/rtc-msc313.c"]}],"references":["https://git.kernel.org/stable/c/5affaaf3334c9274131dae889ed79ea0553d61b4","https://git.kernel.org/stable/c/ba50fee6b41bcbafaeed3c51f90d37d1480ff9a0","https://git.kernel.org/stable/c/21b8a1dd56a163825e5749b303858fb902ebf198"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50322.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50322","state":"PUBLISHED","datePublished":"2025-09-15T14:48:55.905Z","dateUpdated":"2026-05-11T19:17:04.462Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-09-15T14:18:36.814Z"},"containers":{"cna":{"title":"rtc: msc313: Fix function prototype mismatch in msc313_rtc_probe()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nrtc: msc313: Fix function prototype mismatch in msc313_rtc_probe()\n\nWith clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG),\nindirect call targets are validated against the expected function\npointer prototype to make sure the call target is valid to help mitigate\nROP attacks. If they are not identical, there is a failure at run time,\nwhich manifests as either a kernel panic or thread getting killed.\n\nmsc313_rtc_probe() was passing clk_disable_unprepare() directly, which\ndid not have matching prototypes for devm_add_action_or_reset()'s\ncallback argument. Refactor to use devm_clk_get_enabled() instead.\n\nThis was found as a result of Clang's new -Wcast-function-type-strict\nflag, which is more sensitive than the simpler -Wcast-function-type,\nwhich only checks for type width mismatches."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"be7d9c9161b9c76edeff15e79edc2f256568fe05","status":"affected","lessThan":"5affaaf3334c9274131dae889ed79ea0553d61b4","versionType":"git"},{"version":"be7d9c9161b9c76edeff15e79edc2f256568fe05","status":"affected","lessThan":"ba50fee6b41bcbafaeed3c51f90d37d1480ff9a0","versionType":"git"},{"version":"be7d9c9161b9c76edeff15e79edc2f256568fe05","status":"affected","lessThan":"21b8a1dd56a163825e5749b303858fb902ebf198","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/rtc/rtc-msc313.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.16","versionType":"semver"},{"version":"6.0.17","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.3","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/rtc/rtc-msc313.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/5affaaf3334c9274131dae889ed79ea0553d61b4"},{"url":"https://git.kernel.org/stable/c/ba50fee6b41bcbafaeed3c51f90d37d1480ff9a0"},{"url":"https://git.kernel.org/stable/c/21b8a1dd56a163825e5749b303858fb902ebf198"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:17:04.462Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.0.17"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.1.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}