lkml.org 
[lkml]   [2021]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 000/190] Revertion of all of the umn.edu commits
On Wed, 21 Apr 2021, Qiushi Wu wrote:

> The function description of "kobject_init_and_add()" mentioned that "If
> this function returns an error, kobject_put() must be called to properly
> clean up the memory associated with the object." (see
> https://elixir.bootlin.com/linux/v5.12-rc8/source/lib/kobject.c#L464) So
> we use this patch to fix the issue, and I may miss some context here,
> but I don't see why this cause some issue like NULL dereferences.
>
> The identification methodology for this bug and other similar bugs that
> are error-handling related, is shown in "Understanding and Detecting
> Disordered Error Handling with Precise Function Pairing."
> (https://www.usenix.org/conference/usenixsecurity21/presentation/wu-qiushi)

You are calling kobject_put() if kobject_init_and_add() fails. That will
in turn invoke pci_slot_release() which will try to delete slot->list, but
that hasn't been initialized yet.

Fixed in 4684709bf8, present in two major Linux kernel releases.

--
Jiri Kosina
SUSE Labs

\
 
 \ /
  Last update: 2021-04-21 17:48    [W:0.350 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site