Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-22 Thread Jarkko Sakkinen
On Thu, Jul 16, 2020 at 10:38:00AM -0700, Guenter Roeck wrote: > On Thu, Jul 16, 2020 at 10:28 AM Jarkko Sakkinen > wrote: > > > > On Tue, Jul 14, 2020 at 08:48:38AM -0700, Guenter Roeck wrote: > > > On Tue, Jul 14, 2020 at 4:32 AM Jarkko Sakkinen > > > wrote: > > > > > > > > On Fri, Jul 10,

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-16 Thread Guenter Roeck
On Thu, Jul 16, 2020 at 10:28 AM Jarkko Sakkinen wrote: > > On Tue, Jul 14, 2020 at 08:48:38AM -0700, Guenter Roeck wrote: > > On Tue, Jul 14, 2020 at 4:32 AM Jarkko Sakkinen > > wrote: > > > > > > On Fri, Jul 10, 2020 at 11:25:44AM -0700, Andrey Pronin wrote: > > > > > Why does not

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-16 Thread Jarkko Sakkinen
On Tue, Jul 14, 2020 at 08:48:38AM -0700, Guenter Roeck wrote: > On Tue, Jul 14, 2020 at 4:32 AM Jarkko Sakkinen > wrote: > > > > On Fri, Jul 10, 2020 at 11:25:44AM -0700, Andrey Pronin wrote: > > > > Why does not tpm_del_char_device need this? > > > > > > "Not" is a typo in the sentence above,

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-14 Thread Guenter Roeck
On Tue, Jul 14, 2020 at 4:32 AM Jarkko Sakkinen wrote: > > On Fri, Jul 10, 2020 at 11:25:44AM -0700, Andrey Pronin wrote: > > > Why does not tpm_del_char_device need this? > > > > "Not" is a typo in the sentence above, right? tpm_del_char_device *does* > > need the fix. When tpm_class_shutdown is

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-14 Thread Jarkko Sakkinen
On Fri, Jul 10, 2020 at 11:25:44AM -0700, Andrey Pronin wrote: > > Why does not tpm_del_char_device need this? > > "Not" is a typo in the sentence above, right? tpm_del_char_device *does* > need the fix. When tpm_class_shutdown is called it sets chip->ops to > NULL. If tpm_del_char_device is

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-10 Thread Andrey Pronin
On Fri, Jul 10, 2020 at 12:08 PM James Bottomley wrote: > > On Thu, 2020-07-09 at 17:22 -0700, Andrey Pronin wrote: > > This patch prevents NULL dereferencing when using chip->ops while > > sending TPM2_Shutdown command if both tpm_class_shutdown handler and > > tpm_del_char_device are called

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-10 Thread James Bottomley
On Thu, 2020-07-09 at 17:22 -0700, Andrey Pronin wrote: > This patch prevents NULL dereferencing when using chip->ops while > sending TPM2_Shutdown command if both tpm_class_shutdown handler and > tpm_del_char_device are called during system shutdown. > > Both these handlers set chip->ops to NULL

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-10 Thread Andrey Pronin
On Fri, Jul 10, 2020 at 4:40 AM Jarkko Sakkinen wrote: > > On Thu, Jul 09, 2020 at 05:22:09PM -0700, Andrey Pronin wrote: > > This patch prevents NULL dereferencing when using chip->ops while > > sending TPM2_Shutdown command if both tpm_class_shutdown handler and > > tpm_del_char_device are

Re: [PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-10 Thread Jarkko Sakkinen
On Thu, Jul 09, 2020 at 05:22:09PM -0700, Andrey Pronin wrote: > This patch prevents NULL dereferencing when using chip->ops while > sending TPM2_Shutdown command if both tpm_class_shutdown handler and > tpm_del_char_device are called during system shutdown. > > Both these handlers set chip->ops

[PATCH] tpm: avoid accessing cleared ops during shutdown

2020-07-09 Thread Andrey Pronin
This patch prevents NULL dereferencing when using chip->ops while sending TPM2_Shutdown command if both tpm_class_shutdown handler and tpm_del_char_device are called during system shutdown. Both these handlers set chip->ops to NULL but don't check if it's already NULL when they are called before