[kbuild] security/landlock/syscalls.c:329:6: warning: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
CC: l...@lists.linux.dev CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: "Mickaël Salaün" CC: James Morris tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1db333d9a51f3459fba1bcaa564d95befe79f0b3 commit: 265885daf3e5082eb9f6e2a23bdbf9ba4456a21b landlock: Add syscall implementations date: 11 months ago :: branch date: 4 hours ago :: commit date: 11 months ago config: mips-randconfig-c004-20220227 (https://download.01.org/0day-ci/archive/20220311/202203110046.u5f6ftwj-...@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) 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 mips cross compiling tool for clang build # apt-get install binutils-mips-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=265885daf3e5082eb9f6e2a23bdbf9ba4456a21b git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 265885daf3e5082eb9f6e2a23bdbf9ba4456a21b # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot clang-analyzer warnings: (new ones prefixed by >>) if (!buf->data) ^~ include/linux/tpm.h:332:2: note: Taking false branch if (!buf->data) ^ include/linux/tpm.h:337:2: note: Returning zero, which participates in a condition later return 0; ^~~~ drivers/char/tpm/tpm1-cmd.c:488:7: note: Returning from 'tpm_buf_init' rc = tpm_buf_init(&buf, TPM_TAG_RQU_COMMAND, TPM_ORD_GET_CAP); ^~~~ drivers/char/tpm/tpm1-cmd.c:489:6: note: 'rc' is 0 if (rc) ^~ drivers/char/tpm/tpm1-cmd.c:489:2: note: Taking false branch if (rc) ^ drivers/char/tpm/tpm1-cmd.c:492:6: note: 'subcap_id' is not equal to TPM_CAP_VERSION_1_1 if (subcap_id == TPM_CAP_VERSION_1_1 || ^ drivers/char/tpm/tpm1-cmd.c:492:6: note: Left side of '||' is false drivers/char/tpm/tpm1-cmd.c:493:6: note: 'subcap_id' is not equal to TPM_CAP_VERSION_1_2 subcap_id == TPM_CAP_VERSION_1_2) { ^ drivers/char/tpm/tpm1-cmd.c:492:2: note: Taking false branch if (subcap_id == TPM_CAP_VERSION_1_1 || ^ drivers/char/tpm/tpm1-cmd.c:497:7: note: 'subcap_id' is not equal to TPM_CAP_FLAG_PERM if (subcap_id == TPM_CAP_FLAG_PERM || ^ drivers/char/tpm/tpm1-cmd.c:497:7: note: Left side of '||' is false drivers/char/tpm/tpm1-cmd.c:498:7: note: 'subcap_id' is not equal to TPM_CAP_FLAG_VOL subcap_id == TPM_CAP_FLAG_VOL) ^ drivers/char/tpm/tpm1-cmd.c:497:3: note: Taking false branch if (subcap_id == TPM_CAP_FLAG_PERM || ^ drivers/char/tpm/tpm1-cmd.c:506:7: note: Value assigned to field 'duration_adjusted', which participates in a condition later rc = tpm_transmit_cmd(chip, &buf, min_cap_length, desc); ^~ drivers/char/tpm/tpm1-cmd.c:507:6: note: Assuming 'rc' is 0, which participates in a condition later if (!rc) ^~~ drivers/char/tpm/tpm1-cmd.c:507:2: note: Taking true branch if (!rc) ^ drivers/char/tpm/tpm1-cmd.c:510:2: note: Returning zero (loaded from 'rc'), which participates in a condition later return rc; ^ drivers/char/tpm/tpm1-cmd.c:417:7: note: Returning from 'tpm1_getcap' rc = tpm1_getcap(chip, TPM_CAP_PROP_TIS_DURATION, &cap, ^~ drivers/char/tpm/tpm1-cmd.c:420:6: note: 'rc' is 0 if (rc) ^~ drivers/char/tpm/tpm1-cmd.c:420:2: note: Taking false branch if (rc) ^ drivers/char/tpm/tpm1-cmd.c:435:6: note: Assuming field 'update_durations' is null if (chip->ops->update_durations) ^~~ drivers/char/tpm/tpm1-cmd.c:435:2: note: Taking false branch if (chip->ops->update_durations) ^ drivers/char/tpm/tpm1-cmd.c:438:6: note: Assuming field 'duration_adjusted' is true if (chip->duration_adjusted) { ^~~ drivers/char/tpm/tpm1-cmd.c:438:2: note: Taking true branch
[kbuild] security/landlock/syscalls.c:329:6: warning: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
CC: l...@lists.linux.dev CC: kbuild-...@lists.01.org CC: linux-ker...@vger.kernel.org TO: "Mickaël Salaün" CC: James Morris tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: b81b1829e7e39f6cebdf6e4d5484eacbceda8554 commit: 265885daf3e5082eb9f6e2a23bdbf9ba4456a21b landlock: Add syscall implementations date: 10 months ago :: branch date: 10 hours ago :: commit date: 10 months ago config: mips-randconfig-c004-20220211 (https://download.01.org/0day-ci/archive/20220213/202202131248.smsqrnzo-...@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31) 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 mips cross compiling tool for clang build # apt-get install binutils-mips-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=265885daf3e5082eb9f6e2a23bdbf9ba4456a21b git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 265885daf3e5082eb9f6e2a23bdbf9ba4456a21b # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot clang-analyzer warnings: (new ones prefixed by >>) if (fwnode_property_present(fwnode, "color")) { ^ drivers/leds/led-core.c:391:6: note: Assuming the condition is true if (!fwnode_property_present(fwnode, "function")) ^~~~ drivers/leds/led-core.c:391:2: note: Taking true branch if (!fwnode_property_present(fwnode, "function")) ^ drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->label', which participates in a condition later return; ^ drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->function', which participates in a condition later drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->color_present', which participates in a condition later drivers/leds/led-core.c:429:2: note: Returning from 'led_parse_fwnode_props' led_parse_fwnode_props(dev, fwnode, &props); ^~~ drivers/leds/led-core.c:431:12: note: Field 'label' is null if (props.label) { ^ drivers/leds/led-core.c:431:2: note: Taking false branch if (props.label) { ^ drivers/leds/led-core.c:445:19: note: Field 'function' is null } else if (props.function || props.color_present) { ^ drivers/leds/led-core.c:445:13: note: Left side of '||' is false } else if (props.function || props.color_present) { ^ drivers/leds/led-core.c:445:37: note: Field 'color_present' is false } else if (props.function || props.color_present) { ^ drivers/leds/led-core.c:445:9: note: Taking false branch } else if (props.function || props.color_present) { ^ drivers/leds/led-core.c:464:13: note: Assuming field 'default_label' is null } else if (init_data->default_label) { ^~~~ drivers/leds/led-core.c:464:9: note: Taking false branch } else if (init_data->default_label) { ^ drivers/leds/led-core.c:471:13: note: Assuming the condition is true } else if (is_of_node(fwnode)) { ^~ drivers/leds/led-core.c:471:9: note: Taking true branch } else if (is_of_node(fwnode)) { ^ drivers/leds/led-core.c:472:30: note: Assuming the condition is false strscpy(led_classdev_name, to_of_node(fwnode)->name, ^ include/linux/of.h:164:3: note: expanded from macro 'to_of_node' is_of_node(__to_of_node_fwnode) ? \ ^~~ drivers/leds/led-core.c:472:30: note: '?' condition is false strscpy(led_classdev_name, to_of_node(fwnode)->name, ^ include/linux/of.h:164:3: note: expanded from macro 'to_of_node' is_of_node(__to_of_node_fwnode) ? \ ^ drivers/leds/led-core.c:472:30: note: Access to field 'name' results in a dereference of a null pointer strscpy(led_classdev_name, to_of_node(fwnode)->name,