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

!11068 Fix CVE-2024-39501

Merge Pull Request from: @ci-robot 
 
PR sync from: Chen Jun <chenjun102@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/WM6G6G7QIESWMGOHFWPDCFJ2SBS3KWPJ/ 
*** BLURB HERE ***

Amit Cohen (1):
  selftests: forwarding: devlink_lib: Wait for udev events after
    reloading

Dan Williams (1):
  driver core: Fix uevent_show() vs driver detach race

Dirk Behme (1):
  drivers: core: synchronize really_probe() and dev_uevent()


-- 
2.17.1
 
https://gitee.com/src-openeuler/kernel/issues/IACSAA 
 
Link:https://gitee.com/openeuler/kernel/pulls/11068

 

Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Reviewed-by: default avatarLiu YongQiang <liuyongqiang13@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents 0e9c3469 30fcc850
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/mutex.h>
#include <linux/pm_runtime.h>
#include <linux/netdevice.h>
#include <linux/rcupdate.h>
#include <linux/sched/signal.h>
#include <linux/sysfs.h>

@@ -1137,6 +1138,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
		      struct kobj_uevent_env *env)
{
	struct device *dev = kobj_to_dev(kobj);
	struct device_driver *driver;
	int retval = 0;

	/* add device node properties if present */
@@ -1165,8 +1167,12 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
	if (dev->type && dev->type->name)
		add_uevent_var(env, "DEVTYPE=%s", dev->type->name);

	if (dev->driver)
		add_uevent_var(env, "DRIVER=%s", dev->driver->name);
	/* Synchronize with module_remove_driver() */
	rcu_read_lock();
	driver = READ_ONCE(dev->driver);
	if (driver)
		add_uevent_var(env, "DRIVER=%s", driver->name);
	rcu_read_unlock();

	/* Add common DT information about the device */
	of_device_uevent(dev, env);
+4 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/rcupdate.h>
#include "base.h"

static char *make_driver_name(struct device_driver *drv)
@@ -77,6 +78,9 @@ void module_remove_driver(struct device_driver *drv)
	if (!drv)
		return;

	/* Synchronize with dev_uevent() */
	synchronize_rcu();

	sysfs_remove_link(&drv->p->kobj, "module");

	if (drv->owner)
+2 −0
Original line number Diff line number Diff line
@@ -105,4 +105,6 @@ devlink_reload()
	still_pending=$(devlink resource show "$DEVLINK_DEV" | \
			grep -c "size_new")
	check_err $still_pending "Failed reload - There are still unset sizes"

	udevadm settle
}