[arnd-playground:arm-kill-set_fs-5 6/40] include/linux/uaccess.h:366:32: error: initialization of 'const long unsigned int from incompatible pointer type 'u32 {aka 'unsigned int
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git arm-kill-set_fs-5
head: 1086c1cb895540fdf215aecf3ed4a96843d6633e
commit: 175180f99fef4558bae0c2fb337150706c4297ea [6/40] ARM: traps: use get_kernel_nofault instead of set_fs()
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 175180f99fef4558bae0c2fb337150706c4297ea
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
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 >>):
arch/arm/kernel/traps.c:82:6: warning: no previous prototype for 'dump_backtrace_stm' [-Wmissing-prototypes]
82 | void dump_backtrace_stm(u32 *stack, u32 instruction, const char *loglvl)
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:672,
from include/linux/kallsyms.h:12,
from arch/arm/kernel/traps.c:14:
arch/arm/kernel/traps.c: In function 'dump_mem':
>> include/linux/uaccess.h:366:32: error: initialization of 'const long unsigned int *' from incompatible pointer type 'u32 *' {aka 'unsigned int *'} [-Werror=incompatible-pointer-types]
366 | const typeof(val) *__gk_ptr = (ptr); \
| ^
arch/arm/kernel/traps.c:139:9: note: in expansion of macro 'get_kernel_nofault'
139 | if (get_kernel_nofault(val, (u32 *)p))
| ^~~~~~~~~~~~~~~~~~
arch/arm/kernel/traps.c: At top level:
arch/arm/kernel/traps.c:430:17: warning: no previous prototype for 'do_undefinstr' [-Wmissing-prototypes]
430 | asmlinkage void do_undefinstr(struct pt_regs *regs)
| ^~~~~~~~~~~~~
arch/arm/kernel/traps.c:495:39: warning: no previous prototype for 'handle_fiq_as_nmi' [-Wmissing-prototypes]
495 | asmlinkage void __exception_irq_entry handle_fiq_as_nmi(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~
arch/arm/kernel/traps.c:514:17: warning: no previous prototype for 'bad_mode' [-Wmissing-prototypes]
514 | asmlinkage void bad_mode(struct pt_regs *regs, int reason)
| ^~~~~~~~
arch/arm/kernel/traps.c:587:16: warning: no previous prototype for 'arm_syscall' [-Wmissing-prototypes]
587 | asmlinkage int arm_syscall(int no, struct pt_regs *regs)
| ^~~~~~~~~~~
arch/arm/kernel/traps.c:713:1: warning: no previous prototype for 'baddataabort' [-Wmissing-prototypes]
713 | baddataabort(int code, unsigned long instr, struct pt_regs *regs)
| ^~~~~~~~~~~~
arch/arm/kernel/traps.c:753:17: warning: no previous prototype for '__div0' [-Wmissing-prototypes]
753 | asmlinkage void __div0(void)
| ^~~~~~
arch/arm/kernel/traps.c:760:6: warning: no previous prototype for 'abort' [-Wmissing-prototypes]
760 | void abort(void)
| ^~~~~
arch/arm/kernel/traps.c:768:13: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]
768 | void __init trap_init(void)
| ^~~~~~~~~
cc1: some warnings being treated as errors
# https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commi...
git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground arm-kill-set_fs-5
git checkout 175180f99fef4558bae0c2fb337150706c4297ea
vim +366 include/linux/uaccess.h
1a6877b9c0c2ad9 Alexei Starovoitov 2015-08-28 357
0ab32b6f1b88444 Andrew Morton 2015-11-05 358 /**
25f12ae45fc1931 Christoph Hellwig 2020-06-17 359 * get_kernel_nofault(): safely attempt to read from a location
25f12ae45fc1931 Christoph Hellwig 2020-06-17 360 * @val: read into this variable
25f12ae45fc1931 Christoph Hellwig 2020-06-17 361 * @ptr: address to read from
0ab32b6f1b88444 Andrew Morton 2015-11-05 362 *
0ab32b6f1b88444 Andrew Morton 2015-11-05 363 * Returns 0 on success, or -EFAULT.
0ab32b6f1b88444 Andrew Morton 2015-11-05 364 */
0c389d89abc28ed Linus Torvalds 2020-06-18 365 #define get_kernel_nofault(val, ptr) ({ \
0c389d89abc28ed Linus Torvalds 2020-06-18 @366 const typeof(val) *__gk_ptr = (ptr); \
0c389d89abc28ed Linus Torvalds 2020-06-18 367 copy_from_kernel_nofault(&(val), __gk_ptr, sizeof(val));\
0c389d89abc28ed Linus Torvalds 2020-06-18 368 })
0ab32b6f1b88444 Andrew Morton 2015-11-05 369
:::::: The code at line 366 was first introduced by commit
:::::: 0c389d89abc28edf70ae847ee2fa55acb267b826 maccess: make get_kernel_nofault() check for minimal type compatibility
:::::: TO: Linus Torvalds <torvalds(a)linux-foundation.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
Re: [PATCH 2/2] exfat: aggregate dir-entry updates into __exfat_write_inode().
by kernel test robot
Hi Tetsuhiro,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc5 next-20200917]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Tetsuhiro-Kohada/exfat-add-exfat...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 10b82d5176488acee2820e5a2cf0f2ec5c3488b6
config: x86_64-randconfig-s022-20200917 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-201-g24bdaac6-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=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 >>)
>> fs/exfat/inode.c:78:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] start_clu @@ got unsigned int @@
>> fs/exfat/inode.c:78:38: sparse: expected restricted __le32 [usertype] start_clu
>> fs/exfat/inode.c:78:38: sparse: got unsigned int
# https://github.com/0day-ci/linux/commit/605a79d44870ed9f396b6d5289fd1cece...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tetsuhiro-Kohada/exfat-add-exfat_update_inode/20200918-103524
git checkout 605a79d44870ed9f396b6d5289fd1cecea3af8e3
vim +78 fs/exfat/inode.c
19
20 static int __exfat_write_inode(struct inode *inode, int sync)
21 {
22 unsigned long long filesize;
23 struct exfat_dentry *ep, *ep2;
24 struct exfat_entry_set_cache *es = NULL;
25 struct super_block *sb = inode->i_sb;
26 struct exfat_sb_info *sbi = EXFAT_SB(sb);
27 struct exfat_inode_info *ei = EXFAT_I(inode);
28 bool is_dir = (ei->type == TYPE_DIR) ? true : false;
29
30 if (inode->i_ino == EXFAT_ROOT_INO)
31 return 0;
32
33 /*
34 * If the indode is already unlinked, there is no need for updating it.
35 */
36 if (ei->dir.dir == DIR_DELETED)
37 return 0;
38
39 if (is_dir && ei->dir.dir == sbi->root_dir && ei->entry == -1)
40 return 0;
41
42 exfat_set_volume_dirty(sb);
43
44 /* get the directory entry of given file or directory */
45 es = exfat_get_dentry_set(sb, &(ei->dir), ei->entry, ES_ALL_ENTRIES);
46 if (!es)
47 return -EIO;
48 ep = exfat_get_dentry_cached(es, 0);
49 ep2 = exfat_get_dentry_cached(es, 1);
50
51 ep->dentry.file.attr = cpu_to_le16(exfat_make_attr(inode));
52
53 /* set FILE_INFO structure using the acquired struct exfat_dentry */
54 exfat_set_entry_time(sbi, &ei->i_crtime,
55 &ep->dentry.file.create_tz,
56 &ep->dentry.file.create_time,
57 &ep->dentry.file.create_date,
58 &ep->dentry.file.create_time_cs);
59 exfat_set_entry_time(sbi, &inode->i_mtime,
60 &ep->dentry.file.modify_tz,
61 &ep->dentry.file.modify_time,
62 &ep->dentry.file.modify_date,
63 &ep->dentry.file.modify_time_cs);
64 exfat_set_entry_time(sbi, &inode->i_atime,
65 &ep->dentry.file.access_tz,
66 &ep->dentry.file.access_time,
67 &ep->dentry.file.access_date,
68 NULL);
69
70 /* File size should be zero if there is no cluster allocated */
71 filesize = i_size_read(inode);
72 if (ei->start_clu == EXFAT_EOF_CLUSTER)
73 filesize = 0;
74
75 ep2->dentry.stream.valid_size = cpu_to_le64(filesize);
76 ep2->dentry.stream.size = ep2->dentry.stream.valid_size;
77 ep2->dentry.stream.flags = filesize ? ei->flags : ALLOC_FAT_CHAIN;
> 78 ep2->dentry.stream.start_clu = filesize ? ei->start_clu : EXFAT_FREE_CLUSTER;
79
80 exfat_update_dir_chksum_with_entry_set(es);
81 return exfat_free_dentry_set(es, sync);
82 }
83
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:633:12: error: no previous prototype for 'kvm_arch_post_init_vm'
by kernel test robot
Hi Junaid,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e5bd0d2afe7061562c483d301e4aabb51b13fcfa
commit: 1aa9b9572b10529c2e64e2b8f44025d86e124308 kvm: x86: mmu: Recovery of shattered NX large pages
date: 10 months ago
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 1aa9b9572b10529c2e64e2b8f44025d86e124308
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
>> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:633:12: error: no previous prototype for 'kvm_arch_post_init_vm' [-Werror=missing-prototypes]
633 | int __weak kvm_arch_post_init_vm(struct kvm *kvm)
| ^~~~~~~~~~~~~~~~~~~~~
>> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:642:13: error: no previous prototype for 'kvm_arch_pre_destroy_vm' [-Werror=missing-prototypes]
642 | void __weak kvm_arch_pre_destroy_vm(struct kvm *kvm)
| ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus xlnx/master
git checkout 1aa9b9572b10529c2e64e2b8f44025d86e124308
vim +/kvm_arch_post_init_vm +633 arch/powerpc/kvm/../../../virt/kvm/kvm_main.c
628
629 /*
630 * Called after the VM is otherwise initialized, but just before adding it to
631 * the vm_list.
632 */
> 633 int __weak kvm_arch_post_init_vm(struct kvm *kvm)
634 {
635 return 0;
636 }
637
638 /*
639 * Called just after removing the VM from the vm_list, but before doing any
640 * other destruction.
641 */
> 642 void __weak kvm_arch_pre_destroy_vm(struct kvm *kvm)
643 {
644 }
645
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
Re: [PATCH leds v2 05/50] leds: various: guard of_match_table member value with of_match_ptr
by kernel test robot
Hi "Marek,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on pavel-linux-leds/for-next]
[also build test WARNING on next-20200917]
[cannot apply to powerpc/next j.anaszewski-leds/for-next v5.9-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/Start-moving-parsing...
base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: x86_64-randconfig-r004-20200917 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 0ff28fa6a75617d61b1aeea77463d6a1684c3c89)
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
# 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/leds/leds-mt6323.c:474:34: warning: unused variable 'mt6323_led_dt_match' [-Wunused-const-variable]
static const struct of_device_id mt6323_led_dt_match[] = {
^
1 warning generated.
--
>> drivers/leds/leds-pwm.c:183:34: warning: unused variable 'of_pwm_leds_match' [-Wunused-const-variable]
static const struct of_device_id of_pwm_leds_match[] = {
^
1 warning generated.
--
>> drivers/leds/leds-sgm3140.c:292:34: warning: unused variable 'sgm3140_dt_match' [-Wunused-const-variable]
static const struct of_device_id sgm3140_dt_match[] = {
^
1 warning generated.
# https://github.com/0day-ci/linux/commit/a98b683b6c841e96d2f36f884f12d6c8d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/Start-moving-parsing-of-linux-default-trigger-to-LED-core-a-cleanup-of-LED-drivers/20200918-063850
git checkout a98b683b6c841e96d2f36f884f12d6c8ded65713
vim +/mt6323_led_dt_match +474 drivers/leds/leds-mt6323.c
216ec6cc4c1939 Sean Wang 2017-03-20 473
216ec6cc4c1939 Sean Wang 2017-03-20 @474 static const struct of_device_id mt6323_led_dt_match[] = {
216ec6cc4c1939 Sean Wang 2017-03-20 475 { .compatible = "mediatek,mt6323-led" },
216ec6cc4c1939 Sean Wang 2017-03-20 476 {},
216ec6cc4c1939 Sean Wang 2017-03-20 477 };
216ec6cc4c1939 Sean Wang 2017-03-20 478 MODULE_DEVICE_TABLE(of, mt6323_led_dt_match);
216ec6cc4c1939 Sean Wang 2017-03-20 479
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
Re: drivers/gpu/drm/ingenic/ingenic-drm-drv.c:undefined reference to `clk_get_parent'
by Rong Chen
On 9/15/20 9:20 PM, Paul Cercueil wrote:
> Hi,
>
> Le mer. 9 sept. 2020 à 10:28, kernel test robot <lkp(a)intel.com> a écrit :
>> Hi Paul,
>>
>> First bad commit (maybe != root cause):
>>
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> master
>> head: 34d4ddd359dbcdf6c5fb3f85a179243d7a1cb7f8
>> commit: 54fe894219903e32f5154265f46ed1eb5cdc2f5f drm/ingenic: Rename
>> ingenic-drm.c to ingenic-drm-drv.c
>> date: 8 weeks ago
>> config: mips-randconfig-r022-20200909 (attached as .config)
>> compiler: mips-linux-gcc (GCC) 9.3.0
>> reproduce (this is a W=1 build):
>> wget
>> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross
>> -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> git checkout 54fe894219903e32f5154265f46ed1eb5cdc2f5f
>> # save the attached .config to linux build tree
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0
>> make.cross ARCH=mips
>>
>> 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 >>):
>>
>> mips-linux-ld: drivers/gpu/drm/ingenic/ingenic-drm-drv.o: in
>> function `ingenic_drm_probe':
>>>> drivers/gpu/drm/ingenic/ingenic-drm-drv.c:(.text+0xc90): undefined
>>>> reference to `clk_get_parent'
>> mips-linux-ld: drivers/mmc/host/mtk-sd.o: in function
>> `msdc_set_mclk':
>> drivers/mmc/host/mtk-sd.c:(.text+0x26fc): undefined reference to
>> `clk_get_parent'
>> mips-linux-ld: drivers/mmc/host/mtk-sd.c:(.text+0x27c0): undefined
>> reference to `clk_get_parent'
>>
>
> clk_get_parent() is either provided if CONFIG_HAVE_CLK, or it's a
> inline dummy in clk.h otherwise. Given it chokes on other drivers too,
> I would say this is a false positive.
>
> -Paul
>
Hi Paul,
Sorry for the inconvenience, the bot can't distinguish the errors yet if
only file name changed.
we'll continue to improve it.
Best Regards,
Rong Chen
2 years
[arnd-playground:arm-kill-set_fs-5 6/40] arch/arm/kernel/traps.c:139:9: error: incompatible pointer types initializing 'const typeof (val) (aka 'const unsigned long with an expression of type 'u32 (aka 'unsigned int
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git arm-kill-set_fs-5
head: 1086c1cb895540fdf215aecf3ed4a96843d6633e
commit: 175180f99fef4558bae0c2fb337150706c4297ea [6/40] ARM: traps: use get_kernel_nofault instead of set_fs()
config: arm-randconfig-r022-20200917 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 0ff28fa6a75617d61b1aeea77463d6a1684c3c89)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
git checkout 175180f99fef4558bae0c2fb337150706c4297ea
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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 >>):
arch/arm/kernel/traps.c:82:6: warning: no previous prototype for function 'dump_backtrace_stm' [-Wmissing-prototypes]
void dump_backtrace_stm(u32 *stack, u32 instruction, const char *loglvl)
^
arch/arm/kernel/traps.c:82:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void dump_backtrace_stm(u32 *stack, u32 instruction, const char *loglvl)
^
static
>> arch/arm/kernel/traps.c:139:9: error: incompatible pointer types initializing 'const typeof (val) *' (aka 'const unsigned long *') with an expression of type 'u32 *' (aka 'unsigned int *') [-Werror,-Wincompatible-pointer-types]
if (get_kernel_nofault(val, (u32 *)p))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:366:21: note: expanded from macro 'get_kernel_nofault'
const typeof(val) *__gk_ptr = (ptr); \
^ ~~~~~
arch/arm/kernel/traps.c:430:17: warning: no previous prototype for function 'do_undefinstr' [-Wmissing-prototypes]
asmlinkage void do_undefinstr(struct pt_regs *regs)
^
arch/arm/kernel/traps.c:430:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void do_undefinstr(struct pt_regs *regs)
^
static
arch/arm/kernel/traps.c:495:39: warning: no previous prototype for function 'handle_fiq_as_nmi' [-Wmissing-prototypes]
asmlinkage void __exception_irq_entry handle_fiq_as_nmi(struct pt_regs *regs)
^
arch/arm/kernel/traps.c:495:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void __exception_irq_entry handle_fiq_as_nmi(struct pt_regs *regs)
^
static
arch/arm/kernel/traps.c:514:17: warning: no previous prototype for function 'bad_mode' [-Wmissing-prototypes]
asmlinkage void bad_mode(struct pt_regs *regs, int reason)
^
arch/arm/kernel/traps.c:514:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void bad_mode(struct pt_regs *regs, int reason)
^
static
arch/arm/kernel/traps.c:587:16: warning: no previous prototype for function 'arm_syscall' [-Wmissing-prototypes]
asmlinkage int arm_syscall(int no, struct pt_regs *regs)
^
arch/arm/kernel/traps.c:587:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage int arm_syscall(int no, struct pt_regs *regs)
^
static
arch/arm/kernel/traps.c:713:1: warning: no previous prototype for function 'baddataabort' [-Wmissing-prototypes]
baddataabort(int code, unsigned long instr, struct pt_regs *regs)
^
arch/arm/kernel/traps.c:712:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void
^
static
arch/arm/kernel/traps.c:738:6: warning: no previous prototype for function '__pte_error' [-Wmissing-prototypes]
void __pte_error(const char *file, int line, pte_t pte)
^
arch/arm/kernel/traps.c:738:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __pte_error(const char *file, int line, pte_t pte)
^
static
arch/arm/kernel/traps.c:743:6: warning: no previous prototype for function '__pmd_error' [-Wmissing-prototypes]
void __pmd_error(const char *file, int line, pmd_t pmd)
^
arch/arm/kernel/traps.c:743:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __pmd_error(const char *file, int line, pmd_t pmd)
^
static
arch/arm/kernel/traps.c:748:6: warning: no previous prototype for function '__pgd_error' [-Wmissing-prototypes]
void __pgd_error(const char *file, int line, pgd_t pgd)
^
arch/arm/kernel/traps.c:748:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __pgd_error(const char *file, int line, pgd_t pgd)
^
static
arch/arm/kernel/traps.c:753:17: warning: no previous prototype for function '__div0' [-Wmissing-prototypes]
asmlinkage void __div0(void)
^
arch/arm/kernel/traps.c:753:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void __div0(void)
^
static
arch/arm/kernel/traps.c:768:13: warning: no previous prototype for function 'trap_init' [-Wmissing-prototypes]
void __init trap_init(void)
^
arch/arm/kernel/traps.c:768:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __init trap_init(void)
^
static
11 warnings and 1 error generated.
# https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commi...
git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground arm-kill-set_fs-5
git checkout 175180f99fef4558bae0c2fb337150706c4297ea
vim +139 arch/arm/kernel/traps.c
117
118 /*
119 * Dump out the contents of some memory nicely...
120 */
121 static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
122 unsigned long top)
123 {
124 unsigned long first;
125 int i;
126
127 printk("%s%s(0x%08lx to 0x%08lx)\n", lvl, str, bottom, top);
128
129 for (first = bottom & ~31; first < top; first += 32) {
130 unsigned long p;
131 char str[sizeof(" 12345678") * 8 + 1];
132
133 memset(str, ' ', sizeof(str));
134 str[sizeof(str) - 1] = '\0';
135
136 for (p = first, i = 0; i < 8 && p < top; i++, p += 4) {
137 if (p >= bottom && p < top) {
138 unsigned long val;
> 139 if (get_kernel_nofault(val, (u32 *)p))
140 sprintf(str + i * 9, " %08lx", val);
141 else
142 sprintf(str + i * 9, " ????????");
143 }
144 }
145 printk("%s%04lx:%s\n", lvl, first & 0xffff, str);
146 }
147 }
148
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
Re: [PATCH leds v2 05/50] leds: various: guard of_match_table member value with of_match_ptr
by kernel test robot
Hi "Marek,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on pavel-linux-leds/for-next]
[also build test WARNING on next-20200917]
[cannot apply to powerpc/next v5.9-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/Start-moving-parsing...
base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: s390-randconfig-r003-20200917 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 0ff28fa6a75617d61b1aeea77463d6a1684c3c89)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
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 >>):
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from drivers/leds/leds-gpio.c:10:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from drivers/leds/leds-gpio.c:10:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from drivers/leds/leds-gpio.c:10:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from drivers/leds/leds-gpio.c:10:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/leds/leds-gpio.c:197:34: warning: unused variable 'of_gpio_leds_match' [-Wunused-const-variable]
static const struct of_device_id of_gpio_leds_match[] = {
^
21 warnings generated.
--
include/uapi/linux/swab.h:19:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
^
In file included from drivers/leds/leds-lm3532.c:9:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from drivers/leds/leds-lm3532.c:9:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from drivers/leds/leds-lm3532.c:9:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from drivers/leds/leds-lm3532.c:9:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from drivers/leds/leds-lm3532.c:9:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/leds/leds-lm3532.c:737:34: warning: unused variable 'of_lm3532_leds_match' [-Wunused-const-variable]
static const struct of_device_id of_lm3532_leds_match[] = {
^
21 warnings generated.
--
>> drivers/leds/leds-pca963x.c:348:34: warning: unused variable 'of_pca963x_match' [-Wunused-const-variable]
static const struct of_device_id of_pca963x_match[] = {
^
1 warning generated.
# https://github.com/0day-ci/linux/commit/a98b683b6c841e96d2f36f884f12d6c8d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/Start-moving-parsing-of-linux-default-trigger-to-LED-core-a-cleanup-of-LED-drivers/20200918-063850
git checkout a98b683b6c841e96d2f36f884f12d6c8ded65713
vim +/of_gpio_leds_match +197 drivers/leds/leds-gpio.c
a314c5c0040aab Grant Likely 2011-02-22 196
a314c5c0040aab Grant Likely 2011-02-22 @197 static const struct of_device_id of_gpio_leds_match[] = {
a314c5c0040aab Grant Likely 2011-02-22 198 { .compatible = "gpio-leds", },
a314c5c0040aab Grant Likely 2011-02-22 199 {},
a314c5c0040aab Grant Likely 2011-02-22 200 };
472b854bbc0b55 Paolo Pisati 2014-03-06 201
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[dhowells-fs:rxrpc-rxgk 18/18] net/rxrpc/rxgk.c:927:30: warning: variable 'authx_offset' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git rxrpc-rxgk
head: 7f002a9b47c3c704b8ccdd1e900b04cd10a44285
commit: 7f002a9b47c3c704b8ccdd1e900b04cd10a44285 [18/18] rxrpc: Implement the yfs-rxgk transport class (security index 6)
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 7f002a9b47c3c704b8ccdd1e900b04cd10a44285
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
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 >>):
net/rxrpc/rxgk.c: In function 'rxgk_construct_response':
net/rxrpc/rxgk.c:930:8: warning: variable 'p' set but not used [-Wunused-but-set-variable]
930 | void *p;
| ^
>> net/rxrpc/rxgk.c:927:30: warning: variable 'authx_offset' set but not used [-Wunused-but-set-variable]
927 | unsigned short auth_offset, authx_offset;
| ^~~~~~~~~~~~
net/rxrpc/rxgk.c: In function 'rxgk_decode_ticket':
net/rxrpc/rxgk.c:1057:3: warning: 'return' with no value, in function returning non-void [-Wreturn-type]
1057 | return;
| ^~~~~~
net/rxrpc/rxgk.c:1043:12: note: declared here
1043 | static int rxgk_decode_ticket(struct sk_buff *skb,
| ^~~~~~~~~~~~~~~~~~
>> net/rxrpc/rxgk.c:1059:2: warning: #warning TODO [-Wcpp]
1059 | #warning TODO
| ^~~~~~~
net/rxrpc/rxgk.c:1048:16: warning: unused variable 'p' [-Wunused-variable]
1048 | __be32 *xdr, *p;
| ^
net/rxrpc/rxgk.c:1047:14: warning: unused variable 'key' [-Wunused-variable]
1047 | struct key *key;
| ^~~
net/rxrpc/rxgk.c: In function 'rxgk_verify_response':
net/rxrpc/rxgk.c:1171:2: warning: #warning TODO [-Wcpp]
1171 | #warning TODO
| ^~~~~~~
net/rxrpc/rxgk.c:1091:15: warning: variable 'auth_offset' set but not used [-Wunused-but-set-variable]
1091 | unsigned int auth_offset, auth_len;
| ^~~~~~~~~~~
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs rxrpc-rxgk
git checkout 7f002a9b47c3c704b8ccdd1e900b04cd10a44285
vim +/authx_offset +927 net/rxrpc/rxgk.c
908
909 /*
910 * Construct the response.
911 *
912 * struct RXGK_Response {
913 * rxgkTime start_time;
914 * RXGK_Data token;
915 * opaque authenticator<RXGK_MAXAUTHENTICATOR>
916 * };
917 */
918 static int rxgk_construct_response(struct rxrpc_connection *conn,
919 struct sk_buff *challenge,
920 const u8 *nonce)
921 {
922 struct rxrpc_skb_priv *csp = rxrpc_skb(challenge), *rsp;
923 struct rxgk_context *gk = conn->rxgk;
924 const struct rxgk_key *k = gk->key;
925 struct sk_buff *skb;
926 unsigned short resp_len, auth_len, pad_len, enc_len, auth_pad_len, authx_len;
> 927 unsigned short auth_offset, authx_offset;
928 __be64 start_time;
929 __be32 tmp;
> 930 void *p;
931 int ret;
932
933 auth_len = 20 + 4 /* appdatalen */ + 12 + (4 + 4 * 4);
934 enc_len = round_up(gk->gk5e->conflen + auth_len, gk->gk5e->blocksize);
935 pad_len = enc_len - (gk->gk5e->conflen + auth_len);
936 authx_len = enc_len + conn->rxgk->gk5e->cksumlength;
937 auth_pad_len = xdr_round_up(authx_len) - authx_len;
938
939 resp_len = 8;
940 resp_len += 4 + xdr_round_up(k->ticket.len);
941 resp_len += 4 + xdr_round_up(authx_len);
942
943 skb = alloc_skb(resp_len, GFP_NOFS);
944 if (!skb)
945 return -ENOMEM;
946
947 rsp = rxrpc_skb(skb);
948 rsp->hdr = csp->hdr;
949 rsp->hdr.flags = conn->out_clientflag;
950 rsp->hdr.cksum = gk->key_number;
951
952 start_time = cpu_to_be64(conn->rxgk_start_time);
953 p = __skb_put_data(skb, &start_time, 8);
954
955 tmp = htonl(k->ticket.len);
956 __skb_put_data(skb, &tmp, 4);
957 __skb_put_data(skb, k->ticket.data, xdr_round_up(k->ticket.len));
958 tmp = htonl(authx_len);
959 __skb_put_data(skb, &tmp, 4);
960 authx_offset = skb->len;
961 __skb_put_zero(skb, gk->gk5e->conflen);
962 auth_offset = skb->len;
963 rxgk_construct_authenticator(conn, nonce, skb);
964 __skb_put_zero(skb, pad_len + gk->gk5e->cksumlength + auth_pad_len);
965
966 ret = rxgk_encrypt_packet(gk->gk5e, &gk->resp_enc, skb, auth_offset, auth_len);
967 if (ret < 0)
968 goto error;
969
970 ret = rxgk_send_response(conn, skb);
971 error:
972 kfree_skb(skb);
973 _leave(" = %d", ret);
974 return ret;
975 }
976
977 /*
978 * Respond to a challenge packet
979 */
980 static int rxgk_respond_to_challenge(struct rxrpc_connection *conn,
981 struct sk_buff *skb,
982 u32 *_abort_code)
983 {
984 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
985 const char *eproto;
986 u32 abort_code;
987 u8 nonce[20];
988 int ret;
989
990 _enter("{%d,%x}", conn->debug_id, key_serial(conn->params.key));
991
992 eproto = tracepoint_string("chall_no_key");
993 abort_code = RX_PROTOCOL_ERROR;
994 if (!conn->params.key)
995 goto protocol_error;
996
997 abort_code = RXGK_EXPIRED;
998 ret = key_validate(conn->params.key);
999 if (ret < 0)
1000 goto other_error;
1001
1002 eproto = tracepoint_string("chall_short");
1003 abort_code = RXGK_PACKETSHORT;
1004 if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
1005 nonce, sizeof(nonce)) < 0)
1006 goto protocol_error;
1007
1008 _proto("Rx CHALLENGE %%%u { n=%20phN }", sp->hdr.serial, nonce);
1009
1010 ret = rxgk_construct_response(conn, skb, nonce);
1011 if (ret < 0)
1012 goto error;
1013 return ret;
1014
1015 protocol_error:
1016 trace_rxrpc_rx_eproto(NULL, sp->hdr.serial, eproto);
1017 ret = -EPROTO;
1018 other_error:
1019 *_abort_code = abort_code;
1020 error:
1021 return ret;
1022 }
1023
1024 /*
1025 * Decode the ticket in a response.
1026 *
1027 * struct RXGK_AuthName {
1028 * afs_int32 kind;
1029 * opaque data<AUTHDATAMAX>;
1030 * opaque display<AUTHPRINTABLEMAX>;
1031 * };
1032 *
1033 * struct RXGK_Token {
1034 * rxgk_key K0;
1035 * RXGK_Level level;
1036 * rxgkTime starttime;
1037 * afs_int32 lifetime;
1038 * afs_int32 bytelife;
1039 * rxgkTime expirationtime;
1040 * struct RXGK_AuthName identities<>;
1041 * };
1042 */
1043 static int rxgk_decode_ticket(struct sk_buff *skb,
1044 unsigned int ticket_offset, unsigned int ticket_len,
1045 u32 *_abort_code)
1046 {
1047 struct key *key;
1048 __be32 *xdr, *p;
1049 int ret;
1050
1051 xdr = kmalloc(ticket_len, GFP_NOFS);
1052 if (!xdr)
1053 return -ENOMEM;
1054
1055 ret = skb_copy_bits(skb, ticket_offset, xdr, ticket_len);
1056 if (ret < 0)
> 1057 return;
1058
> 1059 #warning TODO
1060 }
1061
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years