All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: tomasz.wroblewski@citrix.com,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH] linux-2.6.18: netback: take	net_schedule_list_lock when removing entry from net_schedule_list
Date: Thu, 04 Nov 2010 12:09:14 +0100	[thread overview]
Message-ID: <4CD2945A.4040301@redhat.com> (raw)
In-Reply-To: <4CCFD63D0200007800020366@vpn.id2.novell.com>

Hi,

On 11/02/10 09:13, Jan Beulich wrote:
> From: Ian Campbell<ian.campbell@citrix.com>
>
> There is a race in net_tx_build_mops between checking if
> net_schedule_list is empty and actually dequeuing the first entry on
> the list. If another thread dequeues the only entry on the list during
> this window we crash because list_first_entry expects a non-empty
> list, like so:
>
> [trace snipped]

I can't find a net_tx_build_mops() function in 2.6.18. I believe I can 
see what the patch does (*), but for 2.6.18, I think the consequences of 
popping one from an empty list differ from the above.

Therefore, can somebody please describe how to reproduce this bug? What 
steps did lead to the NULL dereference in the original 2.6.32 environment?

(*) It takes the locking out of remove_from_net_schedule_list() and 
moves that reponsibility to the callers of 
remove_from_net_schedule_list(). This is justified by the difference 
between call sites: netif_deschedule_work() follows the old behavior, 
but poll_net_schedule_list() (and transitively, net_tx_action()) needs 
to lock the following together:
- checking for non-emptiness,
- modifying the first element,
- removing the first element from the list.

I think without the patch the race could result in memory corruption 
(even if with different consequences than above), but how can one 
trigger the race?

Thank you,
Laszlo Ersek

  reply	other threads:[~2010-11-04 11:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  8:13 [PATCH] linux-2.6.18: netback: take net_schedule_list_lock when removing entry from net_schedule_list Jan Beulich
2010-11-04 11:09 ` Laszlo Ersek [this message]
2010-11-04 11:15   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CD2945A.4040301@redhat.com \
    --to=lersek@redhat.com \
    --cc=JBeulich@novell.com \
    --cc=ian.campbell@citrix.com \
    --cc=tomasz.wroblewski@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.