Re: [PATCH v5 bpf-next 1/3] libbpf: BTF dumper support for typed data
by kernel test robot
Hi Alan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Alan-Maguire/libbpf-BTF-dumper-s...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
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/a0ac40961a89472fd36dcc5449e7a8e0e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alan-Maguire/libbpf-BTF-dumper-support-for-typed-data/20210619-165722
git checkout a0ac40961a89472fd36dcc5449e7a8e0e263d4c0
# 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 errors (new ones prefixed by >>):
btf_dump.c: In function 'btf_dump_type_data_check_zero':
>> btf_dump.c:2107:9: error: declaration of 'bit_sz' shadows a parameter [-Werror=shadow]
2107 | __u8 bit_sz;
| ^~~~~~
btf_dump.c:2024:12: note: shadowed declaration is here
2024 | __u8 bit_sz)
| ~~~~~^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [tools/build/Makefile.build:96: tools/bpf/resolve_btfids/libbpf/staticobjs/btf_dump.o] Error 1
make[4]: *** [Makefile:158: tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o] Error 2
make[3]: *** [Makefile:44: tools/bpf/resolve_btfids//libbpf/libbpf.a] Error 2
--
btf_dump.c: In function 'btf_dump_type_data_check_zero':
>> btf_dump.c:2107:9: error: declaration of 'bit_sz' shadows a parameter [-Werror=shadow]
2107 | __u8 bit_sz;
| ^~~~~~
btf_dump.c:2024:12: note: shadowed declaration is here
2024 | __u8 bit_sz)
| ~~~~~^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [tools/build/Makefile.build:96: tools/bpf/resolve_btfids/libbpf/staticobjs/btf_dump.o] Error 1
make[4]: *** [Makefile:158: tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o] Error 2
make[3]: *** [Makefile:44: tools/bpf/resolve_btfids//libbpf/libbpf.a] Error 2
make[2]: *** [Makefile:72: bpf/resolve_btfids] Error 2
make[1]: *** [Makefile:1965: tools/bpf/resolve_btfids] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:215: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
btf_dump.c: In function 'btf_dump_type_data_check_zero':
>> btf_dump.c:2107:9: error: declaration of 'bit_sz' shadows a parameter [-Werror=shadow]
2107 | __u8 bit_sz;
| ^~~~~~
btf_dump.c:2024:12: note: shadowed declaration is here
2024 | __u8 bit_sz)
| ~~~~~^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [tools/build/Makefile.build:96: tools/bpf/resolve_btfids/libbpf/staticobjs/btf_dump.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [Makefile:158: tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o] Error 2
make[3]: *** [Makefile:44: tools/bpf/resolve_btfids//libbpf/libbpf.a] Error 2
make[2]: *** [Makefile:72: bpf/resolve_btfids] Error 2
make[1]: *** [Makefile:1965: tools/bpf/resolve_btfids] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:215: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[kees:kspp/memcpy/next-20210618/v0 58/82] lib/string_helpers.c:883:6: warning: no previous prototype for function '__read_overflow2_field'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git kspp/memcpy/next-20210618/v0
head: fd2aa2a169de8bde9502e7a2fc48cd03d4bfd996
commit: 21405e341f4b8742f8c6d8b91ad39348d7cf970f [58/82] fortify: Detect struct member overflows in memcpy()
config: powerpc64-randconfig-r004-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d1baf2895467735ab14f4b3415fce204c0cc8e7f)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees kspp/memcpy/next-20210618/v0
git checkout 21405e341f4b8742f8c6d8b91ad39348d7cf970f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
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 >>):
>> lib/string_helpers.c:883:6: warning: no previous prototype for function '__read_overflow2_field' [-Wmissing-prototypes]
void __read_overflow2_field(void) { }
^
lib/string_helpers.c:883:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __read_overflow2_field(void) { }
^
static
>> lib/string_helpers.c:885:6: warning: no previous prototype for function '__write_overflow_field' [-Wmissing-prototypes]
void __write_overflow_field(void) { }
^
lib/string_helpers.c:885:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __write_overflow_field(void) { }
^
static
>> lib/string_helpers.c:889:6: warning: no previous prototype for function 'fortify_warn_write' [-Wmissing-prototypes]
void fortify_warn_write(const char *func, size_t buffer_size, size_t write_size)
^
lib/string_helpers.c:889:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void fortify_warn_write(const char *func, size_t buffer_size, size_t write_size)
^
static
lib/string_helpers.c:896:6: warning: no previous prototype for function 'fortify_panic' [-Wmissing-prototypes]
void fortify_panic(const char *name)
^
lib/string_helpers.c:896:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void fortify_panic(const char *name)
^
static
4 warnings generated.
vim +/__read_overflow2_field +883 lib/string_helpers.c
881
882 /* These are placeholders for fortify compile-time warnings. */
> 883 void __read_overflow2_field(void) { }
884 EXPORT_SYMBOL(__read_overflow2_field);
> 885 void __write_overflow_field(void) { }
886 EXPORT_SYMBOL(__write_overflow_field);
887
888 /* Run-time warnings */
> 889 void fortify_warn_write(const char *func, size_t buffer_size, size_t write_size)
890 {
891 WARN_ONCE(1, "%s: detected buffer (size %zu) overflowing write (size %zu)\n",
892 func, buffer_size, write_size);
893 }
894 EXPORT_SYMBOL(fortify_warn_write);
895
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[nbd168-wireless:mt76 10/100] drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1169:6: warning: variable 'stat' set but not used
by kernel test robot
tree: https://github.com/nbd168/wireless mt76
head: 61a1f99dd1e3c145fce9d601b52e7adb8f37322a
commit: 223fd4f843081059bc8f8d8ba6363bfcc2e5848f [10/100] mt76: mt7915: rework tx rate reporting
config: x86_64-randconfig-r033-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d1baf2895467735ab14f4b3415fce204c0cc8e7f)
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/nbd168/wireless/commit/223fd4f843081059bc8f8d8ba6363bf...
git remote add nbd168-wireless https://github.com/nbd168/wireless
git fetch --no-tags nbd168-wireless mt76
git checkout 223fd4f843081059bc8f8d8ba6363bfcc2e5848f
# 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/net/wireless/mediatek/mt76/mt7915/mac.c:1169:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
u8 stat;
^
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1257:21: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
struct mt7915_dev *dev;
^
2 warnings generated.
vim +/stat +1169 drivers/net/wireless/mediatek/mt76/mt7915/mac.c
e57b7901469fc0 Ryder Lee 2020-04-25 1139
338330bd26b1fe Felix Fietkau 2021-05-07 1140 static void
338330bd26b1fe Felix Fietkau 2021-05-07 1141 mt7915_mac_tx_free(struct mt7915_dev *dev, struct sk_buff *skb)
e57b7901469fc0 Ryder Lee 2020-04-25 1142 {
e57b7901469fc0 Ryder Lee 2020-04-25 1143 struct mt7915_tx_free *free = (struct mt7915_tx_free *)skb->data;
e57b7901469fc0 Ryder Lee 2020-04-25 1144 struct mt76_dev *mdev = &dev->mt76;
4c430774e01b06 Lorenzo Bianconi 2020-11-13 1145 struct mt76_phy *mphy_ext = mdev->phy2;
e57b7901469fc0 Ryder Lee 2020-04-25 1146 struct mt76_txwi_cache *txwi;
e57b7901469fc0 Ryder Lee 2020-04-25 1147 struct ieee80211_sta *sta = NULL;
660915d052c606 Felix Fietkau 2020-09-01 1148 LIST_HEAD(free_list);
660915d052c606 Felix Fietkau 2020-09-01 1149 struct sk_buff *tmp;
e57b7901469fc0 Ryder Lee 2020-04-25 1150 u8 i, count;
5342758d5522db Felix Fietkau 2020-11-21 1151 bool wake = false;
e57b7901469fc0 Ryder Lee 2020-04-25 1152
f8a667a9af9198 Felix Fietkau 2020-08-22 1153 /* clean DMA queues and unmap buffers first */
91990519298e23 Lorenzo Bianconi 2020-11-11 1154 mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_PSD], false);
91990519298e23 Lorenzo Bianconi 2020-11-11 1155 mt76_queue_tx_cleanup(dev, dev->mphy.q_tx[MT_TXQ_BE], false);
4c430774e01b06 Lorenzo Bianconi 2020-11-13 1156 if (mphy_ext) {
4c430774e01b06 Lorenzo Bianconi 2020-11-13 1157 mt76_queue_tx_cleanup(dev, mphy_ext->q_tx[MT_TXQ_PSD], false);
4c430774e01b06 Lorenzo Bianconi 2020-11-13 1158 mt76_queue_tx_cleanup(dev, mphy_ext->q_tx[MT_TXQ_BE], false);
4c430774e01b06 Lorenzo Bianconi 2020-11-13 1159 }
f8a667a9af9198 Felix Fietkau 2020-08-22 1160
e57b7901469fc0 Ryder Lee 2020-04-25 1161 /*
e57b7901469fc0 Ryder Lee 2020-04-25 1162 * TODO: MT_TX_FREE_LATENCY is msdu time from the TXD is queued into PLE,
e57b7901469fc0 Ryder Lee 2020-04-25 1163 * to the time ack is received or dropped by hw (air + hw queue time).
e57b7901469fc0 Ryder Lee 2020-04-25 1164 * Should avoid accessing WTBL to get Tx airtime, and use it instead.
e57b7901469fc0 Ryder Lee 2020-04-25 1165 */
e57b7901469fc0 Ryder Lee 2020-04-25 1166 count = FIELD_GET(MT_TX_FREE_MSDU_CNT, le16_to_cpu(free->ctrl));
e57b7901469fc0 Ryder Lee 2020-04-25 1167 for (i = 0; i < count; i++) {
e57b7901469fc0 Ryder Lee 2020-04-25 1168 u32 msdu, info = le32_to_cpu(free->info[i]);
e57b7901469fc0 Ryder Lee 2020-04-25 @1169 u8 stat;
e57b7901469fc0 Ryder Lee 2020-04-25 1170
e57b7901469fc0 Ryder Lee 2020-04-25 1171 /*
e57b7901469fc0 Ryder Lee 2020-04-25 1172 * 1'b1: new wcid pair.
e57b7901469fc0 Ryder Lee 2020-04-25 1173 * 1'b0: msdu_id with the same 'wcid pair' as above.
e57b7901469fc0 Ryder Lee 2020-04-25 1174 */
e57b7901469fc0 Ryder Lee 2020-04-25 1175 if (info & MT_TX_FREE_PAIR) {
e57b7901469fc0 Ryder Lee 2020-04-25 1176 struct mt7915_sta *msta;
1daf2522fa1604 Felix Fietkau 2020-07-26 1177 struct mt7915_phy *phy;
e57b7901469fc0 Ryder Lee 2020-04-25 1178 struct mt76_wcid *wcid;
e57b7901469fc0 Ryder Lee 2020-04-25 1179 u16 idx;
e57b7901469fc0 Ryder Lee 2020-04-25 1180
e57b7901469fc0 Ryder Lee 2020-04-25 1181 count++;
e57b7901469fc0 Ryder Lee 2020-04-25 1182 idx = FIELD_GET(MT_TX_FREE_WLAN_ID, info);
e57b7901469fc0 Ryder Lee 2020-04-25 1183 wcid = rcu_dereference(dev->mt76.wcid[idx]);
e57b7901469fc0 Ryder Lee 2020-04-25 1184 sta = wcid_to_sta(wcid);
e57b7901469fc0 Ryder Lee 2020-04-25 1185 if (!sta)
e57b7901469fc0 Ryder Lee 2020-04-25 1186 continue;
e57b7901469fc0 Ryder Lee 2020-04-25 1187
e57b7901469fc0 Ryder Lee 2020-04-25 1188 msta = container_of(wcid, struct mt7915_sta, wcid);
1daf2522fa1604 Felix Fietkau 2020-07-26 1189 phy = msta->vif->phy;
1daf2522fa1604 Felix Fietkau 2020-07-26 1190 spin_lock_bh(&dev->sta_poll_lock);
1daf2522fa1604 Felix Fietkau 2020-07-26 1191 if (list_empty(&msta->stats_list))
1daf2522fa1604 Felix Fietkau 2020-07-26 1192 list_add_tail(&msta->stats_list, &phy->stats_list);
1daf2522fa1604 Felix Fietkau 2020-07-26 1193 if (list_empty(&msta->poll_list))
1daf2522fa1604 Felix Fietkau 2020-07-26 1194 list_add_tail(&msta->poll_list, &dev->sta_poll_list);
1daf2522fa1604 Felix Fietkau 2020-07-26 1195 spin_unlock_bh(&dev->sta_poll_lock);
6425791d350301 Felix Fietkau 2020-09-27 1196 continue;
e57b7901469fc0 Ryder Lee 2020-04-25 1197 }
e57b7901469fc0 Ryder Lee 2020-04-25 1198
e57b7901469fc0 Ryder Lee 2020-04-25 1199 msdu = FIELD_GET(MT_TX_FREE_MSDU_ID, info);
e57b7901469fc0 Ryder Lee 2020-04-25 1200 stat = FIELD_GET(MT_TX_FREE_STATUS, info);
e57b7901469fc0 Ryder Lee 2020-04-25 1201
d089692bc7938a Lorenzo Bianconi 2021-04-20 1202 txwi = mt76_token_release(mdev, msdu, &wake);
e57b7901469fc0 Ryder Lee 2020-04-25 1203 if (!txwi)
e57b7901469fc0 Ryder Lee 2020-04-25 1204 continue;
e57b7901469fc0 Ryder Lee 2020-04-25 1205
223fd4f8430810 Felix Fietkau 2021-05-07 1206 mt7915_txwi_free(dev, txwi, sta, &free_list);
e57b7901469fc0 Ryder Lee 2020-04-25 1207 }
0f1c443ca9cfa0 Felix Fietkau 2020-08-20 1208
0f1c443ca9cfa0 Felix Fietkau 2020-08-20 1209 mt7915_mac_sta_poll(dev);
5342758d5522db Felix Fietkau 2020-11-21 1210
d089692bc7938a Lorenzo Bianconi 2021-04-20 1211 if (wake)
d089692bc7938a Lorenzo Bianconi 2021-04-20 1212 mt76_set_tx_blocked(&dev->mt76, false);
5342758d5522db Felix Fietkau 2020-11-21 1213
781eef5b34c57d Felix Fietkau 2020-07-24 1214 mt76_worker_schedule(&dev->mt76.tx_worker);
660915d052c606 Felix Fietkau 2020-09-01 1215
660915d052c606 Felix Fietkau 2020-09-01 1216 napi_consume_skb(skb, 1);
660915d052c606 Felix Fietkau 2020-09-01 1217
660915d052c606 Felix Fietkau 2020-09-01 1218 list_for_each_entry_safe(skb, tmp, &free_list, list) {
660915d052c606 Felix Fietkau 2020-09-01 1219 skb_list_del_init(skb);
660915d052c606 Felix Fietkau 2020-09-01 1220 napi_consume_skb(skb, 1);
660915d052c606 Felix Fietkau 2020-09-01 1221 }
e57b7901469fc0 Ryder Lee 2020-04-25 1222 }
e57b7901469fc0 Ryder Lee 2020-04-25 1223
338330bd26b1fe Felix Fietkau 2021-05-07 1224 void mt7915_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
338330bd26b1fe Felix Fietkau 2021-05-07 1225 struct sk_buff *skb)
338330bd26b1fe Felix Fietkau 2021-05-07 1226 {
338330bd26b1fe Felix Fietkau 2021-05-07 1227 struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
338330bd26b1fe Felix Fietkau 2021-05-07 1228 __le32 *rxd = (__le32 *)skb->data;
338330bd26b1fe Felix Fietkau 2021-05-07 1229 enum rx_pkt_type type;
338330bd26b1fe Felix Fietkau 2021-05-07 1230
338330bd26b1fe Felix Fietkau 2021-05-07 1231 type = FIELD_GET(MT_RXD0_PKT_TYPE, le32_to_cpu(rxd[0]));
338330bd26b1fe Felix Fietkau 2021-05-07 1232
338330bd26b1fe Felix Fietkau 2021-05-07 1233 switch (type) {
338330bd26b1fe Felix Fietkau 2021-05-07 1234 case PKT_TYPE_TXRX_NOTIFY:
338330bd26b1fe Felix Fietkau 2021-05-07 1235 mt7915_mac_tx_free(dev, skb);
338330bd26b1fe Felix Fietkau 2021-05-07 1236 break;
338330bd26b1fe Felix Fietkau 2021-05-07 1237 case PKT_TYPE_RX_EVENT:
338330bd26b1fe Felix Fietkau 2021-05-07 1238 mt7915_mcu_rx_event(dev, skb);
338330bd26b1fe Felix Fietkau 2021-05-07 1239 break;
338330bd26b1fe Felix Fietkau 2021-05-07 1240 case PKT_TYPE_TXRXV:
338330bd26b1fe Felix Fietkau 2021-05-07 1241 mt7915_mac_fill_rx_vector(dev, skb);
338330bd26b1fe Felix Fietkau 2021-05-07 1242 break;
338330bd26b1fe Felix Fietkau 2021-05-07 1243 case PKT_TYPE_NORMAL:
338330bd26b1fe Felix Fietkau 2021-05-07 1244 if (!mt7915_mac_fill_rx(dev, skb)) {
338330bd26b1fe Felix Fietkau 2021-05-07 1245 mt76_rx(&dev->mt76, q, skb);
338330bd26b1fe Felix Fietkau 2021-05-07 1246 return;
338330bd26b1fe Felix Fietkau 2021-05-07 1247 }
338330bd26b1fe Felix Fietkau 2021-05-07 1248 fallthrough;
338330bd26b1fe Felix Fietkau 2021-05-07 1249 default:
338330bd26b1fe Felix Fietkau 2021-05-07 1250 dev_kfree_skb(skb);
338330bd26b1fe Felix Fietkau 2021-05-07 1251 break;
338330bd26b1fe Felix Fietkau 2021-05-07 1252 }
338330bd26b1fe Felix Fietkau 2021-05-07 1253 }
338330bd26b1fe Felix Fietkau 2021-05-07 1254
d80e52c7b6c4d3 Felix Fietkau 2020-08-23 1255 void mt7915_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue_entry *e)
e57b7901469fc0 Ryder Lee 2020-04-25 1256 {
e57b7901469fc0 Ryder Lee 2020-04-25 @1257 struct mt7915_dev *dev;
e57b7901469fc0 Ryder Lee 2020-04-25 1258
e57b7901469fc0 Ryder Lee 2020-04-25 1259 if (!e->txwi) {
e57b7901469fc0 Ryder Lee 2020-04-25 1260 dev_kfree_skb_any(e->skb);
e57b7901469fc0 Ryder Lee 2020-04-25 1261 return;
e57b7901469fc0 Ryder Lee 2020-04-25 1262 }
e57b7901469fc0 Ryder Lee 2020-04-25 1263
e57b7901469fc0 Ryder Lee 2020-04-25 1264 dev = container_of(mdev, struct mt7915_dev, mt76);
e57b7901469fc0 Ryder Lee 2020-04-25 1265
e57b7901469fc0 Ryder Lee 2020-04-25 1266 /* error path */
e57b7901469fc0 Ryder Lee 2020-04-25 1267 if (e->skb == DMA_DUMMY_DATA) {
e57b7901469fc0 Ryder Lee 2020-04-25 1268 struct mt76_txwi_cache *t;
e57b7901469fc0 Ryder Lee 2020-04-25 1269 struct mt7915_txp *txp;
e57b7901469fc0 Ryder Lee 2020-04-25 1270
e57b7901469fc0 Ryder Lee 2020-04-25 1271 txp = mt7915_txwi_to_txp(mdev, e->txwi);
d089692bc7938a Lorenzo Bianconi 2021-04-20 1272 t = mt76_token_put(mdev, le16_to_cpu(txp->token));
e57b7901469fc0 Ryder Lee 2020-04-25 1273 e->skb = t ? t->skb : NULL;
e57b7901469fc0 Ryder Lee 2020-04-25 1274 }
e57b7901469fc0 Ryder Lee 2020-04-25 1275
223fd4f8430810 Felix Fietkau 2021-05-07 1276 if (e->skb)
223fd4f8430810 Felix Fietkau 2021-05-07 1277 mt76_tx_complete_skb(mdev, e->wcid, e->skb);
e57b7901469fc0 Ryder Lee 2020-04-25 1278 }
e57b7901469fc0 Ryder Lee 2020-04-25 1279
:::::: The code at line 1169 was first introduced by commit
:::::: e57b7901469fc0b021930b83a8094baaf3d81b09 mt76: add mac80211 driver for MT7915 PCIe-based chipsets
:::::: TO: Ryder Lee <ryder.lee(a)mediatek.com>
:::::: CC: Felix Fietkau <nbd(a)nbd.name>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[kees:kspp/memcpy/next-20210618/v0 57/82] lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git kspp/memcpy/next-20210618/v0
head: fd2aa2a169de8bde9502e7a2fc48cd03d4bfd996
commit: dd93fde9c4d11dfdf032f768a92ddc9c879fbc78 [57/82] fortify: Add compile-time FORTIFY_SOURCE tests
config: x86_64-randconfig-a002-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d1baf2895467735ab14f4b3415fce204c0cc8e7f)
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://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees kspp/memcpy/next-20210618/v0
git checkout dd93fde9c4d11dfdf032f768a92ddc9c879fbc78
# 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 error/warnings (new ones prefixed by >>):
warning: unsafe memmove() usage lacked '__read_overflow2' warning in lib/test_fortify/read_overflow2-memmove.c
In file included from lib/test_fortify/read_overflow2-memmove.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe memcmp() usage lacked '__read_overflow' warning in lib/test_fortify/read_overflow-memcmp.c
In file included from lib/test_fortify/read_overflow-memcmp.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
warning: unsafe memmove() usage lacked '__write_overflow' warning in lib/test_fortify/write_overflow-memmove.c
In file included from lib/test_fortify/write_overflow-memmove.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe memscan() usage lacked '__read_overflow' warning in lib/test_fortify/read_overflow-memscan.c
In file included from lib/test_fortify/read_overflow-memscan.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe memcmp() usage lacked '__read_overflow2' warning in lib/test_fortify/read_overflow2-memcmp.c
In file included from lib/test_fortify/read_overflow2-memcmp.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
warning: unsafe memcpy() usage lacked '__read_overflow2' warning in lib/test_fortify/read_overflow2-memcpy.c
In file included from lib/test_fortify/read_overflow2-memcpy.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe strscpy() usage lacked '__write_overflow' warning in lib/test_fortify/write_overflow-strscpy.c
In file included from lib/test_fortify/write_overflow-strscpy.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
warning: unsafe memcpy() usage lacked '__write_overflow' warning in lib/test_fortify/write_overflow-memcpy.c
In file included from lib/test_fortify/write_overflow-memcpy.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe memchr_inv() usage lacked '__read_overflow' warning in lib/test_fortify/read_overflow-memchr_inv.c
In file included from lib/test_fortify/read_overflow-memchr_inv.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe memchr() usage lacked '__read_overflow' warning in lib/test_fortify/read_overflow-memchr.c
In file included from lib/test_fortify/read_overflow-memchr.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
--
>> warning: unsafe strncpy() usage lacked '__write_overflow' warning in lib/test_fortify/write_overflow-strncpy.c
In file included from lib/test_fortify/write_overflow-strncpy.c:5:
>> lib/test_fortify/test_fortify.h:21:6: error: no previous prototype for function 'do_fortify_tests' [-Werror,-Wmissing-prototypes]
void do_fortify_tests(void)
^
lib/test_fortify/test_fortify.h:21:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void do_fortify_tests(void)
^
static
1 error generated.
..
vim +/do_fortify_tests +21 lib/test_fortify/test_fortify.h
20
> 21 void do_fortify_tests(void)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[uml:linux-next 13/19] arch/um/kernel/skas/uaccess.c:292:15: sparse: sparse: incorrect type in assignment (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git linux-next
head: 1aee020155f364ef538370d3392969f1077b9bae
commit: dd3035a21ba7ccaa883d7107d357ad06320d78fc [13/19] um: add a UML specific futex implementation
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git/commit/?id=dd3...
git remote add uml https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git
git fetch --no-tags uml linux-next
git checkout dd3035a21ba7ccaa883d7107d357ad06320d78fc
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=um SUBARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/um/kernel/skas/uaccess.c:292:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] [usertype] __user *uaddr @@ got unsigned int [usertype] * @@
arch/um/kernel/skas/uaccess.c:292:15: sparse: expected unsigned int [noderef] [usertype] __user *uaddr
arch/um/kernel/skas/uaccess.c:292:15: sparse: got unsigned int [usertype] *
>> arch/um/kernel/skas/uaccess.c:366:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] [usertype] __user *uaddr @@ got void * @@
arch/um/kernel/skas/uaccess.c:366:15: sparse: expected unsigned int [noderef] [usertype] __user *uaddr
arch/um/kernel/skas/uaccess.c:366:15: sparse: got void *
>> arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile *v @@ got unsigned int [noderef] [usertype] __user *__ai_ptr @@
arch/um/kernel/skas/uaccess.c:373:15: sparse: expected void const volatile *v
arch/um/kernel/skas/uaccess.c:373:15: sparse: got unsigned int [noderef] [usertype] __user *__ai_ptr
>> arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
>> arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
>> arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
>> arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
>> arch/um/kernel/skas/uaccess.c:293:19: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:299:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:302:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:305:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:308:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:311:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:371:18: sparse: sparse: dereference of noderef expression
vim +292 arch/um/kernel/skas/uaccess.c
252
253 /**
254 * arch_futex_atomic_op_inuser() - Atomic arithmetic operation with constant
255 * argument and comparison of the previous
256 * futex value with another constant.
257 *
258 * @encoded_op: encoded operation to execute
259 * @uaddr: pointer to user space address
260 *
261 * Return:
262 * 0 - On success
263 * -EFAULT - User access resulted in a page fault
264 * -EAGAIN - Atomic operation was unable to complete due to contention
265 * -ENOSYS - Operation not supported
266 */
267
268 int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr)
269 {
270 int oldval, ret;
271 struct page *page;
272 unsigned long addr = (unsigned long) uaddr;
273 pte_t *pte;
274
275 ret = -EFAULT;
276 if (!access_ok(uaddr, sizeof(*uaddr)))
277 return -EFAULT;
278 preempt_disable();
279 pte = maybe_map(addr, 1);
280 if (pte == NULL)
281 goto out_inuser;
282
283 page = pte_page(*pte);
284 #ifdef CONFIG_64BIT
285 pagefault_disable();
286 addr = (unsigned long) page_address(page) +
287 (((unsigned long) addr) & ~PAGE_MASK);
288 #else
289 addr = (unsigned long) kmap_atomic(page) +
290 ((unsigned long) addr & ~PAGE_MASK);
291 #endif
> 292 uaddr = (u32 *) addr;
> 293 oldval = *uaddr;
294
295 ret = 0;
296
297 switch (op) {
298 case FUTEX_OP_SET:
299 *uaddr = oparg;
300 break;
301 case FUTEX_OP_ADD:
302 *uaddr += oparg;
303 break;
304 case FUTEX_OP_OR:
305 *uaddr |= oparg;
306 break;
307 case FUTEX_OP_ANDN:
308 *uaddr &= ~oparg;
309 break;
310 case FUTEX_OP_XOR:
311 *uaddr ^= oparg;
312 break;
313 default:
314 ret = -ENOSYS;
315 }
316 #ifdef CONFIG_64BIT
317 pagefault_enable();
318 #else
319 kunmap_atomic((void *)addr);
320 #endif
321
322 out_inuser:
323 preempt_enable();
324
325 if (ret == 0)
326 *oval = oldval;
327
328 return ret;
329 }
330 EXPORT_SYMBOL(arch_futex_atomic_op_inuser);
331
332 /**
333 * futex_atomic_cmpxchg_inatomic() - Compare and exchange the content of the
334 * uaddr with newval if the current value is
335 * oldval.
336 * @uval: pointer to store content of @uaddr
337 * @uaddr: pointer to user space address
338 * @oldval: old value
339 * @newval: new value to store to @uaddr
340 *
341 * Return:
342 * 0 - On success
343 * -EFAULT - User access resulted in a page fault
344 * -EAGAIN - Atomic operation was unable to complete due to contention
345 * -ENOSYS - Function not implemented (only if !HAVE_FUTEX_CMPXCHG)
346 */
347
348 int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
349 u32 oldval, u32 newval)
350 {
351 struct page *page;
352 pte_t *pte;
353 int ret = -EFAULT;
354
355 if (!access_ok(uaddr, sizeof(*uaddr)))
356 return -EFAULT;
357
358 preempt_disable();
359 pte = maybe_map((unsigned long) uaddr, 1);
360 if (pte == NULL)
361 goto out_inatomic;
362
363 page = pte_page(*pte);
364 #ifdef CONFIG_64BIT
365 pagefault_disable();
> 366 uaddr = page_address(page) + (((unsigned long) uaddr) & ~PAGE_MASK);
367 #else
368 uaddr = kmap_atomic(page) + ((unsigned long) uaddr & ~PAGE_MASK);
369 #endif
370
371 *uval = *uaddr;
372
> 373 ret = cmpxchg(uaddr, oldval, newval);
374
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[kees:kspp/memcpy/next-20210618/v0 81/82] drivers/video/fbdev/i740fb.c:743:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git kspp/memcpy/next-20210618/v0
head: fd2aa2a169de8bde9502e7a2fc48cd03d4bfd996
commit: 6d805912063804ea975440760b79392fc0c03948 [81/82] fortify: Work around Clang inlining bugs
config: arm64-randconfig-s031-20210618 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.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.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees kspp/memcpy/next-20210618/v0
git checkout 6d805912063804ea975440760b79392fc0c03948
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/video/fbdev/i740fb.c:743:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *p @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/i740fb.c:743:9: sparse: expected void *p
drivers/video/fbdev/i740fb.c:743:9: sparse: got char [noderef] __iomem *screen_base
>> drivers/video/fbdev/i740fb.c:743:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/i740fb.c:743:9: sparse: expected void const *
drivers/video/fbdev/i740fb.c:743:9: sparse: got char [noderef] __iomem *screen_base
--
drivers/video/fbdev/atmel_lcdfb.c:354:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char [noderef] __iomem *screen_base @@ got void * @@
drivers/video/fbdev/atmel_lcdfb.c:354:27: sparse: expected char [noderef] __iomem *screen_base
drivers/video/fbdev/atmel_lcdfb.c:354:27: sparse: got void *
drivers/video/fbdev/atmel_lcdfb.c:362:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *p @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/atmel_lcdfb.c:362:9: sparse: expected void *p
drivers/video/fbdev/atmel_lcdfb.c:362:9: sparse: got char [noderef] __iomem *screen_base
>> drivers/video/fbdev/atmel_lcdfb.c:362:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/atmel_lcdfb.c:362:9: sparse: expected void const *
drivers/video/fbdev/atmel_lcdfb.c:362:9: sparse: got char [noderef] __iomem *screen_base
drivers/video/fbdev/atmel_lcdfb.c:333:59: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *cpu_addr @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/atmel_lcdfb.c:333:59: sparse: expected void *cpu_addr
drivers/video/fbdev/atmel_lcdfb.c:333:59: sparse: got char [noderef] __iomem *screen_base
drivers/video/fbdev/atmel_lcdfb.c:333:59: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *cpu_addr @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/atmel_lcdfb.c:333:59: sparse: expected void *cpu_addr
drivers/video/fbdev/atmel_lcdfb.c:333:59: sparse: got char [noderef] __iomem *screen_base
vim +743 drivers/video/fbdev/i740fb.c
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 732
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 733 static int i740fb_set_par(struct fb_info *info)
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 734 {
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 735 struct i740fb_par *par = info->par;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 736 u32 itemp;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 737 int i;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 738
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 739 i = i740fb_decode_var(&info->var, par, info);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 740 if (i)
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 741 return i;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 742
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 @743 memset(info->screen_base, 0, info->screen_size);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 744
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 745 vga_protect(par);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 746
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 747 i740outreg(par, XRX, DRAM_EXT_CNTL, DRAM_REFRESH_DISABLE);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 748
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 749 mdelay(1);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 750
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 751 i740outreg(par, XRX, VCLK2_VCO_M, par->video_clk2_m);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 752 i740outreg(par, XRX, VCLK2_VCO_N, par->video_clk2_n);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 753 i740outreg(par, XRX, VCLK2_VCO_MN_MSBS, par->video_clk2_mn_msbs);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 754 i740outreg(par, XRX, VCLK2_VCO_DIV_SEL, par->video_clk2_div_sel);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 755
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 756 i740outreg_mask(par, XRX, PIXPIPE_CONFIG_0,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 757 par->pixelpipe_cfg0 & DAC_8_BIT, 0x80);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 758
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 759 i740inb(par, 0x3DA);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 760 i740outb(par, 0x3C0, 0x00);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 761
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 762 /* update misc output register */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 763 i740outb(par, VGA_MIS_W, par->misc | 0x01);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 764
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 765 /* synchronous reset on */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 766 i740outreg(par, VGA_SEQ_I, VGA_SEQ_RESET, 0x01);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 767 /* write sequencer registers */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 768 i740outreg(par, VGA_SEQ_I, VGA_SEQ_CLOCK_MODE,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 769 par->seq[VGA_SEQ_CLOCK_MODE] | 0x20);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 770 for (i = 2; i < VGA_SEQ_C; i++)
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 771 i740outreg(par, VGA_SEQ_I, i, par->seq[i]);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 772
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 773 /* synchronous reset off */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 774 i740outreg(par, VGA_SEQ_I, VGA_SEQ_RESET, 0x03);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 775
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 776 /* deprotect CRT registers 0-7 */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 777 i740outreg(par, VGA_CRT_IC, VGA_CRTC_V_SYNC_END,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 778 par->crtc[VGA_CRTC_V_SYNC_END]);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 779
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 780 /* write CRT registers */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 781 for (i = 0; i < VGA_CRT_C; i++)
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 782 i740outreg(par, VGA_CRT_IC, i, par->crtc[i]);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 783
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 784 /* write graphics controller registers */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 785 for (i = 0; i < VGA_GFX_C; i++)
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 786 i740outreg(par, VGA_GFX_I, i, par->gdc[i]);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 787
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 788 /* write attribute controller registers */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 789 for (i = 0; i < VGA_ATT_C; i++) {
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 790 i740inb(par, VGA_IS1_RC); /* reset flip-flop */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 791 i740outb(par, VGA_ATT_IW, i);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 792 i740outb(par, VGA_ATT_IW, par->atc[i]);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 793 }
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 794
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 795 i740inb(par, VGA_IS1_RC);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 796 i740outb(par, VGA_ATT_IW, 0x20);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 797
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 798 i740outreg(par, VGA_CRT_IC, EXT_VERT_TOTAL, par->ext_vert_total);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 799 i740outreg(par, VGA_CRT_IC, EXT_VERT_DISPLAY, par->ext_vert_disp_end);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 800 i740outreg(par, VGA_CRT_IC, EXT_VERT_SYNC_START,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 801 par->ext_vert_sync_start);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 802 i740outreg(par, VGA_CRT_IC, EXT_VERT_BLANK_START,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 803 par->ext_vert_blank_start);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 804 i740outreg(par, VGA_CRT_IC, EXT_HORIZ_TOTAL, par->ext_horiz_total);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 805 i740outreg(par, VGA_CRT_IC, EXT_HORIZ_BLANK, par->ext_horiz_blank);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 806 i740outreg(par, VGA_CRT_IC, EXT_OFFSET, par->ext_offset);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 807 i740outreg(par, VGA_CRT_IC, EXT_START_ADDR_HI, par->ext_start_addr_hi);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 808 i740outreg(par, VGA_CRT_IC, EXT_START_ADDR, par->ext_start_addr);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 809
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 810 i740outreg_mask(par, VGA_CRT_IC, INTERLACE_CNTL,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 811 par->interlace_cntl, INTERLACE_ENABLE);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 812 i740outreg_mask(par, XRX, ADDRESS_MAPPING, par->address_mapping, 0x1F);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 813 i740outreg_mask(par, XRX, BITBLT_CNTL, par->bitblt_cntl, COLEXP_MODE);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 814 i740outreg_mask(par, XRX, DISPLAY_CNTL,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 815 par->display_cntl, VGA_WRAP_MODE | GUI_MODE);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 816 i740outreg_mask(par, XRX, PIXPIPE_CONFIG_0, par->pixelpipe_cfg0, 0x9B);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 817 i740outreg_mask(par, XRX, PIXPIPE_CONFIG_2, par->pixelpipe_cfg2, 0x0C);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 818
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 819 i740outreg(par, XRX, PLL_CNTL, par->pll_cntl);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 820
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 821 i740outreg_mask(par, XRX, PIXPIPE_CONFIG_1,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 822 par->pixelpipe_cfg1, DISPLAY_COLOR_MODE);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 823
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 824 itemp = readl(par->regs + FWATER_BLC);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 825 itemp &= ~(LMI_BURST_LENGTH | LMI_FIFO_WATERMARK);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 826 itemp |= par->lmi_fifo_watermark;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 827 writel(itemp, par->regs + FWATER_BLC);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 828
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 829 i740outreg(par, XRX, DRAM_EXT_CNTL, DRAM_REFRESH_60HZ);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 830
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 831 i740outreg_mask(par, MRX, COL_KEY_CNTL_1, 0, BLANK_DISP_OVERLAY);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 832 i740outreg_mask(par, XRX, IO_CTNL,
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 833 par->io_cntl, EXTENDED_ATTR_CNTL | EXTENDED_CRTC_CNTL);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 834
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 835 if (par->pixelpipe_cfg1 != DISPLAY_8BPP_MODE) {
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 836 i740outb(par, VGA_PEL_MSK, 0xFF);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 837 i740outb(par, VGA_PEL_IW, 0x00);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 838 for (i = 0; i < 256; i++) {
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 839 itemp = (par->pixelpipe_cfg0 & DAC_8_BIT) ? i : i >> 2;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 840 i740outb(par, VGA_PEL_D, itemp);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 841 i740outb(par, VGA_PEL_D, itemp);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 842 i740outb(par, VGA_PEL_D, itemp);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 843 }
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 844 }
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 845
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 846 /* Wait for screen to stabilize. */
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 847 mdelay(50);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 848 vga_unprotect(par);
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 849
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 850 info->fix.line_length =
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 851 info->var.xres_virtual * info->var.bits_per_pixel / 8;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 852 if (info->var.bits_per_pixel == 8)
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 853 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 854 else
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 855 info->fix.visual = FB_VISUAL_TRUECOLOR;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 856
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 857 return 0;
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 858 }
5350c65f4f15bb drivers/video/i740fb.c Ondrej Zary 2012-02-10 859
:::::: The code at line 743 was first introduced by commit
:::::: 5350c65f4f15bbc111ffa629130d3f32cdd4ccf6 Resurrect Intel740 driver: i740fb
:::::: TO: Ondrej Zary <linux(a)rainbow-software.org>
:::::: CC: Florian Tobias Schandinat <FlorianSchandinat(a)gmx.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[kees:kspp/memcpy/next-20210618/v0 58/82] include/linux/fortify-string.h:239:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git kspp/memcpy/next-20210618/v0
head: fd2aa2a169de8bde9502e7a2fc48cd03d4bfd996
commit: 21405e341f4b8742f8c6d8b91ad39348d7cf970f [58/82] fortify: Detect struct member overflows in memcpy()
config: i386-randconfig-r026-20210618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id...
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees kspp/memcpy/next-20210618/v0
git checkout 21405e341f4b8742f8c6d8b91ad39348d7cf970f
# save the attached .config to linux build tree
make W=1 ARCH=i386
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 include/linux/string.h:253,
from arch/x86/include/asm/page_32.h:35,
from arch/x86/include/asm/page.h:14,
from arch/x86/include/asm/thread_info.h:12,
from include/linux/thread_info.h:60,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/cifs/smb2pdu.c:31:
In function '__fortify_memcpy_chk',
inlined from '__fortify_memcpy' at include/linux/fortify-string.h:277:2,
inlined from 'SMB2_open' at fs/cifs/smb2pdu.c:2909:3:
include/linux/fortify-string.h:246:4: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
246 | __read_overflow2_field();
| ^~~~~~~~~~~~~~~~~~~~~~~~
In function '__fortify_memcpy_chk',
inlined from '__fortify_memcpy' at include/linux/fortify-string.h:277:2,
inlined from '__SMB2_close' at fs/cifs/smb2pdu.c:3262:4:
include/linux/fortify-string.h:246:4: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
246 | __read_overflow2_field();
| ^~~~~~~~~~~~~~~~~~~~~~~~
In function '__fortify_memcpy_chk',
inlined from '__fortify_memcpy' at include/linux/fortify-string.h:277:2,
inlined from 'posix_info_parse' at fs/cifs/smb2pdu.c:4555:3:
>> include/linux/fortify-string.h:239:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
239 | __write_overflow_field();
| ^~~~~~~~~~~~~~~~~~~~~~~~
In function '__fortify_memcpy_chk',
inlined from '__fortify_memcpy' at include/linux/fortify-string.h:277:2,
inlined from 'posix_info_parse' at fs/cifs/smb2pdu.c:4557:3:
>> include/linux/fortify-string.h:239:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
239 | __write_overflow_field();
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/__write_overflow_field +239 include/linux/fortify-string.h
189
190 /*
191 * To make sure the compiler can enforce protection against buffer overflows,
192 * memcpy(), memmove(), and memset() must not be used beyond individual
193 * struct members. If you need to copy across multiple members, please use
194 * struct_group() to create a named mirror of an anonymous struct union.
195 * (e.g. see struct sk_buff.)
196 *
197 * Mitigation coverage
198 * Bounds checking at:
199 * +-------+-------+-------+-------+
200 * | Compile time | Run time |
201 * memcpy() argument sizes: | write | read | write | read |
202 * +-------+-------+-------+-------+
203 * memcpy(known, known, constant) | y | y | n/a | n/a |
204 * memcpy(unknown, known, constant) | n | y | V | n/a |
205 * memcpy(known, unknown, constant) | y | n | n/a | V |
206 * memcpy(unknown, unknown, constant) | n | n | V | V |
207 * memcpy(known, known, dynamic) | n | n | b | B |
208 * memcpy(unknown, known, dynamic) | n | n | V | B |
209 * memcpy(known, unknown, dynamic) | n | n | b | V |
210 * memcpy(unknown, unknown, dynamic) | n | n | V | V |
211 * +-------+-------+-------+-------+
212 *
213 * y = deterministic compile-time bounds checking
214 * n = cannot do deterministic compile-time bounds checking
215 * n/a = no run-time bounds checking needed since compile-time deterministic
216 * b = perform run-time bounds checking
217 * B = can perform run-time bounds checking, but current unenforced
218 * V = vulnerable to run-time overflow
219 *
220 */
221 __FORTIFY_INLINE void __fortify_memcpy_chk(void *p, const void *q,
222 __kernel_size_t size,
223 const char *func)
224 {
225 size_t p_size = __builtin_object_size(p, 0);
226 size_t q_size = __builtin_object_size(q, 0);
227 size_t p_size_field = __builtin_object_size(p, 1);
228 size_t q_size_field = __builtin_object_size(q, 1);
229
230 if (__builtin_constant_p(size)) {
231 /*
232 * Length argument is a constant expression, so we
233 * can perform compile-time bounds checking where
234 * buffer sizes are known.
235 */
236
237 /* Warn when write size argument larger than dest field. */
238 if (p_size_field < size)
> 239 __write_overflow_field();
240 /*
241 * Warn for over-read under W=1 or when an over-write
242 * happened, so both can be fixed at the same time.
243 */
244 if ((IS_ENABLED(KBUILD_EXTRA_WARN1) || p_size_field < size) &&
245 q_size_field < size)
246 __read_overflow2_field();
247 } else {
248 /*
249 * Length argument is not a constant expression, so
250 * run-time bounds checking can happen where buffer
251 * sizes are known.
252 */
253
254 /* Warn when writing beyond destination field size. */
255 if (p_size != p_size_field && p_size_field < size)
256 fortify_warn_write(func, p_size_field, size);
257 /* Warn when reading beyond source field size. */
258 /*
259 if (q_size != q_size_field && q_size_field < size)
260 fortify_warn_read(func, q_size_field, size);
261 */
262
263 /*
264 * Always stop accesses beyond the struct that contains the
265 * field, when the buffer's remaining size is known.
266 */
267 if ((p_size != (size_t)(-1) && p_size < size) ||
268 (q_size != (size_t)(-1) && q_size < size))
269 fortify_panic(func);
270 }
271 }
272
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months