CC: [email protected] CC: [email protected] BCC: [email protected] CC: [email protected] TO: Arnd Bergmann <[email protected]> CC: Masahiro Yamada <[email protected]> CC: Alex Shi <[email protected]> CC: Nick Desaulniers <[email protected]> CC: Miguel Ojeda <[email protected]> CC: Nathan Chancellor <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: a2c29ccd9477861b16ddc02c411a6c9665250558 commit: e8c07082a810fbb9db303a2b66b66b8d7e588b53 Kbuild: move to -std=gnu11 date: 5 weeks ago :::::: branch date: 6 hours ago :::::: commit date: 5 weeks ago config: x86_64-randconfig-c007-20220411 (https://download.01.org/0day-ci/archive/20220417/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c6e83f560f06cdfe8aa47b248d8bdc58f947274b) 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/?id=e8c07082a810fbb9db303a2b66b66b8d7e588b53 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout e8c07082a810fbb9db303a2b66b66b8d7e588b53 # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^~~~ block/blk-mq.c:2549:3: note: Calling 'blk_mq_commit_rqs' blk_mq_commit_rqs(hctx, &queued, from_schedule); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block/blk-mq.c:2379:6: note: Access to field 'queue' results in a dereference of a null pointer (loaded from variable 'hctx') if (hctx->queue->mq_ops->commit_rqs) { ^~~~ block/blk-mq.c:3954:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(new_hctxs, hctxs, q->nr_hw_queues * ^~~~~~ block/blk-mq.c:3954:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(new_hctxs, hctxs, q->nr_hw_queues * ^~~~~~ block/blk-mq.c:4210:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(new_tags, set->tags, cur_nr_hw_queues * ^~~~~~ block/blk-mq.c:4210:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(new_tags, set->tags, cur_nr_hw_queues * ^~~~~~ block/blk-mq.c:4320:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(set, 0, sizeof(*set)); ^~~~~~ block/blk-mq.c:4320:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 memset(set, 0, sizeof(*set)); ^~~~~~ Suppressed 37 warnings (37 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 37 warnings generated. drivers/gpu/drm/drm_encoder.c:201:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(encoder, 0, sizeof(*encoder)); ^~~~~~ drivers/gpu/drm/drm_encoder.c:201:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 memset(encoder, 0, sizeof(*encoder)); ^~~~~~ Suppressed 36 warnings (36 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 36 warnings generated. Suppressed 36 warnings (36 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 37 warnings generated. drivers/gpu/drm/drm_property.c:576:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(blob->data, data, length); ^~~~~~ drivers/gpu/drm/drm_property.c:576:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(blob->data, data, length); ^~~~~~ Suppressed 36 warnings (36 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 41 warnings generated. drivers/gpu/drm/drm_plane.c:203:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(formats_ptr(blob_data), plane->format_types, formats_size); ^~~~~~ drivers/gpu/drm/drm_plane.c:203:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(formats_ptr(blob_data), plane->format_types, formats_size); ^~~~~~ drivers/gpu/drm/drm_plane.c:321:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(plane->format_types, formats, format_count * sizeof(uint32_t)); ^~~~~~ drivers/gpu/drm/drm_plane.c:321:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(plane->format_types, formats, format_count * sizeof(uint32_t)); ^~~~~~ drivers/gpu/drm/drm_plane.c:323:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(plane->modifiers, format_modifiers, ^~~~~~ drivers/gpu/drm/drm_plane.c:323:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(plane->modifiers, format_modifiers, ^~~~~~ drivers/gpu/drm/drm_plane.c:553:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(plane, 0, sizeof(*plane)); ^~~~~~ drivers/gpu/drm/drm_plane.c:553:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 memset(plane, 0, sizeof(*plane)); ^~~~~~ drivers/gpu/drm/drm_plane.c:1183:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(&new_req, req, sizeof(struct drm_mode_cursor)); ^~~~~~ drivers/gpu/drm/drm_plane.c:1183:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(&new_req, req, sizeof(struct drm_mode_cursor)); ^~~~~~ Suppressed 36 warnings (36 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 39 warnings generated. drivers/gpu/drm/i915/gt/shmem_utils.c:109:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(vaddr + offset_in_page(off), ptr, this); ^~~~~~ drivers/gpu/drm/i915/gt/shmem_utils.c:109:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(vaddr + offset_in_page(off), ptr, this); ^~~~~~ drivers/gpu/drm/i915/gt/shmem_utils.c:112:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(ptr, vaddr + offset_in_page(off), this); ^~~~~~ drivers/gpu/drm/i915/gt/shmem_utils.c:112:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(ptr, vaddr + offset_in_page(off), this); ^~~~~~ Suppressed 37 warnings (37 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 60 warnings generated. >> drivers/gpu/drm/i915/gt/sysfs_engines.c:27:9: warning: Call to function >> 'sprintf' is insecure as it does not provide bounding of the memory buffer >> or security checks introduced in the C11 standard. Replace with analogous >> functions that support length arguments or provides boundary checks such as >> 'sprintf_s' in case of C11 >> [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%s\n", kobj_to_engine(kobj)->name); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:27:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%s\n", kobj_to_engine(kobj)->name); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:36:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%d\n", kobj_to_engine(kobj)->uabi_class); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:36:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%d\n", kobj_to_engine(kobj)->uabi_class); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:45:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%d\n", kobj_to_engine(kobj)->uabi_instance); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:45:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%d\n", kobj_to_engine(kobj)->uabi_instance); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:54:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "0x%x\n", kobj_to_engine(kobj)->mmio_base); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:54:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "0x%x\n", kobj_to_engine(kobj)->mmio_base); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:110:12: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] len += snprintf(buf + len, PAGE_SIZE - len, ^~~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:110:12: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 len += snprintf(buf + len, PAGE_SIZE - len, ^~~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:113:11: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] len += snprintf(buf + len, PAGE_SIZE - len, ^~~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:113:11: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 len += snprintf(buf + len, PAGE_SIZE - len, ^~~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:184:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->props.max_busywait_duration_ns); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:184:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->props.max_busywait_duration_ns); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:195:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->defaults.max_busywait_duration_ns); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:195:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->defaults.max_busywait_duration_ns); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:237:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->props.timeslice_duration_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:237:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->props.timeslice_duration_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:248:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->defaults.timeslice_duration_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:248:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->defaults.timeslice_duration_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:287:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->props.stop_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:287:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->props.stop_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:298:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->defaults.stop_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:298:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->defaults.stop_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:342:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->props.preempt_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:342:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->props.preempt_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:354:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->defaults.preempt_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:354:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->defaults.preempt_timeout_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:397:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->props.heartbeat_interval_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:397:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->props.heartbeat_interval_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:408:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%lu\n", engine->defaults.heartbeat_interval_ms); ^~~~~~~ drivers/gpu/drm/i915/gt/sysfs_engines.c:408:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%lu\n", engine->defaults.heartbeat_interval_ms); ^~~~~~~ Suppressed 44 warnings (44 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 61 warnings generated. drivers/gpu/drm/i915/display/intel_vdsc.c:906:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(rc_buf_thresh_dword, 0, sizeof(rc_buf_thresh_dword)); -- ^~~~~~ drivers/i2c/i2c-core-smbus.c:294:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(data.block + 1, values, length); ^~~~~~ drivers/i2c/i2c-core-smbus.c:410:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(msg[0].buf + 1, data->block, msg[0].len - 1); ^~~~~~ drivers/i2c/i2c-core-smbus.c:410:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(msg[0].buf + 1, data->block, msg[0].len - 1); ^~~~~~ drivers/i2c/i2c-core-smbus.c:425:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(msg[0].buf + 1, data->block, msg[0].len - 1); ^~~~~~ drivers/i2c/i2c-core-smbus.c:425:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(msg[0].buf + 1, data->block, msg[0].len - 1); ^~~~~~ drivers/i2c/i2c-core-smbus.c:447:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(msg[0].buf + 1, data->block + 1, data->block[0]); ^~~~~~ drivers/i2c/i2c-core-smbus.c:447:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(msg[0].buf + 1, data->block + 1, data->block[0]); ^~~~~~ drivers/i2c/i2c-core-smbus.c:497:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(data->block + 1, msg[1].buf, data->block[0]); ^~~~~~ drivers/i2c/i2c-core-smbus.c:497:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(data->block + 1, msg[1].buf, data->block[0]); ^~~~~~ drivers/i2c/i2c-core-smbus.c:508:4: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(data->block, msg[1].buf, msg[1].buf[0] + 1); ^~~~~~ drivers/i2c/i2c-core-smbus.c:508:4: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(data->block, msg[1].buf, msg[1].buf[0] + 1); ^~~~~~ Suppressed 38 warnings (38 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 27 warnings generated. drivers/input/joystick/adi.c:139:6: warning: Although the value stored to 'z' is used in the enclosing expression, the value is never actually read from 'z' [clang-analyzer-deadcode.DeadStores] v = z = gameport_read(gameport); ^ ~~~~~~~~~~~~~~~~~~~~~~~ drivers/input/joystick/adi.c:139:6: note: Although the value stored to 'z' is used in the enclosing expression, the value is never actually read from 'z' v = z = gameport_read(gameport); ^ ~~~~~~~~~~~~~~~~~~~~~~~ drivers/input/joystick/adi.c:397:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_names[t], adi->id); ^~~~~~~~ drivers/input/joystick/adi.c:397:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_names[t], adi->id); ^~~~~~~~ drivers/input/joystick/adi.c:398:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] snprintf(adi->name, ADI_MAX_NAME_LENGTH, "Logitech %s [%s]", buf, adi->cname); ^~~~~~~~ drivers/input/joystick/adi.c:398:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 snprintf(adi->name, ADI_MAX_NAME_LENGTH, "Logitech %s [%s]", buf, adi->cname); ^~~~~~~~ drivers/input/joystick/adi.c:399:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] snprintf(adi->phys, ADI_MAX_PHYS_LENGTH, "%s/input%d", port->gameport->phys, half); ^~~~~~~~ drivers/input/joystick/adi.c:399:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 snprintf(adi->phys, ADI_MAX_PHYS_LENGTH, "%s/input%d", port->gameport->phys, half); ^~~~~~~~ Suppressed 23 warnings (23 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 34 warnings generated. Suppressed 34 warnings (34 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 54 warnings generated. drivers/ptp/ptp_vclock.c:129:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] snprintf(vclock->info.name, PTP_CLOCK_NAME_LEN, "ptp%d_virt", ^~~~~~~~ drivers/ptp/ptp_vclock.c:129:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 snprintf(vclock->info.name, PTP_CLOCK_NAME_LEN, "ptp%d_virt", ^~~~~~~~ drivers/ptp/ptp_vclock.c:163:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] snprintf(name, PTP_CLOCK_NAME_LEN, "ptp%d", pclock_index); ^~~~~~~~ drivers/ptp/ptp_vclock.c:163:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 snprintf(name, PTP_CLOCK_NAME_LEN, "ptp%d", pclock_index); ^~~~~~~~ drivers/ptp/ptp_vclock.c:179:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(*vclock_index, ptp->vclock_index, sizeof(int) * ptp->n_vclocks); ^~~~~~ drivers/ptp/ptp_vclock.c:179:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 memcpy(*vclock_index, ptp->vclock_index, sizeof(int) * ptp->n_vclocks); ^~~~~~ drivers/ptp/ptp_vclock.c:198:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] snprintf(name, PTP_CLOCK_NAME_LEN, "ptp%d", vclock_index); ^~~~~~~~ drivers/ptp/ptp_vclock.c:198:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 snprintf(name, PTP_CLOCK_NAME_LEN, "ptp%d", vclock_index); ^~~~~~~~ Suppressed 50 warnings (50 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 50 warnings generated. Suppressed 50 warnings (50 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 59 warnings generated. Suppressed 59 warnings (59 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 47 warnings generated. >> drivers/gpu/drm/i915/i915_pmu.c:806:9: warning: Call to function 'sprintf' >> is insecure as it does not provide bounding of the memory buffer or security >> checks introduced in the C11 standard. Replace with analogous functions that >> support length arguments or provides boundary checks such as 'sprintf_s' in >> case of C11 >> [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%s\n", eattr->str); ^~~~~~~ drivers/gpu/drm/i915/i915_pmu.c:806:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%s\n", eattr->str); ^~~~~~~ drivers/gpu/drm/i915/i915_pmu.c:836:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "config=0x%lx\n", eattr->val); ^~~~~~~ drivers/gpu/drm/i915/i915_pmu.c:836:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "config=0x%lx\n", eattr->val); ^~~~~~~ drivers/gpu/drm/i915/i915_pmu.c:1046:19: warning: Value stored to 'pmu' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node); ^~~ drivers/gpu/drm/i915/i915_pmu.c:1046:19: note: Value stored to 'pmu' during its initialization is never read struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), cpuhp.node); ^~~ Suppressed 44 warnings (44 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 45 warnings generated. Suppressed 45 warnings (45 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 14 warnings generated. drivers/power/supply/power_supply_sysfs.c:251:13: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] count += sprintf(buf + count, "[%s] ", ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:251:13: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 count += sprintf(buf + count, "[%s] ", ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:255:13: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] count += sprintf(buf + count, "%s ", ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:255:13: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 count += sprintf(buf + count, "%s ", ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:299:10: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return sprintf(buf, "%s\n", ps_attr->text_values[value.intval]); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:299:10: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 return sprintf(buf, "%s\n", ps_attr->text_values[value.intval]); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:308:9: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret = sprintf(buf, "%s\n", value.strval); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:308:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 ret = sprintf(buf, "%s\n", value.strval); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:311:9: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret = sprintf(buf, "%d\n", value.intval); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:311:9: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 ret = sprintf(buf, "%d\n", value.intval); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:415:4: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] sprintf(power_supply_attrs[i].attr_name, "_err_%d", i); ^~~~~~~ drivers/power/supply/power_supply_sysfs.c:415:4: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 sprintf(power_supply_attrs[i].attr_name, "_err_%d", i); ^~~~~~~ Suppressed 8 warnings (8 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. kernel/static_call.c:275:47: warning: Access to field 'func' results in a dereference of a null pointer (loaded from variable 'key') [clang-analyzer-core.NullDereference] arch_static_call_transform(site_addr, NULL, key->func, ^ kernel/static_call.c:478:6: note: Assuming 'static_call_initialized' is false if (static_call_initialized) ^~~~~~~~~~~~~~~~~~~~~~~ kernel/static_call.c:478:2: note: Taking false branch if (static_call_initialized) ^ kernel/static_call.c:483:8: note: Calling '__static_call_init' ret = __static_call_init(NULL, __start_static_call_sites, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/static_call.c:217:6: note: 'start' is not equal to 'stop' if (start == stop) ^~~~~ kernel/static_call.c:217:2: note: Taking false branch if (start == stop) ^ kernel/static_call.c:222:2: note: Loop condition is true. Entering loop body for (site = start; site < stop; site++) { ^ kernel/static_call.c:225:8: note: 'mod' is null if ((mod && within_module_init((unsigned long)site_addr, mod)) || ^~~ kernel/static_call.c:225:12: note: Left side of '&&' is false if ((mod && within_module_init((unsigned long)site_addr, mod)) || ^ kernel/static_call.c:226:9: note: 'mod' is null (!mod && init_section_contains(site_addr, 1))) ^~~ kernel/static_call.c:226:8: note: Left side of '&&' is true (!mod && init_section_contains(site_addr, 1))) ^ kernel/static_call.c:225:3: note: Taking false branch if ((mod && within_module_init((unsigned long)site_addr, mod)) || ^ kernel/static_call.c:229:3: note: Value assigned to 'key' key = static_call_key(site); vim +27 drivers/gpu/drm/i915/gt/sysfs_engines.c 4ec76dbeb62b5f Chris Wilson 2020-02-28 23 4ec76dbeb62b5f Chris Wilson 2020-02-28 24 static ssize_t 4ec76dbeb62b5f Chris Wilson 2020-02-28 25 name_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) 4ec76dbeb62b5f Chris Wilson 2020-02-28 26 { 4ec76dbeb62b5f Chris Wilson 2020-02-28 @27 return sprintf(buf, "%s\n", kobj_to_engine(kobj)->name); 4ec76dbeb62b5f Chris Wilson 2020-02-28 28 } 4ec76dbeb62b5f Chris Wilson 2020-02-28 29 :::::: The code at line 27 was first introduced by commit :::::: 4ec76dbeb62b5f897641af502b8309808e4e2d82 drm/i915/gt: Expose engine properties via sysfs :::::: TO: Chris Wilson <[email protected]> :::::: CC: Chris Wilson <[email protected]> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
