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: <201412022139.58754.PeterHuewe@gmx.de>
Date:	Tue, 2 Dec 2014 21:39:58 +0100
From:	Peter Hüwe <PeterHuewe@....de>
To:	Anton Blanchard <anton@...ba.org>,
	"Hon Ching (Vicky) Lo" <honclo@...ux.vnet.ibm.com>
Cc:	Ashley Lai <ashley@...leylai.com>,
	Marcel Selhorst <tpmdd@...horst.net>,
	tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] tpm/tpm_ibmvtpm: Fail in ibmvtpm_get_data if driver_data is bad

Hi Anton,

is this patchset still needed after Vicky's patch 
"[tpmdd-devel] Fix NULL return in tpm_ibmvtpm_get_desired_dma"
https://patchwork.ozlabs.org/patch/402315/

Ashley raised some concerns.

Since merge window is coming up, a fast reply is appreciated.


Thanks,
Peter

Am Freitag, 19. September 2014, 23:29:42 schrieb Anton Blanchard:
> I'm looking at an oops in tpm_ibmvtpm_get_desired_dma:
> 
>   28:	00 00 20 39 	li      r9,0
>   2c:	10 00 01 e8 	ld      r0,16(r1)
>   30:	28 00 69 80 	lwz     r3,40(r9)
> 
> We set r9 to 0 then load r9+40. The problem is actually in
> ibmvtpm_get_data, it can return NULL but the rest of the driver
> never expects it.
> 
> Add a BUG_ON in ibmvtpm_get_data. We still need to identify the root
> cause but at least this makes it obvious what went wrong.
> 
> Cc: stable@...r.kernel.org
> Signed-off-by: Anton Blanchard <anton@...ba.org>
> ---
> 
> diff --git a/drivers/char/tpm/tpm_ibmvtpm.c
> b/drivers/char/tpm/tpm_ibmvtpm.c index af74c57..0d1eeba 100644
> --- a/drivers/char/tpm/tpm_ibmvtpm.c
> +++ b/drivers/char/tpm/tpm_ibmvtpm.c
> @@ -63,9 +63,9 @@ static int ibmvtpm_send_crq(struct vio_dev *vdev, u64 w1,
> u64 w2) static struct ibmvtpm_dev *ibmvtpm_get_data(const struct device
> *dev) {
>  	struct tpm_chip *chip = dev_get_drvdata(dev);
> -	if (chip)
> -		return (struct ibmvtpm_dev *)TPM_VPRIV(chip);
> -	return NULL;
> +
> +	BUG_ON(!chip);
> +	return (struct ibmvtpm_dev *)TPM_VPRIV(chip);
>  }
> 
>  /**

--
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