ipmi: fix use after free in _ipmi_destroy_user()
commita92ce570c8upstream. The intf_free() function frees the "intf" pointer so we cannot dereference it again on the next line. Fixes:cbb79863fc("ipmi: Don't allow device module unload when in use") Signed-off-by: Dan Carpenter <error27@gmail.com> Message-Id: <Y3M8xa1drZv4CToE@kili> Cc: <stable@vger.kernel.org> # 5.5+ Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bfe1e039a0
commit
f29d127b37
1 changed files with 3 additions and 1 deletions
|
|
@ -1284,6 +1284,7 @@ static void _ipmi_destroy_user(struct ipmi_user *user)
|
|||
unsigned long flags;
|
||||
struct cmd_rcvr *rcvr;
|
||||
struct cmd_rcvr *rcvrs = NULL;
|
||||
struct module *owner;
|
||||
|
||||
if (!acquire_ipmi_user(user, &i)) {
|
||||
/*
|
||||
|
|
@ -1345,8 +1346,9 @@ static void _ipmi_destroy_user(struct ipmi_user *user)
|
|||
kfree(rcvr);
|
||||
}
|
||||
|
||||
owner = intf->owner;
|
||||
kref_put(&intf->refcount, intf_free);
|
||||
module_put(intf->owner);
|
||||
module_put(owner);
|
||||
}
|
||||
|
||||
int ipmi_destroy_user(struct ipmi_user *user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue