From: kernel test robot <lkp@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [tglx-devel:timers/posix 58/61] kernel/signal.c:4257:28: warning: variable 't' is uninitialized when used here
Date: Tue, 6 Jun 2023 11:47:32 +0800 [thread overview]
Message-ID: <202306061121.RfpSvAcZ-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git timers/posix
head: 16a20adb1e0ae19ad42041a7d1b5583e4705ca0c
commit: 3ef2ce19cb1200cb49c61f9b3cef58c4b8a3a10d [58/61] signal: Add list to track ignored posix timers
config: hexagon-randconfig-r026-20230605 (https://download.01.org/0day-ci/archive/20230606/202306061121.RfpSvAcZ-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 4faf3aaf28226a4e950c103a14f6fc1d1fdabb1b)
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git/commit/?id=3ef2ce19cb1200cb49c61f9b3cef58c4b8a3a10d
git remote add tglx-devel https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git
git fetch --no-tags tglx-devel timers/posix
git checkout 3ef2ce19cb1200cb49c61f9b3cef58c4b8a3a10d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306061121.RfpSvAcZ-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from kernel/signal.c:26:
In file included from include/linux/tty.h:12:
In file included from include/linux/tty_port.h:5:
In file included from include/linux/kfifo.h:42:
In file included from include/linux/scatterlist.h:9:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from kernel/signal.c:26:
In file included from include/linux/tty.h:12:
In file included from include/linux/tty_port.h:5:
In file included from include/linux/kfifo.h:42:
In file included from include/linux/scatterlist.h:9:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from kernel/signal.c:26:
In file included from include/linux/tty.h:12:
In file included from include/linux/tty_port.h:5:
In file included from include/linux/kfifo.h:42:
In file included from include/linux/scatterlist.h:9:
In file included from arch/hexagon/include/asm/io.h:334:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
>> kernel/signal.c:4257:28: warning: variable 't' is uninitialized when used here [-Wuninitialized]
4257 | posixtimer_sig_unignore(t, sig);
| ^
kernel/signal.c:4198:37: note: initialize the variable 't' to silence this warning
4198 | struct task_struct *p = current, *t;
| ^
| = NULL
7 warnings generated.
vim +/t +4257 kernel/signal.c
4195
4196 int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
4197 {
4198 struct task_struct *p = current, *t;
4199 struct k_sigaction *k;
4200 sigset_t mask;
4201
4202 if (!valid_signal(sig) || sig < 1 || (act && sig_kernel_only(sig)))
4203 return -EINVAL;
4204
4205 k = &p->sighand->action[sig-1];
4206
4207 spin_lock_irq(&p->sighand->siglock);
4208 if (k->sa.sa_flags & SA_IMMUTABLE) {
4209 spin_unlock_irq(&p->sighand->siglock);
4210 return -EINVAL;
4211 }
4212 if (oact)
4213 *oact = *k;
4214
4215 /*
4216 * Make sure that we never accidentally claim to support SA_UNSUPPORTED,
4217 * e.g. by having an architecture use the bit in their uapi.
4218 */
4219 BUILD_BUG_ON(UAPI_SA_FLAGS & SA_UNSUPPORTED);
4220
4221 /*
4222 * Clear unknown flag bits in order to allow userspace to detect missing
4223 * support for flag bits and to allow the kernel to use non-uapi bits
4224 * internally.
4225 */
4226 if (act)
4227 act->sa.sa_flags &= UAPI_SA_FLAGS;
4228 if (oact)
4229 oact->sa.sa_flags &= UAPI_SA_FLAGS;
4230
4231 sigaction_compat_abi(act, oact);
4232
4233 if (act) {
4234 bool was_ignored = k->sa.sa_handler == SIG_IGN;
4235
4236 sigdelsetmask(&act->sa.sa_mask,
4237 sigmask(SIGKILL) | sigmask(SIGSTOP));
4238 *k = *act;
4239 /*
4240 * POSIX 3.3.1.3:
4241 * "Setting a signal action to SIG_IGN for a signal that is
4242 * pending shall cause the pending signal to be discarded,
4243 * whether or not it is blocked."
4244 *
4245 * "Setting a signal action to SIG_DFL for a signal that is
4246 * pending and whose default action is to ignore the signal
4247 * (for example, SIGCHLD), shall cause the pending signal to
4248 * be discarded, whether or not it is blocked"
4249 */
4250 if (sig_handler_ignored(sig_handler(p, sig), sig)) {
4251 sigemptyset(&mask);
4252 sigaddset(&mask, sig);
4253 flush_sigqueue_mask(p, &mask, &p->signal->shared_pending);
4254 for_each_thread(p, t)
4255 flush_sigqueue_mask(t, &mask, &t->pending);
4256 } else if (was_ignored) {
> 4257 posixtimer_sig_unignore(t, sig);
4258 }
4259 }
4260
4261 spin_unlock_irq(&p->sighand->siglock);
4262 return 0;
4263 }
4264
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-06-06 3:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202306061121.RfpSvAcZ-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox