All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: aubrey.li@linux.intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [anolis-intel-cloud:devel-5.10 9/9] ./include/linux/list.h:70:20: warning: storing the address of local variable 'waiter' in '((struct list_head *)((char *)sem + 8))[4].prev'
Date: Wed, 28 Oct 2026 09:54:22 +0100	[thread overview]
Message-ID: <202610280911.KkXmc2NG-lkp@intel.com> (raw)

tree:   https://gitee.com/anolis/intel-cloud-kernel.git devel-5.10
head:   e404899677bc470e620572471a562f09ea3de082
commit: 50f3b00d4c7ba9aef6e0be4db192ee81f4f8a125 [9/9] libsubcmd: Fix use-after-free for realloc(..., 0)
config: x86_64-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20261028/202610280911.KkXmc2NG-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261028/202610280911.KkXmc2NG-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/202610280911.KkXmc2NG-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from ./include/linux/rculist.h:10,
                    from ./include/linux/pid.h:5,
                    from ./include/linux/sched.h:14,
                    from kernel/locking/semaphore.c:30:
   In function '__list_add',
       inlined from 'list_add_tail' at ./include/linux/list.h:100:2,
       inlined from '__down_common' at kernel/locking/semaphore.c:209:2,
       inlined from '__down_timeout' at kernel/locking/semaphore.c:252:9:
>> ./include/linux/list.h:70:20: warning: storing the address of local variable 'waiter' in '((struct list_head *)((char *)sem + 8))[4].prev' [-Wdangling-pointer=]
      70 |         next->prev = new;
         |         ~~~~~~~~~~~^~~~~
   kernel/locking/semaphore.c: In function '__down_timeout':
   kernel/locking/semaphore.c:207:33: note: 'waiter' declared here
     207 |         struct semaphore_waiter waiter;
         |                                 ^~~~~~
   kernel/locking/semaphore.c:250:62: note: 'sem' declared here
     250 | static noinline int __sched __down_timeout(struct semaphore *sem, long timeout)
         |                                            ~~~~~~~~~~~~~~~~~~^~~
   In function '__list_add',
       inlined from 'list_add_tail' at ./include/linux/list.h:100:2,
       inlined from '__down_common' at kernel/locking/semaphore.c:209:2,
       inlined from '__down' at kernel/locking/semaphore.c:237:2:
>> ./include/linux/list.h:70:20: warning: storing the address of local variable 'waiter' in '((struct list_head *)((char *)sem + 8))[4].prev' [-Wdangling-pointer=]
      70 |         next->prev = new;
         |         ~~~~~~~~~~~^~~~~
   kernel/locking/semaphore.c: In function '__down':
   kernel/locking/semaphore.c:207:33: note: 'waiter' declared here
     207 |         struct semaphore_waiter waiter;
         |                                 ^~~~~~
   kernel/locking/semaphore.c:235:55: note: 'sem' declared here
     235 | static noinline void __sched __down(struct semaphore *sem)
         |                                     ~~~~~~~~~~~~~~~~~~^~~


vim +70 ./include/linux/list.h

d7c816733d501b5 Kees Cook        2016-08-17   56  
^1da177e4c3f415 Linus Torvalds   2005-04-16   57  /*
^1da177e4c3f415 Linus Torvalds   2005-04-16   58   * Insert a new entry between two known consecutive entries.
^1da177e4c3f415 Linus Torvalds   2005-04-16   59   *
^1da177e4c3f415 Linus Torvalds   2005-04-16   60   * This is only for internal list manipulation where we know
^1da177e4c3f415 Linus Torvalds   2005-04-16   61   * the prev/next entries already!
^1da177e4c3f415 Linus Torvalds   2005-04-16   62   */
^1da177e4c3f415 Linus Torvalds   2005-04-16   63  static inline void __list_add(struct list_head *new,
^1da177e4c3f415 Linus Torvalds   2005-04-16   64  			      struct list_head *prev,
^1da177e4c3f415 Linus Torvalds   2005-04-16   65  			      struct list_head *next)
^1da177e4c3f415 Linus Torvalds   2005-04-16   66  {
d7c816733d501b5 Kees Cook        2016-08-17   67  	if (!__list_add_valid(new, prev, next))
d7c816733d501b5 Kees Cook        2016-08-17   68  		return;
d7c816733d501b5 Kees Cook        2016-08-17   69  
^1da177e4c3f415 Linus Torvalds   2005-04-16  @70  	next->prev = new;
^1da177e4c3f415 Linus Torvalds   2005-04-16   71  	new->next = next;
^1da177e4c3f415 Linus Torvalds   2005-04-16   72  	new->prev = prev;
1c97be677f72b3c Paul E. McKenney 2015-09-20   73  	WRITE_ONCE(prev->next, new);
^1da177e4c3f415 Linus Torvalds   2005-04-16   74  }
^1da177e4c3f415 Linus Torvalds   2005-04-16   75  
^1da177e4c3f415 Linus Torvalds   2005-04-16   76  /**
^1da177e4c3f415 Linus Torvalds   2005-04-16   77   * list_add - add a new entry
^1da177e4c3f415 Linus Torvalds   2005-04-16   78   * @new: new entry to be added
^1da177e4c3f415 Linus Torvalds   2005-04-16   79   * @head: list head to add it after
^1da177e4c3f415 Linus Torvalds   2005-04-16   80   *
^1da177e4c3f415 Linus Torvalds   2005-04-16   81   * Insert a new entry after the specified head.
^1da177e4c3f415 Linus Torvalds   2005-04-16   82   * This is good for implementing stacks.
^1da177e4c3f415 Linus Torvalds   2005-04-16   83   */
^1da177e4c3f415 Linus Torvalds   2005-04-16   84  static inline void list_add(struct list_head *new, struct list_head *head)
^1da177e4c3f415 Linus Torvalds   2005-04-16   85  {
^1da177e4c3f415 Linus Torvalds   2005-04-16   86  	__list_add(new, head, head->next);
^1da177e4c3f415 Linus Torvalds   2005-04-16   87  }
199a9afc3dbe98c Dave Jones       2006-09-29   88  
^1da177e4c3f415 Linus Torvalds   2005-04-16   89  
^1da177e4c3f415 Linus Torvalds   2005-04-16   90  /**
^1da177e4c3f415 Linus Torvalds   2005-04-16   91   * list_add_tail - add a new entry
^1da177e4c3f415 Linus Torvalds   2005-04-16   92   * @new: new entry to be added
^1da177e4c3f415 Linus Torvalds   2005-04-16   93   * @head: list head to add it before
^1da177e4c3f415 Linus Torvalds   2005-04-16   94   *
^1da177e4c3f415 Linus Torvalds   2005-04-16   95   * Insert a new entry before the specified head.
^1da177e4c3f415 Linus Torvalds   2005-04-16   96   * This is useful for implementing queues.
^1da177e4c3f415 Linus Torvalds   2005-04-16   97   */
^1da177e4c3f415 Linus Torvalds   2005-04-16   98  static inline void list_add_tail(struct list_head *new, struct list_head *head)
^1da177e4c3f415 Linus Torvalds   2005-04-16   99  {
^1da177e4c3f415 Linus Torvalds   2005-04-16 @100  	__list_add(new, head->prev, head);
^1da177e4c3f415 Linus Torvalds   2005-04-16  101  }
^1da177e4c3f415 Linus Torvalds   2005-04-16  102  

:::::: The code at line 70 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

                 reply	other threads:[~2026-10-28  8:54 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=202610280911.KkXmc2NG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aubrey.li@linux.intel.com \
    --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 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.