Re: [PATCH] drivers: pnp: proc.c: Handle errors while attaching devices

2021-04-25 Thread Leon Romanovsky
On Sun, Apr 25, 2021 at 01:13:01AM +0530, Anupama K Patil wrote: > isapnp_proc_init() does not look at the return value from > isapnp_proc_attach_device(). Check for this return value in > isapnp_proc_detach_device(). > > Cleanup in isapnp_proc_detach_device and > isapnp_proc_detach_bus() for clea

Re: [PATCH] drivers: pnp: proc.c: Removed unnecessary varibles

2021-04-25 Thread Leon Romanovsky
On Fri, Apr 23, 2021 at 03:08:03PM -0600, Shuah Khan wrote: > On 4/22/21 12:03 PM, Anupama K Patil wrote: > > de, e are two variables of the type 'struct proc_dir_entry' > > which can be removed to save memory. This also fixes a coding style > > issue reported by checkpatch where we are suggested t

[PATCH] drivers: pnp: proc.c: Handle errors while attaching devices

2021-04-25 Thread Anupama K Patil
isapnp_proc_init() does not look at the return value from isapnp_proc_attach_device(). Check for this return value in isapnp_proc_detach_device(). Cleanup in isapnp_proc_detach_device and isapnp_proc_detach_bus() for cleanup. Changed sprintf() to the kernel-space function scnprintf() as it return

Re: [PATCH] drivers: pnp: proc.c: Removed unnecessary varibles

2021-04-25 Thread Shuah Khan
On 4/22/21 12:03 PM, Anupama K Patil wrote: de, e are two variables of the type 'struct proc_dir_entry' which can be removed to save memory. This also fixes a coding style issue reported by checkpatch where we are suggested to make assignment outside the if statement. Sounds like a reasonable

[PATCH] drivers: pnp: proc.c: Removed unnecessary varibles

2021-04-25 Thread Anupama K Patil
de, e are two variables of the type 'struct proc_dir_entry' which can be removed to save memory. This also fixes a coding style issue reported by checkpatch where we are suggested to make assignment outside the if statement. Signed-off-by: Anupama K Patil --- drivers/pnp/isapnp/proc.c | 13 +

Re: [QUERY]drivers: pnp: isapnp:proc.c: assignment inside if statement

2021-04-25 Thread Shuah Khan
On 4/20/21 12:05 PM, anupamakpatil123 wrote: This is a code snippet from line 63 of drivers: pnp: isapnp: proc.c This is an error I came across while looking through some checkpatch errors. if (!(de = bus->procdir)) { sprintf(name, "%02x", bus->number); de = bus

Re: Compiling kernel-3.4.xxx with gcc-9.x. Need some help.

2021-04-25 Thread Willy Tarreau
On Sun, Apr 18, 2021 at 07:25:08PM +0200, Fawad Lateef wrote: > I tried booting the userspace compiled with gcc-9.1 and kernel > compiled with gcc-5.5. But seems like the kernel 3.4.111 is not > compatible with user-space compiled with gcc-9.1. > During boot getting error: "FATAL: kernel too old."

[QUERY]drivers: pnp: isapnp:proc.c: assignment inside if statement

2021-04-25 Thread anupamakpatil123
This is a code snippet from line 63 of drivers: pnp: isapnp: proc.c This is an error I came across while looking through some checkpatch errors. if (!(de = bus->procdir)) { sprintf(name, "%02x", bus->number); de = bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir)

Re: Test if a socket accept is from external network

2021-04-25 Thread John Wood
Hi, On Sun, Apr 25, 2021 at 08:01:55AM -0400, Jeffrey Walton wrote: > On Sun, Apr 25, 2021 at 7:09 AM John Wood wrote: > > > > I'm working in a LSM to detect and mitigate fork brute force attacks > > against vulnerable userspace applications. Now, to fine tuning the > > detection I want to detect

Re: Test if a socket accept is from external network

2021-04-25 Thread Jeffrey Walton
On Sun, Apr 25, 2021 at 7:09 AM John Wood wrote: > > I'm working in a LSM to detect and mitigate fork brute force attacks > against vulnerable userspace applications. Now, to fine tuning the > detection I want to detect a network activity. ... > How can I detect that an external connection (using

Test if a socket accept is from external network

2021-04-25 Thread John Wood
Hi, I'm working in a LSM to detect and mitigate fork brute force attacks against vulnerable userspace applications. Now, to fine tuning the detection I want to detect a network activity. To do so, I can use the following code in the "socket_sock_rcv_skb" hook: static int brute_sock_rcv_skb(struct