[hch-misc:dma-bypass.3 1/5] drivers/firmware/qcom_scm.c:829:13: error: implicit declaration of function 'dma_to_phys'; did you mean 'idmap_to_phys'?
by kbuild test robot
tree: git://git.infradead.org/users/hch/misc.git dma-bypass.3
head: e36a07612143eb7d46684c60596e13359d7dec83
commit: b4f328e819b538d013db8dfe53f75177e1c408b4 [1/5] firmware: qcom_scm: don't include dma-direct.h
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-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
git checkout b4f328e819b538d013db8dfe53f75177e1c408b4
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/firmware/qcom_scm.c: In function 'qcom_scm_assign_mem':
>> drivers/firmware/qcom_scm.c:829:13: error: implicit declaration of function 'dma_to_phys'; did you mean 'idmap_to_phys'? [-Werror=implicit-function-declaration]
829 | ptr_phys = dma_to_phys(__scm->dev, ptr_dma);
| ^~~~~~~~~~~
| idmap_to_phys
cc1: some warnings being treated as errors
vim +829 drivers/firmware/qcom_scm.c
57d3b816718c1c Elliot Berman 2020-01-07 786
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 787 /**
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 788 * qcom_scm_assign_mem() - Make a secure call to reassign memory ownership
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 789 * @mem_addr: mem region whose ownership need to be reassigned
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 790 * @mem_sz: size of the region.
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 791 * @srcvm: vmid for current set of owners, each set bit in
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 792 * flag indicate a unique owner
c8b08fc0d6f834 Stephen Boyd 2019-05-17 793 * @newvm: array having new owners and corresponding permission
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 794 * flags
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 795 * @dest_cnt: number of owners in next set.
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 796 *
c8b08fc0d6f834 Stephen Boyd 2019-05-17 797 * Return negative errno on failure or 0 on success with @srcvm updated.
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 798 */
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 799 int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 800 unsigned int *srcvm,
af311ff9a69189 Stephen Boyd 2019-05-17 801 const struct qcom_scm_vmperm *newvm,
af311ff9a69189 Stephen Boyd 2019-05-17 802 unsigned int dest_cnt)
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 803 {
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 804 struct qcom_scm_current_perm_info *destvm;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 805 struct qcom_scm_mem_map_info *mem_to_map;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 806 phys_addr_t mem_to_map_phys;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 807 phys_addr_t dest_phys;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 808 phys_addr_t ptr_phys;
6e37ccf78a5329 Stephen Boyd 2019-05-17 809 dma_addr_t ptr_dma;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 810 size_t mem_to_map_sz;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 811 size_t dest_sz;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 812 size_t src_sz;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 813 size_t ptr_sz;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 814 int next_vm;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 815 __le32 *src;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 816 void *ptr;
af311ff9a69189 Stephen Boyd 2019-05-17 817 int ret, i, b;
af311ff9a69189 Stephen Boyd 2019-05-17 818 unsigned long srcvm_bits = *srcvm;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 819
af311ff9a69189 Stephen Boyd 2019-05-17 820 src_sz = hweight_long(srcvm_bits) * sizeof(*src);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 821 mem_to_map_sz = sizeof(*mem_to_map);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 822 dest_sz = dest_cnt * sizeof(*destvm);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 823 ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) +
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 824 ALIGN(dest_sz, SZ_64);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 825
6e37ccf78a5329 Stephen Boyd 2019-05-17 826 ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_dma, GFP_KERNEL);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 827 if (!ptr)
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 828 return -ENOMEM;
6e37ccf78a5329 Stephen Boyd 2019-05-17 @829 ptr_phys = dma_to_phys(__scm->dev, ptr_dma);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 830
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 831 /* Fill source vmid detail */
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 832 src = ptr;
af311ff9a69189 Stephen Boyd 2019-05-17 833 i = 0;
af311ff9a69189 Stephen Boyd 2019-05-17 834 for_each_set_bit(b, &srcvm_bits, BITS_PER_LONG)
af311ff9a69189 Stephen Boyd 2019-05-17 835 src[i++] = cpu_to_le32(b);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 836
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 837 /* Fill details of mem buff to map */
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 838 mem_to_map = ptr + ALIGN(src_sz, SZ_64);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 839 mem_to_map_phys = ptr_phys + ALIGN(src_sz, SZ_64);
af311ff9a69189 Stephen Boyd 2019-05-17 840 mem_to_map->mem_addr = cpu_to_le64(mem_addr);
af311ff9a69189 Stephen Boyd 2019-05-17 841 mem_to_map->mem_size = cpu_to_le64(mem_sz);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 842
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 843 next_vm = 0;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 844 /* Fill details of next vmid detail */
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 845 destvm = ptr + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 846 dest_phys = ptr_phys + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64);
af311ff9a69189 Stephen Boyd 2019-05-17 847 for (i = 0; i < dest_cnt; i++, destvm++, newvm++) {
af311ff9a69189 Stephen Boyd 2019-05-17 848 destvm->vmid = cpu_to_le32(newvm->vmid);
af311ff9a69189 Stephen Boyd 2019-05-17 849 destvm->perm = cpu_to_le32(newvm->perm);
af311ff9a69189 Stephen Boyd 2019-05-17 850 destvm->ctx = 0;
af311ff9a69189 Stephen Boyd 2019-05-17 851 destvm->ctx_size = 0;
af311ff9a69189 Stephen Boyd 2019-05-17 852 next_vm |= BIT(newvm->vmid);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 853 }
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 854
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 855 ret = __qcom_scm_assign_mem(__scm->dev, mem_to_map_phys, mem_to_map_sz,
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 856 ptr_phys, src_sz, dest_phys, dest_sz);
6e37ccf78a5329 Stephen Boyd 2019-05-17 857 dma_free_coherent(__scm->dev, ptr_sz, ptr, ptr_dma);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 858 if (ret) {
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 859 dev_err(__scm->dev,
c8b08fc0d6f834 Stephen Boyd 2019-05-17 860 "Assign memory protection call failed %d\n", ret);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 861 return -EINVAL;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 862 }
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 863
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 864 *srcvm = next_vm;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 865 return 0;
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 866 }
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 867 EXPORT_SYMBOL(qcom_scm_assign_mem);
d82bd359972a7f Avaneesh Kumar Dwivedi 2017-10-24 868
:::::: The code at line 829 was first introduced by commit
:::::: 6e37ccf78a53296c6c7bf426065762c27829eb84 firmware: qcom_scm: Use proper types for dma mappings
:::::: TO: Stephen Boyd <swboyd(a)chromium.org>
:::::: CC: Bjorn Andersson <bjorn.andersson(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
Re: [PATCH RFC v2 27/33] ice: add XDP frame size to driver
by kbuild test robot
Hi Jesper,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master linus/master next-20200409]
[cannot apply to jkirsher-next-queue/dev-queue v5.6]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jesper-Dangaard-Brouer/XDP-exten...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-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
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
drivers/net/ethernet/intel/ice/ice_txrx.c: In function 'ice_rx_frame_truesize':
>> drivers/net/ethernet/intel/ice/ice_txrx.c:439:2: error: expected ';' before 'return'
439 | return truesize;
| ^~~~~~
>> drivers/net/ethernet/intel/ice/ice_txrx.c:440:1: warning: no return statement in function returning non-void [-Wreturn-type]
440 | }
| ^
vim +439 drivers/net/ethernet/intel/ice/ice_txrx.c
425
426 static unsigned int ice_rx_frame_truesize(struct ice_ring *rx_ring,
427 unsigned int size)
428 {
429 unsigned int truesize;
430
431 #if (PAGE_SIZE < 8192)
432 truesize = ice_rx_pg_size(rx_ring) / 2; /* Must be power-of-2 */
433 #else
434 truesize = ice_rx_offset(rx_ring) ?
435 SKB_DATA_ALIGN(ice_rx_offset(rx_ring) + size) +
436 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) :
437 SKB_DATA_ALIGN(size)
438 #endif
> 439 return truesize;
> 440 }
441
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
[lee:android-3.18-preview 119/185] net/batman-adv/bat_iv_ogm.c:342 batadv_iv_ogm_iface_enable() error: double unlocked 'hard_iface->bat_iv.ogm_buff_mutex' (orig line 325)
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lee/linux.git android-3.18-preview
head: 50896cc052e256af7bc02e3202c5c2c3d3bebbee
commit: 8ce6294364ab0866e1a36598fc3a4ea8e9c216a0 [119/185] batman-adv: Avoid free/alloc race when handling OGM buffer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/batman-adv/bat_iv_ogm.c:342 batadv_iv_ogm_iface_enable() error: double unlocked 'hard_iface->bat_iv.ogm_buff_mutex' (orig line 325)
# https://git.kernel.org/pub/scm/linux/kernel/git/lee/linux.git/commit/?id=...
git remote add lee https://git.kernel.org/pub/scm/linux/kernel/git/lee/linux.git
git remote update lee
git checkout 8ce6294364ab0866e1a36598fc3a4ea8e9c216a0
vim +342 net/batman-adv/bat_iv_ogm.c
56303d34a332be Sven Eckelmann 2012-06-05 309 static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
d0b9fd89c2e446 Marek Lindner 2011-07-30 310 {
96412690116afc Sven Eckelmann 2012-06-05 311 struct batadv_ogm_packet *batadv_ogm_packet;
14511519d4b49a Marek Lindner 2012-08-02 312 unsigned char *ogm_buff;
d7d32ec0f199cc Marek Lindner 2012-02-07 313 uint32_t random_seqno;
5346c35ebfbdb1 Sven Eckelmann 2012-05-05 314 int res = -ENOMEM;
d7d32ec0f199cc Marek Lindner 2012-02-07 315
8ce6294364ab08 Sven Eckelmann 2020-03-18 316 mutex_lock(&hard_iface->bat_iv.ogm_buff_mutex);
8ce6294364ab08 Sven Eckelmann 2020-03-18 317
d7d32ec0f199cc Marek Lindner 2012-02-07 318 /* randomize initial seqno to avoid collision */
d7d32ec0f199cc Marek Lindner 2012-02-07 319 get_random_bytes(&random_seqno, sizeof(random_seqno));
14511519d4b49a Marek Lindner 2012-08-02 320 atomic_set(&hard_iface->bat_iv.ogm_seqno, random_seqno);
d0b9fd89c2e446 Marek Lindner 2011-07-30 321
14511519d4b49a Marek Lindner 2012-08-02 322 hard_iface->bat_iv.ogm_buff_len = BATADV_OGM_HLEN;
14511519d4b49a Marek Lindner 2012-08-02 323 ogm_buff = kmalloc(hard_iface->bat_iv.ogm_buff_len, GFP_ATOMIC);
8ce6294364ab08 Sven Eckelmann 2020-03-18 324 if (!ogm_buff) {
8ce6294364ab08 Sven Eckelmann 2020-03-18 @325 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unlock.
Btw, it would be nicer to move this allocation outsie of the lock. Also
we could move the get_random_bytes() out of the lock too.
77af7575c4b11c Marek Lindner 2012-02-07 326 goto out;
8ce6294364ab08 Sven Eckelmann 2020-03-18 327 }
77af7575c4b11c Marek Lindner 2012-02-07 328
14511519d4b49a Marek Lindner 2012-08-02 329 hard_iface->bat_iv.ogm_buff = ogm_buff;
14511519d4b49a Marek Lindner 2012-08-02 330
14511519d4b49a Marek Lindner 2012-08-02 331 batadv_ogm_packet = (struct batadv_ogm_packet *)ogm_buff;
a40d9b075c21f0 Simon Wunderlich 2013-12-02 332 batadv_ogm_packet->packet_type = BATADV_IV_OGM;
a40d9b075c21f0 Simon Wunderlich 2013-12-02 333 batadv_ogm_packet->version = BATADV_COMPAT_VERSION;
a40d9b075c21f0 Simon Wunderlich 2013-12-02 334 batadv_ogm_packet->ttl = 2;
96412690116afc Sven Eckelmann 2012-06-05 335 batadv_ogm_packet->flags = BATADV_NO_FLAGS;
414254e342a0d5 Marek Lindner 2013-04-23 336 batadv_ogm_packet->reserved = 0;
96412690116afc Sven Eckelmann 2012-06-05 337 batadv_ogm_packet->tq = BATADV_TQ_MAX_VALUE;
77af7575c4b11c Marek Lindner 2012-02-07 338
77af7575c4b11c Marek Lindner 2012-02-07 339 res = 0;
77af7575c4b11c Marek Lindner 2012-02-07 340
77af7575c4b11c Marek Lindner 2012-02-07 341 out:
8ce6294364ab08 Sven Eckelmann 2020-03-18 @342 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Double unlock.
8ce6294364ab08 Sven Eckelmann 2020-03-18 343
77af7575c4b11c Marek Lindner 2012-02-07 344 return res;
d0b9fd89c2e446 Marek Lindner 2011-07-30 345 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
[hch-misc:sanitize-vmalloc-api.2 5/32] kernel/dma/remap.c:32:22: error: 'count' undeclared; did you mean 'd_count'?
by kbuild test robot
tree: git://git.infradead.org/users/hch/misc.git sanitize-vmalloc-api.2
head: f44e0a9207268d44a9f106376661ed3c3f764564
commit: eab29baeeab828a08269b7260d4f02462ba99fe3 [5/32] dma-mapping: use vmap insted of reimplementing it
config: xtensa-randconfig-a001-20200414 (attached as .config)
compiler: xtensa-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
git checkout eab29baeeab828a08269b7260d4f02462ba99fe3
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/dma/remap.c: In function 'dma_common_pages_remap':
>> kernel/dma/remap.c:32:22: error: 'count' undeclared (first use in this function); did you mean 'd_count'?
32 | vaddr = vmap(pages, count, VM_DMA_COHERENT, prot);
| ^~~~~
| d_count
kernel/dma/remap.c:32:22: note: each undeclared identifier is reported only once for each function it appears in
vim +32 kernel/dma/remap.c
22
23 /*
24 * Remaps an array of PAGE_SIZE pages into another vm_area.
25 * Cannot be used in non-sleeping contexts
26 */
27 void *dma_common_pages_remap(struct page **pages, size_t size,
28 pgprot_t prot, const void *caller)
29 {
30 void *vaddr;
31
> 32 vaddr = vmap(pages, count, VM_DMA_COHERENT, prot);
33 if (vaddr)
34 find_vm_area(vaddr)->pages = pages;
35 return vaddr;
36 }
37
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
[f2fs-stable:linux-4.19.y 482/544] fs/f2fs/inode.c:303:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'blkcnt_t'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git linux-4.19.y
head: 3434bce292365a84f60c290ae808001a98c95968
commit: 0f87f20d0536ae21524ce1c25335aec991229114 [482/544] f2fs: fix to check i_compr_blocks correctly
config: i386-randconfig-a002-20200414 (attached as .config)
compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
reproduce:
git checkout 0f87f20d0536ae21524ce1c25335aec991229114
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
fs/f2fs/inode.c: In function 'sanity_check_inode':
>> fs/f2fs/inode.c:303:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'blkcnt_t' [-Wformat=]
f2fs_warn(sbi, "%s: inode (ino=%lx) has inconsistent "
^
vim +303 fs/f2fs/inode.c
198
199 static bool sanity_check_inode(struct inode *inode, struct page *node_page)
200 {
201 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
202 struct f2fs_inode_info *fi = F2FS_I(inode);
203 struct f2fs_inode *ri = F2FS_INODE(node_page);
204 unsigned long long iblocks;
205
206 iblocks = le64_to_cpu(F2FS_INODE(node_page)->i_blocks);
207 if (!iblocks) {
208 set_sbi_flag(sbi, SBI_NEED_FSCK);
209 f2fs_warn(sbi, "%s: corrupted inode i_blocks i_ino=%lx iblocks=%llu, run fsck to fix.",
210 __func__, inode->i_ino, iblocks);
211 return false;
212 }
213
214 if (ino_of_node(node_page) != nid_of_node(node_page)) {
215 set_sbi_flag(sbi, SBI_NEED_FSCK);
216 f2fs_warn(sbi, "%s: corrupted inode footer i_ino=%lx, ino,nid: [%u, %u] run fsck to fix.",
217 __func__, inode->i_ino,
218 ino_of_node(node_page), nid_of_node(node_page));
219 return false;
220 }
221
222 if (f2fs_sb_has_flexible_inline_xattr(sbi)
223 && !f2fs_has_extra_attr(inode)) {
224 set_sbi_flag(sbi, SBI_NEED_FSCK);
225 f2fs_warn(sbi, "%s: corrupted inode ino=%lx, run fsck to fix.",
226 __func__, inode->i_ino);
227 return false;
228 }
229
230 if (f2fs_has_extra_attr(inode) &&
231 !f2fs_sb_has_extra_attr(sbi)) {
232 set_sbi_flag(sbi, SBI_NEED_FSCK);
233 f2fs_warn(sbi, "%s: inode (ino=%lx) is with extra_attr, but extra_attr feature is off",
234 __func__, inode->i_ino);
235 return false;
236 }
237
238 if (fi->i_extra_isize > F2FS_TOTAL_EXTRA_ATTR_SIZE ||
239 fi->i_extra_isize % sizeof(__le32)) {
240 set_sbi_flag(sbi, SBI_NEED_FSCK);
241 f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_extra_isize: %d, max: %zu",
242 __func__, inode->i_ino, fi->i_extra_isize,
243 F2FS_TOTAL_EXTRA_ATTR_SIZE);
244 return false;
245 }
246
247 if (f2fs_has_extra_attr(inode) &&
248 f2fs_sb_has_flexible_inline_xattr(sbi) &&
249 f2fs_has_inline_xattr(inode) &&
250 (!fi->i_inline_xattr_size ||
251 fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) {
252 set_sbi_flag(sbi, SBI_NEED_FSCK);
253 f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, max: %zu",
254 __func__, inode->i_ino, fi->i_inline_xattr_size,
255 MAX_INLINE_XATTR_SIZE);
256 return false;
257 }
258
259 if (F2FS_I(inode)->extent_tree) {
260 struct extent_info *ei = &F2FS_I(inode)->extent_tree->largest;
261
262 if (ei->len &&
263 (!f2fs_is_valid_blkaddr(sbi, ei->blk,
264 DATA_GENERIC_ENHANCE) ||
265 !f2fs_is_valid_blkaddr(sbi, ei->blk + ei->len - 1,
266 DATA_GENERIC_ENHANCE))) {
267 set_sbi_flag(sbi, SBI_NEED_FSCK);
268 f2fs_warn(sbi, "%s: inode (ino=%lx) extent info [%u, %u, %u] is incorrect, run fsck to fix",
269 __func__, inode->i_ino,
270 ei->blk, ei->fofs, ei->len);
271 return false;
272 }
273 }
274
275 if (f2fs_has_inline_data(inode) &&
276 (!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode))) {
277 set_sbi_flag(sbi, SBI_NEED_FSCK);
278 f2fs_warn(sbi, "%s: inode (ino=%lx, mode=%u) should not have inline_data, run fsck to fix",
279 __func__, inode->i_ino, inode->i_mode);
280 return false;
281 }
282
283 if (f2fs_has_inline_dentry(inode) && !S_ISDIR(inode->i_mode)) {
284 set_sbi_flag(sbi, SBI_NEED_FSCK);
285 f2fs_warn(sbi, "%s: inode (ino=%lx, mode=%u) should not have inline_dentry, run fsck to fix",
286 __func__, inode->i_ino, inode->i_mode);
287 return false;
288 }
289
290 if (f2fs_has_extra_attr(inode) && f2fs_sb_has_compression(sbi) &&
291 fi->i_flags & F2FS_COMPR_FL &&
292 F2FS_FITS_IN_INODE(ri, fi->i_extra_isize,
293 i_log_cluster_size)) {
294 if (ri->i_compress_algorithm >= COMPRESS_MAX) {
295 f2fs_warn(sbi, "%s: inode (ino=%lx) has unsupported "
296 "compress algorithm: %u, run fsck to fix",
297 __func__, inode->i_ino,
298 ri->i_compress_algorithm);
299 return false;
300 }
301 if (le64_to_cpu(ri->i_compr_blocks) >
302 SECTOR_TO_BLOCK(inode->i_blocks)) {
> 303 f2fs_warn(sbi, "%s: inode (ino=%lx) has inconsistent "
304 "i_compr_blocks:%llu, i_blocks:%lu, run fsck to fix",
305 __func__, inode->i_ino,
306 le64_to_cpu(ri->i_compr_blocks),
307 SECTOR_TO_BLOCK(inode->i_blocks));
308 return false;
309 }
310 if (ri->i_log_cluster_size < MIN_COMPRESS_LOG_SIZE ||
311 ri->i_log_cluster_size > MAX_COMPRESS_LOG_SIZE) {
312 f2fs_warn(sbi, "%s: inode (ino=%lx) has unsupported "
313 "log cluster size: %u, run fsck to fix",
314 __func__, inode->i_ino,
315 ri->i_log_cluster_size);
316 return false;
317 }
318 }
319
320 return true;
321 }
322
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
[monstr-microblaze:for-test 396/1134] error: include/uapi/linux/xilinx-v4l2-events.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier
by kbuild test robot
tree: git://git.monstr.eu/linux-2.6-microblaze for-test
head: 21f70b89dfef52f69ce1413868950cf5baf3868d
commit: 79911b8f4de117478c53deda417ccddc3ea4ef59 [396/1134] v4l: xilinx: scd: Add v4l2 custom events
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project d5143e3f102a91599682fc630205e5c6fec58c76)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 79911b8f4de117478c53deda417ccddc3ea4ef59
# save the attached .config to linux build tree
COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x58): first defined here
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [scripts/Makefile.host:116: scripts/dtc/dtc] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1263: scripts_dtc] Error 2
>> error: include/uapi/linux/xilinx-v4l2-events.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier
make[2]: *** [scripts/Makefile.headersinst:66: usr/include/linux/xilinx-v4l2-events.h] Error 1
make[2]: Target '__headers' not remade because of errors.
make[1]: *** [Makefile:1195: headers] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:179: sub-make] Error 2
12 real 21 user 16 sys 312.80% cpu make prepare
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
Re: [PATCH net-next] net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode
by kbuild test robot
Hi DENG,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on net/master linus/master v5.7-rc1 next-20200413]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/DENG-Qingfang/net-dsa-mt7530-fix...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 7f80ccfe996871ca69648efee74a60ae7ad0dcd9
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/net/dsa/mt7530.c:23:
>> drivers/net/dsa/mt7530.h:181:29: error: expected ',' or '}' before ';' token
181 | MT7530_VLAN_EG_DISABLED = 0;
| ^
drivers/net/dsa/mt7530.c: In function 'mt7530_port_set_vlan_unaware':
>> drivers/net/dsa/mt7530.c:851:17: error: 'MT7530_VLAN_EG_CONSISTENT' undeclared (first use in this function); did you mean 'MT7530_VLAN_TRANSPARENT'?
851 | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mt7530.h:175:29: note: in definition of macro 'PVC_EG_TAG'
175 | #define PVC_EG_TAG(x) (((x) & 0x7) << 8)
| ^
drivers/net/dsa/mt7530.c:851:17: note: each undeclared identifier is reported only once for each function it appears in
851 | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mt7530.h:175:29: note: in definition of macro 'PVC_EG_TAG'
175 | #define PVC_EG_TAG(x) (((x) & 0x7) << 8)
| ^
drivers/net/dsa/mt7530.c: In function 'mt7530_setup':
drivers/net/dsa/mt7530.c:1388:18: error: 'MT7530_VLAN_EG_CONSISTENT' undeclared (first use in this function); did you mean 'MT7530_VLAN_TRANSPARENT'?
1388 | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mt7530.h:175:29: note: in definition of macro 'PVC_EG_TAG'
175 | #define PVC_EG_TAG(x) (((x) & 0x7) << 8)
| ^
vim +181 drivers/net/dsa/mt7530.h
179
180 enum mt7530_vlan_port_eg_tag {
> 181 MT7530_VLAN_EG_DISABLED = 0;
182 MT7530_VLAN_EG_CONSISTENT = 1;
183 };
184
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
Re: [PATCH] ext4: fix BUG_ON in fs/ext4/page_io.c:ext4_release_io_end()
by kbuild test robot
Hi Theodore,
I love your patch! Yet something to improve:
[auto build test ERROR on ext4/dev]
[also build test ERROR on v5.7-rc1 next-20200413]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Theodore-Ts-o/ext4-fix-BUG_ON-in...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: x86_64-defconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/export.h:43:0,
from include/linux/linkage.h:7,
from include/linux/fs.h:5,
from fs/ext4/page-io.c:10:
fs/ext4/page-io.c: In function 'ext4_release_io_end':
>> fs/ext4/page-io.c:158:57: error: 'ext4_io_end_t {aka struct ext4_io_end}' has no member named 'size'
BUG_ON((io_end->flag & EXT4_IO_END_UNWRITTEN) && io_end->size);
^
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
>> fs/ext4/page-io.c:158:2: note: in expansion of macro 'BUG_ON'
BUG_ON((io_end->flag & EXT4_IO_END_UNWRITTEN) && io_end->size);
^~~~~~
vim +158 fs/ext4/page-io.c
152
153 static void ext4_release_io_end(ext4_io_end_t *io_end)
154 {
155 struct bio *bio, *next_bio;
156
157 BUG_ON(!list_empty(&io_end->list));
> 158 BUG_ON((io_end->flag & EXT4_IO_END_UNWRITTEN) && io_end->size);
159 WARN_ON(io_end->handle);
160
161 for (bio = io_end->bio; bio; bio = next_bio) {
162 next_bio = bio->bi_private;
163 ext4_finish_bio(bio);
164 bio_put(bio);
165 }
166 ext4_free_io_end_vec(io_end);
167 kmem_cache_free(io_end_cachep, io_end);
168 }
169
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months
[hch-misc:set_fs-sysctl 6/6] fs/proc/proc_sysctl.c:602:16: error: invalid storage class for function 'proc_sys_read'
by kbuild test robot
tree: git://git.infradead.org/users/hch/misc.git set_fs-sysctl
head: 862858db7419b3123f7b182ceb2026ef94efc2a5
commit: 862858db7419b3123f7b182ceb2026ef94efc2a5 [6/6] sysctl: pass kernel pointers to ->proc_handler
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-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
git checkout 862858db7419b3123f7b182ceb2026ef94efc2a5
# save the attached .config to linux build tree
GCC_VERSION=9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/proc/proc_sysctl.c: In function 'proc_sys_call_handler':
>> fs/proc/proc_sysctl.c:602:16: error: invalid storage class for function 'proc_sys_read'
602 | static ssize_t proc_sys_read(struct file *filp, char __user *buf,
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:602:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
602 | static ssize_t proc_sys_read(struct file *filp, char __user *buf,
| ^~~~~~
>> fs/proc/proc_sysctl.c:608:16: error: invalid storage class for function 'proc_sys_write'
608 | static ssize_t proc_sys_write(struct file *filp, const char __user *buf,
| ^~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:614:12: error: invalid storage class for function 'proc_sys_open'
614 | static int proc_sys_open(struct inode *inode, struct file *filp)
| ^~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:631:17: error: invalid storage class for function 'proc_sys_poll'
631 | static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
| ^~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:663:13: error: invalid storage class for function 'proc_sys_fill_cache'
663 | static bool proc_sys_fill_cache(struct file *file,
| ^~~~~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:712:13: error: invalid storage class for function 'proc_sys_link_fill_cache'
712 | static bool proc_sys_link_fill_cache(struct file *file,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:733:12: error: invalid storage class for function 'scan'
733 | static int scan(struct ctl_table_header *head, struct ctl_table *table,
| ^~~~
>> fs/proc/proc_sysctl.c:753:12: error: invalid storage class for function 'proc_sys_readdir'
753 | static int proc_sys_readdir(struct file *file, struct dir_context *ctx)
| ^~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:782:12: error: invalid storage class for function 'proc_sys_permission'
782 | static int proc_sys_permission(struct inode *inode, int mask)
| ^~~~~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:810:12: error: invalid storage class for function 'proc_sys_setattr'
810 | static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
| ^~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:827:12: error: invalid storage class for function 'proc_sys_getattr'
827 | static int proc_sys_getattr(const struct path *path, struct kstat *stat,
| ^~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:846:11: error: initializer element is not constant
846 | .open = proc_sys_open,
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:846:11: note: (near initialization for 'proc_sys_file_operations.open')
fs/proc/proc_sysctl.c:847:11: error: initializer element is not constant
847 | .poll = proc_sys_poll,
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:847:11: note: (near initialization for 'proc_sys_file_operations.poll')
fs/proc/proc_sysctl.c:848:11: error: initializer element is not constant
848 | .read = proc_sys_read,
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:848:11: note: (near initialization for 'proc_sys_file_operations.read')
fs/proc/proc_sysctl.c:849:12: error: initializer element is not constant
849 | .write = proc_sys_write,
| ^~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:849:12: note: (near initialization for 'proc_sys_file_operations.write')
fs/proc/proc_sysctl.c:855:20: error: initializer element is not constant
855 | .iterate_shared = proc_sys_readdir,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:855:20: note: (near initialization for 'proc_sys_dir_file_operations.iterate_shared')
fs/proc/proc_sysctl.c:860:16: error: initializer element is not constant
860 | .permission = proc_sys_permission,
| ^~~~~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:860:16: note: (near initialization for 'proc_sys_inode_operations.permission')
fs/proc/proc_sysctl.c:861:13: error: initializer element is not constant
861 | .setattr = proc_sys_setattr,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:861:13: note: (near initialization for 'proc_sys_inode_operations.setattr')
fs/proc/proc_sysctl.c:862:13: error: initializer element is not constant
862 | .getattr = proc_sys_getattr,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:862:13: note: (near initialization for 'proc_sys_inode_operations.getattr')
fs/proc/proc_sysctl.c:867:16: error: initializer element is not constant
867 | .permission = proc_sys_permission,
| ^~~~~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:867:16: note: (near initialization for 'proc_sys_dir_operations.permission')
fs/proc/proc_sysctl.c:868:13: error: initializer element is not constant
868 | .setattr = proc_sys_setattr,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:868:13: note: (near initialization for 'proc_sys_dir_operations.setattr')
fs/proc/proc_sysctl.c:869:13: error: initializer element is not constant
869 | .getattr = proc_sys_getattr,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:869:13: note: (near initialization for 'proc_sys_dir_operations.getattr')
>> fs/proc/proc_sysctl.c:872:12: error: invalid storage class for function 'proc_sys_revalidate'
872 | static int proc_sys_revalidate(struct dentry *dentry, unsigned int flags)
| ^~~~~~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:879:12: error: invalid storage class for function 'proc_sys_delete'
879 | static int proc_sys_delete(const struct dentry *dentry)
| ^~~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:884:12: error: invalid storage class for function 'sysctl_is_seen'
884 | static int sysctl_is_seen(struct ctl_table_header *p)
| ^~~~~~~~~~~~~~
>> fs/proc/proc_sysctl.c:899:12: error: invalid storage class for function 'proc_sys_compare'
899 | static int proc_sys_compare(const struct dentry *dentry,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:920:18: error: initializer element is not constant
920 | .d_revalidate = proc_sys_revalidate,
| ^~~~~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:920:18: note: (near initialization for 'proc_sys_dentry_operations.d_revalidate')
fs/proc/proc_sysctl.c:921:14: error: initializer element is not constant
921 | .d_delete = proc_sys_delete,
| ^~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:921:14: note: (near initialization for 'proc_sys_dentry_operations.d_delete')
fs/proc/proc_sysctl.c:922:15: error: initializer element is not constant
922 | .d_compare = proc_sys_compare,
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:922:15: note: (near initialization for 'proc_sys_dentry_operations.d_compare')
>> fs/proc/proc_sysctl.c:925:24: error: invalid storage class for function 'find_subdir'
925 | static struct ctl_dir *find_subdir(struct ctl_dir *dir,
| ^~~~~~~~~~~
>> fs/proc/proc_sysctl.c:939:24: error: invalid storage class for function 'new_dir'
939 | static struct ctl_dir *new_dir(struct ctl_table_set *set,
| ^~~~~~~
>> fs/proc/proc_sysctl.c:977:24: error: invalid storage class for function 'get_subdir'
977 | static struct ctl_dir *get_subdir(struct ctl_dir *dir,
| ^~~~~~~~~~
>> fs/proc/proc_sysctl.c:1027:24: error: invalid storage class for function 'xlate_dir'
1027 | static struct ctl_dir *xlate_dir(struct ctl_table_set *set, struct ctl_dir *dir)
| ^~~~~~~~~
fs/proc/proc_sysctl.c:1040:12: error: invalid storage class for function 'sysctl_follow_link'
1040 | static int sysctl_follow_link(struct ctl_table_header **phead,
| ^~~~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1074:12: error: invalid storage class for function 'sysctl_err'
1074 | static int sysctl_err(const char *path, struct ctl_table *table, char *fmt, ...)
| ^~~~~~~~~~
fs/proc/proc_sysctl.c:1090:12: error: invalid storage class for function 'sysctl_check_table_array'
1090 | static int sysctl_check_table_array(const char *path, struct ctl_table *table)
| ^~~~~~~~~~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1103:12: error: invalid storage class for function 'sysctl_check_table'
1103 | static int sysctl_check_table(const char *path, struct ctl_table *table)
| ^~~~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1137:33: error: invalid storage class for function 'new_links'
1137 | static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table,
| ^~~~~~~~~
fs/proc/proc_sysctl.c:1180:13: error: invalid storage class for function 'get_links'
1180 | static bool get_links(struct ctl_dir *dir,
| ^~~~~~~~~
fs/proc/proc_sysctl.c:1208:12: error: invalid storage class for function 'insert_links'
1208 | static int insert_links(struct ctl_table_header *head)
| ^~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from include/linux/list.h:9,
from include/linux/sysctl.h:25,
from fs/proc/proc_sysctl.c:6:
fs/proc/proc_sysctl.c:1373:15: error: non-static declaration of 'register_sysctl' follows static declaration
1373 | EXPORT_SYMBOL(register_sysctl);
| ^~~~~~~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
158 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1373:1: note: in expansion of macro 'EXPORT_SYMBOL'
1373 | EXPORT_SYMBOL(register_sysctl);
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1368:26: note: previous definition of 'register_sysctl' was here
1368 | struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table)
| ^~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from include/linux/list.h:9,
from include/linux/sysctl.h:25,
from fs/proc/proc_sysctl.c:6:
include/linux/export.h:67:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
67 | static const struct kernel_symbol __ksymtab_##sym \
| ^~~~~~
include/linux/export.h:108:2: note: in expansion of macro '__KSYMTAB_ENTRY'
108 | __KSYMTAB_ENTRY(sym, sec)
| ^~~~~~~~~~~~~~~
include/linux/export.h:147:39: note: in expansion of macro '___EXPORT_SYMBOL'
147 | #define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
| ^~~~~~~~~~~~~~~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
158 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1373:1: note: in expansion of macro 'EXPORT_SYMBOL'
1373 | EXPORT_SYMBOL(register_sysctl);
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1375:14: error: invalid storage class for function 'append_path'
1375 | static char *append_path(const char *path, char *pos, const char *name)
| ^~~~~~~~~~~
fs/proc/proc_sysctl.c:1388:12: error: invalid storage class for function 'count_subheaders'
1388 | static int count_subheaders(struct ctl_table *table)
| ^~~~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1407:12: error: invalid storage class for function 'register_leaf_sysctl_tables'
1407 | static int register_leaf_sysctl_tables(const char *path, char *pos,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from include/linux/list.h:9,
from include/linux/sysctl.h:25,
from fs/proc/proc_sysctl.c:6:
fs/proc/proc_sysctl.c:1569:15: error: non-static declaration of 'register_sysctl_paths' follows static declaration
1569 | EXPORT_SYMBOL(register_sysctl_paths);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
98 | extern typeof(sym) sym; \
| ^~~
include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
| ^~~~~~~~~~~~~~~
include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
158 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
| ^~~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1569:1: note: in expansion of macro 'EXPORT_SYMBOL'
1569 | EXPORT_SYMBOL(register_sysctl_paths);
| ^~~~~~~~~~~~~
fs/proc/proc_sysctl.c:1563:26: note: previous definition of 'register_sysctl_paths' was here
1563 | struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
--
kernel/bpf/cgroup.c: In function '__cgroup_bpf_run_filter_sysctl':
>> kernel/bpf/cgroup.c:1173:64: error: 'pos' undeclared (first use in this function); did you mean 'ppos'?
1173 | if (table->proc_handler(table, 0, ctx.cur_val, &ctx.cur_len, &pos)) {
| ^~~
| ppos
kernel/bpf/cgroup.c:1173:64: note: each undeclared identifier is reported only once for each function it appears in
vim +/proc_sys_read +602 fs/proc/proc_sysctl.c
77b14db502cb85 Eric W. Biederman 2007-02-14 601
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 @602 static ssize_t proc_sys_read(struct file *filp, char __user *buf,
77b14db502cb85 Eric W. Biederman 2007-02-14 603 size_t count, loff_t *ppos)
77b14db502cb85 Eric W. Biederman 2007-02-14 604 {
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 605 return proc_sys_call_handler(filp, (void __user *)buf, count, ppos, 0);
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 606 }
77b14db502cb85 Eric W. Biederman 2007-02-14 607
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 @608 static ssize_t proc_sys_write(struct file *filp, const char __user *buf,
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 609 size_t count, loff_t *ppos)
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 610 {
7708bfb1c855f2 Pavel Emelyanov 2008-04-29 611 return proc_sys_call_handler(filp, (void __user *)buf, count, ppos, 1);
77b14db502cb85 Eric W. Biederman 2007-02-14 612 }
77b14db502cb85 Eric W. Biederman 2007-02-14 613
f1ecf06854a66e Lucas De Marchi 2011-11-02 @614 static int proc_sys_open(struct inode *inode, struct file *filp)
f1ecf06854a66e Lucas De Marchi 2011-11-02 615 {
4e474a00d7ff74 Lucas De Marchi 2012-03-22 616 struct ctl_table_header *head = grab_header(inode);
f1ecf06854a66e Lucas De Marchi 2011-11-02 617 struct ctl_table *table = PROC_I(inode)->sysctl_entry;
f1ecf06854a66e Lucas De Marchi 2011-11-02 618
4e474a00d7ff74 Lucas De Marchi 2012-03-22 619 /* sysctl was unregistered */
4e474a00d7ff74 Lucas De Marchi 2012-03-22 620 if (IS_ERR(head))
4e474a00d7ff74 Lucas De Marchi 2012-03-22 621 return PTR_ERR(head);
4e474a00d7ff74 Lucas De Marchi 2012-03-22 622
f1ecf06854a66e Lucas De Marchi 2011-11-02 623 if (table->poll)
f1ecf06854a66e Lucas De Marchi 2011-11-02 624 filp->private_data = proc_sys_poll_event(table->poll);
f1ecf06854a66e Lucas De Marchi 2011-11-02 625
4e474a00d7ff74 Lucas De Marchi 2012-03-22 626 sysctl_head_finish(head);
4e474a00d7ff74 Lucas De Marchi 2012-03-22 627
f1ecf06854a66e Lucas De Marchi 2011-11-02 628 return 0;
f1ecf06854a66e Lucas De Marchi 2011-11-02 629 }
f1ecf06854a66e Lucas De Marchi 2011-11-02 630
076ccb76e1a6cf Al Viro 2017-07-03 @631 static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
f1ecf06854a66e Lucas De Marchi 2011-11-02 632 {
496ad9aa8ef448 Al Viro 2013-01-23 633 struct inode *inode = file_inode(filp);
4e474a00d7ff74 Lucas De Marchi 2012-03-22 634 struct ctl_table_header *head = grab_header(inode);
f1ecf06854a66e Lucas De Marchi 2011-11-02 635 struct ctl_table *table = PROC_I(inode)->sysctl_entry;
076ccb76e1a6cf Al Viro 2017-07-03 636 __poll_t ret = DEFAULT_POLLMASK;
4e474a00d7ff74 Lucas De Marchi 2012-03-22 637 unsigned long event;
4e474a00d7ff74 Lucas De Marchi 2012-03-22 638
4e474a00d7ff74 Lucas De Marchi 2012-03-22 639 /* sysctl was unregistered */
4e474a00d7ff74 Lucas De Marchi 2012-03-22 640 if (IS_ERR(head))
a9a08845e9acbd Linus Torvalds 2018-02-11 641 return EPOLLERR | EPOLLHUP;
f1ecf06854a66e Lucas De Marchi 2011-11-02 642
f1ecf06854a66e Lucas De Marchi 2011-11-02 643 if (!table->proc_handler)
f1ecf06854a66e Lucas De Marchi 2011-11-02 644 goto out;
f1ecf06854a66e Lucas De Marchi 2011-11-02 645
f1ecf06854a66e Lucas De Marchi 2011-11-02 646 if (!table->poll)
f1ecf06854a66e Lucas De Marchi 2011-11-02 647 goto out;
f1ecf06854a66e Lucas De Marchi 2011-11-02 648
4e474a00d7ff74 Lucas De Marchi 2012-03-22 649 event = (unsigned long)filp->private_data;
f1ecf06854a66e Lucas De Marchi 2011-11-02 650 poll_wait(filp, &table->poll->wait, wait);
f1ecf06854a66e Lucas De Marchi 2011-11-02 651
f1ecf06854a66e Lucas De Marchi 2011-11-02 652 if (event != atomic_read(&table->poll->event)) {
f1ecf06854a66e Lucas De Marchi 2011-11-02 653 filp->private_data = proc_sys_poll_event(table->poll);
a9a08845e9acbd Linus Torvalds 2018-02-11 654 ret = EPOLLIN | EPOLLRDNORM | EPOLLERR | EPOLLPRI;
f1ecf06854a66e Lucas De Marchi 2011-11-02 655 }
f1ecf06854a66e Lucas De Marchi 2011-11-02 656
f1ecf06854a66e Lucas De Marchi 2011-11-02 657 out:
4e474a00d7ff74 Lucas De Marchi 2012-03-22 658 sysctl_head_finish(head);
4e474a00d7ff74 Lucas De Marchi 2012-03-22 659
f1ecf06854a66e Lucas De Marchi 2011-11-02 660 return ret;
f1ecf06854a66e Lucas De Marchi 2011-11-02 661 }
77b14db502cb85 Eric W. Biederman 2007-02-14 662
f0c3b5093addc8 Al Viro 2013-05-16 @663 static bool proc_sys_fill_cache(struct file *file,
f0c3b5093addc8 Al Viro 2013-05-16 664 struct dir_context *ctx,
9043476f726802 Al Viro 2008-07-15 665 struct ctl_table_header *head,
9043476f726802 Al Viro 2008-07-15 666 struct ctl_table *table)
77b14db502cb85 Eric W. Biederman 2007-02-14 667 {
f0c3b5093addc8 Al Viro 2013-05-16 668 struct dentry *child, *dir = file->f_path.dentry;
77b14db502cb85 Eric W. Biederman 2007-02-14 669 struct inode *inode;
77b14db502cb85 Eric W. Biederman 2007-02-14 670 struct qstr qname;
77b14db502cb85 Eric W. Biederman 2007-02-14 671 ino_t ino = 0;
77b14db502cb85 Eric W. Biederman 2007-02-14 672 unsigned type = DT_UNKNOWN;
77b14db502cb85 Eric W. Biederman 2007-02-14 673
77b14db502cb85 Eric W. Biederman 2007-02-14 674 qname.name = table->procname;
77b14db502cb85 Eric W. Biederman 2007-02-14 675 qname.len = strlen(table->procname);
8387ff2577eb9e Linus Torvalds 2016-06-10 676 qname.hash = full_name_hash(dir, qname.name, qname.len);
77b14db502cb85 Eric W. Biederman 2007-02-14 677
77b14db502cb85 Eric W. Biederman 2007-02-14 678 child = d_lookup(dir, &qname);
77b14db502cb85 Eric W. Biederman 2007-02-14 679 if (!child) {
76aab3ab61f305 Al Viro 2016-04-20 680 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
76aab3ab61f305 Al Viro 2016-04-20 681 child = d_alloc_parallel(dir, &qname, &wq);
76aab3ab61f305 Al Viro 2016-04-20 682 if (IS_ERR(child))
76aab3ab61f305 Al Viro 2016-04-20 683 return false;
76aab3ab61f305 Al Viro 2016-04-20 684 if (d_in_lookup(child)) {
888e2b03ef5669 Al Viro 2018-05-03 685 struct dentry *res;
9043476f726802 Al Viro 2008-07-15 686 inode = proc_sys_make_inode(dir->d_sb, head, table);
ea5751ccd665a2 Ivan Delalande 2018-12-13 687 if (IS_ERR(inode)) {
76aab3ab61f305 Al Viro 2016-04-20 688 d_lookup_done(child);
9043476f726802 Al Viro 2008-07-15 689 dput(child);
f0c3b5093addc8 Al Viro 2013-05-16 690 return false;
76aab3ab61f305 Al Viro 2016-04-20 691 }
fb045adb99d9b7 Nick Piggin 2011-01-07 692 d_set_d_op(child, &proc_sys_dentry_operations);
888e2b03ef5669 Al Viro 2018-05-03 693 res = d_splice_alias(inode, child);
888e2b03ef5669 Al Viro 2018-05-03 694 d_lookup_done(child);
888e2b03ef5669 Al Viro 2018-05-03 695 if (unlikely(res)) {
888e2b03ef5669 Al Viro 2018-05-03 696 if (IS_ERR(res)) {
888e2b03ef5669 Al Viro 2018-05-03 697 dput(child);
888e2b03ef5669 Al Viro 2018-05-03 698 return false;
888e2b03ef5669 Al Viro 2018-05-03 699 }
888e2b03ef5669 Al Viro 2018-05-03 700 dput(child);
888e2b03ef5669 Al Viro 2018-05-03 701 child = res;
888e2b03ef5669 Al Viro 2018-05-03 702 }
77b14db502cb85 Eric W. Biederman 2007-02-14 703 }
77b14db502cb85 Eric W. Biederman 2007-02-14 704 }
2b0143b5c986be David Howells 2015-03-17 705 inode = d_inode(child);
77b14db502cb85 Eric W. Biederman 2007-02-14 706 ino = inode->i_ino;
77b14db502cb85 Eric W. Biederman 2007-02-14 707 type = inode->i_mode >> 12;
77b14db502cb85 Eric W. Biederman 2007-02-14 708 dput(child);
f0c3b5093addc8 Al Viro 2013-05-16 709 return dir_emit(ctx, qname.name, qname.len, ino, type);
9043476f726802 Al Viro 2008-07-15 710 }
9043476f726802 Al Viro 2008-07-15 711
f0c3b5093addc8 Al Viro 2013-05-16 @712 static bool proc_sys_link_fill_cache(struct file *file,
f0c3b5093addc8 Al Viro 2013-05-16 713 struct dir_context *ctx,
0e47c99d7fe25e Eric W. Biederman 2012-01-07 714 struct ctl_table_header *head,
0e47c99d7fe25e Eric W. Biederman 2012-01-07 715 struct ctl_table *table)
0e47c99d7fe25e Eric W. Biederman 2012-01-07 716 {
f0c3b5093addc8 Al Viro 2013-05-16 717 bool ret = true;
a0b0d1c345d031 Danilo Krummrich 2018-04-10 718
0e47c99d7fe25e Eric W. Biederman 2012-01-07 719 head = sysctl_head_grab(head);
a0b0d1c345d031 Danilo Krummrich 2018-04-10 720 if (IS_ERR(head))
a0b0d1c345d031 Danilo Krummrich 2018-04-10 721 return false;
0e47c99d7fe25e Eric W. Biederman 2012-01-07 722
0e47c99d7fe25e Eric W. Biederman 2012-01-07 723 /* It is not an error if we can not follow the link ignore it */
835b94e05c92e6 Danilo Krummrich 2018-04-10 724 if (sysctl_follow_link(&head, &table))
0e47c99d7fe25e Eric W. Biederman 2012-01-07 725 goto out;
0e47c99d7fe25e Eric W. Biederman 2012-01-07 726
f0c3b5093addc8 Al Viro 2013-05-16 727 ret = proc_sys_fill_cache(file, ctx, head, table);
0e47c99d7fe25e Eric W. Biederman 2012-01-07 728 out:
0e47c99d7fe25e Eric W. Biederman 2012-01-07 729 sysctl_head_finish(head);
0e47c99d7fe25e Eric W. Biederman 2012-01-07 730 return ret;
0e47c99d7fe25e Eric W. Biederman 2012-01-07 731 }
0e47c99d7fe25e Eric W. Biederman 2012-01-07 732
e5eea0981a3840 Joe Perches 2014-08-08 @733 static int scan(struct ctl_table_header *head, struct ctl_table *table,
9043476f726802 Al Viro 2008-07-15 734 unsigned long *pos, struct file *file,
f0c3b5093addc8 Al Viro 2013-05-16 735 struct dir_context *ctx)
9043476f726802 Al Viro 2008-07-15 736 {
f0c3b5093addc8 Al Viro 2013-05-16 737 bool res;
9043476f726802 Al Viro 2008-07-15 738
f0c3b5093addc8 Al Viro 2013-05-16 739 if ((*pos)++ < ctx->pos)
f0c3b5093addc8 Al Viro 2013-05-16 740 return true;
9043476f726802 Al Viro 2008-07-15 741
0e47c99d7fe25e Eric W. Biederman 2012-01-07 742 if (unlikely(S_ISLNK(table->mode)))
f0c3b5093addc8 Al Viro 2013-05-16 743 res = proc_sys_link_fill_cache(file, ctx, head, table);
0e47c99d7fe25e Eric W. Biederman 2012-01-07 744 else
f0c3b5093addc8 Al Viro 2013-05-16 745 res = proc_sys_fill_cache(file, ctx, head, table);
9043476f726802 Al Viro 2008-07-15 746
f0c3b5093addc8 Al Viro 2013-05-16 747 if (res)
f0c3b5093addc8 Al Viro 2013-05-16 748 ctx->pos = *pos;
6a75ce167c53b4 Eric W. Biederman 2012-01-18 749
6a75ce167c53b4 Eric W. Biederman 2012-01-18 750 return res;
77b14db502cb85 Eric W. Biederman 2007-02-14 751 }
77b14db502cb85 Eric W. Biederman 2007-02-14 752
f0c3b5093addc8 Al Viro 2013-05-16 @753 static int proc_sys_readdir(struct file *file, struct dir_context *ctx)
77b14db502cb85 Eric W. Biederman 2007-02-14 754 {
f0c3b5093addc8 Al Viro 2013-05-16 755 struct ctl_table_header *head = grab_header(file_inode(file));
9043476f726802 Al Viro 2008-07-15 756 struct ctl_table_header *h = NULL;
6a75ce167c53b4 Eric W. Biederman 2012-01-18 757 struct ctl_table *entry;
7ec66d06362da7 Eric W. Biederman 2011-12-29 758 struct ctl_dir *ctl_dir;
77b14db502cb85 Eric W. Biederman 2007-02-14 759 unsigned long pos;
77b14db502cb85 Eric W. Biederman 2007-02-14 760
9043476f726802 Al Viro 2008-07-15 761 if (IS_ERR(head))
9043476f726802 Al Viro 2008-07-15 762 return PTR_ERR(head);
9043476f726802 Al Viro 2008-07-15 763
7ec66d06362da7 Eric W. Biederman 2011-12-29 764 ctl_dir = container_of(head, struct ctl_dir, header);
77b14db502cb85 Eric W. Biederman 2007-02-14 765
f0c3b5093addc8 Al Viro 2013-05-16 766 if (!dir_emit_dots(file, ctx))
93362fa47fe98b Zhou Chengming 2017-01-06 767 goto out;
f0c3b5093addc8 Al Viro 2013-05-16 768
77b14db502cb85 Eric W. Biederman 2007-02-14 769 pos = 2;
77b14db502cb85 Eric W. Biederman 2007-02-14 770
7ec66d06362da7 Eric W. Biederman 2011-12-29 771 for (first_entry(ctl_dir, &h, &entry); h; next_entry(&h, &entry)) {
f0c3b5093addc8 Al Viro 2013-05-16 772 if (!scan(h, entry, &pos, file, ctx)) {
9043476f726802 Al Viro 2008-07-15 773 sysctl_head_finish(h);
9043476f726802 Al Viro 2008-07-15 774 break;
77b14db502cb85 Eric W. Biederman 2007-02-14 775 }
77b14db502cb85 Eric W. Biederman 2007-02-14 776 }
93362fa47fe98b Zhou Chengming 2017-01-06 777 out:
77b14db502cb85 Eric W. Biederman 2007-02-14 778 sysctl_head_finish(head);
f0c3b5093addc8 Al Viro 2013-05-16 779 return 0;
77b14db502cb85 Eric W. Biederman 2007-02-14 780 }
77b14db502cb85 Eric W. Biederman 2007-02-14 781
10556cb21a0d0b Al Viro 2011-06-20 @782 static int proc_sys_permission(struct inode *inode, int mask)
77b14db502cb85 Eric W. Biederman 2007-02-14 783 {
77b14db502cb85 Eric W. Biederman 2007-02-14 784 /*
77b14db502cb85 Eric W. Biederman 2007-02-14 785 * sysctl entries that are not writeable,
77b14db502cb85 Eric W. Biederman 2007-02-14 786 * are _NOT_ writeable, capabilities or not.
77b14db502cb85 Eric W. Biederman 2007-02-14 787 */
f696a3659fc4b3 Miklos Szeredi 2008-07-31 788 struct ctl_table_header *head;
f696a3659fc4b3 Miklos Szeredi 2008-07-31 789 struct ctl_table *table;
77b14db502cb85 Eric W. Biederman 2007-02-14 790 int error;
77b14db502cb85 Eric W. Biederman 2007-02-14 791
f696a3659fc4b3 Miklos Szeredi 2008-07-31 792 /* Executable files are not allowed under /proc/sys/ */
f696a3659fc4b3 Miklos Szeredi 2008-07-31 793 if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode))
f696a3659fc4b3 Miklos Szeredi 2008-07-31 794 return -EACCES;
f696a3659fc4b3 Miklos Szeredi 2008-07-31 795
f696a3659fc4b3 Miklos Szeredi 2008-07-31 796 head = grab_header(inode);
9043476f726802 Al Viro 2008-07-15 797 if (IS_ERR(head))
9043476f726802 Al Viro 2008-07-15 798 return PTR_ERR(head);
77b14db502cb85 Eric W. Biederman 2007-02-14 799
f696a3659fc4b3 Miklos Szeredi 2008-07-31 800 table = PROC_I(inode)->sysctl_entry;
9043476f726802 Al Viro 2008-07-15 801 if (!table) /* global root - r-xr-xr-x */
9043476f726802 Al Viro 2008-07-15 802 error = mask & MAY_WRITE ? -EACCES : 0;
9043476f726802 Al Viro 2008-07-15 803 else /* Use the permissions on the sysctl table entry */
73f7ef435934e9 Eric W. Biederman 2012-11-16 804 error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK);
9043476f726802 Al Viro 2008-07-15 805
77b14db502cb85 Eric W. Biederman 2007-02-14 806 sysctl_head_finish(head);
77b14db502cb85 Eric W. Biederman 2007-02-14 807 return error;
77b14db502cb85 Eric W. Biederman 2007-02-14 808 }
77b14db502cb85 Eric W. Biederman 2007-02-14 809
:::::: The code at line 602 was first introduced by commit
:::::: 7708bfb1c855f2a076ef71cc21647deea022ebe7 sysctl: merge equal proc_sys_read and proc_sys_write
:::::: TO: Pavel Emelyanov <xemul(a)openvz.org>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 5 months