[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81102f38-3e1f-ec36-3119-a098bd5a85c4@gmail.com>
Date: Wed, 23 Feb 2022 14:23:47 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: "Zhang, Qiang1" <qiang1.zhang@...el.com>,
syzbot <syzbot+348b571beb5eeb70a582@...kaller.appspotmail.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rafael@...nel.org" <rafael@...nel.org>,
"syzkaller-bugs@...glegroups.com" <syzkaller-bugs@...glegroups.com>,
"balbi@...nel.org" <balbi@...nel.org>,
"stern@...land.harvard.edu" <stern@...land.harvard.edu>
Subject: Re: [syzbot] KASAN: use-after-free Read in dev_uevent
Hi Qiang1,
On 2/23/22 14:17, Zhang, Qiang1 wrote:
>
> Cc: Alan Stern
> Felipe Balbi
>
> Hello syzbot, Please try it:
>
> From 574d45ff924e2d2f9b9f5cc3e846f8004498a811 Mon Sep 17 00:00:00 2001
> From: Zqiang <qiang1.zhang@...el.com>
> Date: Wed, 23 Feb 2022 18:18:22 +0800
> Subject: [PATCH] driver core: Fix use-after-free in dev_uevent()
>
> In dev_uevent(), if the "dev->driver" is valid, the "dev->driver->name"
> be accessed, there may be a window period between these two operations.
> in this window period if the "dev->driver" is set to null
> (in usb_gadget_unregister_driver function), when the "dev->driver->name"
> is accessed again, invalid address will be accessed. fix it by checking
> "dev->driver" again.
>
> Signed-off-by: Zqiang <qiang1.zhang@...el.com>
> ---
> drivers/base/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 3d6430eb0c6a..a45b927ee76e 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -2317,7 +2317,7 @@ static int dev_uevent(struct kobject *kobj, struct kobj_uevent_env *env)
> add_uevent_var(env, "DEVTYPE=%s", dev->type->name);
>
> if (dev->driver)
> - add_uevent_var(env, "DRIVER=%s", dev->driver->name);
> + add_uevent_var(env, "DRIVER=%s", dev_driver_string(dev));
>
> /* Add common DT information about the device */
> of_device_uevent(dev, env);
> --
> 2.25.1
>
you should use '#syz test' command to ask syzbot to test the patch.
Basic syntax is '#syz test: <git tree> <branch or sha>' and syzbot will
apply attached patch (if you have attached it)
More about syzbot interactions here [1].
[1]
https://github.com/google/syzkaller/blob/15439f1624735bde5ae3f3b66c1b964a98
With regards,
Pavel Skripkin
Powered by blists - more mailing lists