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>] [day] [month] [year] [list]
Message-ID: <e0a7bc4c-aa14-4326-b2fd-7aae797892ba@suswa.mountain>
Date: Sat, 2 Aug 2025 09:24:04 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, John David Anglin <dave.anglin@...l.net>
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
	linux-kernel@...r.kernel.org, Helge Deller <deller@....de>
Subject: arch/parisc/lib/memcpy.c:44 raw_copy_from_user() warn: if statement
 not indented

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a6923c06a3b2e2c534ae28c53a7531e76cc95cfa
commit: 91428ca9320edbab1211851d82429d33b9cd73ef parisc: Check region is readable by user in raw_copy_from_user()
config: parisc-randconfig-r071-20250801 (https://download.01.org/0day-ci/archive/20250802/202508021047.Mp1T16dT-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.1.0

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@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202508021047.Mp1T16dT-lkp@intel.com/

smatch warnings:
arch/parisc/lib/memcpy.c:44 raw_copy_from_user() warn: if statement not indented

vim +44 arch/parisc/lib/memcpy.c

f64fd180ec2c0b Al Viro           2017-03-24  33  unsigned long raw_copy_from_user(void *dst, const void __user *src,
9e91db6b4abecd Helge Deller      2016-10-06  34  			       unsigned long len)
^1da177e4c3f41 Linus Torvalds    2005-04-16  35  {
91428ca9320edb John David Anglin 2025-07-21  36  	unsigned long start = (unsigned long) src;
91428ca9320edb John David Anglin 2025-07-21  37  	unsigned long end = start + len;
91428ca9320edb John David Anglin 2025-07-21  38  	unsigned long newlen = len;
91428ca9320edb John David Anglin 2025-07-21  39  
360bd6c658076f Helge Deller      2022-02-17  40  	mtsp(get_user_space(), SR_TEMP1);
360bd6c658076f Helge Deller      2022-02-17  41  	mtsp(get_kernel_space(), SR_TEMP2);
91428ca9320edb John David Anglin 2025-07-21  42  
91428ca9320edb John David Anglin 2025-07-21  43  	/* Check region is user accessible */
91428ca9320edb John David Anglin 2025-07-21 @44  	if (start)

Was the if statement accidentally deleted?  Otherwise it should
have been indented and multi-line indents get curly braces for
readability even when they are not required by C.

91428ca9320edb John David Anglin 2025-07-21  45  	while (start < end) {
91428ca9320edb John David Anglin 2025-07-21  46  		if (!prober_user(SR_TEMP1, start)) {
91428ca9320edb John David Anglin 2025-07-21  47  			newlen = (start - (unsigned long) src);
91428ca9320edb John David Anglin 2025-07-21  48  			break;
91428ca9320edb John David Anglin 2025-07-21  49  		}
91428ca9320edb John David Anglin 2025-07-21  50  		start += PAGE_SIZE;
91428ca9320edb John David Anglin 2025-07-21  51  		/* align to page boundry which may have different permission */
91428ca9320edb John David Anglin 2025-07-21  52  		start = PAGE_ALIGN_DOWN(start);
91428ca9320edb John David Anglin 2025-07-21  53  	}
91428ca9320edb John David Anglin 2025-07-21  54  	return len - newlen + pa_memcpy(dst, (void __force *)src, newlen);
^1da177e4c3f41 Linus Torvalds    2005-04-16  55  }

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ