[jimc:dyn-drm-trc 17/19] lib/dynamic_debug.c:874:15: error: variable 'flags' set but not used
by kernel test robot
tree: https://github.com/jimc/linux.git dyn-drm-trc
head: df426d10840ccdda8ef29b66f8df55a010836a7c
commit: 8931711b03d17ea34bc44b6fa6c8b6296266b951 [17/19] dyndbg: issue trace-events from pr_debug, dev_dbg
config: riscv-randconfig-c006-20220213 (https://download.01.org/0day-ci/archive/20220213/202202132018.JLgM43hK-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 478c237e21b2c3a83e46f26fcbeb3876682f9b14)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/jimc/linux/commit/8931711b03d17ea34bc44b6fa6c8b6296266...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dyn-drm-trc
git checkout 8931711b03d17ea34bc44b6fa6c8b6296266b951
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash
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 >>):
>> lib/dynamic_debug.c:874:15: error: variable 'flags' set but not used [-Werror,-Wunused-but-set-variable]
unsigned int flags;
^
1 error generated.
vim +/flags +874 lib/dynamic_debug.c
0feefd97861f9b Jason Baron 2011-10-04 869
906d201530f2c5 Joe Perches 2014-09-24 870 void __dynamic_netdev_dbg(struct _ddebug *descriptor,
ffa10cb47a94c9 Jason Baron 2011-08-11 871 const struct net_device *dev, const char *fmt, ...)
ffa10cb47a94c9 Jason Baron 2011-08-11 872 {
ffa10cb47a94c9 Jason Baron 2011-08-11 873 struct va_format vaf;
55bd43faa7bd6f Jim Cromie 2021-11-22 @874 unsigned int flags;
ffa10cb47a94c9 Jason Baron 2011-08-11 875 va_list args;
ffa10cb47a94c9 Jason Baron 2011-08-11 876
ffa10cb47a94c9 Jason Baron 2011-08-11 877 BUG_ON(!descriptor);
ffa10cb47a94c9 Jason Baron 2011-08-11 878 BUG_ON(!fmt);
ffa10cb47a94c9 Jason Baron 2011-08-11 879
ffa10cb47a94c9 Jason Baron 2011-08-11 880 va_start(args, fmt);
b004ff4972e2a4 Joe Perches 2012-09-12 881
ffa10cb47a94c9 Jason Baron 2011-08-11 882 vaf.fmt = fmt;
ffa10cb47a94c9 Jason Baron 2011-08-11 883 vaf.va = &args;
55bd43faa7bd6f Jim Cromie 2021-11-22 884 flags = descriptor->flags;
b004ff4972e2a4 Joe Perches 2012-09-12 885
b004ff4972e2a4 Joe Perches 2012-09-12 886 if (dev && dev->dev.parent) {
640d1eaff2c09e Jim Cromie 2021-05-04 887 char buf[PREFIX_SIZE] = "";
b004ff4972e2a4 Joe Perches 2012-09-12 888
8931711b03d17e Jim Cromie 2021-12-01 889 ddebug_dev_printk(descriptor, dev->dev.parent,
ccc7f4968a18b9 Veaceslav Falico 2014-07-17 890 "%s%s %s %s%s: %pV",
b004ff4972e2a4 Joe Perches 2012-09-12 891 dynamic_emit_prefix(descriptor, buf),
b004ff4972e2a4 Joe Perches 2012-09-12 892 dev_driver_string(dev->dev.parent),
b004ff4972e2a4 Joe Perches 2012-09-12 893 dev_name(dev->dev.parent),
ccc7f4968a18b9 Veaceslav Falico 2014-07-17 894 netdev_name(dev), netdev_reg_state(dev),
ccc7f4968a18b9 Veaceslav Falico 2014-07-17 895 &vaf);
b004ff4972e2a4 Joe Perches 2012-09-12 896 } else if (dev) {
8931711b03d17e Jim Cromie 2021-12-01 897 ddebug_dev_printk(descriptor, &dev->dev, KERN_DEBUG "%s%s: %pV",
55bd43faa7bd6f Jim Cromie 2021-11-22 898 netdev_name(dev), netdev_reg_state(dev), &vaf);
b004ff4972e2a4 Joe Perches 2012-09-12 899 } else {
8931711b03d17e Jim Cromie 2021-12-01 900 ddebug_printk(descriptor, KERN_DEBUG "(NULL net_device): %pV", &vaf);
b004ff4972e2a4 Joe Perches 2012-09-12 901 }
b004ff4972e2a4 Joe Perches 2012-09-12 902
ffa10cb47a94c9 Jason Baron 2011-08-11 903 va_end(args);
ffa10cb47a94c9 Jason Baron 2011-08-11 904 }
ffa10cb47a94c9 Jason Baron 2011-08-11 905 EXPORT_SYMBOL(__dynamic_netdev_dbg);
ffa10cb47a94c9 Jason Baron 2011-08-11 906
:::::: The code at line 874 was first introduced by commit
:::::: 55bd43faa7bd6fe653d8b401414961a35bcd9151 dyndbg: add write-events-to-tracefs code
:::::: TO: Jim Cromie <jim.cromie(a)gmail.com>
:::::: CC: Jim Cromie <jim.cromie(a)gmail.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[jimc:dyn-drm-trc 16/19] lib/dynamic_debug.c:754:9: error: function 'ddebug_trace' might be a candidate for 'gnu_printf' format attribute
by kernel test robot
tree: https://github.com/jimc/linux.git dyn-drm-trc
head: df426d10840ccdda8ef29b66f8df55a010836a7c
commit: 55bd43faa7bd6fe653d8b401414961a35bcd9151 [16/19] dyndbg: add write-events-to-tracefs code
config: arc-randconfig-r015-20220213 (https://download.01.org/0day-ci/archive/20220213/202202132037.RtzRjiQe-lk...)
compiler: arc-elf-gcc (GCC) 11.2.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/jimc/linux/commit/55bd43faa7bd6fe653d8b401414961a35bcd...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dyn-drm-trc
git checkout 55bd43faa7bd6fe653d8b401414961a35bcd9151
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
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 >>):
lib/dynamic_debug.c: In function 'ddebug_trace':
>> lib/dynamic_debug.c:754:9: error: function 'ddebug_trace' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
754 | len = vscnprintf(buf->buf, sizeof(buf->buf), fmt, args);
| ^~~
cc1: all warnings being treated as errors
vim +754 lib/dynamic_debug.c
735
736 static void ddebug_trace(const char *fmt, va_list args)
737 {
738 struct ddebug_trace_buf *buf;
739 int bufidx;
740 int len;
741
742 preempt_disable_notrace();
743
744 bufidx = __this_cpu_inc_return(ddebug_trace_reserve) - 1;
745
746 if (WARN_ON_ONCE(bufidx > DYNAMIC_TRACE_NESTING))
747 goto out;
748
749 /* For the same reasons as in __ftrace_trace_stack(). */
750 barrier();
751
752 buf = this_cpu_ptr(ddebug_trace_bufs.bufs) + bufidx;
753
> 754 len = vscnprintf(buf->buf, sizeof(buf->buf), fmt, args);
755 trace_console(buf->buf, len);
756
757 out:
758 /* As above. */
759 barrier();
760 __this_cpu_dec(ddebug_trace_reserve);
761 preempt_enable_notrace();
762 }
763
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1148:33: error: variable 'priv' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b81b1829e7e39f6cebdf6e4d5484eacbceda8554
commit: de99e6479885dfa3f64a9511a6477c2b7899e53f Merge tag 'drm-msm-next-2021-10-26' of https://gitlab.freedesktop.org/drm/msm into drm-next
date: 4 months ago
config: parisc-randconfig-r015-20220213 (https://download.01.org/0day-ci/archive/20220213/202202132058.hSfn3UlB-lk...)
compiler: hppa-linux-gcc (GCC) 11.2.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 de99e6479885dfa3f64a9511a6477c2b7899e53f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash drivers/gpu/drm/msm/ drivers/misc/cardreader/ drivers/net/ethernet/broadcom/bnxt/ drivers/staging/vc04_services/ mm/
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 >>):
In file included from drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:17:
drivers/gpu/drm/msm/msm_drv.h:531: error: "COND" redefined [-Werror]
531 | #define COND(bool, val) ((bool) ? (val) : 0)
|
In file included from arch/parisc/include/asm/jump_label.h:8,
from include/linux/jump_label.h:117,
from include/linux/static_key.h:1,
from include/linux/kasan.h:7,
from include/linux/slab.h:136,
from include/linux/resource_ext.h:11,
from include/linux/acpi.h:14,
from include/linux/i2c.h:13,
from include/drm/drm_crtc.h:28,
from drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:13:
arch/parisc/include/asm/assembly.h:37: note: this is the location of the previous definition
37 | #define COND(x) x
|
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c: In function 'dpu_encoder_virt_enable':
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1148:33: error: variable 'priv' set but not used [-Werror=unused-but-set-variable]
1148 | struct msm_drm_private *priv;
| ^~~~
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c: In function 'dpu_encoder_virt_disable':
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1197:33: error: variable 'priv' set but not used [-Werror=unused-but-set-variable]
1197 | struct msm_drm_private *priv;
| ^~~~
cc1: all warnings being treated as errors
vim +/priv +1148 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1143
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1144 static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1145 {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1146 struct dpu_encoder_virt *dpu_enc = NULL;
86b89080368b46 Jeykumar Sankaran 2018-09-05 1147 int ret = 0;
c943b4948b5848 Chandan Uddaraju 2020-08-27 @1148 struct msm_drm_private *priv;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1149 struct drm_display_mode *cur_mode = NULL;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1150
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1151 if (!drm_enc) {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1152 DPU_ERROR("invalid encoder\n");
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1153 return;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1154 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1155 dpu_enc = to_dpu_encoder_virt(drm_enc);
fba7427eb59496 Sean Paul 2018-11-16 1156
fba7427eb59496 Sean Paul 2018-11-16 1157 mutex_lock(&dpu_enc->enc_lock);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1158 cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
c943b4948b5848 Chandan Uddaraju 2020-08-27 1159 priv = drm_enc->dev->dev_private;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1160
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1161 trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1162 cur_mode->vdisplay);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1163
86b89080368b46 Jeykumar Sankaran 2018-09-05 1164 /* always enable slave encoder before master */
86b89080368b46 Jeykumar Sankaran 2018-09-05 1165 if (dpu_enc->cur_slave && dpu_enc->cur_slave->ops.enable)
86b89080368b46 Jeykumar Sankaran 2018-09-05 1166 dpu_enc->cur_slave->ops.enable(dpu_enc->cur_slave);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1167
86b89080368b46 Jeykumar Sankaran 2018-09-05 1168 if (dpu_enc->cur_master && dpu_enc->cur_master->ops.enable)
86b89080368b46 Jeykumar Sankaran 2018-09-05 1169 dpu_enc->cur_master->ops.enable(dpu_enc->cur_master);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1170
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1171 ret = dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_KICKOFF);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1172 if (ret) {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1173 DPU_ERROR_ENC(dpu_enc, "dpu resource control failed: %d\n",
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1174 ret);
fba7427eb59496 Sean Paul 2018-11-16 1175 goto out;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1176 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1177
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1178 _dpu_encoder_virt_enable_helper(drm_enc);
fba7427eb59496 Sean Paul 2018-11-16 1179
167dac97eb46c7 Bjorn Andersson 2021-10-16 1180 if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS) {
167dac97eb46c7 Bjorn Andersson 2021-10-16 1181 ret = msm_dp_display_enable(dpu_enc->dp, drm_enc);
c943b4948b5848 Chandan Uddaraju 2020-08-27 1182 if (ret) {
c943b4948b5848 Chandan Uddaraju 2020-08-27 1183 DPU_ERROR_ENC(dpu_enc, "dp display enable failed: %d\n",
c943b4948b5848 Chandan Uddaraju 2020-08-27 1184 ret);
c943b4948b5848 Chandan Uddaraju 2020-08-27 1185 goto out;
c943b4948b5848 Chandan Uddaraju 2020-08-27 1186 }
c943b4948b5848 Chandan Uddaraju 2020-08-27 1187 }
fba7427eb59496 Sean Paul 2018-11-16 1188 dpu_enc->enabled = true;
fba7427eb59496 Sean Paul 2018-11-16 1189
fba7427eb59496 Sean Paul 2018-11-16 1190 out:
fba7427eb59496 Sean Paul 2018-11-16 1191 mutex_unlock(&dpu_enc->enc_lock);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1192 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 1193
:::::: The code at line 1148 was first introduced by commit
:::::: c943b4948b5848fc0e07f875edbd35a973879e22 drm/msm/dp: add displayPort driver support
:::::: TO: Chandan Uddaraju <chandanu(a)codeaurora.org>
:::::: CC: Rob Clark <robdclark(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
drivers/clk/bcm/clk-bcm2835.c:942:6: error: variable 'rem' set but not used
by kernel test robot
Hi Maxime,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b81b1829e7e39f6cebdf6e4d5484eacbceda8554
commit: 8ca011ef4af48a7af7b15afd8a4a44039dd04cea clk: bcm-2835: Remove rounding up the dividers
date: 4 months ago
config: arm-randconfig-r006-20220213 (https://download.01.org/0day-ci/archive/20220213/202202132034.ZltYqjTa-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 478c237e21b2c3a83e46f26fcbeb3876682f9b14)
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/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 8ca011ef4af48a7af7b15afd8a4a44039dd04cea
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/clk/bcm/
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 >>):
>> drivers/clk/bcm/clk-bcm2835.c:942:6: error: variable 'rem' set but not used [-Werror,-Wunused-but-set-variable]
u64 rem;
^
1 error generated.
vim +/rem +942 drivers/clk/bcm/clk-bcm2835.c
41691b8862e2a3 Eric Anholt 2015-10-08 932
41691b8862e2a3 Eric Anholt 2015-10-08 933 static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
41691b8862e2a3 Eric Anholt 2015-10-08 934 unsigned long rate,
8ca011ef4af48a Maxime Ripard 2021-09-22 935 unsigned long parent_rate)
41691b8862e2a3 Eric Anholt 2015-10-08 936 {
41691b8862e2a3 Eric Anholt 2015-10-08 937 struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
41691b8862e2a3 Eric Anholt 2015-10-08 938 const struct bcm2835_clock_data *data = clock->data;
9c95b32ca09364 Remi Pommarel 2015-12-06 939 u32 unused_frac_mask =
9c95b32ca09364 Remi Pommarel 2015-12-06 940 GENMASK(CM_DIV_FRAC_BITS - data->frac_bits, 0) >> 1;
41691b8862e2a3 Eric Anholt 2015-10-08 941 u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS;
9c95b32ca09364 Remi Pommarel 2015-12-06 @942 u64 rem;
959ca92a3235fc Martin Sperl 2016-02-29 943 u32 div, mindiv, maxdiv;
41691b8862e2a3 Eric Anholt 2015-10-08 944
9c95b32ca09364 Remi Pommarel 2015-12-06 945 rem = do_div(temp, rate);
41691b8862e2a3 Eric Anholt 2015-10-08 946 div = temp;
41691b8862e2a3 Eric Anholt 2015-10-08 947 div &= ~unused_frac_mask;
41691b8862e2a3 Eric Anholt 2015-10-08 948
959ca92a3235fc Martin Sperl 2016-02-29 949 /* different clamping limits apply for a mash clock */
959ca92a3235fc Martin Sperl 2016-02-29 950 if (data->is_mash_clock) {
959ca92a3235fc Martin Sperl 2016-02-29 951 /* clamp to min divider of 2 */
959ca92a3235fc Martin Sperl 2016-02-29 952 mindiv = 2 << CM_DIV_FRAC_BITS;
959ca92a3235fc Martin Sperl 2016-02-29 953 /* clamp to the highest possible integer divider */
959ca92a3235fc Martin Sperl 2016-02-29 954 maxdiv = (BIT(data->int_bits) - 1) << CM_DIV_FRAC_BITS;
959ca92a3235fc Martin Sperl 2016-02-29 955 } else {
997f16bd5d2e9b Martin Sperl 2016-02-29 956 /* clamp to min divider of 1 */
959ca92a3235fc Martin Sperl 2016-02-29 957 mindiv = 1 << CM_DIV_FRAC_BITS;
997f16bd5d2e9b Martin Sperl 2016-02-29 958 /* clamp to the highest possible fractional divider */
959ca92a3235fc Martin Sperl 2016-02-29 959 maxdiv = GENMASK(data->int_bits + CM_DIV_FRAC_BITS - 1,
959ca92a3235fc Martin Sperl 2016-02-29 960 CM_DIV_FRAC_BITS - data->frac_bits);
959ca92a3235fc Martin Sperl 2016-02-29 961 }
959ca92a3235fc Martin Sperl 2016-02-29 962
959ca92a3235fc Martin Sperl 2016-02-29 963 /* apply the clamping limits */
959ca92a3235fc Martin Sperl 2016-02-29 964 div = max_t(u32, div, mindiv);
959ca92a3235fc Martin Sperl 2016-02-29 965 div = min_t(u32, div, maxdiv);
41691b8862e2a3 Eric Anholt 2015-10-08 966
41691b8862e2a3 Eric Anholt 2015-10-08 967 return div;
41691b8862e2a3 Eric Anholt 2015-10-08 968 }
41691b8862e2a3 Eric Anholt 2015-10-08 969
:::::: The code at line 942 was first introduced by commit
:::::: 9c95b32ca09364e4687b72c4e17b78dc1c420026 clk: bcm2835: add a round up ability to the clock divisor
:::::: TO: Remi Pommarel <repk(a)triplefau.lt>
:::::: CC: Michael Turquette <mturquette(a)baylibre.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[linux-next:master 4586/5417] include/linux/fortify-string.h:336:4: error: call to __read_overflow2_field declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6d9bd4ad4ca08b1114e814c2c42383b8b13be631
commit: e9ebe9d15a978c03dbf5a1d091399d77b893a0bd [4586/5417] fortify: Add Clang support
config: arm-randconfig-c002-20220213 (https://download.01.org/0day-ci/archive/20220213/202202132020.DM0CzXLY-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 478c237e21b2c3a83e46f26fcbeb3876682f9b14)
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 e9ebe9d15a978c03dbf5a1d091399d77b893a0bd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/nfc/pn533/ drivers/scsi/libfc/
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 >>):
In file included from drivers/nfc/pn533/pn533.c:9:
In file included from include/linux/device.h:15:
In file included from include/linux/dev_printk.h:16:
In file included from include/linux/ratelimit.h:6:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:5:
In file included from include/linux/rculist.h:11:
In file included from include/linux/rcupdate.h:29:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:13:
In file included from include/linux/cpumask.h:12:
In file included from include/linux/bitmap.h:11:
In file included from include/linux/string.h:253:
>> include/linux/fortify-string.h:336:4: error: call to __read_overflow2_field declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
__read_overflow2_field(q_size_field, size);
^
>> include/linux/fortify-string.h:336:4: error: call to __read_overflow2_field declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
2 errors generated.
--
In file included from drivers/scsi/libfc/fc_elsct.c:17:
In file included from include/scsi/libfc.h:11:
In file included from include/linux/timer.h:8:
In file included from include/linux/debugobjects.h:6:
In file included from include/linux/spinlock.h:62:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:13:
In file included from include/linux/cpumask.h:12:
In file included from include/linux/bitmap.h:11:
In file included from include/linux/string.h:253:
>> include/linux/fortify-string.h:328:4: error: call to __write_overflow_field declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
__write_overflow_field(p_size_field, size);
^
>> include/linux/fortify-string.h:328:4: error: call to __write_overflow_field declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
2 errors generated.
vim +/warning +336 include/linux/fortify-string.h
45e31710b1ca2b Kees Cook 2021-06-16 267
45e31710b1ca2b Kees Cook 2021-06-16 268 /*
45e31710b1ca2b Kees Cook 2021-06-16 269 * __builtin_object_size() must be captured here to avoid evaluating argument
45e31710b1ca2b Kees Cook 2021-06-16 270 * side-effects further into the macro layers.
45e31710b1ca2b Kees Cook 2021-06-16 271 */
45e31710b1ca2b Kees Cook 2021-06-16 272 #define memset(p, c, s) __fortify_memset_chk(p, c, s, \
45e31710b1ca2b Kees Cook 2021-06-16 273 __builtin_object_size(p, 0), __builtin_object_size(p, 1))
a28a6e860c6cf2 Francis Laniel 2021-02-25 274
9b106a9037d705 Kees Cook 2021-04-20 275 /*
9b106a9037d705 Kees Cook 2021-04-20 276 * To make sure the compiler can enforce protection against buffer overflows,
9b106a9037d705 Kees Cook 2021-04-20 277 * memcpy(), memmove(), and memset() must not be used beyond individual
9b106a9037d705 Kees Cook 2021-04-20 278 * struct members. If you need to copy across multiple members, please use
9b106a9037d705 Kees Cook 2021-04-20 279 * struct_group() to create a named mirror of an anonymous struct union.
9b106a9037d705 Kees Cook 2021-04-20 280 * (e.g. see struct sk_buff.) Read overflow checking is currently only
9b106a9037d705 Kees Cook 2021-04-20 281 * done when a write overflow is also present, or when building with W=1.
9b106a9037d705 Kees Cook 2021-04-20 282 *
9b106a9037d705 Kees Cook 2021-04-20 283 * Mitigation coverage matrix
9b106a9037d705 Kees Cook 2021-04-20 284 * Bounds checking at:
9b106a9037d705 Kees Cook 2021-04-20 285 * +-------+-------+-------+-------+
9b106a9037d705 Kees Cook 2021-04-20 286 * | Compile time | Run time |
9b106a9037d705 Kees Cook 2021-04-20 287 * memcpy() argument sizes: | write | read | write | read |
9b106a9037d705 Kees Cook 2021-04-20 288 * dest source length +-------+-------+-------+-------+
9b106a9037d705 Kees Cook 2021-04-20 289 * memcpy(known, known, constant) | y | y | n/a | n/a |
9b106a9037d705 Kees Cook 2021-04-20 290 * memcpy(known, unknown, constant) | y | n | n/a | V |
9b106a9037d705 Kees Cook 2021-04-20 291 * memcpy(known, known, dynamic) | n | n | B | B |
9b106a9037d705 Kees Cook 2021-04-20 292 * memcpy(known, unknown, dynamic) | n | n | B | V |
9b106a9037d705 Kees Cook 2021-04-20 293 * memcpy(unknown, known, constant) | n | y | V | n/a |
9b106a9037d705 Kees Cook 2021-04-20 294 * memcpy(unknown, unknown, constant) | n | n | V | V |
9b106a9037d705 Kees Cook 2021-04-20 295 * memcpy(unknown, known, dynamic) | n | n | V | B |
9b106a9037d705 Kees Cook 2021-04-20 296 * memcpy(unknown, unknown, dynamic) | n | n | V | V |
9b106a9037d705 Kees Cook 2021-04-20 297 * +-------+-------+-------+-------+
9b106a9037d705 Kees Cook 2021-04-20 298 *
9b106a9037d705 Kees Cook 2021-04-20 299 * y = perform deterministic compile-time bounds checking
9b106a9037d705 Kees Cook 2021-04-20 300 * n = cannot perform deterministic compile-time bounds checking
9b106a9037d705 Kees Cook 2021-04-20 301 * n/a = no run-time bounds checking needed since compile-time deterministic
9b106a9037d705 Kees Cook 2021-04-20 302 * B = can perform run-time bounds checking (currently unimplemented)
9b106a9037d705 Kees Cook 2021-04-20 303 * V = vulnerable to run-time overflow (will need refactoring to solve)
9b106a9037d705 Kees Cook 2021-04-20 304 *
9b106a9037d705 Kees Cook 2021-04-20 305 */
9b106a9037d705 Kees Cook 2021-04-20 306 __FORTIFY_INLINE void fortify_memcpy_chk(__kernel_size_t size,
9b106a9037d705 Kees Cook 2021-04-20 307 const size_t p_size,
9b106a9037d705 Kees Cook 2021-04-20 308 const size_t q_size,
9b106a9037d705 Kees Cook 2021-04-20 309 const size_t p_size_field,
9b106a9037d705 Kees Cook 2021-04-20 310 const size_t q_size_field,
9b106a9037d705 Kees Cook 2021-04-20 311 const char *func)
a28a6e860c6cf2 Francis Laniel 2021-02-25 312 {
a28a6e860c6cf2 Francis Laniel 2021-02-25 313 if (__builtin_constant_p(size)) {
9b106a9037d705 Kees Cook 2021-04-20 314 /*
9b106a9037d705 Kees Cook 2021-04-20 315 * Length argument is a constant expression, so we
9b106a9037d705 Kees Cook 2021-04-20 316 * can perform compile-time bounds checking where
9b106a9037d705 Kees Cook 2021-04-20 317 * buffer sizes are known.
9b106a9037d705 Kees Cook 2021-04-20 318 */
9b106a9037d705 Kees Cook 2021-04-20 319
9b106a9037d705 Kees Cook 2021-04-20 320 /* Error when size is larger than enclosing struct. */
9b106a9037d705 Kees Cook 2021-04-20 321 if (p_size > p_size_field && p_size < size)
a28a6e860c6cf2 Francis Laniel 2021-02-25 322 __write_overflow();
9b106a9037d705 Kees Cook 2021-04-20 323 if (q_size > q_size_field && q_size < size)
a28a6e860c6cf2 Francis Laniel 2021-02-25 324 __read_overflow2();
9b106a9037d705 Kees Cook 2021-04-20 325
9b106a9037d705 Kees Cook 2021-04-20 326 /* Warn when write size argument larger than dest field. */
9b106a9037d705 Kees Cook 2021-04-20 327 if (p_size_field < size)
9b106a9037d705 Kees Cook 2021-04-20 @328 __write_overflow_field(p_size_field, size);
9b106a9037d705 Kees Cook 2021-04-20 329 /*
9b106a9037d705 Kees Cook 2021-04-20 330 * Warn for source field over-read when building with W=1
9b106a9037d705 Kees Cook 2021-04-20 331 * or when an over-write happened, so both can be fixed at
9b106a9037d705 Kees Cook 2021-04-20 332 * the same time.
9b106a9037d705 Kees Cook 2021-04-20 333 */
9b106a9037d705 Kees Cook 2021-04-20 334 if ((IS_ENABLED(KBUILD_EXTRA_WARN1) || p_size_field < size) &&
9b106a9037d705 Kees Cook 2021-04-20 335 q_size_field < size)
9b106a9037d705 Kees Cook 2021-04-20 @336 __read_overflow2_field(q_size_field, size);
a28a6e860c6cf2 Francis Laniel 2021-02-25 337 }
9b106a9037d705 Kees Cook 2021-04-20 338 /*
9b106a9037d705 Kees Cook 2021-04-20 339 * At this point, length argument may not be a constant expression,
9b106a9037d705 Kees Cook 2021-04-20 340 * so run-time bounds checking can be done where buffer sizes are
9b106a9037d705 Kees Cook 2021-04-20 341 * known. (This is not an "else" because the above checks may only
9b106a9037d705 Kees Cook 2021-04-20 342 * be compile-time warnings, and we want to still warn for run-time
9b106a9037d705 Kees Cook 2021-04-20 343 * overflows.)
9b106a9037d705 Kees Cook 2021-04-20 344 */
9b106a9037d705 Kees Cook 2021-04-20 345
9b106a9037d705 Kees Cook 2021-04-20 346 /*
9b106a9037d705 Kees Cook 2021-04-20 347 * Always stop accesses beyond the struct that contains the
9b106a9037d705 Kees Cook 2021-04-20 348 * field, when the buffer's remaining size is known.
9b106a9037d705 Kees Cook 2021-04-20 349 * (The -1 test is to optimize away checks where the buffer
9b106a9037d705 Kees Cook 2021-04-20 350 * lengths are unknown.)
9b106a9037d705 Kees Cook 2021-04-20 351 */
9b106a9037d705 Kees Cook 2021-04-20 352 if ((p_size != (size_t)(-1) && p_size < size) ||
9b106a9037d705 Kees Cook 2021-04-20 353 (q_size != (size_t)(-1) && q_size < size))
9b106a9037d705 Kees Cook 2021-04-20 354 fortify_panic(func);
a28a6e860c6cf2 Francis Laniel 2021-02-25 355 }
a28a6e860c6cf2 Francis Laniel 2021-02-25 356
:::::: The code at line 336 was first introduced by commit
:::::: 9b106a9037d705d0c5cbc747b6fed7cbb33b0e00 fortify: Detect struct member overflows in memcpy() at compile-time
:::::: TO: Kees Cook <keescook(a)chromium.org>
:::::: CC: Kees Cook <keescook(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[hnaz-mm:master 92/304] mm/page-writeback.c:93:28: error: 'dirty_bytes_min' defined but not used
by kernel test robot
tree: https://github.com/hnaz/linux-mm master
head: 31e523f69aa14a1f4ba298c63034d8dc62c4aae7
commit: d2d94dec619e0ab7f6805f3bc6e7932d71bfe765 [92/304] mm: move page-writeback sysctls to their own file
config: powerpc64-randconfig-s032-20220213 (https://download.01.org/0day-ci/archive/20220213/202202131948.o0qQogUI-lk...)
compiler: powerpc64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/hnaz/linux-mm/commit/d2d94dec619e0ab7f6805f3bc6e7932d7...
git remote add hnaz-mm https://github.com/hnaz/linux-mm
git fetch --no-tags hnaz-mm master
git checkout d2d94dec619e0ab7f6805f3bc6e7932d71bfe765
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash
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 >>):
mm/page-writeback.c:2002:12: error: 'dirty_writeback_centisecs_handler' defined but not used [-Werror=unused-function]
2002 | static int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:545:12: error: 'dirty_bytes_handler' defined but not used [-Werror=unused-function]
545 | static int dirty_bytes_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:531:12: error: 'dirty_ratio_handler' defined but not used [-Werror=unused-function]
531 | static int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
| ^~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:520:12: error: 'dirty_background_bytes_handler' defined but not used [-Werror=unused-function]
520 | static int dirty_background_bytes_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:509:12: error: 'dirty_background_ratio_handler' defined but not used [-Werror=unused-function]
509 | static int dirty_background_ratio_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> mm/page-writeback.c:93:28: error: 'dirty_bytes_min' defined but not used [-Werror=unused-const-variable=]
93 | static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/dirty_bytes_min +93 mm/page-writeback.c
91
92 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
> 93 static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
94
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH 1/4] bpf: Add pin_name into struct bpf_prog_aux
by kernel test robot
Hi Yafang,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bpf/master]
[also build test WARNING on net/master horms-ipvs/master net-next/master v5.17-rc3 next-20220211]
[cannot apply to bpf-next/master]
[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/Yafang-Shao/bpf-Add-more-informa...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git master
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220211/202202112213.WGiJCCYD-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.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/6cd35bc70f99caee380d84f5ba9256ac5...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yafang-Shao/bpf-Add-more-information-into-bpffs/20220211-201319
git checkout 6cd35bc70f99caee380d84f5ba9256ac5fe03860
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash kernel/bpf/
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 >>):
kernel/bpf/inode.c: In function 'bpf_obj_do_pin':
>> kernel/bpf/inode.c:469:24: warning: ignoring return value of 'strncpy_from_user' declared with attribute 'warn_unused_result' [-Wunused-result]
469 | (void) strncpy_from_user(aux->pin_name, pathname, BPF_PIN_NAME_LEN);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +469 kernel/bpf/inode.c
437
438 static int bpf_obj_do_pin(const char __user *pathname, void *raw,
439 enum bpf_type type)
440 {
441 struct bpf_prog_aux *aux;
442 struct bpf_prog *prog;
443 struct dentry *dentry;
444 struct inode *dir;
445 struct path path;
446 umode_t mode;
447 int ret;
448
449 dentry = user_path_create(AT_FDCWD, pathname, &path, 0);
450 if (IS_ERR(dentry))
451 return PTR_ERR(dentry);
452
453 mode = S_IFREG | ((S_IRUSR | S_IWUSR) & ~current_umask());
454
455 ret = security_path_mknod(&path, dentry, mode, 0);
456 if (ret)
457 goto out;
458
459 dir = d_inode(path.dentry);
460 if (dir->i_op != &bpf_dir_iops) {
461 ret = -EPERM;
462 goto out;
463 }
464
465 switch (type) {
466 case BPF_TYPE_PROG:
467 prog = raw;
468 aux = prog->aux;
> 469 (void) strncpy_from_user(aux->pin_name, pathname, BPF_PIN_NAME_LEN);
470 aux->pin_name[BPF_PIN_NAME_LEN - 1] = '\0';
471 ret = vfs_mkobj(dentry, mode, bpf_mkprog, raw);
472 break;
473 case BPF_TYPE_MAP:
474 ret = vfs_mkobj(dentry, mode, bpf_mkmap, raw);
475 break;
476 case BPF_TYPE_LINK:
477 ret = vfs_mkobj(dentry, mode, bpf_mklink, raw);
478 break;
479 default:
480 ret = -EPERM;
481 }
482 out:
483 done_path_create(&path, dentry);
484 return ret;
485 }
486
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week