Skip to contentSkip to conversation

thunderbolt: Handle NULL boot ACL entries properly

PATCH In review Mika Westerberg 2 participants 3 messages Apr 30, 2018 – May 7, 2018 Thunderbolt driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 thunderbolt: Handle NULL boot ACL entries properly

If the boot ACL entry is already NULL we should not fill in the upper two DWs with 0xfffffffff. Otherwise they are not shown as empty entries when the sysfs attribute is read.

Fixes 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL")

---
Changes from v1 (https://lkml.org/lkml/2018/4/27/845):

* Use || instead of && to make sure UUIDs with only one zero DW are still treated as valid.

 drivers/thunderbolt/icm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/icm.c +1 -1
index 2d2ceda9aa26..500911f16498 100644
@@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids)
 			/* Map empty entries to null UUID */
 			uuid[0] = 0;
 			uuid[1] = 0;
-		} else {
+		} else if (uuid[0] != 0 || uuid[1] != 0) {
 			/* Upper two DWs are always one's */
 			uuid[2] = 0xffffffff;
 			uuid[3] = 0xffffffff;
Signature · 1 line
2.17.0
maintainer Acked-by on v2 1/1
#1 lore raw

drivers/thunderbolt/icm.c static int icm_ar_get_boot_acl(struct tb *tb,

Quoted 20 lines · Mika Westerberg

If the boot ACL entry is already NULL we should not fill in the upper two DWs with 0xfffffffff. Otherwise they are not shown as empty entries when the sysfs attribute is read.

Fixes 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL")

---
Changes from v1 (https://lkml.org/lkml/2018/4/27/845):

* Use || instead of && to make sure UUIDs with only one zero DW are still treated as valid.

  drivers/thunderbolt/icm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/icm.c +0 -0
index 2d2ceda9aa26..500911f16498 100644
@@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb,

uuid_t *uuids, size_t nuuids)

Quoted 10 lines
drivers/thunderbolt/icm.c +1 -2
                         /* Map empty entries to null UUID */
                         uuid[0] = 0;
                         uuid[1] = 0;
-               } else {
+               } else if (uuid[0] != 0 || uuid[1] != 0) {
                         /* Upper two DWs are always one's */
                         uuid[2] = 0xffffffff;
                         uuid[3] = 0xffffffff;
--

2.17.0

author Applied
#2 lore raw
Quoted 36 lines · Yehezkel Bernat

drivers/thunderbolt/icm.c static int icm_ar_get_boot_acl(struct tb *tb,

Quoted 20 lines · Mika Westerberg

If the boot ACL entry is already NULL we should not fill in the upper two DWs with 0xfffffffff. Otherwise they are not shown as empty entries when the sysfs attribute is read.

Fixes 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL")

---
Changes from v1 (https://lkml.org/lkml/2018/4/27/845):

* Use || instead of && to make sure UUIDs with only one zero DW are still treated as valid.

  drivers/thunderbolt/icm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/icm.c +0 -0
index 2d2ceda9aa26..500911f16498 100644
@@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb,

uuid_t *uuids, size_t nuuids)

Quoted 10 lines
drivers/thunderbolt/icm.c +1 -2
                         /* Map empty entries to null UUID */
                         uuid[0] = 0;
                         uuid[1] = 0;
-               } else {
+               } else if (uuid[0] != 0 || uuid[1] != 0) {
                         /* Upper two DWs are always one's */
                         uuid[2] = 0xffffffff;
                         uuid[3] = 0xffffffff;
--

2.17.0

Quoted 1 line

Applied to thunderbolt.git/fixes.