lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 10 Nov 2013 21:52:25 +0200
From:	Dmitry Kasatkin <dmitry.kasatkin@...il.com>
To:	Shuah Khan <shuah.kh@...sung.com>
Cc:	james.l.morris@...cle.com, Mimi Zohar <zohar@...ux.vnet.ibm.com>,
	Dmitry Kasatkin <d.kasatkin@...sung.com>,
	David Howells <dhowells@...hat.com>,
	linux-security-module@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Shuah Khan <shuahkhan@...il.com>
Subject: Re: [PATCH linux-next] security/integrity: Fix build error and
 warnings when CONFIG_INTEGRITY_ASYMMETRIC_KEYS is disabled

Hello Shuah,

Thanks for the patch.

If I am correct, Mimi has fixed already this error just recently.
But it did not get into James' tree yet...

http://git.kernel.org/cgit/linux/kernel/git/zohar/linux-integrity.git/commit/?h=next-fixes&id=f60bfa151cbe2e2eb6d5eaf84a3421405e7f282a

- Dmitry


On Fri, Nov 8, 2013 at 11:23 PM, Shuah Khan <shuah.kh@...sung.com> wrote:
> Fixed both linux-next build error and warnings with the following changes
>
> - define integrity_init_keyring() only when CONFIG_INTEGRITY_ASYMMETRIC_KEYS
>   is enabled
> - move integrity_init_keyring() stub from integrity.h
> - define integrity_init_keyring() prototype as an extern when
>   CONFIG_INTEGRITY_ASYMMETRIC_KEYS
>
> linux-next build fails with the following error when CONFIG_INTEGRITY_ASYMMETRIC_KEYS
> is disabled.
>
>   CC      security/integrity/digsig.o
> security/integrity/digsig.c:70:5: error: redefinition of ‘integrity_init_keyring’
>  int integrity_init_keyring(const unsigned int id)
>      ^
> In file included from security/integrity/digsig.c:22:0:
> security/integrity/integrity.h:149:12: note: previous definition of ‘integrity_init_keyring’ was here
>  static int integrity_init_keyring(const unsigned int id)
>             ^
> security/integrity/integrity.h:149:12: warning: ‘integrity_init_keyring’ defined but not used [-Wunused-function]
> make[2]: *** [security/integrity/digsig.o] Error 1
> make[1]: *** [security/integrity] Error 2
> make: *** [security] Error 2
>
> Signed-off-by: Shuah Khan <shuah.kh@...sung.com>
> ---
>  security/integrity/digsig.c    | 7 +++++++
>  security/integrity/integrity.h | 8 ++------
>  2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
> index 77ca965..28bc1a7 100644
> --- a/security/integrity/digsig.c
> +++ b/security/integrity/digsig.c
> @@ -67,6 +67,7 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
>         return -EOPNOTSUPP;
>  }
>
> +#ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
>  int integrity_init_keyring(const unsigned int id)
>  {
>         const struct cred *cred = current_cred();
> @@ -84,3 +85,9 @@ int integrity_init_keyring(const unsigned int id)
>                         keyring_name[id], PTR_ERR(keyring[id]));
>         return 0;
>  }
> +#else
> +int integrity_init_keyring(const unsigned int id)
> +{
> +       return 0;
> +}
> +#endif
> diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h
> index b9e7c13..99ac783 100644
> --- a/security/integrity/integrity.h
> +++ b/security/integrity/integrity.h
> @@ -134,22 +134,18 @@ static inline int integrity_digsig_verify(const unsigned int id,
>
>  #endif /* CONFIG_INTEGRITY_SIGNATURE */
>
> +extern int integrity_init_keyring(const unsigned int id);
> +
>  #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
>  int asymmetric_verify(struct key *keyring, const char *sig,
>                       int siglen, const char *data, int datalen);
>
> -int integrity_init_keyring(const unsigned int id);
>  #else
>  static inline int asymmetric_verify(struct key *keyring, const char *sig,
>                                     int siglen, const char *data, int datalen)
>  {
>         return -EOPNOTSUPP;
>  }
> -
> -static int integrity_init_keyring(const unsigned int id)
> -{
> -       return 0;
> -}
>  #endif
>
>  #ifdef CONFIG_INTEGRITY_AUDIT
> --
> 1.8.3.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Thanks,
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists