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]
Date:   Tue, 1 Mar 2022 17:18:03 +0100
From:   Lino Sanfilippo <LinoSanfilippo@....de>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     peterhuewe@....de, jarkko@...nel.org, stefanb@...ux.vnet.ibm.com,
        James.Bottomley@...senpartnership.com, David.Laight@...LAB.COM,
        linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org,
        p.rosenberger@...bus.com,
        Lino Sanfilippo <l.sanfilippo@...bus.com>,
        stable@...r.kernel.org
Subject: Re: [PATCH v8 1/1] tpm: fix reference counting for struct tpm_chip

On 01.03.22 at 15:05, Jason Gunthorpe wrote:
> On Tue, Mar 01, 2022 at 03:21:08AM +0100, Lino Sanfilippo wrote:
>> @@ -653,8 +623,10 @@ void tpm_chip_unregister(struct tpm_chip *chip)
>>  	if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(chip))
>>  		hwrng_unregister(&chip->hwrng);
>>  	tpm_bios_log_teardown(chip);
>> -	if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip))
>> +	if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
>>  		cdev_device_del(&chip->cdevs, &chip->devs);
>> +		put_device(&chip->devs);
>> +	}
>
> I would put those two lines in a function bside tpm_devs_add() as
> well, more modular.
>

Agreed, I will put this in a tpm_devs_remove() function as counterpart to tpm_devs_add().

Regards,
Lino

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ