lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h9u3eliy.fsf@vitty.brq.redhat.com>
Date:	Mon, 02 Mar 2015 11:33:41 +0100
From:	Vitaly Kuznetsov <vkuznets@...hat.com>
To:	"K. Y. Srinivasan" <kys@...rosoft.com>
Cc:	devel@...uxdriverproject.org,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	linux-kernel@...r.kernel.org, Dexuan Cui <decui@...rosoft.com>
Subject: Re: [PATCH] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure

Vitaly Kuznetsov <vkuznets@...hat.com> writes:

> When add_memory() fails the following BUG is observed:
> [  743.646107] hv_balloon: hot_add memory failed error is -17
> [  743.679973]
> [  743.680930] =====================================
> [  743.680930] [ BUG: bad unlock balance detected! ]
> [  743.680930] 3.19.0-rc5_bug1131426+ #552 Not tainted
> [  743.680930] -------------------------------------
> [  743.680930] kworker/0:2/255 is trying to release lock (&dm_device.ha_region_mutex) at:
> [  743.680930] [<ffffffff81aae5fe>] mutex_unlock+0xe/0x10
> [  743.680930] but there are no more locks to release!
>
> This happens as we don't acquire ha_region_mutex and hot_add_req() expects us
> to as it does unconditional mutex_unlock(). Acquire the lock on the error path.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
> ---
> This patch is dependent on the previously posted 'Drivers: hv: hv_balloon:
> eliminate the trylock path in acquire/release_region_mutex'.

Hi K.Y.,

I don't see this patch in your '[PATCH 0/7] Drivers: hv: Collection
fixes and enhancements' sent to Greg. Please let me know if you see any
issues with it as it looks like a pretty important bugfix to me.

Thanks,

> ---
>  drivers/hv/hv_balloon.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
> index 1283035..771bf84 100644
> --- a/drivers/hv/hv_balloon.c
> +++ b/drivers/hv/hv_balloon.c
> @@ -654,6 +654,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
>  			}
>  			has->ha_end_pfn -= HA_CHUNK;
>  			has->covered_end_pfn -=  processed_pfn;
> +			mutex_lock(&dm_device.ha_region_mutex);
>  			break;
>  		}

-- 
  Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ