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] [day] [month] [year] [list]
Date:	Mon, 20 Jun 2016 22:29:17 +0000
From:	Stuart Yoder <stuart.yoder@....com>
To:	Bharat Bhushan <bharat.bhushan@....com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC:	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Bharat Bhushan <bharat.bhushan@....com>
Subject: RE: [PATCH] fsl mc-bus: Move mc-io destroy to bus remove



> -----Original Message-----
> From: Bharat Bhushan [mailto:Bharat.Bhushan@....com]
> Sent: Thursday, June 16, 2016 1:52 AM
> To: gregkh@...uxfoundation.org; Stuart Yoder <stuart.yoder@....com>
> Cc: devel@...verdev.osuosl.org; linux-kernel@...r.kernel.org; Bharat Bhushan <bharat.bhushan@....com>
> Subject: [PATCH] fsl mc-bus: Move mc-io destroy to bus remove
> 
> fsl_mc_device_add() is called when a new mc device is added and
> fsl_mc_device_remove() is called when a mc device is removed.
> Now mc portals (fsl_create_mc_io) are not created during device
> addition i.e fsl_mc_device_add(). But mc portal are being destroyed
> when an mc device are removed i.e fsl_mc_device_remove(), which is
> not correct way of reverting what is done during device addition.
> 
> Now this leads to the problem with VFIO driver where we do not want
> the portal to be destroyed when an mc-device is removed. VFIO
> creates one mc-portal for all dprc-containers bound to it and it
> destroys the mc portal when driver itself is removed.
> 
> This change moves the mc-portal destroy part to bus-remove for
> mc-bus and dprc-driver remove for child DPRCs. This also makes
> fsl_mc_device_remove() exactly reverting what is done in
> fsl_mc_device_add() with respect to mc portal creation.

I think we need to improve and clarify this commit message.
This change is needed, but I don't think the message
makes it clear what is going on.

> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@....com>
> ---
>  drivers/staging/fsl-mc/bus/dprc-driver.c | 3 +++
>  drivers/staging/fsl-mc/bus/mc-bus.c      | 8 ++++----
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
> index 7fc4717..14f9c82 100644
> --- a/drivers/staging/fsl-mc/bus/dprc-driver.c
> +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
> @@ -801,6 +801,9 @@ static int dprc_remove(struct fsl_mc_device *mc_dev)
>  		dev_set_msi_domain(&mc_dev->dev, NULL);
>  	}
> 
> +	fsl_destroy_mc_io(mc_dev->mc_io);
> +	mc_dev->mc_io = NULL;
> +

We need to do the destroy here, but we need to add a check and
only do this for child containers.

Thanks,
Stuart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ