Linux cryptographic layer development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arbab Haider <arbabhaider649@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: oe-kbuild-all@lists.linux.dev,
	Arbab Haider <arbabhaider649@gmail.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	John Garry <john.g.garry@oracle.com>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: hisilicon/sec - Fix element drop and UAF in sec_send_request()
Date: Sat, 1 Aug 2026 04:39:54 +0800	[thread overview]
Message-ID: <202608010642.kGjbBrg7-lkp@intel.com> (raw)
In-Reply-To: <20260730215449.299311-1-arbabhaider649@gmail.com>

Hi Arbab,

kernel test robot noticed the following build warnings:

[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on herbert-crypto-2.6/master linus/master v7.2-rc5 next-20260731]
[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/Arbab-Haider/crypto-hisilicon-sec-Fix-element-drop-and-UAF-in-sec_send_request/20260731-234619
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/20260730215449.299311-1-arbabhaider649%40gmail.com
patch subject: [PATCH] crypto: hisilicon/sec - Fix element drop and UAF in sec_send_request()
config: alpha-allmodconfig (https://download.01.org/0day-ci/archive/20260801/202608010642.kGjbBrg7-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260801/202608010642.kGjbBrg7-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608010642.kGjbBrg7-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/crypto/hisilicon/sec/sec_algs.c: In function 'sec_send_request':
>> drivers/crypto/hisilicon/sec/sec_algs.c:406:33: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     406 |                                 ;
         |                                 ^
   drivers/crypto/hisilicon/sec/sec_algs.c:410:33: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     410 |                                 ;
         |                                 ^


vim +/if +406 drivers/crypto/hisilicon/sec/sec_algs.c

   382	
   383	/* queuelock must be held */
   384	static void sec_send_request(struct sec_request *sec_req, struct sec_queue *queue)
   385	{
   386		struct sec_request_el *el, *temp;
   387	
   388		mutex_lock(&sec_req->lock);
   389		list_for_each_entry_safe(el, temp, &sec_req->elements, head) {
   390			/*
   391			 * Add to hardware queue only under following circumstances
   392			 * 1) Software and hardware queue empty so no chain dependencies
   393			 * 2) No dependencies as new IV - (check software queue empty
   394			 *    to maintain order)
   395			 * 3) No dependencies because the mode does no chaining.
   396			 *
   397			 * In other cases first insert onto the software queue which
   398			 * is then emptied as requests complete
   399			 */
   400			if (!queue->havesoftqueue ||
   401			    (kfifo_is_empty(&queue->softqueue) &&
   402			     sec_queue_empty(queue))) {
   403				if (WARN_ON_ONCE(sec_queue_send(queue, &el->req,
   404								sec_req)))
   405					/* Should not happen with proper capacity check */
 > 406					;
   407			} else {
   408				if (WARN_ON_ONCE(!kfifo_put(&queue->softqueue, el)))
   409					/* Should not happen with proper capacity check */
   410					;
   411			}
   412		}
   413		mutex_unlock(&sec_req->lock);
   414	}
   415	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      reply	other threads:[~2026-07-31 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 21:54 [PATCH] crypto: hisilicon/sec - Fix element drop and UAF in sec_send_request() Arbab Haider
2026-07-31 20:39 ` kernel test robot [this message]

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=202608010642.kGjbBrg7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=arbabhaider649@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.g.garry@oracle.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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