Skip to contentSkip to conversation

connector/cn_proc: make comm length as TASK_COMM_LEN.

PATCH In review Imran Khan 3 participants 4 messages Feb 9, 2024 – Feb 16, 2024

Subsystems (2)
lore
Share & tools
lore

Imran Khan

author
#0 lore raw

PATCH 1/1 connector/cn_proc: make comm length as TASK_COMM_LEN.

Since comm_proc_event::comm contains a task_struct::comm, make its size same as TASK_COMM_LEN and avoid magic number in buffer size.

---
 include/uapi/linux/cn_proc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/cn_proc.h +1 -1
index f2afb7cc4926..fd876c9b284f 100644
@@ -136,7 +136,7 @@ struct proc_event {
 		struct comm_proc_event {
 			__kernel_pid_t process_pid;
 			__kernel_pid_t process_tgid;
-			char           comm[16];
+			char           comm[TASK_COMM_LEN];
 		} comm;
 
 		struct coredump_proc_event {
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 3 lines · On Fri, 9 Feb 2024 23:10:46 +1100 Imran Khan wrote:

Since comm_proc_event::comm contains a task_struct::comm, make its size same as TASK_COMM_LEN and avoid magic number in buffer size.

missed CCing netdev?

author
#2 lore raw

Hello Jakub,

Quoted 6 lines · Jakub Kicinski
Quoted 3 lines · On Fri, 9 Feb 2024 23:10:46 +1100 Imran Khan wrote:

Since comm_proc_event::comm contains a task_struct::comm, make its size same as TASK_COMM_LEN and avoid magic number in buffer size.

missed CCing netdev?

Thanks for getting back on this. Actually get_maintainer.pl for cn_proc.h was not showing any maintainers, so I took the "To" list from cn_proc.c. For CCing I stuck with what get_maintainer.pl was showing.
I have added netdev in CC now.

Thanks,
Imran

reviewer
#3 lore raw
Quoted 8 lines · Imran Khan

Hello Jakub,

Quoted 5 lines · Jakub Kicinski
Quoted 3 lines · On Fri, 9 Feb 2024 23:10:46 +1100 Imran Khan wrote:

Since comm_proc_event::comm contains a task_struct::comm, make its size same as TASK_COMM_LEN and avoid magic number in buffer size.

Quoted 5 lines
Quoted 1 line

missed CCing netdev?

Thanks for getting back on this. Actually get_maintainer.pl for cn_proc.h was not showing any maintainers, so I took the "To" list from cn_proc.c. For CCing I stuck with what get_maintainer.pl was showing.
I have added netdev in CC now.

Thanks Imran,

please consider submitting a patch to add cn_proc.h (x2?) to MAINTAINERS.