tpm: use test_bit() to check TPM2 flag in eventlog and sysfs code
PATCH 1/1 tpm: use test_bit() to check TPM2 flag in eventlog and sysfs code
There is change done to introduce atomic bitops to set and test chip->flags.
This patch fixes tpm_bios_log_setup() and tpm_sysfs_add_device() to use test_bit() to check for TPM_CHIP_FLAG_TPM2 flag.
--- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm_eventlog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm-sysfs.c +1 -1
@@ -284,7 +284,7 @@ static const struct attribute_group tpm_dev_group = {void tpm_sysfs_add_device (struct tpm_chip *chip) { -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) +if (test_bit (TPM_CHIP_FLAG_TPM2 , &chip->flags))return ;/* The sysfs routines rely on an implicit tpm_try_get_ops, device_del
drivers/char/tpm/tpm_eventlog.c +1 -1
@@ -391,7 +391,7 @@ int tpm_bios_log_setup(struct tpm_chip *chip)unsigned int cnt;int rc =0 ; -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) +if (test_bit (TPM_CHIP_FLAG_TPM2 , &chip->flags))return 0 ; rc =tpm_read_log (chip);
Signature · 1 line
2.5.0
Quoted 6 lines · Nayna Jain
There is change done to introduce atomic bitops to set and test
chip->flags.
This patch fixestpm_bios_log_setup()andtpm_sysfs_add_device()to usetest_bit()to check forTPM_CHIP_FLAG_TPM2flag.Signed-off-by Nayna Jain <[email protected]>
I'm bit lost of the purpose of this patch.
/Jarkko
Quoted 38 lines
--- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm_eventlog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/char/tpm/tpm-sysfs.c +1
-1@@ -284,7 +284,7 @@ static const struct attribute_group tpm_dev_group = {void tpm_sysfs_add_device (struct tpm_chip *chip) { -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) +if (test_bit (TPM_CHIP_FLAG_TPM2 , &chip->flags))return ;/* The sysfs routines rely on an implicit tpm_try_get_ops, device_del drivers/char/tpm/tpm_eventlog.c +1
-1@@ -391,7 +391,7 @@ int tpm_bios_log_setup(struct tpm_chip *chip)unsigned int cnt;int rc =0 ; -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) +if (test_bit (TPM_CHIP_FLAG_TPM2 , &chip->flags))return 0 ; rc =tpm_read_log (chip);Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Nayna Jain
There is change done to introduce atomic bitops to set and test
chip->flags.
This patch fixestpm_bios_log_setup()andtpm_sysfs_add_device()to usetest_bit()to check forTPM_CHIP_FLAG_TPM2flag.Signed-off-by Nayna Jain <[email protected]>I'm bit lost of the purpose of this patch.
I was using tabrm branch which has changes related to using bitops for chip->flags, but it was failing for TPM2 check in tpm_bios_log_setup() with the existing way of checking. Replacing existing one with test_bit() check makes it work. Same in case of tpm_sysfs_add_device().
Thanks & Regards,
- Nayna
Quoted 42 lines
/Jarkko
Quoted 38 lines
--- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm_eventlog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/char/tpm/tpm-sysfs.c +1
-1@@ -284,7 +284,7 @@ static const struct attribute_group tpm_dev_group = {void tpm_sysfs_add_device (struct tpm_chip *chip) { -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) +if (test_bit (TPM_CHIP_FLAG_TPM2 , &chip->flags))return ;/* The sysfs routines rely on an implicit tpm_try_get_ops, device_del drivers/char/tpm/tpm_eventlog.c +1
-2@@ -391,7 +391,7 @@ int tpm_bios_log_setup(struct tpm_chip *chip)unsigned int cnt;int rc =0 ; -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) +if (test_bit (TPM_CHIP_FLAG_TPM2 , &chip->flags))return 0 ; rc =tpm_read_log (chip); --2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 58340988.9000700-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Quoted 9 lines · Nayna
Quoted 6 lines · Jarkko Sakkinen
Quoted 5 lines · Nayna Jain
There is change done to introduce atomic bitops to set and test
chip->flags.
This patch fixestpm_bios_log_setup()andtpm_sysfs_add_device()to usetest_bit()to check forTPM_CHIP_FLAG_TPM2flag.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Nayna Jain <[email protected]>I'm bit lost of the purpose of this patch.
I was using tabrm branch which has changes related to using bitops for
chip->flags, but it was failing for TPM2 check intpm_bios_log_setup()with the existing way of checking. Replacing existing one withtest_bit()check makes it work. Same in case oftpm_sysfs_add_device().
Why didn't you just response to the thread with a review comment especially as the patch is not applied to the master branch?
/Jarkko
------------------------------------------------------------------------------
Quoted 14 lines · Jarkko Sakkinen
Quoted 13 lines · Nayna
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Nayna Jain
There is change done to introduce atomic bitops to set and test
chip->flags.
This patch fixestpm_bios_log_setup()andtpm_sysfs_add_device()to usetest_bit()to check forTPM_CHIP_FLAG_TPM2flag.Signed-off-by Nayna Jain <[email protected]>I'm bit lost of the purpose of this patch.
Quoted 7 lines
Quoted 4 lines
I was using tabrm branch which has changes related to using bitops for
chip->flags, but it was failing for TPM2 check intpm_bios_log_setup()with the existing way of checking. Replacing existing one withtest_bit()check makes it work. Same in case oftpm_sysfs_add_device().Why didn't you just response to the thread with a review comment especially as the patch is not applied to the master branch?
Oh!! Ok.. Sorry, I should have done that.
Will take care next time.
So basically it needs to be fixed as part of that patch.
Thanks & Regards,
- Nayna
Quoted 3 lines
/Jarkko
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 22 lines · Nayna
Quoted 19 lines · Jarkko Sakkinen
Quoted 17 lines · Nayna
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Nayna Jain
There is change done to introduce atomic bitops to set and test
chip->flags.
This patch fixestpm_bios_log_setup()andtpm_sysfs_add_device()to usetest_bit()to check forTPM_CHIP_FLAG_TPM2flag.Signed-off-by Nayna Jain <[email protected]>I'm bit lost of the purpose of this patch.
I was using tabrm branch which has changes related to using bitops for
chip->flags, but it was failing for TPM2 check intpm_bios_log_setup()with the existing way of checking. Replacing existing one withtest_bit()check makes it work. Same in case oftpm_sysfs_add_device().
Quoted 7 lines
Quoted 2 lines
Why didn't you just response to the thread with a review comment especially as the patch is not applied to the master branch?
Oh!! Ok.. Sorry, I should have done that.
Will take care next time.So basically it needs to be fixed as part of that patch.
NP. Thanks for reporting the issue!
/Jarkko
------------------------------------------------------------------------------
Quoted 14 lines · Jarkko Sakkinen
Quoted 13 lines · Nayna
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Nayna Jain
There is change done to introduce atomic bitops to set and test
chip->flags.
This patch fixestpm_bios_log_setup()andtpm_sysfs_add_device()to usetest_bit()to check forTPM_CHIP_FLAG_TPM2flag.Signed-off-by Nayna Jain <[email protected]>I'm bit lost of the purpose of this patch.
Quoted 7 lines
Quoted 4 lines
I was using tabrm branch which has changes related to using bitops for
chip->flags, but it was failing for TPM2 check intpm_bios_log_setup()with the existing way of checking. Replacing existing one withtest_bit()check makes it work. Same in case oftpm_sysfs_add_device().Why didn't you just response to the thread with a review comment especially as the patch is not applied to the master branch?
Anyway I updated the corresponding patches. Thanks for reporting these issues!
/Jarkko