* [song:vfs-mount-lsm 3/8] security/apparmor/mount.c:369:7: warning: address of function 'dev_name' will always evaluate to 'true'
@ 2026-09-23 10:18 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-23 10:18 UTC (permalink / raw)
To: Song Liu; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/song/linux.git vfs-mount-lsm
head: 8ad7b1df9b9f7aad03a05ff62ec0f4b056a5bdb0
commit: 29d4e9aed0d3c9b01889fef51d01f9983796a30c [3/8] apparmor: Convert from sb_mount to granular mount hooks
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20260923/202609231243.dBmfdEyG-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260923/202609231243.dBmfdEyG-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/202609231243.dBmfdEyG-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> security/apparmor/mount.c:369:7: warning: address of function 'dev_name' will always evaluate to 'true' [-Wpointer-bool-conversion]
369 | if (!dev_name || !*dev_name)
| ~^~~~~~~~
security/apparmor/mount.c:369:7: note: prefix with the address-of operator to silence this warning
369 | if (!dev_name || !*dev_name)
| ^
| &
1 warning generated.
vim +369 security/apparmor/mount.c
2ea3ffb7782a84 John Johansen 2017-07-18 354
90c436a64a6e20 John Johansen 2022-09-19 355 int aa_bind_mount(const struct cred *subj_cred,
90c436a64a6e20 John Johansen 2022-09-19 356 struct aa_label *label, const struct path *path,
29d4e9aed0d3c9 Song Liu 2026-07-06 357 const struct path *old_path, bool recurse)
2ea3ffb7782a84 John Johansen 2017-07-18 358 {
2ea3ffb7782a84 John Johansen 2017-07-18 359 struct aa_profile *profile;
2ea3ffb7782a84 John Johansen 2017-07-18 360 char *buffer = NULL, *old_buffer = NULL;
29d4e9aed0d3c9 Song Liu 2026-07-06 361 unsigned long flags = MS_BIND | (recurse ? MS_REC : 0);
2ea3ffb7782a84 John Johansen 2017-07-18 362 int error;
6c27cd23bd43c8 John Johansen 2026-07-27 363 DEFINE_AUDIT_MOUNT(ad, OP_MOUNT, subj_cred);
2ea3ffb7782a84 John Johansen 2017-07-18 364
2ea3ffb7782a84 John Johansen 2017-07-18 365 AA_BUG(!label);
2ea3ffb7782a84 John Johansen 2017-07-18 366 AA_BUG(!path);
29d4e9aed0d3c9 Song Liu 2026-07-06 367 AA_BUG(!old_path);
2ea3ffb7782a84 John Johansen 2017-07-18 368
2ea3ffb7782a84 John Johansen 2017-07-18 @369 if (!dev_name || !*dev_name)
2ea3ffb7782a84 John Johansen 2017-07-18 370 return -EINVAL;
2ea3ffb7782a84 John Johansen 2017-07-18 371
2ea3ffb7782a84 John Johansen 2017-07-18 372 flags &= MS_REC | MS_BIND;
6c27cd23bd43c8 John Johansen 2026-07-27 373 ad.mnt.flags = flags;
2ea3ffb7782a84 John Johansen 2017-07-18 374
2ea3ffb7782a84 John Johansen 2017-07-18 375
341c1fda5e1715 John Johansen 2019-09-14 376 buffer = aa_get_buffer(false);
341c1fda5e1715 John Johansen 2019-09-14 377 old_buffer = aa_get_buffer(false);
df323337e507a0 Sebastian Andrzej Siewior 2019-05-03 378 error = -ENOMEM;
9c95a278ba7ca3 Patrick Steinhardt 2019-12-11 379 if (!buffer || !old_buffer)
df323337e507a0 Sebastian Andrzej Siewior 2019-05-03 380 goto out;
df323337e507a0 Sebastian Andrzej Siewior 2019-05-03 381
ecafacef162fc7 John Johansen 2026-07-28 382 error = fn_for_each(label, profile,
29d4e9aed0d3c9 Song Liu 2026-07-06 383 match_mnt(profile, path, buffer, old_path,
6c27cd23bd43c8 John Johansen 2026-07-27 384 old_buffer, NULL, flags, NULL, false, &ad));
df323337e507a0 Sebastian Andrzej Siewior 2019-05-03 385 out:
df323337e507a0 Sebastian Andrzej Siewior 2019-05-03 386 aa_put_buffer(buffer);
df323337e507a0 Sebastian Andrzej Siewior 2019-05-03 387 aa_put_buffer(old_buffer);
2ea3ffb7782a84 John Johansen 2017-07-18 388
2ea3ffb7782a84 John Johansen 2017-07-18 389 return error;
2ea3ffb7782a84 John Johansen 2017-07-18 390 }
2ea3ffb7782a84 John Johansen 2017-07-18 391
:::::: The code at line 369 was first introduced by commit
:::::: 2ea3ffb7782a84da33a8382f13ebd016da50079b apparmor: add mount mediation
:::::: TO: John Johansen <john.johansen@canonical.com>
:::::: CC: John Johansen <john.johansen@canonical.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-23 10:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23 10:18 [song:vfs-mount-lsm 3/8] security/apparmor/mount.c:369:7: warning: address of function 'dev_name' will always evaluate to 'true' kernel test robot
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.