Kernel
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- 59 participants
- 18840 discussions

24 Mar '24
From: Eric Dumazet <edumazet(a)google.com>
mainline inclusion
from mainline-v6.8-rc3
commit 577e4432f3ac810049cb7e6b71f4d96ec7c6e894
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I99JO6
CVE: CVE-2024-26640
--------------------------------
TCP rx zerocopy intent is to map pages initially allocated
from NIC drivers, not pages owned by a fs.
This patch adds to can_map_frag() these additional checks:
- Page must not be a compound one.
- page->mapping must be NULL.
This fixes the panic reported by ZhangPeng.
syzbot was able to loopback packets built with sendfile(),
mapping pages owned by an ext4 file to TCP rx zerocopy.
r3 = socket$inet_tcp(0x2, 0x1, 0x0)
mmap(&(0x7f0000ff9000/0x4000)=nil, 0x4000, 0x0, 0x12, r3, 0x0)
r4 = socket$inet_tcp(0x2, 0x1, 0x0)
bind$inet(r4, &(0x7f0000000000)={0x2, 0x4e24, @multicast1}, 0x10)
connect$inet(r4, &(0x7f00000006c0)={0x2, 0x4e24, @empty}, 0x10)
r5 = openat$dir(0xffffffffffffff9c, &(0x7f00000000c0)='./file0\x00',
0x181e42, 0x0)
fallocate(r5, 0x0, 0x0, 0x85b8)
sendfile(r4, r5, 0x0, 0x8ba0)
getsockopt$inet_tcp_TCP_ZEROCOPY_RECEIVE(r4, 0x6, 0x23,
&(0x7f00000001c0)={&(0x7f0000ffb000/0x3000)=nil, 0x3000, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0}, &(0x7f0000000440)=0x40)
r6 = openat$dir(0xffffffffffffff9c, &(0x7f00000000c0)='./file0\x00',
0x181e42, 0x0)
Fixes: 93ab6cc69162 ("tcp: implement mmap() for zero copy receive")
Link: https://lore.kernel.org/netdev/5106a58e-04da-372a-b836-9d3d0bd2507b@huawei.…
Reported-and-bisected-by: ZhangPeng <zhangpeng362(a)huawei.com>
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
Cc: Arjun Roy <arjunroy(a)google.com>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: linux-mm(a)vger.kernel.org
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: linux-fsdevel(a)vger.kernel.org
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Conflicts:
net/ipv4/tcp.c
Signed-off-by: Ziyang Xuan <william.xuanziyang(a)huawei.com>
---
net/ipv4/tcp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index fb2b55894b8dc..4416d1c24dbbe 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1810,6 +1810,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
zc->recv_skip_hint = 0;
ret = 0;
while (length + PAGE_SIZE <= zc->length) {
+ struct page *page;
+
if (zc->recv_skip_hint < PAGE_SIZE) {
if (skb) {
skb = skb->next;
@@ -1830,7 +1832,9 @@ static int tcp_zerocopy_receive(struct sock *sk,
frags++;
}
}
- if (frags->size != PAGE_SIZE || frags->page_offset)
+ page = skb_frag_page(frags);
+ if (frags->size != PAGE_SIZE || frags->page_offset ||
+ PageCompound(page) || page->mapping)
break;
ret = vm_insert_page(vma, address + length,
skb_frag_page(frags));
--
2.25.1
2
1

[openeuler:OLK-5.10 56/30000] crypto/asymmetric_keys/pgp_public_key.c:310:15: error: implicit declaration of function 'pgp_parse_packets'
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: b670dd901cbbf97745380d373b1d2607b3235590
commit: c283657144c1475e571f0c1f34477af1f682a12f [56/30000] KEYS: Provide a function to load keys from a PGP keyring blob
config: x86_64-buildonly-randconfig-001-20240324 (https://download.01.org/0day-ci/archive/20240324/202403241216.myVe6NZX-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403241216.myVe6NZX-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403241216.myVe6NZX-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> crypto/asymmetric_keys/pgp_public_key.c:35:34: error: field 'pgp' has incomplete type
35 | struct pgp_parse_context pgp;
| ^~~
>> crypto/asymmetric_keys/pgp_public_key.c:48:39: warning: 'struct pgp_parse_pubkey' declared inside parameter list will not be visible outside of this definition or declaration
48 | struct pgp_parse_pubkey *pgp,
| ^~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_calc_pkey_keyid':
>> crypto/asymmetric_keys/pgp_public_key.c:63:17: error: invalid use of undefined type 'struct pgp_parse_pubkey'
63 | n = (pgp->version < PGP_KEY_VERSION_4) ? 8 : 6;
| ^~
crypto/asymmetric_keys/pgp_public_key.c:85:32: error: invalid use of undefined type 'struct pgp_parse_pubkey'
85 | digest_putc(digest, pgp->version);
| ^~
crypto/asymmetric_keys/pgp_public_key.c:87:18: error: invalid use of undefined type 'struct pgp_parse_pubkey'
87 | a32 = pgp->creation_time;
| ^~
crypto/asymmetric_keys/pgp_public_key.c:93:16: error: invalid use of undefined type 'struct pgp_parse_pubkey'
93 | if (pgp->version < PGP_KEY_VERSION_4) {
| ^~
crypto/asymmetric_keys/pgp_public_key.c:96:24: error: invalid use of undefined type 'struct pgp_parse_pubkey'
96 | if (pgp->expires_at)
| ^~
crypto/asymmetric_keys/pgp_public_key.c:97:35: error: invalid use of undefined type 'struct pgp_parse_pubkey'
97 | a16 = (pgp->expires_at - pgp->creation_time) / 86400UL;
| ^~
crypto/asymmetric_keys/pgp_public_key.c:97:53: error: invalid use of undefined type 'struct pgp_parse_pubkey'
97 | a16 = (pgp->expires_at - pgp->creation_time) / 86400UL;
| ^~
crypto/asymmetric_keys/pgp_public_key.c:104:32: error: invalid use of undefined type 'struct pgp_parse_pubkey'
104 | digest_putc(digest, pgp->pubkey_algo);
| ^~
crypto/asymmetric_keys/pgp_public_key.c: At top level:
crypto/asymmetric_keys/pgp_public_key.c:121:44: warning: 'struct pgp_parse_pubkey' declared inside parameter list will not be visible outside of this definition or declaration
121 | struct pgp_parse_pubkey *pgp,
| ^~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_generate_fingerprint':
crypto/asymmetric_keys/pgp_public_key.c:132:37: error: invalid use of undefined type 'struct pgp_parse_pubkey'
132 | tfm = crypto_alloc_shash(pgp->version < PGP_KEY_VERSION_4 ?
| ^~
>> crypto/asymmetric_keys/pgp_public_key.c:148:43: error: passing argument 2 of 'pgp_calc_pkey_keyid' from incompatible pointer type [-Werror=incompatible-pointer-types]
148 | ret = pgp_calc_pkey_keyid(digest, pgp, pub);
| ^~~
| |
| struct pgp_parse_pubkey *
crypto/asymmetric_keys/pgp_public_key.c:48:57: note: expected 'struct pgp_parse_pubkey *' but argument is of type 'struct pgp_parse_pubkey *'
48 | struct pgp_parse_pubkey *pgp,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_process_public_key':
>> crypto/asymmetric_keys/pgp_public_key.c:201:33: error: storage size of 'pgp' isn't known
201 | struct pgp_parse_pubkey pgp;
| ^~~
>> crypto/asymmetric_keys/pgp_public_key.c:224:15: error: implicit declaration of function 'pgp_parse_public_key'; did you mean 'pgp_process_public_key'? [-Werror=implicit-function-declaration]
224 | ret = pgp_parse_public_key(&data, &datalen, &pgp);
| ^~~~~~~~~~~~~~~~~~~~
| pgp_process_public_key
>> crypto/asymmetric_keys/pgp_public_key.c:201:33: warning: unused variable 'pgp' [-Wunused-variable]
201 | struct pgp_parse_pubkey pgp;
| ^~~
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_key_parse':
>> crypto/asymmetric_keys/pgp_public_key.c:310:15: error: implicit declaration of function 'pgp_parse_packets' [-Werror=implicit-function-declaration]
310 | ret = pgp_parse_packets(prep->data, prep->datalen, &ctx.pgp);
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
>> crypto/asymmetric_keys/pgp_preload.c:23:34: error: field 'pgp' has incomplete type
23 | struct pgp_parse_context pgp;
| ^~~
crypto/asymmetric_keys/pgp_preload.c: In function 'preload_pgp_keys':
>> crypto/asymmetric_keys/pgp_preload.c:110:15: error: implicit declaration of function 'pgp_parse_packets' [-Werror=implicit-function-declaration]
110 | ret = pgp_parse_packets(pgpdata, pgpdatalen, &ctx.pgp);
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PGP_KEY_PARSER
Depends on [n]: CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y] && ASYMMETRIC_PUBLIC_KEY_SUBTYPE [=n]
Selected by [y]:
- PGP_PRELOAD [=y] && CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y]
vim +/pgp_parse_packets +310 crypto/asymmetric_keys/pgp_public_key.c
4006f47d4e2171 Roberto Sassu 2021-03-03 116
4006f47d4e2171 Roberto Sassu 2021-03-03 117 /*
4006f47d4e2171 Roberto Sassu 2021-03-03 118 * Calculate the public key ID fingerprint
4006f47d4e2171 Roberto Sassu 2021-03-03 119 */
4006f47d4e2171 Roberto Sassu 2021-03-03 120 static int pgp_generate_fingerprint(struct pgp_key_data_parse_context *ctx,
4006f47d4e2171 Roberto Sassu 2021-03-03 121 struct pgp_parse_pubkey *pgp,
4006f47d4e2171 Roberto Sassu 2021-03-03 122 struct public_key *pub)
4006f47d4e2171 Roberto Sassu 2021-03-03 123 {
4006f47d4e2171 Roberto Sassu 2021-03-03 124 struct crypto_shash *tfm;
4006f47d4e2171 Roberto Sassu 2021-03-03 125 struct shash_desc *digest;
4006f47d4e2171 Roberto Sassu 2021-03-03 126 char *fingerprint;
4006f47d4e2171 Roberto Sassu 2021-03-03 127 u8 *raw_fingerprint;
4006f47d4e2171 Roberto Sassu 2021-03-03 128 int digest_size, offset;
4006f47d4e2171 Roberto Sassu 2021-03-03 129 int ret, i;
4006f47d4e2171 Roberto Sassu 2021-03-03 130
4006f47d4e2171 Roberto Sassu 2021-03-03 131 ret = -ENOMEM;
4006f47d4e2171 Roberto Sassu 2021-03-03 132 tfm = crypto_alloc_shash(pgp->version < PGP_KEY_VERSION_4 ?
4006f47d4e2171 Roberto Sassu 2021-03-03 133 "md5" : "sha1", 0, 0);
4006f47d4e2171 Roberto Sassu 2021-03-03 134 if (!tfm)
4006f47d4e2171 Roberto Sassu 2021-03-03 135 goto cleanup;
4006f47d4e2171 Roberto Sassu 2021-03-03 136
4006f47d4e2171 Roberto Sassu 2021-03-03 137 digest = kmalloc(sizeof(*digest) + crypto_shash_descsize(tfm),
4006f47d4e2171 Roberto Sassu 2021-03-03 138 GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 139 if (!digest)
4006f47d4e2171 Roberto Sassu 2021-03-03 140 goto cleanup_tfm;
4006f47d4e2171 Roberto Sassu 2021-03-03 141
4006f47d4e2171 Roberto Sassu 2021-03-03 142 digest->tfm = tfm;
4006f47d4e2171 Roberto Sassu 2021-03-03 143 crypto_shash_set_flags(digest->tfm, CRYPTO_TFM_REQ_MAY_SLEEP);
4006f47d4e2171 Roberto Sassu 2021-03-03 144 ret = crypto_shash_init(digest);
4006f47d4e2171 Roberto Sassu 2021-03-03 145 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 146 goto cleanup_hash;
4006f47d4e2171 Roberto Sassu 2021-03-03 147
4006f47d4e2171 Roberto Sassu 2021-03-03 @148 ret = pgp_calc_pkey_keyid(digest, pgp, pub);
4006f47d4e2171 Roberto Sassu 2021-03-03 149 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 150 goto cleanup_hash;
4006f47d4e2171 Roberto Sassu 2021-03-03 151
4006f47d4e2171 Roberto Sassu 2021-03-03 152 digest_size = crypto_shash_digestsize(tfm);
4006f47d4e2171 Roberto Sassu 2021-03-03 153
4006f47d4e2171 Roberto Sassu 2021-03-03 154 raw_fingerprint = kmalloc(digest_size, GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 155 if (!raw_fingerprint)
4006f47d4e2171 Roberto Sassu 2021-03-03 156 goto cleanup_hash;
4006f47d4e2171 Roberto Sassu 2021-03-03 157
4006f47d4e2171 Roberto Sassu 2021-03-03 158 ret = crypto_shash_final(digest, raw_fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 159 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 160 goto cleanup_raw_fingerprint;
4006f47d4e2171 Roberto Sassu 2021-03-03 161
a98cb7a4b757b7 David Howells 2021-03-03 162 ctx->fingerprint_len = digest_size * 2;
4006f47d4e2171 Roberto Sassu 2021-03-03 163 fingerprint = kmalloc(digest_size * 2 + 1, GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 164 if (!fingerprint)
4006f47d4e2171 Roberto Sassu 2021-03-03 165 goto cleanup_raw_fingerprint;
4006f47d4e2171 Roberto Sassu 2021-03-03 166
4006f47d4e2171 Roberto Sassu 2021-03-03 167 offset = digest_size - 8;
4006f47d4e2171 Roberto Sassu 2021-03-03 168 pr_debug("offset %u/%u\n", offset, digest_size);
4006f47d4e2171 Roberto Sassu 2021-03-03 169
4006f47d4e2171 Roberto Sassu 2021-03-03 170 for (i = 0; i < digest_size; i++)
4006f47d4e2171 Roberto Sassu 2021-03-03 171 sprintf(fingerprint + i * 2, "%02x", raw_fingerprint[i]);
4006f47d4e2171 Roberto Sassu 2021-03-03 172 pr_debug("fingerprint %s\n", fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 173
4006f47d4e2171 Roberto Sassu 2021-03-03 174 ctx->raw_fingerprint = raw_fingerprint;
4006f47d4e2171 Roberto Sassu 2021-03-03 175 ctx->fingerprint = fingerprint;
4006f47d4e2171 Roberto Sassu 2021-03-03 176 ret = 0;
4006f47d4e2171 Roberto Sassu 2021-03-03 177 cleanup_raw_fingerprint:
4006f47d4e2171 Roberto Sassu 2021-03-03 178 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 179 kfree(raw_fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 180 cleanup_hash:
4006f47d4e2171 Roberto Sassu 2021-03-03 181 kfree(digest);
4006f47d4e2171 Roberto Sassu 2021-03-03 182 cleanup_tfm:
4006f47d4e2171 Roberto Sassu 2021-03-03 183 crypto_free_shash(tfm);
4006f47d4e2171 Roberto Sassu 2021-03-03 184 cleanup:
4006f47d4e2171 Roberto Sassu 2021-03-03 185 kleave(" = %d", ret);
4006f47d4e2171 Roberto Sassu 2021-03-03 186 return ret;
4006f47d4e2171 Roberto Sassu 2021-03-03 187 }
4006f47d4e2171 Roberto Sassu 2021-03-03 188
4006f47d4e2171 Roberto Sassu 2021-03-03 189 /*
4006f47d4e2171 Roberto Sassu 2021-03-03 190 * Extract a public key or public subkey from the PGP stream.
4006f47d4e2171 Roberto Sassu 2021-03-03 191 */
4006f47d4e2171 Roberto Sassu 2021-03-03 192 static int pgp_process_public_key(struct pgp_parse_context *context,
4006f47d4e2171 Roberto Sassu 2021-03-03 193 enum pgp_packet_tag type,
4006f47d4e2171 Roberto Sassu 2021-03-03 194 u8 headerlen,
4006f47d4e2171 Roberto Sassu 2021-03-03 195 const u8 *data,
4006f47d4e2171 Roberto Sassu 2021-03-03 196 size_t datalen)
4006f47d4e2171 Roberto Sassu 2021-03-03 197 {
4006f47d4e2171 Roberto Sassu 2021-03-03 198 const char *algo;
4006f47d4e2171 Roberto Sassu 2021-03-03 199 struct pgp_key_data_parse_context *ctx =
4006f47d4e2171 Roberto Sassu 2021-03-03 200 container_of(context, struct pgp_key_data_parse_context, pgp);
4006f47d4e2171 Roberto Sassu 2021-03-03 @201 struct pgp_parse_pubkey pgp;
4006f47d4e2171 Roberto Sassu 2021-03-03 202 struct public_key *pub;
4006f47d4e2171 Roberto Sassu 2021-03-03 203 int ret;
4006f47d4e2171 Roberto Sassu 2021-03-03 204
4006f47d4e2171 Roberto Sassu 2021-03-03 205 kenter(",%u,%u,,%zu", type, headerlen, datalen);
4006f47d4e2171 Roberto Sassu 2021-03-03 206
a98cb7a4b757b7 David Howells 2021-03-03 207 if (type == PGP_PKT_USER_ID) {
a98cb7a4b757b7 David Howells 2021-03-03 208 ctx->user_id = data;
a98cb7a4b757b7 David Howells 2021-03-03 209 ctx->user_id_len = datalen;
a98cb7a4b757b7 David Howells 2021-03-03 210 kleave(" = 0 [user ID]");
a98cb7a4b757b7 David Howells 2021-03-03 211 return 0;
a98cb7a4b757b7 David Howells 2021-03-03 212 }
a98cb7a4b757b7 David Howells 2021-03-03 213
4006f47d4e2171 Roberto Sassu 2021-03-03 214 if (ctx->fingerprint) {
4006f47d4e2171 Roberto Sassu 2021-03-03 215 kleave(" = -ENOKEY [already]");
4006f47d4e2171 Roberto Sassu 2021-03-03 216 return -EBADMSG;
4006f47d4e2171 Roberto Sassu 2021-03-03 217 }
4006f47d4e2171 Roberto Sassu 2021-03-03 218
4006f47d4e2171 Roberto Sassu 2021-03-03 219 pub = kzalloc(sizeof(struct public_key), GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 220 if (!pub)
4006f47d4e2171 Roberto Sassu 2021-03-03 221 return -ENOMEM;
4006f47d4e2171 Roberto Sassu 2021-03-03 222 pub->id_type = "PGP";
4006f47d4e2171 Roberto Sassu 2021-03-03 223
4006f47d4e2171 Roberto Sassu 2021-03-03 @224 ret = pgp_parse_public_key(&data, &datalen, &pgp);
4006f47d4e2171 Roberto Sassu 2021-03-03 225 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 226 goto cleanup;
4006f47d4e2171 Roberto Sassu 2021-03-03 227
4006f47d4e2171 Roberto Sassu 2021-03-03 228 if (pgp.pubkey_algo >= PGP_PUBKEY__LAST)
4006f47d4e2171 Roberto Sassu 2021-03-03 229 goto cleanup_unsupported_pkey_algo;
4006f47d4e2171 Roberto Sassu 2021-03-03 230 algo = pgp_to_public_key_algo[pgp.pubkey_algo];
4006f47d4e2171 Roberto Sassu 2021-03-03 231 if (!algo)
4006f47d4e2171 Roberto Sassu 2021-03-03 232 goto cleanup_unsupported_pkey_algo;
4006f47d4e2171 Roberto Sassu 2021-03-03 233 pub->pkey_algo = algo;
4006f47d4e2171 Roberto Sassu 2021-03-03 234
4006f47d4e2171 Roberto Sassu 2021-03-03 235 pub->key = kmemdup(data, datalen, GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 236 if (!pub->key)
4006f47d4e2171 Roberto Sassu 2021-03-03 237 goto cleanup_nomem;
4006f47d4e2171 Roberto Sassu 2021-03-03 238
4006f47d4e2171 Roberto Sassu 2021-03-03 239 pub->keylen = datalen;
4006f47d4e2171 Roberto Sassu 2021-03-03 240
4006f47d4e2171 Roberto Sassu 2021-03-03 241 ret = pgp_generate_fingerprint(ctx, &pgp, pub);
4006f47d4e2171 Roberto Sassu 2021-03-03 242 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 243 goto cleanup;
4006f47d4e2171 Roberto Sassu 2021-03-03 244
4006f47d4e2171 Roberto Sassu 2021-03-03 245 ctx->pub = pub;
4006f47d4e2171 Roberto Sassu 2021-03-03 246 kleave(" = 0 [use]");
4006f47d4e2171 Roberto Sassu 2021-03-03 247 return 0;
4006f47d4e2171 Roberto Sassu 2021-03-03 248
4006f47d4e2171 Roberto Sassu 2021-03-03 249 cleanup_unsupported_pkey_algo:
4006f47d4e2171 Roberto Sassu 2021-03-03 250 pr_debug("Unsupported public key algorithm %u\n",
4006f47d4e2171 Roberto Sassu 2021-03-03 251 pgp.pubkey_algo);
4006f47d4e2171 Roberto Sassu 2021-03-03 252 ret = -ENOPKG;
4006f47d4e2171 Roberto Sassu 2021-03-03 253 goto cleanup;
4006f47d4e2171 Roberto Sassu 2021-03-03 254 cleanup_nomem:
4006f47d4e2171 Roberto Sassu 2021-03-03 255 ret = -ENOMEM;
4006f47d4e2171 Roberto Sassu 2021-03-03 256 goto cleanup;
4006f47d4e2171 Roberto Sassu 2021-03-03 257 cleanup:
4006f47d4e2171 Roberto Sassu 2021-03-03 258 pr_devel("cleanup");
4006f47d4e2171 Roberto Sassu 2021-03-03 259 kfree(pub->key);
4006f47d4e2171 Roberto Sassu 2021-03-03 260 kfree(pub);
4006f47d4e2171 Roberto Sassu 2021-03-03 261 kleave(" = %d", ret);
4006f47d4e2171 Roberto Sassu 2021-03-03 262 return ret;
4006f47d4e2171 Roberto Sassu 2021-03-03 263 }
4006f47d4e2171 Roberto Sassu 2021-03-03 264
4006f47d4e2171 Roberto Sassu 2021-03-03 265 static struct asymmetric_key_ids *pgp_key_generate_id(
4006f47d4e2171 Roberto Sassu 2021-03-03 266 struct pgp_key_data_parse_context *ctx)
4006f47d4e2171 Roberto Sassu 2021-03-03 267 {
4006f47d4e2171 Roberto Sassu 2021-03-03 268 struct asymmetric_key_ids *kids;
4006f47d4e2171 Roberto Sassu 2021-03-03 269 struct asymmetric_key_id *kid;
4006f47d4e2171 Roberto Sassu 2021-03-03 270 int fingerprint_len = strlen(ctx->fingerprint) / 2;
4006f47d4e2171 Roberto Sassu 2021-03-03 271
4006f47d4e2171 Roberto Sassu 2021-03-03 272 kids = kzalloc(sizeof(struct asymmetric_key_ids), GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 273 if (!kids)
4006f47d4e2171 Roberto Sassu 2021-03-03 274 return kids;
4006f47d4e2171 Roberto Sassu 2021-03-03 275
4006f47d4e2171 Roberto Sassu 2021-03-03 276 kid = asymmetric_key_generate_id(ctx->raw_fingerprint, fingerprint_len,
4006f47d4e2171 Roberto Sassu 2021-03-03 277 NULL, 0);
4006f47d4e2171 Roberto Sassu 2021-03-03 278 if (IS_ERR(kid))
4006f47d4e2171 Roberto Sassu 2021-03-03 279 goto error;
4006f47d4e2171 Roberto Sassu 2021-03-03 280
4006f47d4e2171 Roberto Sassu 2021-03-03 281 kids->id[0] = kid;
4006f47d4e2171 Roberto Sassu 2021-03-03 282 kids->id[1] = kmemdup(kid, sizeof(kid) + fingerprint_len, GFP_KERNEL);
4006f47d4e2171 Roberto Sassu 2021-03-03 283 if (!kids->id[1])
4006f47d4e2171 Roberto Sassu 2021-03-03 284 goto error;
4006f47d4e2171 Roberto Sassu 2021-03-03 285
4006f47d4e2171 Roberto Sassu 2021-03-03 286 return kids;
4006f47d4e2171 Roberto Sassu 2021-03-03 287 error:
4006f47d4e2171 Roberto Sassu 2021-03-03 288 kfree(kids->id[0]);
4006f47d4e2171 Roberto Sassu 2021-03-03 289 kfree(kids);
4006f47d4e2171 Roberto Sassu 2021-03-03 290
4006f47d4e2171 Roberto Sassu 2021-03-03 291 return NULL;
4006f47d4e2171 Roberto Sassu 2021-03-03 292 }
4006f47d4e2171 Roberto Sassu 2021-03-03 293
4006f47d4e2171 Roberto Sassu 2021-03-03 294 /*
4006f47d4e2171 Roberto Sassu 2021-03-03 295 * Attempt to parse the instantiation data blob for a key as a PGP packet
4006f47d4e2171 Roberto Sassu 2021-03-03 296 * message holding a key.
4006f47d4e2171 Roberto Sassu 2021-03-03 297 */
4006f47d4e2171 Roberto Sassu 2021-03-03 298 static int pgp_key_parse(struct key_preparsed_payload *prep)
4006f47d4e2171 Roberto Sassu 2021-03-03 299 {
4006f47d4e2171 Roberto Sassu 2021-03-03 300 struct pgp_key_data_parse_context ctx;
4006f47d4e2171 Roberto Sassu 2021-03-03 301 int ret;
4006f47d4e2171 Roberto Sassu 2021-03-03 302
4006f47d4e2171 Roberto Sassu 2021-03-03 303 kenter("");
4006f47d4e2171 Roberto Sassu 2021-03-03 304
4006f47d4e2171 Roberto Sassu 2021-03-03 305 memset(&ctx, 0, sizeof(ctx));
a98cb7a4b757b7 David Howells 2021-03-03 306 ctx.pgp.types_of_interest = (1 << PGP_PKT_PUBLIC_KEY) |
a98cb7a4b757b7 David Howells 2021-03-03 307 (1 << PGP_PKT_USER_ID);
4006f47d4e2171 Roberto Sassu 2021-03-03 308 ctx.pgp.process_packet = pgp_process_public_key;
4006f47d4e2171 Roberto Sassu 2021-03-03 309
4006f47d4e2171 Roberto Sassu 2021-03-03 @310 ret = pgp_parse_packets(prep->data, prep->datalen, &ctx.pgp);
4006f47d4e2171 Roberto Sassu 2021-03-03 311 if (ret < 0)
4006f47d4e2171 Roberto Sassu 2021-03-03 312 goto error;
4006f47d4e2171 Roberto Sassu 2021-03-03 313
a98cb7a4b757b7 David Howells 2021-03-03 314 if (ctx.user_id && ctx.user_id_len > 0) {
a98cb7a4b757b7 David Howells 2021-03-03 315 /* Propose a description for the key
a98cb7a4b757b7 David Howells 2021-03-03 316 * (user ID without the comment)
a98cb7a4b757b7 David Howells 2021-03-03 317 */
a98cb7a4b757b7 David Howells 2021-03-03 318 size_t ulen = ctx.user_id_len, flen = ctx.fingerprint_len;
a98cb7a4b757b7 David Howells 2021-03-03 319 const char *p;
a98cb7a4b757b7 David Howells 2021-03-03 320
a98cb7a4b757b7 David Howells 2021-03-03 321 p = memchr(ctx.user_id, '(', ulen);
a98cb7a4b757b7 David Howells 2021-03-03 322 if (p) {
a98cb7a4b757b7 David Howells 2021-03-03 323 /* Remove the comment */
a98cb7a4b757b7 David Howells 2021-03-03 324 do {
a98cb7a4b757b7 David Howells 2021-03-03 325 p--;
a98cb7a4b757b7 David Howells 2021-03-03 326 } while (*p == ' ' && p > ctx.user_id);
a98cb7a4b757b7 David Howells 2021-03-03 327 if (*p != ' ')
a98cb7a4b757b7 David Howells 2021-03-03 328 p++;
a98cb7a4b757b7 David Howells 2021-03-03 329 ulen = p - ctx.user_id;
a98cb7a4b757b7 David Howells 2021-03-03 330 }
a98cb7a4b757b7 David Howells 2021-03-03 331
a98cb7a4b757b7 David Howells 2021-03-03 332 if (ulen > 255 - 9)
a98cb7a4b757b7 David Howells 2021-03-03 333 ulen = 255 - 9;
a98cb7a4b757b7 David Howells 2021-03-03 334 prep->description = kmalloc(ulen + 1 + 8 + 1, GFP_KERNEL);
a98cb7a4b757b7 David Howells 2021-03-03 335 ret = -ENOMEM;
a98cb7a4b757b7 David Howells 2021-03-03 336 if (!prep->description)
a98cb7a4b757b7 David Howells 2021-03-03 337 goto error;
a98cb7a4b757b7 David Howells 2021-03-03 338 memcpy(prep->description, ctx.user_id, ulen);
a98cb7a4b757b7 David Howells 2021-03-03 339 prep->description[ulen] = ' ';
a98cb7a4b757b7 David Howells 2021-03-03 340 memcpy(prep->description + ulen + 1,
a98cb7a4b757b7 David Howells 2021-03-03 341 ctx.fingerprint + flen - 8, 8);
a98cb7a4b757b7 David Howells 2021-03-03 342 prep->description[ulen + 9] = 0;
a98cb7a4b757b7 David Howells 2021-03-03 343 pr_debug("desc '%s'\n", prep->description);
a98cb7a4b757b7 David Howells 2021-03-03 344 }
a98cb7a4b757b7 David Howells 2021-03-03 345
4006f47d4e2171 Roberto Sassu 2021-03-03 346 /* We're pinning the module by being linked against it */
4006f47d4e2171 Roberto Sassu 2021-03-03 347 __module_get(public_key_subtype.owner);
4006f47d4e2171 Roberto Sassu 2021-03-03 348 prep->payload.data[asym_subtype] = &public_key_subtype;
4006f47d4e2171 Roberto Sassu 2021-03-03 349 prep->payload.data[asym_key_ids] = pgp_key_generate_id(&ctx);
4006f47d4e2171 Roberto Sassu 2021-03-03 350 prep->payload.data[asym_crypto] = ctx.pub;
4006f47d4e2171 Roberto Sassu 2021-03-03 351 prep->quotalen = 100;
4006f47d4e2171 Roberto Sassu 2021-03-03 352 kfree(ctx.fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 353 kfree(ctx.raw_fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 354 return 0;
4006f47d4e2171 Roberto Sassu 2021-03-03 355
4006f47d4e2171 Roberto Sassu 2021-03-03 356 error:
4006f47d4e2171 Roberto Sassu 2021-03-03 357 public_key_free(ctx.pub);
4006f47d4e2171 Roberto Sassu 2021-03-03 358 kfree(ctx.fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 359 kfree(ctx.raw_fingerprint);
4006f47d4e2171 Roberto Sassu 2021-03-03 360 return ret;
4006f47d4e2171 Roberto Sassu 2021-03-03 361 }
4006f47d4e2171 Roberto Sassu 2021-03-03 362
:::::: The code at line 310 was first introduced by commit
:::::: 4006f47d4e2171af60bfb5daab2bcce8bc02c309 KEYS: PGP data parser
:::::: TO: Roberto Sassu <roberto.sassu(a)huawei.com>
:::::: CC: Zheng Zengkai <zhengzengkai(a)huawei.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-6.6 3338/6857] crypto/asymmetric_keys/pgp_preload.c:63:25: error: variable has incomplete type 'enum pgp_packet_tag'
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 1b4212c630731d88b07d5b6e28ecaff1a76d3839
commit: 43d4042e06d2bf96adf67d25e8d91653507a4cf9 [3338/6857] KEYS: Provide a function to load keys from a PGP keyring blob
config: x86_64-randconfig-071-20240323 (https://download.01.org/0day-ci/archive/20240324/202403241144.mKTk9zUl-lkp@…)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403241144.mKTk9zUl-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403241144.mKTk9zUl-lkp@intel.com/
All errors (new ones prefixed by >>):
crypto/asymmetric_keys/pgp_preload.c:25:27: error: field has incomplete type 'struct pgp_parse_context'
25 | struct pgp_parse_context pgp;
| ^
crypto/asymmetric_keys/pgp_preload.c:25:9: note: forward declaration of 'struct pgp_parse_context'
25 | struct pgp_parse_context pgp;
| ^
crypto/asymmetric_keys/pgp_preload.c:63:10: warning: declaration of 'enum pgp_packet_tag' will not be visible outside of this function [-Wvisibility]
63 | enum pgp_packet_tag type, u8 headerlen,
| ^
>> crypto/asymmetric_keys/pgp_preload.c:63:25: error: variable has incomplete type 'enum pgp_packet_tag'
63 | enum pgp_packet_tag type, u8 headerlen,
| ^
crypto/asymmetric_keys/pgp_preload.c:63:10: note: forward declaration of 'enum pgp_packet_tag'
63 | enum pgp_packet_tag type, u8 headerlen,
| ^
>> crypto/asymmetric_keys/pgp_preload.c:107:36: error: use of undeclared identifier 'PGP_PKT_PUBLIC_KEY'
107 | ctx.pgp.types_of_interest = (1 << PGP_PKT_PUBLIC_KEY);
| ^
>> crypto/asymmetric_keys/pgp_preload.c:112:8: error: call to undeclared function 'pgp_parse_packets'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
112 | ret = pgp_parse_packets(pgpdata, pgpdatalen, &ctx.pgp);
| ^
crypto/asymmetric_keys/pgp_preload.c:101:12: warning: no previous prototype for function 'preload_pgp_keys' [-Wmissing-prototypes]
101 | int __init preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen,
| ^
crypto/asymmetric_keys/pgp_preload.c:101:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
101 | int __init preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen,
| ^
| static
2 warnings and 4 errors generated.
--
crypto/asymmetric_keys/pgp_public_key.c:37:27: error: field has incomplete type 'struct pgp_parse_context'
37 | struct pgp_parse_context pgp;
| ^
crypto/asymmetric_keys/pgp_public_key.c:37:9: note: forward declaration of 'struct pgp_parse_context'
37 | struct pgp_parse_context pgp;
| ^
crypto/asymmetric_keys/pgp_public_key.c:50:18: warning: declaration of 'struct pgp_parse_pubkey' will not be visible outside of this function [-Wvisibility]
50 | struct pgp_parse_pubkey *pgp,
| ^
>> crypto/asymmetric_keys/pgp_public_key.c:63:2: error: call to undeclared function 'kenter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
63 | kenter("");
| ^
crypto/asymmetric_keys/pgp_public_key.c:65:10: error: incomplete definition of type 'struct pgp_parse_pubkey'
65 | n = (pgp->version < PGP_KEY_VERSION_4) ? 8 : 6;
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
>> crypto/asymmetric_keys/pgp_public_key.c:65:22: error: use of undeclared identifier 'PGP_KEY_VERSION_4'
65 | n = (pgp->version < PGP_KEY_VERSION_4) ? 8 : 6;
| ^
>> crypto/asymmetric_keys/pgp_public_key.c:67:9: error: call to undeclared function 'mpi_key_length'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
67 | ret = mpi_key_length(key_ptr, keylen, nb + i, nn + i);
| ^
crypto/asymmetric_keys/pgp_public_key.c:87:25: error: incomplete definition of type 'struct pgp_parse_pubkey'
87 | digest_putc(digest, pgp->version);
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:89:11: error: incomplete definition of type 'struct pgp_parse_pubkey'
89 | a32 = pgp->creation_time;
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:95:9: error: incomplete definition of type 'struct pgp_parse_pubkey'
95 | if (pgp->version < PGP_KEY_VERSION_4) {
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:95:21: error: use of undeclared identifier 'PGP_KEY_VERSION_4'
95 | if (pgp->version < PGP_KEY_VERSION_4) {
| ^
crypto/asymmetric_keys/pgp_public_key.c:98:10: error: incomplete definition of type 'struct pgp_parse_pubkey'
98 | if (pgp->expires_at)
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:99:14: error: incomplete definition of type 'struct pgp_parse_pubkey'
99 | a16 = (pgp->expires_at - pgp->creation_time) / 86400UL;
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:99:32: error: incomplete definition of type 'struct pgp_parse_pubkey'
99 | a16 = (pgp->expires_at - pgp->creation_time) / 86400UL;
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:106:25: error: incomplete definition of type 'struct pgp_parse_pubkey'
106 | digest_putc(digest, pgp->pubkey_algo);
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:50:18: note: forward declaration of 'struct pgp_parse_pubkey'
50 | struct pgp_parse_pubkey *pgp,
| ^
>> crypto/asymmetric_keys/pgp_public_key.c:115:2: error: call to undeclared function 'kleave'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
115 | kleave(" = %d", ret);
| ^
crypto/asymmetric_keys/pgp_public_key.c:123:16: warning: declaration of 'struct pgp_parse_pubkey' will not be visible outside of this function [-Wvisibility]
123 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:134:30: error: incomplete definition of type 'struct pgp_parse_pubkey'
134 | tfm = crypto_alloc_shash(pgp->version < PGP_KEY_VERSION_4 ?
| ~~~^
crypto/asymmetric_keys/pgp_public_key.c:123:16: note: forward declaration of 'struct pgp_parse_pubkey'
123 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:134:42: error: use of undeclared identifier 'PGP_KEY_VERSION_4'
134 | tfm = crypto_alloc_shash(pgp->version < PGP_KEY_VERSION_4 ?
| ^
crypto/asymmetric_keys/pgp_public_key.c:150:36: error: incompatible pointer types passing 'struct pgp_parse_pubkey *' to parameter of type 'struct pgp_parse_pubkey *' [-Werror,-Wincompatible-pointer-types]
150 | ret = pgp_calc_pkey_keyid(digest, pgp, pub);
| ^~~
crypto/asymmetric_keys/pgp_public_key.c:50:36: note: passing argument to parameter 'pgp' here
50 | struct pgp_parse_pubkey *pgp,
| ^
crypto/asymmetric_keys/pgp_public_key.c:191:2: error: call to undeclared function 'kleave'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
191 | kleave(" = %d", ret);
| ^
crypto/asymmetric_keys/pgp_public_key.c:199:12: warning: declaration of 'enum pgp_packet_tag' will not be visible outside of this function [-Wvisibility]
199 | enum pgp_packet_tag type,
| ^
>> crypto/asymmetric_keys/pgp_public_key.c:199:27: error: variable has incomplete type 'enum pgp_packet_tag'
199 | enum pgp_packet_tag type,
| ^
crypto/asymmetric_keys/pgp_public_key.c:199:12: note: forward declaration of 'enum pgp_packet_tag'
199 | enum pgp_packet_tag type,
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for DRM_I915_DEBUG_GEM
Depends on [n]: HAS_IOMEM [=y] && DRM_I915 [=y] && EXPERT [=y] && DRM_I915_WERROR [=n]
Selected by [y]:
- DRM_I915_DEBUG [=y] && HAS_IOMEM [=y] && DRM_I915 [=y] && EXPERT [=y] && !COMPILE_TEST [=n]
WARNING: unmet direct dependencies detected for PGP_KEY_PARSER
Depends on [n]: CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y] && ASYMMETRIC_PUBLIC_KEY_SUBTYPE [=n]
Selected by [y]:
- PGP_PRELOAD [=y] && CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y]
vim +63 crypto/asymmetric_keys/pgp_preload.c
58
59 /*
60 * Extract a public key or subkey from the PGP stream.
61 */
62 static int __init found_pgp_key(struct pgp_parse_context *context,
> 63 enum pgp_packet_tag type, u8 headerlen,
64 const u8 *data, size_t datalen)
65 {
66 struct preload_pgp_keys_context *ctx =
67 container_of(context, struct preload_pgp_keys_context, pgp);
68 int ret;
69
70 if (ctx->found_key) {
71 ctx->key_end = data - headerlen;
72 ret = create_pgp_key(ctx);
73 if (ret < 0)
74 return ret;
75 }
76
77 ctx->key_start = data - headerlen;
78 ctx->found_key = true;
79 return 0;
80 }
81
82 /**
83 * preload_pgp_keys - Load keys from a PGP keyring blob
84 * @pgpdata: The PGP keyring blob containing the keys.
85 * @pgpdatalen: The size of the @pgpdata blob.
86 * @keyring: The keyring to add the new keys to.
87 *
88 * Preload a pack of keys from a PGP keyring blob.
89 *
90 * The keys have their descriptions generated from the user ID and fingerprint
91 * in the PGP stream. Since keys can be matched on their key IDs independently
92 * of the key description, the description is mostly irrelevant apart from the
93 * fact that keys of the same description displace one another from a keyring.
94 *
95 * The caller should override the current creds if they want the keys to be
96 * owned by someone other than the current process's owner. Keys will not be
97 * accounted towards the owner's quota.
98 *
99 * This function may only be called whilst the kernel is booting.
100 */
101 int __init preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen,
102 struct key *keyring)
103 {
104 struct preload_pgp_keys_context ctx;
105 int ret;
106
> 107 ctx.pgp.types_of_interest = (1 << PGP_PKT_PUBLIC_KEY);
108 ctx.pgp.process_packet = found_pgp_key;
109 ctx.keyring = make_key_ref(keyring, 1);
110 ctx.found_key = false;
111
> 112 ret = pgp_parse_packets(pgpdata, pgpdatalen, &ctx.pgp);
113 if (ret < 0)
114 return ret;
115
116 if (ctx.found_key) {
117 ctx.key_end = pgpdata + pgpdatalen;
118 return create_pgp_key(&ctx);
119 }
120 return 0;
121 }
122
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[PATCH openEuler-1.0-LTS] netfilter: nat: fix compilation issue in nf_nat_csum_recalc
by Zhengchao Shao 24 Mar '24
by Zhengchao Shao 24 Mar '24
24 Mar '24
hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9B2EN
--------------------------------
When use the "make W=1Arch=x86_64 net/" command for compilation, the
following issue occurs:
net/netfilter/nf_nat_proto.c:56:6: warning: no previous prototype for
‘nf_nat_csum_recalc’ [-Wmissing-prototypes]
void nf_nat_csum_recalc(struct sk_buff *skb,
^~~~~~~~~~~~~~~~~~
To fix the issue, add the necessary header files.
Fixes: 83abe3a3b857 ("netfilter: nat: remove csum_recalc hook")
Reported-by: kernel test robot <lkp(a)intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403232115.AU4CMSAJ-lkp@intel.com/
Signed-off-by: Zhengchao Shao <shaozhengchao(a)huawei.com>
---
net/netfilter/nf_nat_proto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_nat_proto.c b/net/netfilter/nf_nat_proto.c
index a4b68557b0f9..9114168bb84b 100644
--- a/net/netfilter/nf_nat_proto.c
+++ b/net/netfilter/nf_nat_proto.c
@@ -12,6 +12,8 @@
#include <net/ip6_route.h>
#include <net/xfrm.h>
#include <net/ipv6.h>
+#include <uapi/linux/netfilter/nf_nat.h>
+#include <net/netfilter/nf_nat_l3proto.h>
static void nf_nat_ipv4_csum_recalc(struct sk_buff *skb,
u8 proto, void *data, __sum16 *check,
--
2.34.1
2
1

[PATCH openEuler-1.0-LTS] netfilter: nat: fix compilation issue in nf_nat_csum_recalc
by Zhengchao Shao 24 Mar '24
by Zhengchao Shao 24 Mar '24
24 Mar '24
When use the "make W=1Arch=x86_64 net/" command for compilation, the
following issue occurs:
net/netfilter/nf_nat_proto.c:56:6: warning: no previous prototype for
‘nf_nat_csum_recalc’ [-Wmissing-prototypes]
void nf_nat_csum_recalc(struct sk_buff *skb,
^~~~~~~~~~~~~~~~~~
To fix the issue, add the necessary header files.
Fixes: 83abe3a3b857 ("netfilter: nat: remove csum_recalc hook")
Signed-off-by: Zhengchao Shao <shaozhengchao(a)huawei.com>
---
net/netfilter/nf_nat_proto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_nat_proto.c b/net/netfilter/nf_nat_proto.c
index a4b68557b0f9..9114168bb84b 100644
--- a/net/netfilter/nf_nat_proto.c
+++ b/net/netfilter/nf_nat_proto.c
@@ -12,6 +12,8 @@
#include <net/ip6_route.h>
#include <net/xfrm.h>
#include <net/ipv6.h>
+#include <uapi/linux/netfilter/nf_nat.h>
+#include <net/netfilter/nf_nat_l3proto.h>
static void nf_nat_ipv4_csum_recalc(struct sk_buff *skb,
u8 proto, void *data, __sum16 *check,
--
2.34.1
2
1

[openeuler:OLK-5.10 14627/30000] ld.lld: error: undefined symbol: kernel_swap_enabled
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: b670dd901cbbf97745380d373b1d2607b3235590
commit: 79c68ab3280fab8ace1b10bf8eadce508ee89c3c [14627/30000] etmem: add original kernel swap enabled options
config: x86_64-randconfig-001-20240323 (https://download.01.org/0day-ci/archive/20240324/202403241008.Fq0JzJes-lkp@…)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403241008.Fq0JzJes-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403241008.Fq0JzJes-lkp@intel.com/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: kernel_swap_enabled
>>> referenced by vmscan.c:3467 (mm/vmscan.c:3467)
>>> vmscan.o:(try_to_free_pages) in archive mm/built-in.a
>>> referenced by vmscan.c:3467 (mm/vmscan.c:3467)
>>> vmscan.o:(kswapd) in archive mm/built-in.a
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PGP_PRELOAD
Depends on [n]: CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=n]
Selected by [y]:
- PGP_PRELOAD_PUBLIC_KEYS [=y] && CRYPTO [=y]
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-5.10 27196/30000] drivers/net/ethernet/mucse/rnp/rnp_sysfs.c:1958:9: warning: 'strncpy' specified bound 100 equals destination size
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: b670dd901cbbf97745380d373b1d2607b3235590
commit: e53494b741272933726616122ea77143d9742631 [27196/30000] drivers: initial support for rnp drivers from Mucse Technology
config: x86_64-buildonly-randconfig-005-20240324 (https://download.01.org/0day-ci/archive/20240324/202403240810.wSTu29eU-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403240810.wSTu29eU-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403240810.wSTu29eU-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/mucse/rnp/rnp.h:21,
from drivers/net/ethernet/mucse/rnp/rnp_sysfs.c:13:
drivers/net/ethernet/mucse/rnp/rnp_common.h: In function '_rnp_skb_dump':
drivers/net/ethernet/mucse/rnp/rnp_common.h:336:36: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
336 | &dev->features);
| ^
drivers/net/ethernet/mucse/rnp/rnp_common.h:299:23: warning: variable 'tailroom' set but not used [-Wunused-but-set-variable]
299 | int headroom, tailroom;
| ^~~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_common.h:299:13: warning: variable 'headroom' set but not used [-Wunused-but-set-variable]
299 | int headroom, tailroom;
| ^~~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_common.h:298:23: warning: variable 'has_trans' set but not used [-Wunused-but-set-variable]
298 | bool has_mac, has_trans;
| ^~~~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_common.h:298:14: warning: variable 'has_mac' set but not used [-Wunused-but-set-variable]
298 | bool has_mac, has_trans;
| ^~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_sysfs.c: At top level:
drivers/net/ethernet/mucse/rnp/rnp_sysfs.c:1214:5: warning: no previous prototype for 'rnp_mbx_get_pn_sn' [-Wmissing-prototypes]
1214 | int rnp_mbx_get_pn_sn(struct rnp_hw *hw, char pn[33], char sn[33])
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/mucse/rnp/rnp_sysfs.c: In function '_switch_loopback':
>> drivers/net/ethernet/mucse/rnp/rnp_sysfs.c:1958:9: warning: 'strncpy' specified bound 100 equals destination size [-Wstringop-truncation]
1958 | strncpy(name, peer_eth, sizeof(name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PGP_PRELOAD
Depends on [n]: CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=n]
Selected by [y]:
- PGP_PRELOAD_PUBLIC_KEYS [=y] && CRYPTO [=y]
vim +/strncpy +1958 drivers/net/ethernet/mucse/rnp/rnp_sysfs.c
1950
1951 static ssize_t _switch_loopback(struct rnp_adapter *adapter,
1952 const char *peer_eth, int en)
1953 {
1954 struct net_device *peer_netdev = NULL;
1955 struct rnp_adapter *peer_adapter = NULL;
1956 char name[100];
1957
> 1958 strncpy(name, peer_eth, sizeof(name));
1959 strim(name);
1960
1961 pr_info("%s: nr_lane:%d peer_lane:%s en:%d\n", __func__, 0,
1962 peer_eth, en);
1963
1964 peer_netdev = dev_get_by_name(&init_net, name);
1965 if (!peer_netdev) {
1966 e_err(drv, "canot' find %s\n", name);
1967 return -EINVAL;
1968 }
1969 peer_adapter = netdev_priv(peer_netdev);
1970
1971 if (PCI_SLOT(peer_adapter->pdev->devfn) !=
1972 PCI_SLOT(adapter->pdev->devfn)) {
1973 e_err(drv, "%s %s not in same slot\n",
1974 netdev_name(adapter->netdev),
1975 netdev_name(peer_adapter->netdev));
1976 dev_put(peer_netdev);
1977 return -EINVAL;
1978 }
1979
1980
1981 do_switch_loopback_set(adapter, en, 0,
1982 rnp_is_pf1(&peer_adapter->hw) ? 4 : 0);
1983 do_switch_loopback_set(peer_adapter, en, 0,
1984 rnp_is_pf1(&adapter->hw) ? 4 : 0);
1985
1986 if (peer_netdev)
1987 dev_put(peer_netdev);
1988
1989 return 0;
1990 }
1991 static ssize_t switch_loopback_on_store(struct device *dev,
1992 struct device_attribute *attr,
1993 const char *buf, size_t count)
1994 {
1995 struct rnp_adapter *adapter = netdev_priv(to_net_device(dev));
1996
1997 return _switch_loopback(adapter, buf, 1) == 0 ? count : -EINVAL;
1998 }
1999
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-5.10] BUILD REGRESSION b670dd901cbbf97745380d373b1d2607b3235590
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree/branch: https://gitee.com/openeuler/kernel.git OLK-5.10
branch HEAD: b670dd901cbbf97745380d373b1d2607b3235590 !5269 printk: avoid deadlock in panic
Error/Warning reports:
https://lore.kernel.org/oe-kbuild-all/202403232345.qUtlhdt3-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202403240020.k6ATfsBm-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202403240050.7nMqX49L-lkp@intel.com
Error/Warning: (recently discovered and may have been fixed)
drivers/net/dsa/mv88e6xxx/chip.c:2320:4: error: implicit declaration of function 'mv88e6xxx_g2_eeprom_wait' [-Werror,-Wimplicit-function-declaration]
kernel/livepatch/core.c:1102:5: warning: no previous prototype for function 'klp_try_disable_patch' [-Wmissing-prototypes]
kernel/livepatch/core.c:1253:5: warning: no previous prototype for function 'klp_try_enable_patch' [-Wmissing-prototypes]
kernel/sched/bpf_sched.c:108:5: warning: "CONFIG_CGROUP_SCHED" is not defined, evaluates to 0 [-Wundef]
mm/share_pool.c:2573:7: warning: no previous prototype for '__mg_sp_alloc_nodemask' [-Wmissing-prototypes]
Error/Warning ids grouped by kconfigs:
gcc_recent_errors
|-- arm64-randconfig-003-20240312
| `-- mm-share_pool.c:warning:no-previous-prototype-for-__mg_sp_alloc_nodemask
|-- x86_64-buildonly-randconfig-002-20240324
| |-- drivers-ub-urma-ubcore-ubcore_dp.c:warning:no-previous-prototype-for-ubcore_rearm_jfc
| |-- drivers-ub-urma-ubcore-ubcore_main.c:warning:no-previous-prototype-for-ubcore_open
| |-- drivers-ub-urma-ubcore-ubcore_umem.c:warning:no-previous-prototype-for-ubcore_umem_get
| |-- drivers-ub-urma-ubcore-ubcore_umem.c:warning:no-previous-prototype-for-ubcore_umem_release
| |-- drivers-ub-urma-uburma-uburma_cmd.c:warning:no-previous-prototype-for-uburma_jfc_event_cb
| |-- drivers-ub-urma-uburma-uburma_cmd.c:warning:no-previous-prototype-for-uburma_jfr_event_cb
| |-- drivers-ub-urma-uburma-uburma_cmd.c:warning:no-previous-prototype-for-uburma_jfs_event_cb
| |-- drivers-ub-urma-uburma-uburma_dev_ops.c:warning:no-previous-prototype-for-uburma_close
| |-- drivers-ub-urma-uburma-uburma_dev_ops.c:warning:no-previous-prototype-for-uburma_mmap
| |-- drivers-ub-urma-uburma-uburma_dev_ops.c:warning:no-previous-prototype-for-uburma_open
| |-- drivers-ub-urma-uburma-uburma_dev_ops.c:warning:no-previous-prototype-for-uburma_release_file
| `-- drivers-ub-urma-uburma-uburma_dev_ops.c:warning:the-comparison-will-always-evaluate-as-false-for-the-address-of-dev_name-will-never-be-NULL
|-- x86_64-buildonly-randconfig-005-20240324
| |-- drivers-gpu-drm-inspur-inspur_drm_drv.c:warning:no-previous-prototype-for-inspur_drm_interrupt
| |-- drivers-ub-urma-ubcore-ubcore_dp.c:warning:no-previous-prototype-for-ubcore_rearm_jfc
| |-- drivers-ub-urma-ubcore-ubcore_main.c:warning:no-previous-prototype-for-ubcore_open
| |-- drivers-ub-urma-ubcore-ubcore_umem.c:warning:no-previous-prototype-for-ubcore_umem_get
| `-- drivers-ub-urma-ubcore-ubcore_umem.c:warning:no-previous-prototype-for-ubcore_umem_release
`-- x86_64-randconfig-012-20240323
`-- kernel-sched-bpf_sched.c:warning:CONFIG_CGROUP_SCHED-is-not-defined-evaluates-to
clang_recent_errors
|-- x86_64-allyesconfig
| |-- drivers-infiniband-hw-xsc-mem.c:warning:no-previous-prototype-for-function-xsc_find_chunk_cont_0
| |-- drivers-infiniband-hw-xsc-mr.c:warning:variable-using_peer_mem-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Excess-function-parameter-eecd-description-in-rnpm_lower_eeprom_clk
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Excess-function-parameter-hash_value-description-in-rnpm_set_mta
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Excess-function-parameter-hw-description-in-rnpm_mta_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Excess-function-parameter-pf-description-in-rnpm_set_vlan_anti_spoofing
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Function-parameter-or-member-count-not-described-in-rnpm_shift_in_eeprom_bits
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Function-parameter-or-member-eec-not-described-in-rnpm_lower_eeprom_clk
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Function-parameter-or-member-mc_addr-not-described-in-rnpm_set_mta
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Function-parameter-or-member-mode-not-described-in-rnpm_mta_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_common.c:warning:Function-parameter-or-member-vf-not-described-in-rnpm_set_vlan_anti_spoofing
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_debugfs.c:warning:Excess-function-parameter-pf-description-in-rnpm_dbg_adapter_exit
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_debugfs.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_dbg_adapter_exit
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-dev-description-in-rnpm_get_priv_flags
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-dev-description-in-rnpm_set_priv_flags
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-ec-description-in-rnpm_get_coalesce
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-ee-description-in-rnpm_get_module_eeprom
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-flags-description-in-rnpm_set_priv_flags
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-kec-description-in-rnpm_get_coalesce
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-kec-description-in-rnpm_set_coalesce
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-netdev-description-in-rnpm_get_module_eeprom
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-netdev-description-in-rnpm_get_module_info
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-netdev-description-in-rnpm_get_rxnfc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Excess-function-parameter-pf-description-in-rnpm_get_rss_hash_opts
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_get_rss_hash_opts
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-coal-not-described-in-rnpm_get_coalesce
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-dev-not-described-in-rnpm_get_module_eeprom
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-dev-not-described-in-rnpm_get_module_info
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-dev-not-described-in-rnpm_get_rxnfc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-eeprom-not-described-in-rnpm_get_module_eeprom
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-kernel_coal-not-described-in-rnpm_get_coalesce
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-kernel_coal-not-described-in-rnpm_set_coalesce
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-netdev-not-described-in-rnpm_get_priv_flags
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-netdev-not-described-in-rnpm_set_priv_flags
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:Function-parameter-or-member-priv_flags-not-described-in-rnpm_set_priv_flags
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:variable-autoneg_changed-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:variable-dma_ch-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ethtool.c:warning:variable-duplex_changed-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-inner_vlan_tag-description-in-rnpm_tx_ctxtdesc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-l4_hdr_len-description-in-rnpm_tx_ctxtdesc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-mss_seg_len-description-in-rnpm_tx_ctxtdesc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-rxr_count-description-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-rxr_idx-description-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-tunnel_hdr_len-description-in-rnpm_tx_ctxtdesc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-txr_count-description-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-txr_idx-description-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Excess-function-parameter-v_count-description-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Function-parameter-or-member-eth_queue_idx-not-described-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Function-parameter-or-member-inner_vlan_tunnel_len-not-described-in-rnpm_tx_ctxtdesc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Function-parameter-or-member-mss_len_vf_num-not-described-in-rnpm_tx_ctxtdesc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Function-parameter-or-member-r_count-not-described-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Function-parameter-or-member-r_idx-not-described-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:Function-parameter-or-member-step-not-described-in-rnpm_alloc_q_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:no-previous-prototype-for-function-rnpm_setup_layer2_remapping
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:no-previous-prototype-for-function-rnpm_setup_tuple5_remapping
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_lib.c:warning:no-previous-prototype-for-function-rnpm_setup_tuple5_remapping_tcam
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-data-description-in-rnpm_pf_service_timer
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-data-description-in-rnpm_service_timer
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-ent-description-in-rnpm_probe
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-hw-description-in-rnpm_wol_supported
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-link_speed-description-in-rnpm_watchdog_update_link
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-maxrate-description-in-rnpm_tx_maxrate_own
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-msix_vector-description-in-rnpm_set_ring_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-netdev-description-in-rnpm_setup_tc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-netdev-description-in-rnpm_tx_maxrate_own
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-pb-description-in-rnpm_lpbthresh
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-queue-description-in-rnpm_set_ring_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-skb-description-in-rnpm_is_non_eop
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Excess-function-parameter-subdev_id-description-in-rnpm_wol_supported
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_rx_ring_reinit
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_setup_rx_resources
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_setup_tx_resources
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_tx_maxrate_own
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-adapter-not-described-in-rnpm_wol_supported
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-dev-not-described-in-rnpm_setup_tc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-id-not-described-in-rnpm_probe
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-is_rxframe-not-described-in-rnpm_write_eitr
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-napi_budget-not-described-in-rnpm_clean_tx_irq
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-rnpm_msix_vector-not-described-in-rnpm_set_ring_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-rnpm_queue-not-described-in-rnpm_set_ring_vector
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-subdevice_id-not-described-in-rnpm_wol_supported
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-t-not-described-in-rnpm_pf_service_timer
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-t-not-described-in-rnpm_service_timer
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:Function-parameter-or-member-txqueue-not-described-in-rnpm_tx_timeout
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-clean_all_port_resetting
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-control_mac_rx
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_assign_netdev_ops
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_can_rpu_start
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_check_mc_addr
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_clear_udp_tunnel_port
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_fix_queue_number
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_pf_service_event_schedule
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_pf_service_task
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_pf_service_timer
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_rx_ring_reinit
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_service_timer
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_vlan_stags_flag
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_write_eitr
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_xmit_nop_frame_ring
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-rnpm_xmit_nop_frame_ring_temp
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-update_pf_vlan
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:no-previous-prototype-for-function-wait_all_port_resetting
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:variable-hw-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:variable-packets-is-used-uninitialized-whenever-if-condition-is-false
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_main.c:warning:variable-xdp_xmit-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx.c:warning:Excess-function-parameter-vf_number-description-in-rnpm_check_for_ack_pf
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx.c:warning:Excess-function-parameter-vf_number-description-in-rnpm_check_for_msg_pf
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx.c:warning:Excess-function-parameter-vf_number-description-in-rnpm_read_mbx_pf
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx.c:warning:Function-parameter-or-member-mbx_id-not-described-in-rnpm_check_for_ack_pf
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx.c:warning:Function-parameter-or-member-mbx_id-not-described-in-rnpm_check_for_msg_pf
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx.c:warning:Function-parameter-or-member-mbx_id-not-described-in-rnpm_read_mbx_pf
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-mbx_cookie_zalloc
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_fw_get_capablity
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_fw_reg_read
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_fw_send_cmd_wait
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_get_port_stats2
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_link_stat_mark_disable
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_mbx_fw_post_req
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_mbx_lldp_all_ports_enable
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_mbx_pluginout_evt_en
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:no-previous-prototype-for-function-rnpm_mbx_write_posted_locked
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:variable-err-is-uninitialized-when-used-here
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:variable-err-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:variable-hw-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_mbx_fw.c:warning:variable-value-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:Excess-function-parameter-atr_input-description-in-rnpm_atr_compute_perfect_hash_n10
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:Excess-function-parameter-stream-description-in-rnpm_atr_compute_sig_hash_n10
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:Function-parameter-or-member-common-not-described-in-rnpm_atr_compute_sig_hash_n10
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:Function-parameter-or-member-input-not-described-in-rnpm_atr_compute_perfect_hash_n10
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:Function-parameter-or-member-input-not-described-in-rnpm_atr_compute_sig_hash_n10
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:no-previous-prototype-for-function-rnpm_reset_pipeline_n10
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_n10.c:warning:variable-status-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Excess-function-parameter-eeprom_data-description-in-rnpm_read_i2c_sff8472_generic
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Excess-function-parameter-hw-description-in-rnpm_get_i2c_data
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Excess-function-parameter-hw-description-in-rnpm_get_phy_type_from_id
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-autoneg_wait_to_complete-not-described-in-rnpm_setup_phy_link_speed_generic
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-dev_addr-not-described-in-rnpm_read_i2c_byte_generic
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-dev_addr-not-described-in-rnpm_write_i2c_byte_generic
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-device_type-not-described-in-rnpm_read_phy_reg_generic
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-link_up-not-described-in-rnpm_check_phy_link_tnx
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-phy_id-not-described-in-rnpm_get_phy_type_from_id
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-sff8472_data-not-described-in-rnpm_read_i2c_sff8472_generic
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_phy.c:warning:Function-parameter-or-member-speed-not-described-in-rnpm_check_phy_link_tnx
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ptp.c:warning:no-previous-prototype-for-function-rnpm_ptp_setup_ptp
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_ptp.c:warning:variable-target-set-but-not-used
| |-- drivers-net-ethernet-mucse-rnpm-rnpm_sysfs.c:warning:no-previous-prototype-for-function-rnpm_mbx_get_pn_sn
| |-- drivers-net-ethernet-yunsilicon-xsc-common-xsc_core.h:warning:bitwise-or-with-non-zero-value-always-evaluates-to-true
| |-- drivers-net-ethernet-yunsilicon-xsc-net-main.c:warning:no-previous-prototype-for-function-xsc_eth_change_link_status
| |-- drivers-net-ethernet-yunsilicon-xsc-net-main.c:warning:no-previous-prototype-for-function-xsc_get_vf_config
| |-- drivers-net-ethernet-yunsilicon-xsc-net-main.c:warning:no-previous-prototype-for-function-xsc_rx_get_linear_frag_sz
| |-- drivers-net-ethernet-yunsilicon-xsc-net-main.c:warning:no-previous-prototype-for-function-xsc_rx_is_linear_skb
| |-- drivers-net-ethernet-yunsilicon-xsc-net-main.c:warning:no-previous-prototype-for-function-xsc_select_queue
| |-- drivers-net-ethernet-yunsilicon-xsc-net-main.c:warning:variable-txq_ix-is-uninitialized-when-used-here
| |-- drivers-net-ethernet-yunsilicon-xsc-net-xsc_dcbnl.c:warning:variable-buffer_size-set-but-not-used
| |-- drivers-net-ethernet-yunsilicon-xsc-net-xsc_dcbnl.c:warning:variable-curr_pfc_en-is-uninitialized-when-used-here
| |-- drivers-net-ethernet-yunsilicon-xsc-net-xsc_dcbnl.c:warning:variable-prio2buffer-set-but-not-used
| |-- drivers-net-ethernet-yunsilicon-xsc-pci-main.c:warning:no-previous-prototype-for-function-xsc_devid_to_pcie_no
| |-- drivers-net-ethernet-yunsilicon-xsc-pci-xsc_pci_ctrl.c:warning:no-previous-prototype-for-function-find_kallsyms_lookup_name
| |-- drivers-net-ethernet-yunsilicon-xsc-pci-xsc_pci_ctrl.c:warning:no-previous-prototype-for-function-noop_pre
| |-- drivers-net-ethernet-yusur-k2-..-platform-ys_intr.c:warning:overlapping-comparisons-always-evaluate-to-false
| |-- drivers-net-ethernet-yusur-k2-ys_k2_tx.c:warning:variable-clean_tail_ptr-set-but-not-used
| |-- drivers-ub-urma-ubcore-ubcore_device.c:warning:no-previous-prototype-for-function-ubcore_find_tpf_device_legacy
| |-- drivers-ub-urma-ubcore-ubcore_tp.c:warning:no-previous-prototype-for-function-ubcore_modify_tp_state
| |-- drivers-ub-urma-uburma-uburma_main.c:warning:no-previous-prototype-for-function-uburma_dev_accessible_by_ns
| |-- drivers-ub-urma-uburma-uburma_main.c:warning:no-previous-prototype-for-function-uburma_set_dev_ns
| `-- drivers-ub-urma-uburma-uburma_main.c:warning:no-previous-prototype-for-function-uburma_set_ns_mode
|-- x86_64-buildonly-randconfig-003-20240324
| |-- drivers-ub-urma-ubcore-ubcore_device.c:warning:no-previous-prototype-for-function-ubcore_find_tpf_device_legacy
| |-- drivers-ub-urma-ubcore-ubcore_tp.c:warning:no-previous-prototype-for-function-ubcore_modify_tp_state
| |-- drivers-ub-urma-uburma-uburma_main.c:warning:no-previous-prototype-for-function-uburma_dev_accessible_by_ns
| |-- drivers-ub-urma-uburma-uburma_main.c:warning:no-previous-prototype-for-function-uburma_set_dev_ns
| `-- drivers-ub-urma-uburma-uburma_main.c:warning:no-previous-prototype-for-function-uburma_set_ns_mode
|-- x86_64-buildonly-randconfig-006-20240324
| `-- drivers-ptp-ptp_hisi.c:warning:unused-variable-hisi_ptp_acpi_match
|-- x86_64-randconfig-015-20240323
| |-- kernel-livepatch-core.c:warning:no-previous-prototype-for-function-klp_try_disable_patch
| `-- kernel-livepatch-core.c:warning:no-previous-prototype-for-function-klp_try_enable_patch
`-- x86_64-randconfig-071-20240323
`-- drivers-net-dsa-mv88e6xxx-chip.c:error:implicit-declaration-of-function-mv88e6xxx_g2_eeprom_wait-Werror-Wimplicit-function-declaration
elapsed time: 725m
configs tested: 35
configs skipped: 149
tested configs:
arm64 allmodconfig clang
arm64 allnoconfig gcc
arm64 defconfig gcc
arm64 randconfig-001-20240323 gcc
arm64 randconfig-002-20240323 gcc
arm64 randconfig-003-20240323 clang
arm64 randconfig-004-20240323 clang
x86_64 allnoconfig clang
x86_64 allyesconfig clang
x86_64 buildonly-randconfig-001-20240324 gcc
x86_64 buildonly-randconfig-002-20240324 gcc
x86_64 buildonly-randconfig-003-20240324 clang
x86_64 buildonly-randconfig-004-20240324 clang
x86_64 buildonly-randconfig-005-20240324 gcc
x86_64 buildonly-randconfig-006-20240324 clang
x86_64 defconfig gcc
x86_64 randconfig-001-20240324 clang
x86_64 randconfig-002-20240324 clang
x86_64 randconfig-003-20240324 clang
x86_64 randconfig-004-20240324 clang
x86_64 randconfig-005-20240324 clang
x86_64 randconfig-006-20240324 gcc
x86_64 randconfig-011-20240324 clang
x86_64 randconfig-012-20240324 gcc
x86_64 randconfig-013-20240324 gcc
x86_64 randconfig-014-20240324 gcc
x86_64 randconfig-015-20240324 gcc
x86_64 randconfig-016-20240324 clang
x86_64 randconfig-071-20240324 clang
x86_64 randconfig-072-20240324 gcc
x86_64 randconfig-073-20240324 clang
x86_64 randconfig-074-20240324 clang
x86_64 randconfig-075-20240324 clang
x86_64 randconfig-076-20240324 gcc
x86_64 rhel-8.3-rust clang
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-6.6 1780/6857] kernel/module/strict_rwx.c:36:6: warning: no previous prototype for function 'module_disable_ro'
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 1b4212c630731d88b07d5b6e28ecaff1a76d3839
commit: c8783f92771c891518257c9deb22cd91d4e1a212 [1780/6857] livepatch/core: Revert module_enable_ro and module_disable_ro
config: x86_64-randconfig-015-20240323 (https://download.01.org/0day-ci/archive/20240324/202403240225.chgQpK3C-lkp@…)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403240225.chgQpK3C-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403240225.chgQpK3C-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/module/strict_rwx.c:36:6: warning: no previous prototype for function 'module_disable_ro' [-Wmissing-prototypes]
36 | void module_disable_ro(const struct module *mod)
| ^
kernel/module/strict_rwx.c:36:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
36 | void module_disable_ro(const struct module *mod)
| ^
| static
1 warning generated.
vim +/module_disable_ro +36 kernel/module/strict_rwx.c
34
35 #ifdef CONFIG_LIVEPATCH_WO_FTRACE
> 36 void module_disable_ro(const struct module *mod)
37 {
38 if (!IS_ENABLED(CONFIG_STRICT_MODULE_RWX))
39 return;
40 #ifdef CONFIG_STRICT_MODULE_RWX
41 if (!rodata_enabled)
42 return;
43 #endif
44
45 module_set_memory(mod, MOD_TEXT, set_memory_rw);
46 module_set_memory(mod, MOD_INIT_TEXT, set_memory_rw);
47 module_set_memory(mod, MOD_RODATA, set_memory_rw);
48 module_set_memory(mod, MOD_INIT_RODATA, set_memory_rw);
49 }
50 #endif /* CONFIG_LIVEPATCH_WO_FTRACE */
51
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-5.10 2165/30000] kernel/livepatch/core.c:1102:5: warning: no previous prototype for function 'klp_try_disable_patch'
by kernel test robot 24 Mar '24
by kernel test robot 24 Mar '24
24 Mar '24
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: b670dd901cbbf97745380d373b1d2607b3235590
commit: c33e42836a745f2b3ab28bd6cb09c208cbcc950e [2165/30000] livepatch/core: Allow implementation without ftrace
config: x86_64-randconfig-015-20240323 (https://download.01.org/0day-ci/archive/20240324/202403240050.7nMqX49L-lkp@…)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403240050.7nMqX49L-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403240050.7nMqX49L-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/livepatch/core.c:1084:12: warning: no previous prototype for function 'klp_check_calltrace' [-Wmissing-prototypes]
1084 | int __weak klp_check_calltrace(struct klp_patch *patch, int enable)
| ^
kernel/livepatch/core.c:1084:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1084 | int __weak klp_check_calltrace(struct klp_patch *patch, int enable)
| ^
| static
kernel/livepatch/core.c:1107:27: error: incomplete definition of type 'struct patch_data'
1107 | if (atomic_inc_return(&pd->cpu_count) == 1) {
| ~~^
kernel/livepatch/core.c:1105:9: note: forward declaration of 'struct patch_data'
1105 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1108:31: error: incomplete definition of type 'struct patch_data'
1108 | struct klp_patch *patch = pd->patch;
| ~~^
kernel/livepatch/core.c:1105:9: note: forward declaration of 'struct patch_data'
1105 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1112:18: error: incomplete definition of type 'struct patch_data'
1112 | atomic_inc(&pd->cpu_count);
| ~~^
kernel/livepatch/core.c:1105:9: note: forward declaration of 'struct patch_data'
1105 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1117:18: error: incomplete definition of type 'struct patch_data'
1117 | atomic_inc(&pd->cpu_count);
| ~~^
kernel/livepatch/core.c:1105:9: note: forward declaration of 'struct patch_data'
1105 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1120:17: error: incomplete definition of type 'struct patch_data'
1120 | atomic_inc(&pd->cpu_count);
| ~~^
kernel/livepatch/core.c:1105:9: note: forward declaration of 'struct patch_data'
1105 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1122:25: error: incomplete definition of type 'struct patch_data'
1122 | while (atomic_read(&pd->cpu_count) <= num_online_cpus())
| ~~^
kernel/livepatch/core.c:1105:9: note: forward declaration of 'struct patch_data'
1105 | struct patch_data *pd = (struct patch_data *)data;
| ^
>> kernel/livepatch/core.c:1102:5: warning: no previous prototype for function 'klp_try_disable_patch' [-Wmissing-prototypes]
1102 | int klp_try_disable_patch(void *data)
| ^
kernel/livepatch/core.c:1102:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1102 | int klp_try_disable_patch(void *data)
| ^
| static
kernel/livepatch/core.c:1134:20: error: variable has incomplete type 'struct patch_data'
1134 | struct patch_data patch_data = {
| ^
kernel/livepatch/core.c:1134:9: note: forward declaration of 'struct patch_data'
1134 | struct patch_data patch_data = {
| ^
kernel/livepatch/core.c:1151:8: error: implicit declaration of function 'stop_machine' [-Werror,-Wimplicit-function-declaration]
1151 | ret = stop_machine(klp_try_disable_patch, &patch_data, cpu_online_mask);
| ^
kernel/livepatch/core.c:1258:27: error: incomplete definition of type 'struct patch_data'
1258 | if (atomic_inc_return(&pd->cpu_count) == 1) {
| ~~^
kernel/livepatch/core.c:1256:9: note: forward declaration of 'struct patch_data'
1256 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1259:31: error: incomplete definition of type 'struct patch_data'
1259 | struct klp_patch *patch = pd->patch;
| ~~^
kernel/livepatch/core.c:1256:9: note: forward declaration of 'struct patch_data'
1256 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1263:18: error: incomplete definition of type 'struct patch_data'
1263 | atomic_inc(&pd->cpu_count);
| ~~^
kernel/livepatch/core.c:1256:9: note: forward declaration of 'struct patch_data'
1256 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1268:18: error: incomplete definition of type 'struct patch_data'
1268 | atomic_inc(&pd->cpu_count);
| ~~^
kernel/livepatch/core.c:1256:9: note: forward declaration of 'struct patch_data'
1256 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1271:17: error: incomplete definition of type 'struct patch_data'
1271 | atomic_inc(&pd->cpu_count);
| ~~^
kernel/livepatch/core.c:1256:9: note: forward declaration of 'struct patch_data'
1256 | struct patch_data *pd = (struct patch_data *)data;
| ^
kernel/livepatch/core.c:1273:25: error: incomplete definition of type 'struct patch_data'
1273 | while (atomic_read(&pd->cpu_count) <= num_online_cpus())
| ~~^
kernel/livepatch/core.c:1256:9: note: forward declaration of 'struct patch_data'
1256 | struct patch_data *pd = (struct patch_data *)data;
| ^
>> kernel/livepatch/core.c:1253:5: warning: no previous prototype for function 'klp_try_enable_patch' [-Wmissing-prototypes]
1253 | int klp_try_enable_patch(void *data)
| ^
kernel/livepatch/core.c:1253:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1253 | int klp_try_enable_patch(void *data)
| ^
| static
kernel/livepatch/core.c:1285:20: error: variable has incomplete type 'struct patch_data'
1285 | struct patch_data patch_data = {
| ^
kernel/livepatch/core.c:1285:9: note: forward declaration of 'struct patch_data'
1285 | struct patch_data patch_data = {
| ^
kernel/livepatch/core.c:1302:8: error: implicit declaration of function 'stop_machine' [-Werror,-Wimplicit-function-declaration]
1302 | ret = stop_machine(klp_try_enable_patch, &patch_data, cpu_online_mask);
| ^
3 warnings and 16 errors generated.
vim +/klp_try_disable_patch +1102 kernel/livepatch/core.c
1101
> 1102 int klp_try_disable_patch(void *data)
1103 {
1104 int ret = 0;
> 1105 struct patch_data *pd = (struct patch_data *)data;
1106
1107 if (atomic_inc_return(&pd->cpu_count) == 1) {
1108 struct klp_patch *patch = pd->patch;
1109
1110 ret = klp_check_calltrace(patch, 0);
1111 if (ret) {
1112 atomic_inc(&pd->cpu_count);
1113 return ret;
1114 }
1115 ret = disable_patch(patch);
1116 if (ret) {
1117 atomic_inc(&pd->cpu_count);
1118 return ret;
1119 }
1120 atomic_inc(&pd->cpu_count);
1121 } else {
1122 while (atomic_read(&pd->cpu_count) <= num_online_cpus())
1123 cpu_relax();
1124
1125 klp_smp_isb();
1126 }
1127
1128 return ret;
1129 }
1130
1131 static int __klp_disable_patch(struct klp_patch *patch)
1132 {
1133 int ret;
1134 struct patch_data patch_data = {
1135 .patch = patch,
1136 .cpu_count = ATOMIC_INIT(0),
1137 };
1138
1139 if (WARN_ON(!patch->enabled))
1140 return -EINVAL;
1141
1142 #ifdef CONFIG_LIVEPATCH_STACK
1143 /* enforce stacking: only the last enabled patch can be disabled */
1144 if (!list_is_last(&patch->list, &klp_patches) &&
1145 list_next_entry(patch, list)->enabled) {
1146 pr_err("only the last enabled patch can be disabled\n");
1147 return -EBUSY;
1148 }
1149 #endif
1150
1151 ret = stop_machine(klp_try_disable_patch, &patch_data, cpu_online_mask);
1152 if (ret)
1153 return ret;
1154
1155 klp_free_patch_async(patch);
1156 return 0;
1157 }
1158 #endif /* ifdef CONFIG_LIVEPATCH_FTRACE */
1159
1160 #ifdef CONFIG_LIVEPATCH_FTRACE
1161 static int __klp_enable_patch(struct klp_patch *patch)
1162 {
1163 struct klp_object *obj;
1164 int ret;
1165
1166 if (klp_transition_patch)
1167 return -EBUSY;
1168
1169 if (WARN_ON(patch->enabled))
1170 return -EINVAL;
1171
1172 pr_notice("enabling patch '%s'\n", patch->mod->name);
1173
1174 klp_init_transition(patch, KLP_PATCHED);
1175
1176 /*
1177 * Enforce the order of the func->transition writes in
1178 * klp_init_transition() and the ops->func_stack writes in
1179 * klp_patch_object(), so that klp_ftrace_handler() will see the
1180 * func->transition updates before the handler is registered and the
1181 * new funcs become visible to the handler.
1182 */
1183 smp_wmb();
1184
1185 klp_for_each_object(patch, obj) {
1186 if (!klp_is_object_loaded(obj))
1187 continue;
1188
1189 ret = klp_pre_patch_callback(obj);
1190 if (ret) {
1191 pr_warn("pre-patch callback failed for object '%s'\n",
1192 klp_is_module(obj) ? obj->name : "vmlinux");
1193 goto err;
1194 }
1195
1196 ret = klp_patch_object(obj);
1197 if (ret) {
1198 pr_warn("failed to patch object '%s'\n",
1199 klp_is_module(obj) ? obj->name : "vmlinux");
1200 goto err;
1201 }
1202 }
1203
1204 klp_start_transition();
1205 patch->enabled = true;
1206 klp_try_complete_transition();
1207
1208 return 0;
1209 err:
1210 pr_warn("failed to enable patch '%s'\n", patch->mod->name);
1211
1212 klp_cancel_transition();
1213 return ret;
1214 }
1215 #else /* ifdef CONFIG_LIVEPATCH_WO_FTRACE */
1216 /*
1217 * This function is called from stop_machine() context.
1218 */
1219 static int enable_patch(struct klp_patch *patch)
1220 {
1221 struct klp_object *obj;
1222 int ret;
1223
1224 pr_notice_once("tainting kernel with TAINT_LIVEPATCH\n");
1225 add_taint(TAINT_LIVEPATCH, LOCKDEP_STILL_OK);
1226
1227 if (!try_module_get(patch->mod))
1228 return -ENODEV;
1229
1230 patch->enabled = true;
1231
1232 pr_notice("enabling patch '%s'\n", patch->mod->name);
1233
1234 klp_for_each_object(patch, obj) {
1235 if (!klp_is_object_loaded(obj))
1236 continue;
1237
1238 ret = klp_patch_object(obj);
1239 if (ret) {
1240 pr_warn("failed to patch object '%s'\n",
1241 klp_is_module(obj) ? obj->name : "vmlinux");
1242 goto disable;
1243 }
1244 }
1245
1246 return 0;
1247
1248 disable:
1249 disable_patch(patch);
1250 return ret;
1251 }
1252
> 1253 int klp_try_enable_patch(void *data)
1254 {
1255 int ret = 0;
> 1256 struct patch_data *pd = (struct patch_data *)data;
1257
1258 if (atomic_inc_return(&pd->cpu_count) == 1) {
1259 struct klp_patch *patch = pd->patch;
1260
1261 ret = klp_check_calltrace(patch, 1);
1262 if (ret) {
1263 atomic_inc(&pd->cpu_count);
1264 return ret;
1265 }
1266 ret = enable_patch(patch);
1267 if (ret) {
1268 atomic_inc(&pd->cpu_count);
1269 return ret;
1270 }
1271 atomic_inc(&pd->cpu_count);
1272 } else {
1273 while (atomic_read(&pd->cpu_count) <= num_online_cpus())
1274 cpu_relax();
1275
1276 klp_smp_isb();
1277 }
1278
1279 return ret;
1280 }
1281
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0