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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190403095031.11720-1-yuehaibing@huawei.com>
Date:   Wed, 3 Apr 2019 17:50:31 +0800
From:   Yue Haibing <yuehaibing@...wei.com>
To:     <davem@...emloft.net>, <viro@...iv.linux.org.uk>,
        <willemb@...gle.com>, <edumazet@...gle.com>, <fw@...len.de>,
        <sagi@...htbitslabs.com>, <hch@....de>, <pabeni@...hat.com>,
        <pctammela@...il.com>
CC:     <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH] iov_iter: Fix build error without CONFIG_CRYPTO

From: YueHaibing <yuehaibing@...wei.com>

If CONFIG_CRYPTO is not set or set to m,
gcc building warn this:

lib/iov_iter.o: In function `hash_and_copy_to_iter':
iov_iter.c:(.text+0x9129): undefined reference to `crypto_stats_get'
iov_iter.c:(.text+0x9152): undefined reference to `crypto_stats_ahash_update'

Reported-by: Hulk Robot <hulkci@...wei.com>
Fixes: d05f443554b3 ("iov_iter: introduce hash_and_copy_to_iter helper")
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
 include/linux/skbuff.h | 2 ++
 lib/iov_iter.c         | 2 ++
 net/core/datagram.c    | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9027a8c..3999112 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3396,9 +3396,11 @@ static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
 }
 int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen,
 				   struct msghdr *msg);
+#ifdef CONFIG_CRYPTO
 int skb_copy_and_hash_datagram_iter(const struct sk_buff *skb, int offset,
 			   struct iov_iter *to, int len,
 			   struct ahash_request *hash);
+#endif
 int skb_copy_datagram_from_iter(struct sk_buff *skb, int offset,
 				 struct iov_iter *from, int len);
 int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm);
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 50e77ec..ed02f74 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1528,6 +1528,7 @@ size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *csump,
 }
 EXPORT_SYMBOL(csum_and_copy_to_iter);
 
+#ifdef CONFIG_CRYPTO
 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
 		struct iov_iter *i)
 {
@@ -1542,6 +1543,7 @@ size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
 	return copied;
 }
 EXPORT_SYMBOL(hash_and_copy_to_iter);
+#endif
 
 int iov_iter_npages(const struct iov_iter *i, int maxpages)
 {
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 91bb5a0..8815ec2 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -494,6 +494,7 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
 	return 0;
 }
 
+#ifdef CONFIG_CRYPTO
 /**
  *	skb_copy_and_hash_datagram_iter - Copy datagram to an iovec iterator
  *          and update a hash.
@@ -511,6 +512,7 @@ int skb_copy_and_hash_datagram_iter(const struct sk_buff *skb, int offset,
 			hash_and_copy_to_iter, hash);
 }
 EXPORT_SYMBOL(skb_copy_and_hash_datagram_iter);
+#endif
 
 static size_t simple_copy_to_iter(const void *addr, size_t bytes,
 		void *data __always_unused, struct iov_iter *i)
-- 
2.7.4


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ