Skip to contentSkip to conversation

kernel/hung_task: fix address space of proc_dohung_task_timeout_secs

PATCH Applied Ben Dooks 2 participants 4 messages Jul 14, 2022 Hung task detector

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 kernel/hung_task: fix address space of proc_dohung_task_timeout_secs

The proc_dohung_task_timeout_secs() function is incorrectly marked as having a __user buffer as argument 3. However this is not the case and it is casing multiple sparse warnings. Fix the following warnings by removing __user from the argument:

kernel/hung_task.c:237:52: warning: incorrect type in argument 3 (different address spaces)
kernel/hung_task.c:237:52: expected void *
kernel/hung_task.c:237:52: got void [noderef] __user *buffer
kernel/hung_task.c:287:35: warning: incorrect type in initializer (incompatible argument 3 (different address spaces))
kernel/hung_task.c:287:35: expected int ( [usertype] *proc_handler )( ... )
kernel/hung_task.c:287:35: got int ( * )( ... )
kernel/hung_task.c:295:35: warning: incorrect type in initializer (incompatible argument 3 (different address spaces))
kernel/hung_task.c:295:35: expected int ( [usertype] *proc_handler )( ... )
kernel/hung_task.c:295:35: got int ( * )( ... )

---
 kernel/hung_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/hung_task.c +1 -1
index cff3ae8c818f..bb2354f73ded 100644
@@ -229,7 +229,7 @@ static long hung_timeout_jiffies(unsigned long last_checked,
  * Process updating of timeout sysctl
  */
 static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
-				  void __user *buffer,
+				  void *buffer,
 				  size_t *lenp, loff_t *ppos)
 {
 	int ret;
Signature · 1 line
2.35.1
#1 lore raw

On 14/07/2022 08:47, Ben Dooks wrote:

Hey Ben,
Odd CC list here? I assume you're piping get_maintainer into send-email or something, but idk who is going to see or apply this patch! Ditto your other one for this file.

Might be worth adding some of what get_maintainer spits out:
Petr Mladek <[email protected]> (commit_signer:4/4=100%,authored:1/4=25%,removed_lines:10/15=67%)
Andrew Morton <[email protected]> (commit_signer:2/4=50%)
Rasmus Villemoes <[email protected]> (commit_signer:1/4=25%,authored:1/4=25%,removed_lines:1/15=7%) John Ogness <[email protected]> (commit_signer:1/4=25%,authored:1/4=25%,added_lines:10/90=11%,removed_lines:1/15=7%) Kees Cook <[email protected]> (commit_signer:1/4=25%)
Xiaoming Ni <[email protected]> (authored:1/4=25%,added_lines:78/90=87%,removed_lines:3/15=20%)

Thanks,
Conor.

Quoted 33 lines

The proc_dohung_task_timeout_secs() function is incorrectly marked as having a __user buffer as argument 3. However this is not the case and it is casing multiple sparse warnings. Fix the following warnings by removing __user from the argument:

kernel/hung_task.c:237:52: warning: incorrect type in argument 3 (different address spaces)
kernel/hung_task.c:237:52: expected void *
kernel/hung_task.c:237:52: got void [noderef] __user *buffer
kernel/hung_task.c:287:35: warning: incorrect type in initializer (incompatible argument 3 (different address spaces))
kernel/hung_task.c:287:35: expected int ( [usertype] *proc_handler )( ... )
kernel/hung_task.c:287:35: got int ( * )( ... )
kernel/hung_task.c:295:35: warning: incorrect type in initializer (incompatible argument 3 (different address spaces))
kernel/hung_task.c:295:35: expected int ( [usertype] *proc_handler )( ... )
kernel/hung_task.c:295:35: got int ( * )( ... )

---
  kernel/hung_task.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/hung_task.c +1 -1
index cff3ae8c818f..bb2354f73ded 100644
@@ -229,7 +229,7 @@ static long hung_timeout_jiffies(unsigned long last_checked,
   * Process updating of timeout sysctl
   */
  static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
-				  void __user *buffer,
+				  void *buffer,
  				  size_t *lenp, loff_t *ppos)
  {
  	int ret;
author
#2 lore raw
Quoted 6 lines · On 14/07/2022 09:10, [email protected] wrote:

On 14/07/2022 08:47, Ben Dooks wrote:

Hey Ben,
Odd CC list here? I assume you're piping get_maintainer into send-email or something, but idk who is going to see or apply this patch! Ditto your other one for this file.

Since (see below) the script wasn't clear I just cc our management.

Quoted 8 lines

Might be worth adding some of what get_maintainer spits out:
Petr Mladek <[email protected]> (commit_signer:4/4=100%,authored:1/4=25%,removed_lines:10/15=67%)
Andrew Morton <[email protected]> (commit_signer:2/4=50%)
Rasmus Villemoes <[email protected]> (commit_signer:1/4=25%,authored:1/4=25%,removed_lines:1/15=7%) John Ogness <[email protected]> (commit_signer:1/4=25%,authored:1/4=25%,added_lines:10/90=11%,removed_lines:1/15=7%) Kees Cook <[email protected]> (commit_signer:1/4=25%)
Xiaoming Ni <[email protected]> (authored:1/4=25%,added_lines:78/90=87%,removed_lines:3/15=20%)

I think only akpm would be one of those, given no overall maintainer I had a look and just use the kernel list and hope someone picks it up.

#3 lore raw
Quoted 19 lines · Ben Dooks
Quoted 6 lines · On 14/07/2022 09:10, [email protected] wrote:

On 14/07/2022 08:47, Ben Dooks wrote:

Hey Ben,
Odd CC list here? I assume you're piping get_maintainer into send-email or something, but idk who is going to see or apply this patch! Ditto your other one for this file.

Since (see below) the script wasn't clear I just cc our management.

Quoted 8 lines

Might be worth adding some of what get_maintainer spits out:
Petr Mladek <[email protected]> (commit_signer:4/4=100%,authored:1/4=25%,removed_lines:10/15=67%)
Andrew Morton <[email protected]> (commit_signer:2/4=50%)
Rasmus Villemoes <[email protected]> (commit_signer:1/4=25%,authored:1/4=25%,removed_lines:1/15=7%) John Ogness <[email protected]> (commit_signer:1/4=25%,authored:1/4=25%,added_lines:10/90=11%,removed_lines:1/15=7%) Kees Cook <[email protected]> (commit_signer:1/4=25%)
Xiaoming Ni <[email protected]> (authored:1/4=25%,added_lines:78/90=87%,removed_lines:3/15=20%)

Quoted 3 lines

I think only akpm would be one of those, given no overall maintainer I had a look and just use the kernel list and hope someone picks it up.

Yeah, adding Andrew would be a good option. And I guess kernel-janitors?