All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Wang <wei.w.wang@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	linux-mm@kvack.org, mhocko@kernel.org, akpm@linux-foundation.org,
	pbonzini@redhat.com, liliang.opensource@gmail.com,
	yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com,
	riel@redhat.com
Subject: [virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
Date: Fri, 19 Jan 2018 14:24:11 +0800	[thread overview]
Message-ID: <5A618F0B.4090805@intel.com> (raw)
In-Reply-To: <20180117180337-mutt-send-email-mst@kernel.org>

On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote:
> On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote:
>>   
>> +static void virtballoon_changed(struct virtio_device *vdev)
>> +{
>> +	struct virtio_balloon *vb = vdev->priv;
>> +	unsigned long flags;
>> +	__u32 cmd_id;
>> +	s64 diff = towards_target(vb);
>> +
>> +	if (diff) {
>> +		spin_lock_irqsave(&vb->stop_update_lock, flags);
>> +		if (!vb->stop_update)
> Why do you ignore stop_update for freeze?
> This means new wq entries can be added during remove
> causing use after free issues.

I think stop_update isn't needed, because the lock has already been 
handled internally by the APIs. Similar examples like 
mem_cgroup_css_free() in "mm/memcontrol.c", there is no such locks used 
for cancel_work_sync(&memcg->high_work).

Best,
Wei

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


WARNING: multiple messages have this Message-ID (diff)
From: Wei Wang <wei.w.wang@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	linux-mm@kvack.org, mhocko@kernel.org, akpm@linux-foundation.org,
	pbonzini@redhat.com, liliang.opensource@gmail.com,
	yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com,
	riel@redhat.com
Subject: Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
Date: Fri, 19 Jan 2018 14:24:11 +0800	[thread overview]
Message-ID: <5A618F0B.4090805@intel.com> (raw)
In-Reply-To: <20180117180337-mutt-send-email-mst@kernel.org>

On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote:
> On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote:
>>   
>> +static void virtballoon_changed(struct virtio_device *vdev)
>> +{
>> +	struct virtio_balloon *vb = vdev->priv;
>> +	unsigned long flags;
>> +	__u32 cmd_id;
>> +	s64 diff = towards_target(vb);
>> +
>> +	if (diff) {
>> +		spin_lock_irqsave(&vb->stop_update_lock, flags);
>> +		if (!vb->stop_update)
> Why do you ignore stop_update for freeze?
> This means new wq entries can be added during remove
> causing use after free issues.

I think stop_update isn't needed, because the lock has already been 
handled internally by the APIs. Similar examples like 
mem_cgroup_css_free() in "mm/memcontrol.c", there is no such locks used 
for cancel_work_sync(&memcg->high_work).

Best,
Wei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Wei Wang <wei.w.wang@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	linux-mm@kvack.org, mhocko@kernel.org, akpm@linux-foundation.org,
	pbonzini@redhat.com, liliang.opensource@gmail.com,
	yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com,
	riel@redhat.com
Subject: Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
Date: Fri, 19 Jan 2018 14:24:11 +0800	[thread overview]
Message-ID: <5A618F0B.4090805@intel.com> (raw)
In-Reply-To: <20180117180337-mutt-send-email-mst@kernel.org>

On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote:
> On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote:
>>   
>> +static void virtballoon_changed(struct virtio_device *vdev)
>> +{
>> +	struct virtio_balloon *vb = vdev->priv;
>> +	unsigned long flags;
>> +	__u32 cmd_id;
>> +	s64 diff = towards_target(vb);
>> +
>> +	if (diff) {
>> +		spin_lock_irqsave(&vb->stop_update_lock, flags);
>> +		if (!vb->stop_update)
> Why do you ignore stop_update for freeze?
> This means new wq entries can be added during remove
> causing use after free issues.

I think stop_update isn't needed, because the lock has already been 
handled internally by the APIs. Similar examples like 
mem_cgroup_css_free() in "mm/memcontrol.c", there is no such locks used 
for cancel_work_sync(&memcg->high_work).

Best,
Wei

  parent reply	other threads:[~2018-01-19  6:21 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  5:10 [virtio-dev] [PATCH v22 0/3] Virtio-balloon: support free page reporting Wei Wang
2018-01-17  5:10 ` Wei Wang
2018-01-17  5:10 ` Wei Wang
2018-01-17  5:10 ` [virtio-dev] [PATCH v22 1/3] mm: support reporting free page blocks Wei Wang
2018-01-17  5:10   ` Wei Wang
2018-01-17  5:10   ` Wei Wang
2018-01-17  5:10 ` Wei Wang
2018-01-17  5:10 ` [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ Wei Wang
2018-01-17  5:10 ` [virtio-dev] " Wei Wang
2018-01-17  5:10   ` Wei Wang
2018-01-17  5:10   ` Wei Wang
2018-01-17  8:21   ` Pankaj Gupta
2018-01-17  8:21   ` Pankaj Gupta
2018-01-17  8:21     ` Pankaj Gupta
2018-01-17  9:00     ` Wei Wang
2018-01-17  9:00     ` [virtio-dev] " Wei Wang
2018-01-17  9:00       ` Wei Wang
2018-01-17  9:00       ` Wei Wang
2018-01-17  9:27       ` Pankaj Gupta
2018-01-17  9:27       ` Pankaj Gupta
2018-01-17  9:27         ` Pankaj Gupta
2018-01-17 10:47         ` Wei Wang
2018-01-17 10:47         ` [virtio-dev] " Wei Wang
2018-01-17 10:47           ` Wei Wang
2018-01-17 10:47           ` Wei Wang
2018-01-17 16:44   ` [virtio-dev] " Michael S. Tsirkin
2018-01-17 16:44     ` Michael S. Tsirkin
2018-01-17 16:44     ` Michael S. Tsirkin
2018-01-18 13:30     ` Tetsuo Handa
2018-01-18 13:30       ` Tetsuo Handa
2018-01-18 19:09       ` [virtio-dev] " Michael S. Tsirkin
2018-01-18 19:09         ` Michael S. Tsirkin
2018-01-18 19:09         ` Michael S. Tsirkin
2018-01-18 19:09         ` Michael S. Tsirkin
2018-01-18 21:11         ` Tetsuo Handa
2018-01-18 21:11           ` Tetsuo Handa
2018-01-18 22:32           ` [virtio-dev] " Michael S. Tsirkin
2018-01-18 22:32             ` Michael S. Tsirkin
2018-01-18 22:32             ` Michael S. Tsirkin
2018-01-18 22:32             ` Michael S. Tsirkin
2018-01-20 14:23             ` Tetsuo Handa
2018-01-20 14:23               ` Tetsuo Handa
2018-01-19  3:44     ` [virtio-dev] " Wei Wang
2018-01-19  3:44       ` Wei Wang
2018-01-19  3:44       ` Wei Wang
2018-01-19 12:39       ` Michael S. Tsirkin
2018-01-19 12:39       ` [virtio-dev] " Michael S. Tsirkin
2018-01-19 12:39         ` Michael S. Tsirkin
2018-01-19 12:39         ` Michael S. Tsirkin
2018-01-22 11:25         ` [virtio-dev] " Wei Wang
2018-01-22 11:25         ` Wei Wang
2018-01-22 11:25           ` Wei Wang
2018-01-22 11:25           ` Wei Wang
2018-01-24  3:18           ` Wei Wang
2018-01-24  3:18             ` Wei Wang
2018-01-24  3:18             ` Wei Wang
2018-01-24  3:18             ` Wei Wang
2018-01-24  4:31             ` Michael S. Tsirkin
2018-01-24  4:31             ` Michael S. Tsirkin
2018-01-24  4:31               ` Michael S. Tsirkin
2018-01-24  4:31               ` Michael S. Tsirkin
2018-01-24  4:29           ` Michael S. Tsirkin
2018-01-24  4:29           ` Michael S. Tsirkin
2018-01-24  4:29             ` Michael S. Tsirkin
2018-01-24  4:29             ` Michael S. Tsirkin
2018-01-24 11:28             ` Wei Wang
2018-01-24 11:28               ` Wei Wang
2018-01-24 11:28               ` Wei Wang
2018-01-24 11:28             ` Wei Wang
2018-01-19  3:44     ` Wei Wang
2018-01-19  6:24     ` Wei Wang [this message]
2018-01-19  6:24       ` Wei Wang
2018-01-19  6:24       ` Wei Wang
2018-01-19  6:24     ` Wei Wang
2018-01-17 16:44   ` Michael S. Tsirkin
2018-01-17  5:10 ` [PATCH v22 3/3] virtio-balloon: don't report free pages when page poisoning is enabled Wei Wang
2018-01-17  5:10 ` [virtio-dev] " Wei Wang
2018-01-17  5:10   ` Wei Wang
2018-01-17  5:10   ` Wei Wang
2018-01-18 22:37   ` [virtio-dev] " Michael S. Tsirkin
2018-01-18 22:37     ` Michael S. Tsirkin
2018-01-18 22:37     ` Michael S. Tsirkin
2018-01-18 22:37     ` Michael S. Tsirkin

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=5A618F0B.4090805@intel.com \
    --to=wei.w.wang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kvm@vger.kernel.org \
    --cc=liliang.opensource@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mst@redhat.com \
    --cc=nilal@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=quan.xu0@gmail.com \
    --cc=riel@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=yang.zhang.wz@gmail.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.