Re: [PATCH v28 22/25] Audit: Add record for multiple process LSM attributes
by kernel test robot
Hi Casey,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pcmoore-audit/next]
[also build test WARNING on nf/master linus/master v5.14-rc2]
[cannot apply to nf-next/master security/next-testing next-20210721]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Casey-Schaufler/LSM-Infrastructu...
base: https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/06ec035c23ade985d4661768f52f2e8cd...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Casey-Schaufler/LSM-Infrastructure-management-of-the-sock-security/20210722-094735
git checkout 06ec035c23ade985d4661768f52f2e8cda1ce313
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from kernel/audit.c:51:
include/linux/audit.h:571:1: error: expected identifier or '(' before '+' token
571 | +static inline struct audit_context *audit_alloc_local(gfp_t gfpflags)
| ^
kernel/audit.c: In function 'audit_log_config_change':
kernel/audit.c:393:12: error: implicit declaration of function 'audit_alloc_for_lsm'; did you mean 'audit_alloc_mark'? [-Werror=implicit-function-declaration]
393 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^~~~~~~~~~~~~~~~~~~
| audit_alloc_mark
>> kernel/audit.c:393:10: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
393 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c: In function 'audit_receive_msg':
kernel/audit.c:1358:13: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1358 | lcontext = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c:1381:13: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1381 | lcontext = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c:1399:12: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1399 | lcontext = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c:1431:12: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1431 | lcontext = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c:1505:12: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1505 | lcontext = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c: In function 'audit_log_multicast':
kernel/audit.c:1567:10: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1567 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^
kernel/audit.c: At top level:
kernel/audit.c:1789:14: warning: no previous prototype for 'audit_serial' [-Wmissing-prototypes]
1789 | unsigned int audit_serial(void)
| ^~~~~~~~~~~~
kernel/audit.c: In function 'audit_log_vformat':
kernel/audit.c:1937:2: warning: function 'audit_log_vformat' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1937 | len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args);
| ^~~
kernel/audit.c:1946:3: warning: function 'audit_log_vformat' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1946 | len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);
| ^~~
kernel/audit.c: In function 'audit_log_set_loginuid':
kernel/audit.c:2334:10: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2334 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^
In file included from include/linux/perf_event.h:25,
from include/linux/trace_events.h:10,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:87,
from kernel/audit.c:44:
At top level:
arch/arc/include/asm/perf_event.h:126:23: warning: 'arc_pmu_cache_map' defined but not used [-Wunused-const-variable=]
126 | static const unsigned arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
| ^~~~~~~~~~~~~~~~~
arch/arc/include/asm/perf_event.h:91:27: warning: 'arc_pmu_ev_hw_map' defined but not used [-Wunused-const-variable=]
91 | static const char * const arc_pmu_ev_hw_map[] = {
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from kernel/auditfilter.c:12:
include/linux/audit.h:571:1: error: expected identifier or '(' before '+' token
571 | +static inline struct audit_context *audit_alloc_local(gfp_t gfpflags)
| ^
kernel/auditfilter.c: In function 'audit_log_rule_change':
kernel/auditfilter.c:1107:12: error: implicit declaration of function 'audit_alloc_for_lsm'; did you mean 'audit_alloc_mark'? [-Werror=implicit-function-declaration]
1107 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^~~~~~~~~~~~~~~~~~~
| audit_alloc_mark
>> kernel/auditfilter.c:1107:10: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1107 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^
cc1: some warnings being treated as errors
--
In file included from security/integrity/integrity_audit.c:12:
include/linux/audit.h:571:1: error: expected identifier or '(' before '+' token
571 | +static inline struct audit_context *audit_alloc_local(gfp_t gfpflags)
| ^
security/integrity/integrity_audit.c: In function 'integrity_audit_message':
security/integrity/integrity_audit.c:48:12: error: implicit declaration of function 'audit_alloc_for_lsm'; did you mean 'audit_log_format'? [-Werror=implicit-function-declaration]
48 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^~~~~~~~~~~~~~~~~~~
| audit_log_format
>> security/integrity/integrity_audit.c:48:10: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
48 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^
cc1: some warnings being treated as errors
--
In file included from security/integrity/ima/ima.h:22,
from security/integrity/ima/ima_api.c:18:
include/linux/audit.h:571:1: error: expected identifier or '(' before '+' token
571 | +static inline struct audit_context *audit_alloc_local(gfp_t gfpflags)
| ^
security/integrity/ima/ima_api.c: In function 'ima_audit_measurement':
security/integrity/ima/ima_api.c:362:12: error: implicit declaration of function 'audit_alloc_for_lsm'; did you mean 'audit_log_format'? [-Werror=implicit-function-declaration]
362 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^~~~~~~~~~~~~~~~~~~
| audit_log_format
>> security/integrity/ima/ima_api.c:362:10: warning: assignment to 'struct audit_context *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
362 | context = audit_alloc_for_lsm(GFP_KERNEL);
| ^
cc1: some warnings being treated as errors
vim +393 kernel/audit.c
385
386 static int audit_log_config_change(char *function_name, u32 new, u32 old,
387 int allow_changes)
388 {
389 struct audit_context *context;
390 struct audit_buffer *ab;
391 int rc = 0;
392
> 393 context = audit_alloc_for_lsm(GFP_KERNEL);
394 ab = audit_log_start(context, GFP_KERNEL, AUDIT_CONFIG_CHANGE);
395 if (unlikely(!ab))
396 return rc;
397 audit_log_format(ab, "op=set %s=%u old=%u ", function_name, new, old);
398 audit_log_session_info(ab);
399 rc = audit_log_task_context(ab);
400 if (rc)
401 allow_changes = 0; /* Something weird, deny request */
402 audit_log_format(ab, " res=%d", allow_changes);
403 audit_log_end(ab);
404 audit_free_local(context);
405 return rc;
406 }
407
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[linux-chenxing:mstar_v5_14_rebase 214/352] arch/arm/mach-mstar/pm.c:116:11: warning: assignment to 'void *' from 'long unsigned int' makes pointer from integer without a cast
by kernel test robot
tree: git://github.com/linux-chenxing/linux.git mstar_v5_14_rebase
head: 651efd0e52f225e60faa8b30f9768021e2104d3c
commit: 91aa393cc0c2ecb91050bf89c81540d3127b4804 [214/352] pm code
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/linux-chenxing/linux/commit/91aa393cc0c2ecb91050bf89c8...
git remote add linux-chenxing git://github.com/linux-chenxing/linux.git
git fetch --no-tags linux-chenxing mstar_v5_14_rebase
git checkout 91aa393cc0c2ecb91050bf89c81540d3127b4804
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/arm/mach-mstar/pm.c:81:12: warning: no previous prototype for 'msc313_pm_init' [-Wmissing-prototypes]
81 | int __init msc313_pm_init(void)
| ^~~~~~~~~~~~~~
arch/arm/mach-mstar/pm.c: In function 'msc313_pm_init':
>> arch/arm/mach-mstar/pm.c:116:11: warning: assignment to 'void *' from 'long unsigned int' makes pointer from integer without a cast [-Wint-conversion]
116 | imi_base = gen_pool_alloc(imi_pool, MSTARV7_PM_SIZE);
| ^
>> arch/arm/mach-mstar/pm.c:123:41: warning: passing argument 2 of 'gen_pool_virt_to_phys' makes integer from pointer without a cast [-Wint-conversion]
123 | phys = gen_pool_virt_to_phys(imi_pool, imi_base);
| ^~~~~~~~
| |
| void *
In file included from arch/arm/mach-mstar/pm.c:11:
include/linux/genalloc.h:97:65: note: expected 'long unsigned int' but argument is of type 'void *'
97 | extern phys_addr_t gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long);
| ^~~~~~~~~~~~~
vim +116 arch/arm/mach-mstar/pm.c
c1569e4f0b838c Daniel Palmer 2019-08-30 80
c1569e4f0b838c Daniel Palmer 2019-08-30 81 int __init msc313_pm_init(void)
c1569e4f0b838c Daniel Palmer 2019-08-30 82 {
c1569e4f0b838c Daniel Palmer 2019-08-30 83 int ret = 0;
c1569e4f0b838c Daniel Palmer 2019-08-30 84 struct device_node *node;
c1569e4f0b838c Daniel Palmer 2019-08-30 85 struct platform_device *pdev;
c1569e4f0b838c Daniel Palmer 2019-08-30 86 struct gen_pool *imi_pool;
c1569e4f0b838c Daniel Palmer 2019-08-30 87 void __iomem *imi_base;
c1569e4f0b838c Daniel Palmer 2019-08-30 88 void __iomem *virt;
c1569e4f0b838c Daniel Palmer 2019-08-30 89 phys_addr_t phys;
c1569e4f0b838c Daniel Palmer 2019-08-30 90 unsigned int resume_pbase;
c1569e4f0b838c Daniel Palmer 2019-08-30 91
c1569e4f0b838c Daniel Palmer 2019-08-30 92 pmsleep = syscon_regmap_lookup_by_compatible(COMPAT_PMSLEEP);
c1569e4f0b838c Daniel Palmer 2019-08-30 93 if(!pmsleep)
c1569e4f0b838c Daniel Palmer 2019-08-30 94 return -ENODEV;
c1569e4f0b838c Daniel Palmer 2019-08-30 95
c1569e4f0b838c Daniel Palmer 2019-08-30 96 node = of_find_compatible_node(NULL, NULL, "mmio-sram");
c1569e4f0b838c Daniel Palmer 2019-08-30 97 if (!node) {
c1569e4f0b838c Daniel Palmer 2019-08-30 98 pr_warn("%s: failed to find imi node\n", __func__);
c1569e4f0b838c Daniel Palmer 2019-08-30 99 return -ENODEV;
c1569e4f0b838c Daniel Palmer 2019-08-30 100 }
c1569e4f0b838c Daniel Palmer 2019-08-30 101
91aa393cc0c2ec Daniel Palmer 2020-11-24 102 pdev = of_find_device_by_node(node);
c1569e4f0b838c Daniel Palmer 2019-08-30 103 if (!pdev) {
c1569e4f0b838c Daniel Palmer 2019-08-30 104 pr_warn("%s: failed to find imi device\n", __func__);
c1569e4f0b838c Daniel Palmer 2019-08-30 105 ret = -ENODEV;
c1569e4f0b838c Daniel Palmer 2019-08-30 106 goto put_node;
c1569e4f0b838c Daniel Palmer 2019-08-30 107 }
c1569e4f0b838c Daniel Palmer 2019-08-30 108
c1569e4f0b838c Daniel Palmer 2019-08-30 109 imi_pool = gen_pool_get(&pdev->dev, NULL);
c1569e4f0b838c Daniel Palmer 2019-08-30 110 if (!imi_pool) {
c1569e4f0b838c Daniel Palmer 2019-08-30 111 pr_warn("%s: imi pool unavailable!\n", __func__);
c1569e4f0b838c Daniel Palmer 2019-08-30 112 ret = -ENODEV;
c1569e4f0b838c Daniel Palmer 2019-08-30 113 goto put_node;
c1569e4f0b838c Daniel Palmer 2019-08-30 114 }
c1569e4f0b838c Daniel Palmer 2019-08-30 115
c1569e4f0b838c Daniel Palmer 2019-08-30 @116 imi_base = gen_pool_alloc(imi_pool, MSTARV7_PM_SIZE);
c1569e4f0b838c Daniel Palmer 2019-08-30 117 if (!imi_base) {
c1569e4f0b838c Daniel Palmer 2019-08-30 118 pr_warn("%s: unable to alloc pm memory in imi!\n", __func__);
c1569e4f0b838c Daniel Palmer 2019-08-30 119 ret = -ENOMEM;
c1569e4f0b838c Daniel Palmer 2019-08-30 120 goto put_node;
91aa393cc0c2ec Daniel Palmer 2020-11-24 121 }
c1569e4f0b838c Daniel Palmer 2019-08-30 122
91aa393cc0c2ec Daniel Palmer 2020-11-24 @123 phys = gen_pool_virt_to_phys(imi_pool, imi_base);
:::::: The code at line 116 was first introduced by commit
:::::: c1569e4f0b838c4a36a86a3ba7695da03b107ba2 ARM: mstar: PM
:::::: TO: Daniel Palmer <daniel(a)0x0f.com>
:::::: CC: Daniel Palmer <daniel(a)0x0f.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH 06/14] drm/i915/guc/slpc: Enable SLPC and add related H2G events
by kernel test robot
Hi Vinay,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210721]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Vinay-Belgaumkar/drm-i915-guc-En...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/14352081e4f18759e70413f3be4151d62...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vinay-Belgaumkar/drm-i915-guc-Enable-GuC-based-power-management-features/20210722-001528
git checkout 14352081e4f18759e70413f3be4151d623c97b8c
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:217:5: warning: no previous prototype for 'slpc_decode_min_freq' [-Wmissing-prototypes]
217 | u32 slpc_decode_min_freq(struct intel_guc_slpc *slpc)
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:229:5: warning: no previous prototype for 'slpc_decode_max_freq' [-Wmissing-prototypes]
229 | u32 slpc_decode_max_freq(struct intel_guc_slpc *slpc)
| ^~~~~~~~~~~~~~~~~~~~
vim +/slpc_decode_min_freq +217 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
216
> 217 u32 slpc_decode_min_freq(struct intel_guc_slpc *slpc)
218 {
219 struct slpc_shared_data *data = slpc->vaddr;
220
221 GEM_BUG_ON(!slpc->vma);
222
223 return DIV_ROUND_CLOSEST(
224 REG_FIELD_GET(SLPC_MIN_UNSLICE_FREQ_MASK,
225 data->task_state_data.freq) *
226 GT_FREQUENCY_MULTIPLIER, GEN9_FREQ_SCALER);
227 }
228
> 229 u32 slpc_decode_max_freq(struct intel_guc_slpc *slpc)
230 {
231 struct slpc_shared_data *data = slpc->vaddr;
232
233 GEM_BUG_ON(!slpc->vma);
234
235 return DIV_ROUND_CLOSEST(
236 REG_FIELD_GET(SLPC_MAX_UNSLICE_FREQ_MASK,
237 data->task_state_data.freq) *
238 GT_FREQUENCY_MULTIPLIER, GEN9_FREQ_SCALER);
239 }
240
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[linux-stable-rc:linux-4.19.y 1864/4040] arch/ia64/kernel/kprobes.c:414:17: error: implicit declaration of function '__kretprobe_trampoline_handler'; did you mean 'kretprobe_trampoline'?
by kernel test robot
Hi Masami,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
head: 5a3ba2f90f8789162a03e07a37224bab4c643d1d
commit: d3380de483d55d904fb94a241406b34ed2fada7d [1864/4040] ia64: kprobes: Use generic kretprobe trampoline handler
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gi...
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.19.y
git checkout d3380de483d55d904fb94a241406b34ed2fada7d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/ia64/kernel/kprobes.c: In function 'get_kprobe_inst':
arch/ia64/kernel/kprobes.c:338:15: warning: variable 'template' set but not used [-Wunused-but-set-variable]
338 | unsigned int template;
| ^~~~~~~~
arch/ia64/kernel/kprobes.c: At top level:
arch/ia64/kernel/kprobes.c:412:15: warning: no previous prototype for 'trampoline_probe_handler' [-Wmissing-prototypes]
412 | int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/kernel/kprobes.c: In function 'trampoline_probe_handler':
>> arch/ia64/kernel/kprobes.c:414:17: error: implicit declaration of function '__kretprobe_trampoline_handler'; did you mean 'kretprobe_trampoline'? [-Werror=implicit-function-declaration]
414 | regs->cr_iip = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| kretprobe_trampoline
At top level:
arch/ia64/kernel/kprobes.c:928:13: warning: 'ia64_get_bsp_cfm' defined but not used [-Wunused-function]
928 | static void ia64_get_bsp_cfm(struct unw_frame_info *info, void *arg)
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86
vim +414 arch/ia64/kernel/kprobes.c
411
412 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
413 {
> 414 regs->cr_iip = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL);
415 /*
416 * By returning a non-zero value, we are telling
417 * kprobe_handler() that we don't want the post_handler
418 * to run (and have re-enabled preemption)
419 */
420 return 1;
421 }
422
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[linux-next:master 412/2389] fs/ksmbd/ndr.c:70:2: warning: 'strncpy' destination unchanged after copying no bytes
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b1347210b01daa977ea980268927aa99198ceccc
commit: c2220322b4577fc32ad3b7b4ddb856bd1f8c7461 [412/2389] ksmbd: replace KSMBD_ALIGN with kernel ALIGN macro
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout c2220322b4577fc32ad3b7b4ddb856bd1f8c7461
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In function 'ndr_write_string',
inlined from 'ndr_encode_dos_attr' at fs/ksmbd/ndr.c:136:3:
>> fs/ksmbd/ndr.c:70:2: warning: 'strncpy' destination unchanged after copying no bytes [-Wstringop-truncation]
70 | strncpy(PAYLOAD_HEAD(n), value, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'ndr_write_string',
inlined from 'ndr_encode_dos_attr' at fs/ksmbd/ndr.c:134:3:
>> fs/ksmbd/ndr.c:70:2: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
70 | strncpy(PAYLOAD_HEAD(n), value, sz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/ndr.c: In function 'ndr_encode_dos_attr':
fs/ksmbd/ndr.c:134:3: note: length computed here
134 | ndr_write_string(n, hex_attr, strlen(hex_attr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +70 fs/ksmbd/ndr.c
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 64
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 65 static int ndr_write_string(struct ndr *n, void *value, size_t sz)
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 66 {
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 67 if (n->length <= n->offset + sz)
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 68 try_to_realloc_ndr_blob(n, sz);
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 69
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 @70 strncpy(PAYLOAD_HEAD(n), value, sz);
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 71 sz++;
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 72 n->offset += sz;
c2220322b4577f fs/ksmbd/ndr.c Hyunchul Lee 2021-06-25 73 n->offset = ALIGN(n->offset, 2);
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 74 return 0;
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 75 }
e2f34481b24db2 fs/cifsd/ndr.c Namjae Jeon 2021-03-16 76
:::::: The code at line 70 was first introduced by commit
:::::: e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 cifsd: add server-side procedures for SMB3
:::::: TO: Namjae Jeon <namjae.jeon(a)samsung.com>
:::::: CC: Steve French <stfrench(a)microsoft.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[linux-next:master 1957/2389] drivers/md/dm-ima.c:184:6: warning: variable 'tfm' is used uninitialized whenever 'if' condition is true
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b1347210b01daa977ea980268927aa99198ceccc
commit: c2608cebed20bb307056d202258cc96ae8a9631d [1957/2389] dm ima: measure data on table load
config: arm-randconfig-r016-20210721 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9625ca5b602616b2f5584e8a49ba93c52c141e40)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout c2608cebed20bb307056d202258cc96ae8a9631d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/md/dm-ima.c:184:6: warning: variable 'tfm' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (dm_ima_alloc_and_copy_device_data(table->md, &device_data_buf, num_targets, noio))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-ima.c:325:20: note: uninitialized use occurs here
crypto_free_shash(tfm);
^~~
drivers/md/dm-ima.c:184:2: note: remove the 'if' if its condition is always false
if (dm_ima_alloc_and_copy_device_data(table->md, &device_data_buf, num_targets, noio))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-ima.c:179:6: warning: variable 'tfm' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!target_data_buf)
^~~~~~~~~~~~~~~~
drivers/md/dm-ima.c:325:20: note: uninitialized use occurs here
crypto_free_shash(tfm);
^~~
drivers/md/dm-ima.c:179:2: note: remove the 'if' if its condition is always false
if (!target_data_buf)
^~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-ima.c:175:6: warning: variable 'tfm' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!target_metadata_buf)
^~~~~~~~~~~~~~~~~~~~
drivers/md/dm-ima.c:325:20: note: uninitialized use occurs here
crypto_free_shash(tfm);
^~~
drivers/md/dm-ima.c:175:2: note: remove the 'if' if its condition is always false
if (!target_metadata_buf)
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/md/dm-ima.c:166:26: note: initialize the variable 'tfm' to silence this warning
struct crypto_shash *tfm;
^
= NULL
3 warnings generated.
vim +184 drivers/md/dm-ima.c
152
153 /*
154 * Build up the IMA data for each target, and finally measure.
155 */
156 void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_flags)
157 {
158 size_t device_data_buf_len, target_metadata_buf_len, target_data_buf_len, l = 0;
159 char *target_metadata_buf = NULL, *target_data_buf = NULL, *digest_buf = NULL;
160 char *ima_buf = NULL, *device_data_buf = NULL;
161 int digest_size, last_target_measured = -1, r;
162 status_type_t type = STATUSTYPE_IMA;
163 size_t cur_total_buf_len = 0;
164 unsigned int num_targets, i;
165 SHASH_DESC_ON_STACK(shash, NULL);
166 struct crypto_shash *tfm;
167 u8 *digest = NULL;
168 bool noio = false;
169
170 ima_buf = dm_ima_alloc(DM_IMA_MEASUREMENT_BUF_LEN, GFP_KERNEL, noio);
171 if (!ima_buf)
172 return;
173
174 target_metadata_buf = dm_ima_alloc(DM_IMA_TARGET_METADATA_BUF_LEN, GFP_KERNEL, noio);
175 if (!target_metadata_buf)
176 goto error;
177
178 target_data_buf = dm_ima_alloc(DM_IMA_TARGET_DATA_BUF_LEN, GFP_KERNEL, noio);
179 if (!target_data_buf)
180 goto error;
181
182 num_targets = dm_table_get_num_targets(table);
183
> 184 if (dm_ima_alloc_and_copy_device_data(table->md, &device_data_buf, num_targets, noio))
185 goto error;
186
187 tfm = crypto_alloc_shash("sha256", 0, 0);
188 if (IS_ERR(tfm))
189 goto error;
190
191 shash->tfm = tfm;
192 digest_size = crypto_shash_digestsize(tfm);
193 digest = dm_ima_alloc(digest_size, GFP_KERNEL, noio);
194 if (!digest)
195 goto error;
196
197 r = crypto_shash_init(shash);
198 if (r)
199 return;
200
201 device_data_buf_len = strlen(device_data_buf);
202 memcpy(ima_buf + l, device_data_buf, device_data_buf_len);
203 l += device_data_buf_len;
204
205 for (i = 0; i < num_targets; i++) {
206 struct dm_target *ti = dm_table_get_target(table, i);
207
208 if (!ti)
209 goto error;
210
211 last_target_measured = 0;
212
213 /*
214 * First retrieve the target metadata.
215 */
216 scnprintf(target_metadata_buf, DM_IMA_TARGET_METADATA_BUF_LEN,
217 "target_index=%d,target_begin=%llu,target_len=%llu,",
218 i, ti->begin, ti->len);
219 target_metadata_buf_len = strlen(target_metadata_buf);
220
221 /*
222 * Then retrieve the actual target data.
223 */
224 if (ti->type->status)
225 ti->type->status(ti, type, status_flags, target_data_buf,
226 DM_IMA_TARGET_DATA_BUF_LEN);
227 else
228 target_data_buf[0] = '\0';
229
230 target_data_buf_len = strlen(target_data_buf);
231
232 /*
233 * Check if the total data can fit into the IMA buffer.
234 */
235 cur_total_buf_len = l + target_metadata_buf_len + target_data_buf_len;
236
237 /*
238 * IMA measurements for DM targets are best-effort.
239 * If the total data buffered so far, including the current target,
240 * is too large to fit into DM_IMA_MEASUREMENT_BUF_LEN, measure what
241 * we have in the current buffer, and continue measuring the remaining
242 * targets by prefixing the device metadata again.
243 */
244 if (unlikely(cur_total_buf_len >= DM_IMA_MEASUREMENT_BUF_LEN)) {
245 dm_ima_measure_data("table_load", ima_buf, l, noio);
246 r = crypto_shash_update(shash, (const u8 *)ima_buf, l);
247 if (r < 0)
248 goto error;
249
250 memset(ima_buf, 0, DM_IMA_MEASUREMENT_BUF_LEN);
251 l = 0;
252
253 /*
254 * Each new "table_load" entry in IMA log should have device data
255 * prefix, so that multiple records from the same table_load for
256 * a given device can be linked together.
257 */
258 memcpy(ima_buf + l, device_data_buf, device_data_buf_len);
259 l += device_data_buf_len;
260
261 /*
262 * If this iteration of the for loop turns out to be the last target
263 * in the table, dm_ima_measure_data("table_load", ...) doesn't need
264 * to be called again, just the hash needs to be finalized.
265 * "last_target_measured" tracks this state.
266 */
267 last_target_measured = 1;
268 }
269
270 /*
271 * Fill-in all the target metadata, so that multiple targets for the same
272 * device can be linked together.
273 */
274 memcpy(ima_buf + l, target_metadata_buf, target_metadata_buf_len);
275 l += target_metadata_buf_len;
276
277 memcpy(ima_buf + l, target_data_buf, target_data_buf_len);
278 l += target_data_buf_len;
279 }
280
281 if (!last_target_measured) {
282 dm_ima_measure_data("table_load", ima_buf, l, noio);
283
284 r = crypto_shash_update(shash, (const u8 *)ima_buf, l);
285 if (r < 0)
286 goto error;
287 }
288
289 /*
290 * Finalize the table hash, and store it in table->md->ima.inactive_table.hash,
291 * so that the table data can be verified against the future device state change
292 * events, e.g. resume, rename, remove, table-clear etc.
293 */
294 r = crypto_shash_final(shash, digest);
295 if (r < 0)
296 goto error;
297
298 digest_buf = dm_ima_alloc((digest_size*2)+1, GFP_KERNEL, noio);
299 if (!digest_buf)
300 goto error;
301
302 for (i = 0; i < digest_size; i++)
303 snprintf((digest_buf+(i*2)), 3, "%02x", digest[i]);
304
305 if (table->md->ima.active_table.hash != table->md->ima.inactive_table.hash)
306 kfree(table->md->ima.inactive_table.hash);
307
308 table->md->ima.inactive_table.hash = digest_buf;
309 table->md->ima.inactive_table.hash_len = strlen(digest_buf);
310 table->md->ima.inactive_table.num_targets = num_targets;
311
312 if (table->md->ima.active_table.device_metadata !=
313 table->md->ima.inactive_table.device_metadata)
314 kfree(table->md->ima.inactive_table.device_metadata);
315
316 table->md->ima.inactive_table.device_metadata = device_data_buf;
317 table->md->ima.inactive_table.device_metadata_len = device_data_buf_len;
318
319 goto exit;
320 error:
321 kfree(digest_buf);
322 kfree(device_data_buf);
323 exit:
324 kfree(digest);
325 crypto_free_shash(tfm);
326 kfree(ima_buf);
327 kfree(target_metadata_buf);
328 kfree(target_data_buf);
329 }
330
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
crypto/async_tx/raid6test.c:44:13: error: 'disk_type' redeclared as different kind of symbol
by kernel test robot
Hi Boris,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3d5895cd351757f69c9a66fb5fc8cf19f454d773
commit: ef45fe470e1e5410db4af87abc5d5055427945ac blk-cgroup: show global disk stats in root cgroup io.stat
date: 1 year ago
config: mips-buildonly-randconfig-r003-20210721 (attached as .config)
compiler: mips-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ef45fe470e1e5410db4af87abc5d5055427945ac
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash crypto/async_tx/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> crypto/async_tx/raid6test.c:44:13: error: 'disk_type' redeclared as different kind of symbol
44 | static char disk_type(int d, int disks)
| ^~~~~~~~~
In file included from arch/mips/include/asm/mach-rc32434/rb.h:10,
from arch/mips/include/asm/mach-rc32434/irq.h:8,
from arch/mips/include/asm/irq.h:18,
from include/linux/irq.h:23,
from include/asm-generic/hardirq.h:13,
from arch/mips/include/asm/hardirq.h:16,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from include/linux/async_tx.h:9,
from crypto/async_tx/raid6test.c:9:
include/linux/genhd.h:27:33: note: previous declaration of 'disk_type' was here
27 | extern const struct device_type disk_type;
| ^~~~~~~~~
vim +/disk_type +44 crypto/async_tx/raid6test.c
cb3c82992f62f8 Dan Williams 2009-07-14 43
cb3c82992f62f8 Dan Williams 2009-07-14 @44 static char disk_type(int d, int disks)
cb3c82992f62f8 Dan Williams 2009-07-14 45 {
cb3c82992f62f8 Dan Williams 2009-07-14 46 if (d == disks - 2)
cb3c82992f62f8 Dan Williams 2009-07-14 47 return 'P';
cb3c82992f62f8 Dan Williams 2009-07-14 48 else if (d == disks - 1)
cb3c82992f62f8 Dan Williams 2009-07-14 49 return 'Q';
cb3c82992f62f8 Dan Williams 2009-07-14 50 else
cb3c82992f62f8 Dan Williams 2009-07-14 51 return 'D';
cb3c82992f62f8 Dan Williams 2009-07-14 52 }
cb3c82992f62f8 Dan Williams 2009-07-14 53
:::::: The code at line 44 was first introduced by commit
:::::: cb3c82992f62f838e6476a0bff12909158007fc6 async_tx: raid6 recovery self test
:::::: TO: Dan Williams <dan.j.williams(a)intel.com>
:::::: CC: Dan Williams <dan.j.williams(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH 09/14] drm/i915/guc/slpc: Add debugfs for SLPC info
by kernel test robot
Hi Vinay,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210721]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Vinay-Belgaumkar/drm-i915-guc-En...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-randconfig-a016-20210720 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c781eb153bfbd1b52b03efe34f56bbeccbb8aba6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/1c6f8cf3c2757db7a87fceef08834f4e0...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vinay-Belgaumkar/drm-i915-guc-Enable-GuC-based-power-management-features/20210722-001528
git checkout 1c6f8cf3c2757db7a87fceef08834f4e0e14f2f9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c:67:6: warning: no previous prototype for function 'intel_eval_slpc_support' [-Wmissing-prototypes]
bool intel_eval_slpc_support(void *data)
^
drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c:67:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool intel_eval_slpc_support(void *data)
^
static
1 warning generated.
--
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:238:5: warning: no previous prototype for function 'slpc_decode_min_freq' [-Wmissing-prototypes]
u32 slpc_decode_min_freq(struct intel_guc_slpc *slpc)
^
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:238:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 slpc_decode_min_freq(struct intel_guc_slpc *slpc)
^
static
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:250:5: warning: no previous prototype for function 'slpc_decode_max_freq' [-Wmissing-prototypes]
u32 slpc_decode_max_freq(struct intel_guc_slpc *slpc)
^
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:250:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 slpc_decode_max_freq(struct intel_guc_slpc *slpc)
^
static
>> drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:445:17: warning: variable 'data' is uninitialized when used here [-Wuninitialized]
slpc_tasks = &data->task_state_data;
^~~~
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:436:31: note: initialize the variable 'data' to silence this warning
struct slpc_shared_data *data;
^
= NULL
3 warnings generated.
vim +/intel_eval_slpc_support +67 drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c
66
> 67 bool intel_eval_slpc_support(void *data)
68 {
69 struct intel_guc *guc;
70
71 guc = (struct intel_guc *)data;
72 return intel_guc_slpc_is_used(guc);
73 }
74
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months