From: kernel test robot <lkp@intel.com>
To: "Maxime Bélair " <maxime.belair@canonical.com>
Cc: oe-kbuild-all@lists.linux.dev,
John Johansen <john.johansen@canonical.com>
Subject: [jj-apparmor:apparmor-next 3/4] security/apparmor/apparmorfs.c:533:undefined reference to `decompress_zstd'
Date: Tue, 30 Jun 2026 23:39:24 +0800 [thread overview]
Message-ID: <202606302325.2wJOujQi-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor.git apparmor-next
head: dda61023f976d7ab3bc7c8b46d26d6d23424f890
commit: 17b5758bf35c7a113363cd7a350b7e6a251b80f4 [3/4] apparmor: Initial support for compressed policies
config: x86_64-randconfig-103-20260630 (https://download.01.org/0day-ci/archive/20260630/202606302325.2wJOujQi-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260630/202606302325.2wJOujQi-lkp@intel.com/reproduce)
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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606302325.2wJOujQi-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: security/apparmor/apparmorfs.o: in function `aa_get_data_from_compressed':
>> security/apparmor/apparmorfs.c:533:(.text+0x3d9c): undefined reference to `decompress_zstd'
vim +533 security/apparmor/apparmorfs.c
442
443
444 /*
445 * aa_fs - policy load/replace/remove
446 */
447
448 /**
449 * aa_simple_write_to_buffer - common routine for getting policy from user
450 * @userbuf: user buffer to copy data from (NOT NULL)
451 * @alloc_size: size of user buffer (REQUIRES: @alloc_size >= @copy_size)
452 * @copy_size: size of data to copy from user buffer
453 * @pos: position write is at in the file (NOT NULL)
454 *
455 * Returns: kernel buffer containing copy of user buffer data or an
456 * ERR_PTR on failure.
457 */
458 static struct aa_loaddata *aa_simple_write_to_buffer(const char __user *userbuf,
459 size_t alloc_size,
460 size_t copy_size,
461 loff_t *pos)
462 {
463 struct aa_loaddata *data;
464
465 AA_BUG(copy_size > alloc_size);
466
467 if (*pos != 0)
468 /* only writes from pos 0, that is complete writes */
469 return ERR_PTR(-ESPIPE);
470
471 /* freed by caller to simple_write_to_buffer */
472 data = aa_loaddata_alloc(alloc_size);
473 if (IS_ERR(data))
474 return data;
475
476 data->size = copy_size;
477 if (copy_from_user(data->data, userbuf, copy_size)) {
478 /* trigger free - don't need to put pcount */
479 aa_put_i_loaddata(data);
480 return ERR_PTR(-EFAULT);
481 }
482
483 return data;
484 }
485 static int decompress_zstd(char *src, size_t slen, char *dst, size_t dlen);
486 /**
487 * aa_get_data_from_compressed - common routine for getting compressed policy
488 * from user and get both compressed and uncompressed version.
489 * @userbuf: user buffer to copy data from (NOT NULL)
490 * @buffer_size: size of user buffer
491 * @pos: position write is at in the file (NOT NULL)
492 * @compressed_data Ptr on compressed data. *compressed_data is allocated there
493 *
494 * Returns: kernel buffer containing copy of user buffer data or an
495 * ERR_PTR on failure.
496 */
497
498 static struct aa_loaddata *aa_get_data_from_compressed(const char __user *userbuf,
499 size_t buffer_size,
500 loff_t *pos,
501 char **compressed_data)
502 {
503 struct aa_loaddata *data;
504 zstd_frame_header header;
505 int error;
506
507 if (!userbuf || !pos)
508 return ERR_PTR(-EINVAL);
509 if (*pos)
510 return ERR_PTR(-ESPIPE);
511
512 *compressed_data = kvmalloc(buffer_size, GFP_KERNEL);
513 if (!*compressed_data)
514 return ERR_PTR(-ENOMEM);
515 error = copy_from_user(*compressed_data, userbuf, buffer_size);
516 if (error)
517 goto fail;
518
519 error = zstd_get_frame_header(&header, *compressed_data, buffer_size);
520 if (error || header.frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN ||
521 header.frameContentSize == ZSTD_CONTENTSIZE_ERROR) {
522 error = -EINVAL;
523 goto fail;
524 }
525
526 data = aa_loaddata_alloc(header.frameContentSize);
527 if (IS_ERR(data)) {
528 error = PTR_ERR(data);
529 goto fail;
530 }
531
532 // We then decompress the data
> 533 error = decompress_zstd(*compressed_data, buffer_size, data->data,
534 header.frameContentSize);
535 if (error)
536 goto fail_decompress;
537
538 data->size = header.frameContentSize;
539 return data;
540
541 fail_decompress:
542 aa_put_i_loaddata(data);
543 fail:
544 kvfree(*compressed_data);
545 return ERR_PTR(error);
546
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-06-30 15:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202606302325.2wJOujQi-lkp@intel.com \
--to=lkp@intel.com \
--cc=john.johansen@canonical.com \
--cc=maxime.belair@canonical.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.