Re: [PATCH v2] tpm/tpm_crb: Avoid unaligned reads in crb_recv()

2019-02-07 Thread Jerry Snitselaar
On Thu Feb 07 19, Sasha Levin wrote: Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: 30fc8d138e91 tpm: TPM 2.0 CRB Interface. The bot has tested the following trees: v4.20.6, v4.19.19, v4.14.97, v4.9.154, v4.4.172. v4.20.6: B

Re: [PATCH v2] tpm/tpm_crb: Avoid unaligned reads in crb_recv()

2019-02-04 Thread Jarkko Sakkinen
On Mon, Feb 04, 2019 at 10:09:51PM +, Winkler, Tomas wrote: > > > > The current approach to read first 6 bytes from the response and then tail > > of > > the response, can cause the 2nd memcpy_fromio() to do an unaligned read > > (e.g. read 32-bit word from address aligned to a 16-bits), depe

Re: [PATCH v2] tpm/tpm_crb: Avoid unaligned reads in crb_recv()

2019-02-04 Thread Jarkko Sakkinen
On Mon, Feb 04, 2019 at 05:12:57PM +, David Laight wrote: > > +* field) in order to make sure that the reminding memory accesses will > > remaining Thanks for your feedback David. I'll implement your suggestions (also in your other response). /Jarkko

RE: [PATCH v2] tpm/tpm_crb: Avoid unaligned reads in crb_recv()

2019-02-04 Thread Winkler, Tomas
> > The current approach to read first 6 bytes from the response and then tail of > the response, can cause the 2nd memcpy_fromio() to do an unaligned read > (e.g. read 32-bit word from address aligned to a 16-bits), depending on how > memcpy_fromio() is implemented. If this happens, the read will

RE: [PATCH v2] tpm/tpm_crb: Avoid unaligned reads in crb_recv()

2019-02-04 Thread David Laight
> + * field) in order to make sure that the reminding memory accesses will remaining - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

[PATCH v2] tpm/tpm_crb: Avoid unaligned reads in crb_recv()

2019-02-04 Thread Jarkko Sakkinen
The current approach to read first 6 bytes from the response and then tail of the response, can cause the 2nd memcpy_fromio() to do an unaligned read (e.g. read 32-bit word from address aligned to a 16-bits), depending on how memcpy_fromio() is implemented. If this happens, the read will fail and t