public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [tty:tty-next 27/37] drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets
@ 2025-11-24 10:25 kernel test robot
  2025-11-24 22:13 ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-11-24 10:25 UTC (permalink / raw)
  To: Jiri Slaby (SUSE); +Cc: llvm, oe-kbuild-all, linux-serial, Greg Kroah-Hartman

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
head:   da218406dd50e0ac96bb383de4edd208286efe70
commit: bfb24564b5fd8625ce5c007f274cabdc3b570969 [27/37] tty: vt/keyboard: use __free()
config: powerpc-randconfig-002-20251124 (https://download.01.org/0day-ci/archive/20251124/202511241835.EA8lShgH-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251124/202511241835.EA8lShgH-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/202511241835.EA8lShgH-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets
                   if (put_user(asize, &a->kb_cnt))
                       ^
   arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
                     __put_user(x, _pu_addr) : -EFAULT;                    \
                     ^
   arch/powerpc/include/asm/uaccess.h:49:3: note: expanded from macro '__put_user'
                   __put_user_size_goto(__pu_val, __pu_addr, __pu_size, __pu_failed);      \
                   ^
   arch/powerpc/include/asm/uaccess.h:127:10: note: expanded from macro '__put_user_size_goto'
           case 1: __put_user_asm_goto(x, __pus_addr, label, "stb"); break;        \
                   ^
   arch/powerpc/include/asm/uaccess.h:87:2: note: expanded from macro '__put_user_asm_goto'
           asm goto(                                       \
           ^
   drivers/tty/vt/keyboard.c:1736:7: note: possible target of asm goto statement
                   if (put_user(asize, &a->kb_cnt))
                       ^
   arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
                     __put_user(x, _pu_addr) : -EFAULT;                    \
                     ^
   arch/powerpc/include/asm/uaccess.h:53:9: note: expanded from macro '__put_user'
                                                                   \
                                                                   ^
   drivers/tty/vt/keyboard.c:1692:33: note: jump exits scope of variable with __attribute__((cleanup))
                   struct kbdiacr __free(kfree) *dia = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacr),
                                                 ^
   drivers/tty/vt/keyboard.c:1722:23: note: jump bypasses initialization of variable with __attribute__((cleanup))
                   void __free(kfree) *buf = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacruc),
                                       ^
   drivers/tty/vt/keyboard.c:1736:7: error: cannot jump from this asm goto statement to one of its possible targets
                   if (put_user(asize, &a->kb_cnt))
                       ^
   arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
                     __put_user(x, _pu_addr) : -EFAULT;                    \
                     ^
   arch/powerpc/include/asm/uaccess.h:49:3: note: expanded from macro '__put_user'
                   __put_user_size_goto(__pu_val, __pu_addr, __pu_size, __pu_failed);      \
                   ^
   arch/powerpc/include/asm/uaccess.h:127:10: note: expanded from macro '__put_user_size_goto'
           case 1: __put_user_asm_goto(x, __pus_addr, label, "stb"); break;        \
                   ^
   arch/powerpc/include/asm/uaccess.h:87:2: note: expanded from macro '__put_user_asm_goto'
           asm goto(                                       \
           ^
   drivers/tty/vt/keyboard.c:1712:7: note: possible target of asm goto statement
                   if (put_user(asize, &a->kb_cnt))
                       ^
   arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
                     __put_user(x, _pu_addr) : -EFAULT;                    \
                     ^
   arch/powerpc/include/asm/uaccess.h:53:9: note: expanded from macro '__put_user'
                                                                   \
                                                                   ^
   drivers/tty/vt/keyboard.c:1722:23: note: jump exits scope of variable with __attribute__((cleanup))
                   void __free(kfree) *buf = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacruc),
                                       ^
   drivers/tty/vt/keyboard.c:1692:33: note: jump bypasses initialization of variable with __attribute__((cleanup))
                   struct kbdiacr __free(kfree) *dia = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacr),
                                                 ^
   2 errors generated.


vim +1712 drivers/tty/vt/keyboard.c

247ff8e610cb63 Alan Cox              2012-02-24  1671  
247ff8e610cb63 Alan Cox              2012-02-24  1672  /**
247ff8e610cb63 Alan Cox              2012-02-24  1673   *	vt_do_diacrit		-	diacritical table updates
247ff8e610cb63 Alan Cox              2012-02-24  1674   *	@cmd: ioctl request
9d329c1c68d2cc Mark Rustad           2014-09-05  1675   *	@udp: pointer to user data for ioctl
247ff8e610cb63 Alan Cox              2012-02-24  1676   *	@perm: permissions check computed by caller
247ff8e610cb63 Alan Cox              2012-02-24  1677   *
247ff8e610cb63 Alan Cox              2012-02-24  1678   *	Update the diacritical tables atomically and safely. Lock them
247ff8e610cb63 Alan Cox              2012-02-24  1679   *	against simultaneous keypresses
247ff8e610cb63 Alan Cox              2012-02-24  1680   */
9d329c1c68d2cc Mark Rustad           2014-09-05  1681  int vt_do_diacrit(unsigned int cmd, void __user *udp, int perm)
247ff8e610cb63 Alan Cox              2012-02-24  1682  {
247ff8e610cb63 Alan Cox              2012-02-24  1683  	unsigned long flags;
247ff8e610cb63 Alan Cox              2012-02-24  1684  	int asize;
247ff8e610cb63 Alan Cox              2012-02-24  1685  
247ff8e610cb63 Alan Cox              2012-02-24  1686  	switch (cmd) {
247ff8e610cb63 Alan Cox              2012-02-24  1687  	case KDGKBDIACR:
247ff8e610cb63 Alan Cox              2012-02-24  1688  	{
9d329c1c68d2cc Mark Rustad           2014-09-05  1689  		struct kbdiacrs __user *a = udp;
247ff8e610cb63 Alan Cox              2012-02-24  1690  		int i;
247ff8e610cb63 Alan Cox              2012-02-24  1691  
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1692) 		struct kbdiacr __free(kfree) *dia = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacr),
247ff8e610cb63 Alan Cox              2012-02-24  1693  								  GFP_KERNEL);
9d329c1c68d2cc Mark Rustad           2014-09-05  1694  		if (!dia)
247ff8e610cb63 Alan Cox              2012-02-24  1695  			return -ENOMEM;
247ff8e610cb63 Alan Cox              2012-02-24  1696  
247ff8e610cb63 Alan Cox              2012-02-24  1697  		/* Lock the diacriticals table, make a copy and then
247ff8e610cb63 Alan Cox              2012-02-24  1698  		   copy it after we unlock */
247ff8e610cb63 Alan Cox              2012-02-24  1699  		spin_lock_irqsave(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1700  
247ff8e610cb63 Alan Cox              2012-02-24  1701  		asize = accent_table_size;
247ff8e610cb63 Alan Cox              2012-02-24  1702  		for (i = 0; i < asize; i++) {
9d329c1c68d2cc Mark Rustad           2014-09-05  1703  			dia[i].diacr = conv_uni_to_8bit(
247ff8e610cb63 Alan Cox              2012-02-24  1704  						accent_table[i].diacr);
9d329c1c68d2cc Mark Rustad           2014-09-05  1705  			dia[i].base = conv_uni_to_8bit(
247ff8e610cb63 Alan Cox              2012-02-24  1706  						accent_table[i].base);
9d329c1c68d2cc Mark Rustad           2014-09-05  1707  			dia[i].result = conv_uni_to_8bit(
247ff8e610cb63 Alan Cox              2012-02-24  1708  						accent_table[i].result);
247ff8e610cb63 Alan Cox              2012-02-24  1709  		}
247ff8e610cb63 Alan Cox              2012-02-24  1710  		spin_unlock_irqrestore(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1711  
247ff8e610cb63 Alan Cox              2012-02-24 @1712  		if (put_user(asize, &a->kb_cnt))
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1713) 			return -EFAULT;
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1714) 		if (copy_to_user(a->kbdiacr, dia, asize * sizeof(struct kbdiacr)))
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1715) 			return -EFAULT;
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1716) 		return 0;
247ff8e610cb63 Alan Cox              2012-02-24  1717  	}
247ff8e610cb63 Alan Cox              2012-02-24  1718  	case KDGKBDIACRUC:
247ff8e610cb63 Alan Cox              2012-02-24  1719  	{
9d329c1c68d2cc Mark Rustad           2014-09-05  1720  		struct kbdiacrsuc __user *a = udp;
247ff8e610cb63 Alan Cox              2012-02-24  1721  
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1722) 		void __free(kfree) *buf = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacruc),
247ff8e610cb63 Alan Cox              2012-02-24  1723  							GFP_KERNEL);
247ff8e610cb63 Alan Cox              2012-02-24  1724  		if (buf == NULL)
247ff8e610cb63 Alan Cox              2012-02-24  1725  			return -ENOMEM;
247ff8e610cb63 Alan Cox              2012-02-24  1726  
247ff8e610cb63 Alan Cox              2012-02-24  1727  		/* Lock the diacriticals table, make a copy and then
247ff8e610cb63 Alan Cox              2012-02-24  1728  		   copy it after we unlock */
247ff8e610cb63 Alan Cox              2012-02-24  1729  		spin_lock_irqsave(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1730  
247ff8e610cb63 Alan Cox              2012-02-24  1731  		asize = accent_table_size;
247ff8e610cb63 Alan Cox              2012-02-24  1732  		memcpy(buf, accent_table, asize * sizeof(struct kbdiacruc));
247ff8e610cb63 Alan Cox              2012-02-24  1733  
247ff8e610cb63 Alan Cox              2012-02-24  1734  		spin_unlock_irqrestore(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1735  
247ff8e610cb63 Alan Cox              2012-02-24  1736  		if (put_user(asize, &a->kb_cnt))
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1737) 			return -EFAULT;
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1738) 		if (copy_to_user(a->kbdiacruc, buf, asize * sizeof(struct kbdiacruc)))
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1739) 			return -EFAULT;
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1740) 
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1741) 		return 0;
247ff8e610cb63 Alan Cox              2012-02-24  1742  	}
247ff8e610cb63 Alan Cox              2012-02-24  1743  
247ff8e610cb63 Alan Cox              2012-02-24  1744  	case KDSKBDIACR:
247ff8e610cb63 Alan Cox              2012-02-24  1745  	{
9d329c1c68d2cc Mark Rustad           2014-09-05  1746  		struct kbdiacrs __user *a = udp;
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1747) 		struct kbdiacr __free(kfree) *dia = NULL;
247ff8e610cb63 Alan Cox              2012-02-24  1748  		unsigned int ct;
247ff8e610cb63 Alan Cox              2012-02-24  1749  		int i;
247ff8e610cb63 Alan Cox              2012-02-24  1750  
247ff8e610cb63 Alan Cox              2012-02-24  1751  		if (!perm)
247ff8e610cb63 Alan Cox              2012-02-24  1752  			return -EPERM;
247ff8e610cb63 Alan Cox              2012-02-24  1753  		if (get_user(ct, &a->kb_cnt))
247ff8e610cb63 Alan Cox              2012-02-24  1754  			return -EFAULT;
247ff8e610cb63 Alan Cox              2012-02-24  1755  		if (ct >= MAX_DIACR)
247ff8e610cb63 Alan Cox              2012-02-24  1756  			return -EINVAL;
247ff8e610cb63 Alan Cox              2012-02-24  1757  
247ff8e610cb63 Alan Cox              2012-02-24  1758  		if (ct) {
e651faa2fba4d3 Philipp Stanner       2023-11-03  1759  			dia = memdup_array_user(a->kbdiacr,
e651faa2fba4d3 Philipp Stanner       2023-11-03  1760  						ct, sizeof(struct kbdiacr));
1051937d465665 Saurabh Sengar        2015-10-28  1761  			if (IS_ERR(dia))
1051937d465665 Saurabh Sengar        2015-10-28  1762  				return PTR_ERR(dia);
247ff8e610cb63 Alan Cox              2012-02-24  1763  		}
247ff8e610cb63 Alan Cox              2012-02-24  1764  
247ff8e610cb63 Alan Cox              2012-02-24  1765  		spin_lock_irqsave(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1766  		accent_table_size = ct;
247ff8e610cb63 Alan Cox              2012-02-24  1767  		for (i = 0; i < ct; i++) {
247ff8e610cb63 Alan Cox              2012-02-24  1768  			accent_table[i].diacr =
9d329c1c68d2cc Mark Rustad           2014-09-05  1769  					conv_8bit_to_uni(dia[i].diacr);
247ff8e610cb63 Alan Cox              2012-02-24  1770  			accent_table[i].base =
9d329c1c68d2cc Mark Rustad           2014-09-05  1771  					conv_8bit_to_uni(dia[i].base);
247ff8e610cb63 Alan Cox              2012-02-24  1772  			accent_table[i].result =
9d329c1c68d2cc Mark Rustad           2014-09-05  1773  					conv_8bit_to_uni(dia[i].result);
247ff8e610cb63 Alan Cox              2012-02-24  1774  		}
247ff8e610cb63 Alan Cox              2012-02-24  1775  		spin_unlock_irqrestore(&kbd_event_lock, flags);
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1776) 
247ff8e610cb63 Alan Cox              2012-02-24  1777  		return 0;
247ff8e610cb63 Alan Cox              2012-02-24  1778  	}
247ff8e610cb63 Alan Cox              2012-02-24  1779  
247ff8e610cb63 Alan Cox              2012-02-24  1780  	case KDSKBDIACRUC:
247ff8e610cb63 Alan Cox              2012-02-24  1781  	{
9d329c1c68d2cc Mark Rustad           2014-09-05  1782  		struct kbdiacrsuc __user *a = udp;
247ff8e610cb63 Alan Cox              2012-02-24  1783  		unsigned int ct;
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1784) 		void __free(kfree) *buf = NULL;
247ff8e610cb63 Alan Cox              2012-02-24  1785  
247ff8e610cb63 Alan Cox              2012-02-24  1786  		if (!perm)
247ff8e610cb63 Alan Cox              2012-02-24  1787  			return -EPERM;
247ff8e610cb63 Alan Cox              2012-02-24  1788  
247ff8e610cb63 Alan Cox              2012-02-24  1789  		if (get_user(ct, &a->kb_cnt))
247ff8e610cb63 Alan Cox              2012-02-24  1790  			return -EFAULT;
247ff8e610cb63 Alan Cox              2012-02-24  1791  
247ff8e610cb63 Alan Cox              2012-02-24  1792  		if (ct >= MAX_DIACR)
247ff8e610cb63 Alan Cox              2012-02-24  1793  			return -EINVAL;
247ff8e610cb63 Alan Cox              2012-02-24  1794  
247ff8e610cb63 Alan Cox              2012-02-24  1795  		if (ct) {
e651faa2fba4d3 Philipp Stanner       2023-11-03  1796  			buf = memdup_array_user(a->kbdiacruc,
e651faa2fba4d3 Philipp Stanner       2023-11-03  1797  						ct, sizeof(struct kbdiacruc));
9b6519009dbe2b Muhammad Falak R Wani 2016-05-20  1798  			if (IS_ERR(buf))
9b6519009dbe2b Muhammad Falak R Wani 2016-05-20  1799  				return PTR_ERR(buf);
247ff8e610cb63 Alan Cox              2012-02-24  1800  		} 
247ff8e610cb63 Alan Cox              2012-02-24  1801  		spin_lock_irqsave(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1802  		if (ct)
247ff8e610cb63 Alan Cox              2012-02-24  1803  			memcpy(accent_table, buf,
247ff8e610cb63 Alan Cox              2012-02-24  1804  					ct * sizeof(struct kbdiacruc));
247ff8e610cb63 Alan Cox              2012-02-24  1805  		accent_table_size = ct;
247ff8e610cb63 Alan Cox              2012-02-24  1806  		spin_unlock_irqrestore(&kbd_event_lock, flags);
247ff8e610cb63 Alan Cox              2012-02-24  1807  		return 0;
247ff8e610cb63 Alan Cox              2012-02-24  1808  	}
247ff8e610cb63 Alan Cox              2012-02-24  1809  	}
bfb24564b5fd86 Jiri Slaby (SUSE      2025-11-19  1810) 	return 0;
247ff8e610cb63 Alan Cox              2012-02-24  1811  }
079c9534a96da9 Alan Cox              2012-02-28  1812  

:::::: The code at line 1712 was first introduced by commit
:::::: 247ff8e610cb63c015de19191db9666754c2ed79 vt: lock the accent table

:::::: TO: Alan Cox <alan@linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tty:tty-next 27/37] drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets
  2025-11-24 10:25 [tty:tty-next 27/37] drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets kernel test robot
@ 2025-11-24 22:13 ` Nathan Chancellor
  2025-11-25  5:51   ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2025-11-24 22:13 UTC (permalink / raw)
  To: kernel test robot
  Cc: Jiri Slaby (SUSE), llvm, oe-kbuild-all, linux-serial,
	Greg Kroah-Hartman

On Mon, Nov 24, 2025 at 06:25:26PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
> head:   da218406dd50e0ac96bb383de4edd208286efe70
> commit: bfb24564b5fd8625ce5c007f274cabdc3b570969 [27/37] tty: vt/keyboard: use __free()
> config: powerpc-randconfig-002-20251124 (https://download.01.org/0day-ci/archive/20251124/202511241835.EA8lShgH-lkp@intel.com/config)
> compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251124/202511241835.EA8lShgH-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/202511241835.EA8lShgH-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets
>                    if (put_user(asize, &a->kb_cnt))
>                        ^
>    arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
>                      __put_user(x, _pu_addr) : -EFAULT;                    \
>                      ^
>    arch/powerpc/include/asm/uaccess.h:49:3: note: expanded from macro '__put_user'
>                    __put_user_size_goto(__pu_val, __pu_addr, __pu_size, __pu_failed);      \
>                    ^
>    arch/powerpc/include/asm/uaccess.h:127:10: note: expanded from macro '__put_user_size_goto'
>            case 1: __put_user_asm_goto(x, __pus_addr, label, "stb"); break;        \
>                    ^
>    arch/powerpc/include/asm/uaccess.h:87:2: note: expanded from macro '__put_user_asm_goto'
>            asm goto(                                       \
>            ^
>    drivers/tty/vt/keyboard.c:1736:7: note: possible target of asm goto statement
>                    if (put_user(asize, &a->kb_cnt))
>                        ^
>    arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
>                      __put_user(x, _pu_addr) : -EFAULT;                    \
>                      ^
>    arch/powerpc/include/asm/uaccess.h:53:9: note: expanded from macro '__put_user'
>                                                                    \
>                                                                    ^
>    drivers/tty/vt/keyboard.c:1692:33: note: jump exits scope of variable with __attribute__((cleanup))
>                    struct kbdiacr __free(kfree) *dia = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacr),
>                                                  ^
>    drivers/tty/vt/keyboard.c:1722:23: note: jump bypasses initialization of variable with __attribute__((cleanup))
>                    void __free(kfree) *buf = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacruc),
>                                        ^

Previously reported:

  https://lore.kernel.org/202509091702.Oc7eCRDw-lkp@intel.com/

My suggested workaround in that thread is still applicable if it would
be acceptable as a formal patch:

  https://lore.kernel.org/20250909215342.GA2456480@ax162/

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tty:tty-next 27/37] drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets
  2025-11-24 22:13 ` Nathan Chancellor
@ 2025-11-25  5:51   ` Jiri Slaby
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2025-11-25  5:51 UTC (permalink / raw)
  To: Nathan Chancellor, kernel test robot
  Cc: llvm, oe-kbuild-all, linux-serial, Greg Kroah-Hartman

On 24. 11. 25, 23:13, Nathan Chancellor wrote:
> On Mon, Nov 24, 2025 at 06:25:26PM +0800, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
>> head:   da218406dd50e0ac96bb383de4edd208286efe70
>> commit: bfb24564b5fd8625ce5c007f274cabdc3b570969 [27/37] tty: vt/keyboard: use __free()
>> config: powerpc-randconfig-002-20251124 (https://download.01.org/0day-ci/archive/20251124/202511241835.EA8lShgH-lkp@intel.com/config)
>> compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251124/202511241835.EA8lShgH-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/202511241835.EA8lShgH-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>>>> drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets
>>                     if (put_user(asize, &a->kb_cnt))
>>                         ^
>>     arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
>>                       __put_user(x, _pu_addr) : -EFAULT;                    \
>>                       ^
>>     arch/powerpc/include/asm/uaccess.h:49:3: note: expanded from macro '__put_user'
>>                     __put_user_size_goto(__pu_val, __pu_addr, __pu_size, __pu_failed);      \
>>                     ^
>>     arch/powerpc/include/asm/uaccess.h:127:10: note: expanded from macro '__put_user_size_goto'
>>             case 1: __put_user_asm_goto(x, __pus_addr, label, "stb"); break;        \
>>                     ^
>>     arch/powerpc/include/asm/uaccess.h:87:2: note: expanded from macro '__put_user_asm_goto'
>>             asm goto(                                       \
>>             ^
>>     drivers/tty/vt/keyboard.c:1736:7: note: possible target of asm goto statement
>>                     if (put_user(asize, &a->kb_cnt))
>>                         ^
>>     arch/powerpc/include/asm/uaccess.h:67:5: note: expanded from macro 'put_user'
>>                       __put_user(x, _pu_addr) : -EFAULT;                    \
>>                       ^
>>     arch/powerpc/include/asm/uaccess.h:53:9: note: expanded from macro '__put_user'
>>                                                                     \
>>                                                                     ^
>>     drivers/tty/vt/keyboard.c:1692:33: note: jump exits scope of variable with __attribute__((cleanup))
>>                     struct kbdiacr __free(kfree) *dia = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacr),
>>                                                   ^
>>     drivers/tty/vt/keyboard.c:1722:23: note: jump bypasses initialization of variable with __attribute__((cleanup))
>>                     void __free(kfree) *buf = kmalloc_array(MAX_DIACR, sizeof(struct kbdiacruc),
>>                                         ^
> 
> Previously reported:
> 
>    https://lore.kernel.org/202509091702.Oc7eCRDw-lkp@intel.com/

Ah, I forgot about this :(.

> My suggested workaround in that thread is still applicable if it would
> be acceptable as a formal patch:
> 
>    https://lore.kernel.org/20250909215342.GA2456480@ax162/

I think it makes sense. Could you post it formally then?

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-25  5:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24 10:25 [tty:tty-next 27/37] drivers/tty/vt/keyboard.c:1712:7: error: cannot jump from this asm goto statement to one of its possible targets kernel test robot
2025-11-24 22:13 ` Nathan Chancellor
2025-11-25  5:51   ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox