Linux-Security-Module Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] integrity/ima: Add declarations to init_once void arguments.
@ 2021-03-23  1:33 Jiele Zhao
  2021-03-29 10:18 ` Jiele Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jiele Zhao @ 2021-03-23  1:33 UTC (permalink / raw)
  To: serge, jmorris; +Cc: linux-security-module, linux-kernel, 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.

Signed-off-by: Jiele Zhao <unclexiaole@gmail.com>
---
 security/integrity/iint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -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;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.
  2021-03-23  1:33 [PATCH] integrity/ima: Add declarations to init_once void arguments Jiele Zhao
@ 2021-03-29 10:18 ` Jiele Zhao
  2021-04-06  2:16 ` Jiele Zhao
  2021-04-06 12:46 ` Mimi Zohar
  2 siblings, 0 replies; 6+ messages in thread
From: Jiele Zhao @ 2021-03-29 10:18 UTC (permalink / raw)
  To: serge, jmorris; +Cc: linux-security-module, linux-kernel

Ping.

On 2021/3/23 9:33, Jiele Zhao wrote:
> 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.
>
> Signed-off-by: Jiele Zhao <unclexiaole@gmail.com>
> ---
>   security/integrity/iint.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/integrity/iint.c b/security/integrity/iint.c
> index 1d20003243c3..5f3f2de997e1 100644
> --- a/security/integrity/iint.c
> +++ b/security/integrity/iint.c
> @@ -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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.
  2021-03-23  1:33 [PATCH] integrity/ima: Add declarations to init_once void arguments Jiele Zhao
  2021-03-29 10:18 ` Jiele Zhao
@ 2021-04-06  2:16 ` Jiele Zhao
  2021-04-06  2:38   ` James Morris
  2021-04-06 12:46 ` Mimi Zohar
  2 siblings, 1 reply; 6+ messages in thread
From: Jiele Zhao @ 2021-04-06  2:16 UTC (permalink / raw)
  To: serge, jmorris; +Cc: linux-security-module, linux-kernel

Ping.

On 2021/3/23 9:33, Jiele Zhao wrote:
> 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.
>
> Signed-off-by: Jiele Zhao <unclexiaole@gmail.com>
> ---
>   security/integrity/iint.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/integrity/iint.c b/security/integrity/iint.c
> index 1d20003243c3..5f3f2de997e1 100644
> --- a/security/integrity/iint.c
> +++ b/security/integrity/iint.c
> @@ -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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.
  2021-04-06  2:16 ` Jiele Zhao
@ 2021-04-06  2:38   ` James Morris
  2021-04-06  6:24     ` Jiele Zhao
  0 siblings, 1 reply; 6+ messages in thread
From: James Morris @ 2021-04-06  2:38 UTC (permalink / raw)
  To: Jiele Zhao
  Cc: Serge E. Hallyn, linux-security-module, linux-kernel, Mimi Zohar

On Tue, 6 Apr 2021, Jiele Zhao wrote:

> Ping.

Mimi Zohar is the maintainer for this code.

> 
> On 2021/3/23 9:33, Jiele Zhao wrote:
> > 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.
> >
> > Signed-off-by: Jiele Zhao <unclexiaole@gmail.com>
> > ---
> >   security/integrity/iint.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/security/integrity/iint.c b/security/integrity/iint.c
> > index 1d20003243c3..5f3f2de997e1 100644
> > --- a/security/integrity/iint.c
> > +++ b/security/integrity/iint.c
> > @@ -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;
> 

-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.
  2021-04-06  2:38   ` James Morris
@ 2021-04-06  6:24     ` Jiele Zhao
  0 siblings, 0 replies; 6+ messages in thread
From: Jiele Zhao @ 2021-04-06  6:24 UTC (permalink / raw)
  To: Mimi Zohar; +Cc: linux-security-module, linux-kernel, james Morris

Hi Mimi,

Please see if this is a useful suggestion.

On 2021/4/6 10:38, James Morris wrote:
> On Tue, 6 Apr 2021, Jiele Zhao wrote:
>
>> Ping.
> Mimi Zohar is the maintainer for this code.
>
>> On 2021/3/23 9:33, Jiele Zhao wrote:
>>> 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.
>>>
>>> Signed-off-by: Jiele Zhao <unclexiaole@gmail.com>
>>> ---
>>>    security/integrity/iint.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/security/integrity/iint.c b/security/integrity/iint.c
>>> index 1d20003243c3..5f3f2de997e1 100644
>>> --- a/security/integrity/iint.c
>>> +++ b/security/integrity/iint.c
>>> @@ -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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.
  2021-03-23  1:33 [PATCH] integrity/ima: Add declarations to init_once void arguments Jiele Zhao
  2021-03-29 10:18 ` Jiele Zhao
  2021-04-06  2:16 ` Jiele Zhao
@ 2021-04-06 12:46 ` Mimi Zohar
  2 siblings, 0 replies; 6+ messages in thread
From: Mimi Zohar @ 2021-04-06 12:46 UTC (permalink / raw)
  To: Jiele Zhao, serge, jmorris; +Cc: linux-security-module, linux-kernel

Hi Jiele,

On Tue, 2021-03-23 at 01:33 +0000, Jiele Zhao wrote:
> 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.
> 
> Signed-off-by: Jiele Zhao <unclexiaole@gmail.com>

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

> ---
>  security/integrity/iint.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/integrity/iint.c b/security/integrity/iint.c
> index 1d20003243c3..5f3f2de997e1 100644
> --- a/security/integrity/iint.c
> +++ b/security/integrity/iint.c
> @@ -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
> 
>  	memset(iint, 0, sizeof(*iint));
>  	iint->ima_file_status = INTEGRITY_UNKNOWN;



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23  1:33 [PATCH] integrity/ima: Add declarations to init_once void arguments Jiele Zhao
2021-03-29 10:18 ` Jiele Zhao
2021-04-06  2:16 ` Jiele Zhao
2021-04-06  2:38   ` James Morris
2021-04-06  6:24     ` Jiele Zhao
2021-04-06 12:46 ` Mimi Zohar

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org
	public-inbox-index linux-security-module

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git