Skip to content

Commit f115f77

Browse files
committed
Merge: i2c: core: Run atomic i2c xfer when !preemptible fixes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4298 Description: Updates i2c: core: Run atomic i2c xfer when !preemptible fixes JIRA: https://issues.redhat.com/browse/RHEL-38315 CVE: CVE-2023-52791 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=61417586 Tested: Did sanity i2c testing Intel (intel-arrowlake-s-02) system. Signed-off-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Lucas Zampieri <lzampier@redhat.com>
2 parents f9a4186 + a418530 commit f115f77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/i2c/i2c-core.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* i2c-core.h - interfaces internal to the I2C framework
44
*/
55

6+
#include <linux/kconfig.h>
67
#include <linux/rwsem.h>
78

89
struct i2c_devinfo {
@@ -29,7 +30,8 @@ int i2c_dev_irq_from_resources(const struct resource *resources,
2930
*/
3031
static inline bool i2c_in_atomic_xfer_mode(void)
3132
{
32-
return system_state > SYSTEM_RUNNING && irqs_disabled();
33+
return system_state > SYSTEM_RUNNING &&
34+
(IS_ENABLED(CONFIG_PREEMPT_COUNT) ? !preemptible() : irqs_disabled());
3335
}
3436

3537
static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap)

0 commit comments

Comments
 (0)