Skip to contentSkip to conversation

integrity: get rid of unneeded initializations in integrity_iint_cache entries

PATCH In review Jeff Layton 3 participants 6 messages Jul 6, 2017 – Dec 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 integrity: get rid of unneeded initializations in integrity_iint_cache entries

From: Jeff Layton <[email protected]>

The init_once routine memsets the whole object to 0, and then explicitly sets some of the fields to 0 again. Just remove the explicit initializations.

---
 security/integrity/iint.c | 3 ---
 1 file changed, 3 deletions(-)
security/integrity/iint.c +0 -3
index 6fc888ca468e..187b7cb378be 100644
@@ -153,14 +153,11 @@ static void init_once(void *foo)
 	struct integrity_iint_cache *iint = foo;
 
 	memset(iint, 0, sizeof(*iint));
-	iint->version = 0;
-	iint->flags = 0UL;
 	iint->ima_file_status = INTEGRITY_UNKNOWN;
 	iint->ima_mmap_status = INTEGRITY_UNKNOWN;
 	iint->ima_bprm_status = INTEGRITY_UNKNOWN;
 	iint->ima_read_status = INTEGRITY_UNKNOWN;
 	iint->evm_status = INTEGRITY_UNKNOWN;
-	iint->measured_pcrs = 0;
 }
 
 static int __init integrity_iintcache_init(void)
Signature · 6 lines
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jeff Layton

From: Jeff Layton <[email protected]>

The init_once routine memsets the whole object to 0, and then explicitly sets some of the fields to 0 again. Just remove the explicit initializations.

Quoted 25 lines
---
 security/integrity/iint.c | 3 ---
 1 file changed, 3 deletions(-)
security/integrity/iint.c +0 -3
index 6fc888ca468e..187b7cb378be 100644
@@ -153,14 +153,11 @@ static void init_once(void *foo)
 	struct integrity_iint_cache *iint = foo;
 
 	memset(iint, 0, sizeof(*iint));
-	iint->version = 0;
-	iint->flags = 0UL;
 	iint->ima_file_status = INTEGRITY_UNKNOWN;
 	iint->ima_mmap_status = INTEGRITY_UNKNOWN;
 	iint->ima_bprm_status = INTEGRITY_UNKNOWN;
 	iint->ima_read_status = INTEGRITY_UNKNOWN;
 	iint->evm_status = INTEGRITY_UNKNOWN;
-	iint->measured_pcrs = 0;
 }
 
 static int __init integrity_iintcache_init(void)
Signature · 1 line
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 10 lines · Serge E. Hallyn
Quoted 7 lines · Jeff Layton

From: Jeff Layton <[email protected]>

The init_once routine memsets the whole object to 0, and then explicitly sets some of the fields to 0 again. Just remove the explicit initializations.

Thanks, queued.

Mimi

Quoted 23 lines
Quoted 23 lines
---
 security/integrity/iint.c | 3 ---
 1 file changed, 3 deletions(-)
security/integrity/iint.c +0 -3
index 6fc888ca468e..187b7cb378be 100644
@@ -153,14 +153,11 @@ static void init_once(void *foo)
 	struct integrity_iint_cache *iint = foo;
 
 	memset(iint, 0, sizeof(*iint));
-	iint->version = 0;
-	iint->flags = 0UL;
 	iint->ima_file_status = INTEGRITY_UNKNOWN;
 	iint->ima_mmap_status = INTEGRITY_UNKNOWN;
 	iint->ima_bprm_status = INTEGRITY_UNKNOWN;
 	iint->ima_read_status = INTEGRITY_UNKNOWN;
 	iint->evm_status = INTEGRITY_UNKNOWN;
-	iint->measured_pcrs = 0;
 }
 
Quoted 8 lines
Quoted 3 lines
security/integrity/iint.c +0 -0
 static int __init integrity_iintcache_init(void)
Signature · 1 line
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 8 lines · Mimi Zohar
Quoted 7 lines · Serge E. Hallyn
Quoted 6 lines · Jeff Layton

From: Jeff Layton <[email protected]>

The init_once routine memsets the whole object to 0, and then explicitly sets some of the fields to 0 again. Just remove the explicit initializations.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Thanks, queued.

Mimi

Hi Mimi,

I notice that this patch hasn't made the last couple of releases. Was it dropped for some reason?

Thanks,
Jeff

Quoted 34 lines
Quoted 32 lines
Quoted 26 lines
---
 security/integrity/iint.c | 3 ---
 1 file changed, 3 deletions(-)
security/integrity/iint.c +0 -3
index 6fc888ca468e..187b7cb378be 100644
@@ -153,14 +153,11 @@ static void init_once(void *foo)
 	struct integrity_iint_cache *iint = foo;
 
 	memset(iint, 0, sizeof(*iint));
-	iint->version = 0;
-	iint->flags = 0UL;
 	iint->ima_file_status = INTEGRITY_UNKNOWN;
 	iint->ima_mmap_status = INTEGRITY_UNKNOWN;
 	iint->ima_bprm_status = INTEGRITY_UNKNOWN;
 	iint->ima_read_status = INTEGRITY_UNKNOWN;
 	iint->evm_status = INTEGRITY_UNKNOWN;
-	iint->measured_pcrs = 0;
 }
 
 static int __init integrity_iintcache_init(void)
Signature · 1 line
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Jeff Layton <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
Quoted 15 lines · Jeff Layton
Quoted 14 lines · Mimi Zohar
Quoted 10 lines · Serge E. Hallyn
Quoted 7 lines · Jeff Layton

From: Jeff Layton <[email protected]>

The init_once routine memsets the whole object to 0, and then explicitly sets some of the fields to 0 again. Just remove the explicit initializations.

Thanks, queued.

Quoted 7 lines
Quoted 2 lines

Mimi

Hi Mimi,

I notice that this patch hasn't made the last couple of releases. Was it dropped for some reason?

Thanks for the reminder. ?I accidentally dropped it (and Sascha Hauer's patch). ?The subject line is too long. ?Assuming you don't object, I'll replace the "get rid of" with "removed" and queue the patch in the next-queued-testing branch.

Mimi

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 24 lines · Mimi Zohar
Quoted 15 lines · Jeff Layton
Quoted 14 lines · Mimi Zohar
Quoted 10 lines · Serge E. Hallyn
Quoted 7 lines · Jeff Layton

From: Jeff Layton <[email protected]>

The init_once routine memsets the whole object to 0, and then explicitly sets some of the fields to 0 again. Just remove the explicit initializations.

Thanks, queued.

Quoted 7 lines
Quoted 2 lines

Mimi

Hi Mimi,

I notice that this patch hasn't made the last couple of releases. Was it dropped for some reason?

Quoted 7 lines

Thanks for the reminder. I accidentally dropped it (and Sascha Hauer's patch). The subject line is too long. Assuming you don't object, I'll replace the "get rid of" with "removed" and queue the patch in the next-queued-testing branch.

Mimi

Sounds good.

Thanks,

Signature · 5 lines
Jeff Layton <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html