Skip to contentSkip to conversation

integrity/ima: Add declarations to init_once void arguments.

PATCH Superseded Jiele Zhao 3 participants 6 messages Mar 23, 2021 – Apr 6, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jiele Zhao

author
#0 lore raw

PATCH 1/1 integrity/ima: Add declarations to init_once void arguments.

init_once is a callback to kmem_cache_create. The parameter type of this function is void *, so it's better to give a explicit cast here.

---
 security/integrity/iint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/iint.c +1 -1
index 1d20003243c3..5f3f2de997e1 100644
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
 static void init_once(void *foo)
 {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
 
 	memset(iint, 0, sizeof(*iint));
 	iint->ima_file_status = INTEGRITY_UNKNOWN;
Signature · 1 line
2.25.1
author
#1 lore raw

Ping.

Quoted 22 lines · Jiele Zhao

init_once is a callback to kmem_cache_create. The parameter type of this function is void *, so it's better to give a explicit cast here.

---
  security/integrity/iint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/iint.c +1 -1
index 1d20003243c3..5f3f2de997e1 100644
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
  static void init_once(void *foo)
  {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
 
  	memset(iint, 0, sizeof(*iint));
  	iint->ima_file_status = INTEGRITY_UNKNOWN;
author
#2 lore raw
In reply to Jiele Zhao

Ping.

Quoted 22 lines · Jiele Zhao

init_once is a callback to kmem_cache_create. The parameter type of this function is void *, so it's better to give a explicit cast here.

---
  security/integrity/iint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/iint.c +1 -1
index 1d20003243c3..5f3f2de997e1 100644
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
  static void init_once(void *foo)
  {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
 
  	memset(iint, 0, sizeof(*iint));
  	iint->ima_file_status = INTEGRITY_UNKNOWN;
maintainer
#3 lore raw
Quoted 1 line · Jiele Zhao

Ping.

Mimi Zohar is the maintainer for this code.

Quoted 26 lines · Jiele Zhao
Quoted 23 lines

init_once is a callback to kmem_cache_create. The parameter type of this function is void *, so it's better to give a explicit cast here.

---
  security/integrity/iint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/iint.c +1 -1
index 1d20003243c3..5f3f2de997e1 100644
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
  static void init_once(void *foo)
  {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache
 *)foo;
 
   memset(iint, 0, sizeof(*iint));
   iint->ima_file_status = INTEGRITY_UNKNOWN;
Signature · 2 lines
James Morris
<[email protected]>
author
#4 lore raw

Hi Mimi,

Please see if this is a useful suggestion.

Quoted 29 lines · James Morris
Quoted 1 line · Jiele Zhao

Ping.

Mimi Zohar is the maintainer for this code.

Quoted 24 lines · Jiele Zhao
Quoted 23 lines

init_once is a callback to kmem_cache_create. The parameter type of this function is void *, so it's better to give a explicit cast here.

---
   security/integrity/iint.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/iint.c +1 -1
index 1d20003243c3..5f3f2de997e1 100644
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
   static void init_once(void *foo)
   {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache
 *)foo;
 
    memset(iint, 0, sizeof(*iint));
    iint->ima_file_status = INTEGRITY_UNKNOWN;
maintainer
#5 lore raw
In reply to Jiele Zhao

Hi Jiele,

Quoted 5 lines · Jiele Zhao

init_once is a callback to kmem_cache_create. The parameter type of this function is void *, so it's better to give a explicit cast here.

Please remove the "ima" in the Subject line and re-post Cc'ing the linux-integrity mailing list.

Quoted 9 lines
---
 security/integrity/iint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/iint.c +0 -0
index 1d20003243c3..5f3f2de997e1 100644

security/integrity/iint.c void integrity_inode_free(struct inode *inode) · line 155

Quoted 5 lines
security/integrity/iint.c +1 -1
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
 static void init_once(void *foo)
 {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;

Like the other init_once() examples, please add a blank before foo.

thanks,

Mimi

Quoted 3 lines
security/integrity/iint.c +0 -0
 	memset(iint, 0, sizeof(*iint));
 	iint->ima_file_status = INTEGRITY_UNKNOWN;