lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211012335.tCnMjA6q-lkp@intel.com>
Date:   Tue, 1 Nov 2022 23:09:33 +0800
From:   kernel test robot <lkp@...el.com>
To:     korantwork@...il.com, axboe@...nel.dk
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        io-uring@...r.kernel.org, linux-kernel@...r.kernel.org,
        Xinghui Li <korantli@...cent.com>
Subject: Re: [PATCH] io_uring: fix two assignments in if conditions

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.1-rc3 next-20221101]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/korantwork-gmail-com/io_uring-fix-two-assignments-in-if-conditions/20221101-153152
patch link:    https://lore.kernel.org/r/20221101072956.13028-1-korantwork%40gmail.com
patch subject: [PATCH] io_uring: fix two assignments in if conditions
config: i386-buildonly-randconfig-r005-20221031
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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
        # https://github.com/intel-lab-lkp/linux/commit/239fabe2a26f6a5971378af7aa6bf17a15de1122
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review korantwork-gmail-com/io_uring-fix-two-assignments-in-if-conditions/20221101-153152
        git checkout 239fabe2a26f6a5971378af7aa6bf17a15de1122
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> io_uring/poll.c:601:7: warning: variable 'apoll' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   if (entry != NULL)
                       ^~~~~~~~~~~~~
   io_uring/poll.c:608:2: note: uninitialized use occurs here
           apoll->double_poll = NULL;
           ^~~~~
   io_uring/poll.c:601:3: note: remove the 'if' if its condition is always true
                   if (entry != NULL)
                   ^~~~~~~~~~~~~~~~~~
   io_uring/poll.c:594:26: note: initialize the variable 'apoll' to silence this warning
           struct async_poll *apoll;
                                   ^
                                    = NULL
   1 warning generated.


vim +601 io_uring/poll.c

   588	
   589	static struct async_poll *io_req_alloc_apoll(struct io_kiocb *req,
   590						     unsigned issue_flags)
   591	{
   592		struct io_ring_ctx *ctx = req->ctx;
   593		struct io_cache_entry *entry;
   594		struct async_poll *apoll;
   595	
   596		if (req->flags & REQ_F_POLLED) {
   597			apoll = req->apoll;
   598			kfree(apoll->double_poll);
   599		} else if (!(issue_flags & IO_URING_F_UNLOCKED)) {
   600			entry = io_alloc_cache_get(&ctx->apoll_cache);
 > 601			if (entry != NULL)
   602				apoll = container_of(entry, struct async_poll, cache);
   603		} else {
   604			apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC);
   605			if (unlikely(!apoll))
   606				return NULL;
   607		}
   608		apoll->double_poll = NULL;
   609		req->apoll = apoll;
   610		return apoll;
   611	}
   612	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (140248 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ