All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: arch/arc/kernel/signal.c:79 save_arcv2_regs() warn: maybe return -EFAULT instead of the bytes remaining?
Date: Tue, 27 Jul 2021 20:55:01 +0800	[thread overview]
Message-ID: <202107272048.lcg2KaZR-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3845 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vineet Gupta <vgupta@synopsys.com>
CC: linux-snps-arc(a)lists.infradead.org

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ff1176468d368232b684f75e82563369208bc371
commit: 96f1b00138cb8f04c742c82d0a7c460b2202e887 ARCv2: save ABI registers across signal handling
date:   7 weeks ago
:::::: branch date: 2 days ago
:::::: commit date: 7 weeks ago
config: arc-randconfig-m031-20210727 (attached as .config)
compiler: arceb-elf-gcc (GCC) 10.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
arch/arc/kernel/signal.c:79 save_arcv2_regs() warn: maybe return -EFAULT instead of the bytes remaining?
arch/arc/kernel/signal.c:96 restore_arcv2_regs() warn: maybe return -EFAULT instead of the bytes remaining?

Old smatch warnings:
arch/arc/kernel/signal.c:198 sys_rt_sigreturn() error: uninitialized symbol 'sp'.
arch/arc/include/asm/thread_info.h:65 current_thread_info() error: uninitialized symbol 'sp'.
arch/arc/kernel/signal.c:297 setup_rt_frame() warn: ignoring unreachable code.
arch/arc/kernel/signal.c:312 setup_rt_frame() warn: ignoring unreachable code.

vim +79 arch/arc/kernel/signal.c

c3581039b6c51a Vineet Gupta 2013-01-18  63  
96f1b00138cb8f Vineet Gupta 2021-06-08  64  static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
96f1b00138cb8f Vineet Gupta 2021-06-08  65  {
96f1b00138cb8f Vineet Gupta 2021-06-08  66  	int err = 0;
96f1b00138cb8f Vineet Gupta 2021-06-08  67  #ifndef CONFIG_ISA_ARCOMPACT
96f1b00138cb8f Vineet Gupta 2021-06-08  68  	struct user_regs_arcv2 v2abi;
96f1b00138cb8f Vineet Gupta 2021-06-08  69  
96f1b00138cb8f Vineet Gupta 2021-06-08  70  	v2abi.r30 = regs->r30;
96f1b00138cb8f Vineet Gupta 2021-06-08  71  #ifdef CONFIG_ARC_HAS_ACCL_REGS
96f1b00138cb8f Vineet Gupta 2021-06-08  72  	v2abi.r58 = regs->r58;
96f1b00138cb8f Vineet Gupta 2021-06-08  73  	v2abi.r59 = regs->r59;
96f1b00138cb8f Vineet Gupta 2021-06-08  74  #else
96f1b00138cb8f Vineet Gupta 2021-06-08  75  	v2abi.r58 = v2abi.r59 = 0;
96f1b00138cb8f Vineet Gupta 2021-06-08  76  #endif
96f1b00138cb8f Vineet Gupta 2021-06-08  77  	err = __copy_to_user(&mctx->v2abi, &v2abi, sizeof(v2abi));
96f1b00138cb8f Vineet Gupta 2021-06-08  78  #endif
96f1b00138cb8f Vineet Gupta 2021-06-08 @79  	return err;
96f1b00138cb8f Vineet Gupta 2021-06-08  80  }
96f1b00138cb8f Vineet Gupta 2021-06-08  81  
96f1b00138cb8f Vineet Gupta 2021-06-08  82  static int restore_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
96f1b00138cb8f Vineet Gupta 2021-06-08  83  {
96f1b00138cb8f Vineet Gupta 2021-06-08  84  	int err = 0;
96f1b00138cb8f Vineet Gupta 2021-06-08  85  #ifndef CONFIG_ISA_ARCOMPACT
96f1b00138cb8f Vineet Gupta 2021-06-08  86  	struct user_regs_arcv2 v2abi;
96f1b00138cb8f Vineet Gupta 2021-06-08  87  
96f1b00138cb8f Vineet Gupta 2021-06-08  88  	err = __copy_from_user(&v2abi, &mctx->v2abi, sizeof(v2abi));
96f1b00138cb8f Vineet Gupta 2021-06-08  89  
96f1b00138cb8f Vineet Gupta 2021-06-08  90  	regs->r30 = v2abi.r30;
96f1b00138cb8f Vineet Gupta 2021-06-08  91  #ifdef CONFIG_ARC_HAS_ACCL_REGS
96f1b00138cb8f Vineet Gupta 2021-06-08  92  	regs->r58 = v2abi.r58;
96f1b00138cb8f Vineet Gupta 2021-06-08  93  	regs->r59 = v2abi.r59;
96f1b00138cb8f Vineet Gupta 2021-06-08  94  #endif
96f1b00138cb8f Vineet Gupta 2021-06-08  95  #endif
96f1b00138cb8f Vineet Gupta 2021-06-08 @96  	return err;
96f1b00138cb8f Vineet Gupta 2021-06-08  97  }
96f1b00138cb8f Vineet Gupta 2021-06-08  98  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37250 bytes --]

             reply	other threads:[~2021-07-27 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 12:55 kernel test robot [this message]
2021-12-07  8:58 arch/arc/kernel/signal.c:79 save_arcv2_regs() warn: maybe return -EFAULT instead of the bytes remaining? kernel test robot
2021-12-08 10:58 kernel test robot
2022-02-11 10:11 kernel test robot
2022-02-11 20:22 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107272048.lcg2KaZR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.