Unverified Commit cd7b4d4e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9155 fix CVE-2023-52791

Merge Pull Request from: @ci-robot 
 
PR sync from: Kaixiong Yu <yukaixiong@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/H465YQ3OKS2PNCWVPSEC4LQLBXHJUXAR/ 
Benjamin Bara (2):
  i2c: core: Run atomic i2c xfer when !preemptible
  i2c: core: Fix atomic xfer check for non-preempt config


-- 
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/I9RFEQ 
 
Link:https://gitee.com/openeuler/kernel/pulls/9155

 

Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 74a41a12 61baa548
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
 * i2c-core.h - interfaces internal to the I2C framework
 */

#include <linux/kconfig.h>
#include <linux/rwsem.h>

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

static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap)