mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 16:21:53 +00:00
nss-ecm: fix read/write UDP/TCP denied ports
In Linux kernel 6.6, the sysctl infrastructure changed how it handles user/kernel memory boundaries. The sysctl handlers now take a regular void *buffer instead of void __user *buffer because the sysctl core now handles the user-to-kernel copy/validation automatically. Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
parent
991bc745ac
commit
8660c6d6e5
@ -0,0 +1,79 @@
|
||||
--- a/frontends/ecm_front_end_common.c
|
||||
+++ b/frontends/ecm_front_end_common.c
|
||||
@@ -860,7 +860,7 @@ uint64_t ecm_front_end_get_slow_packet_c
|
||||
* ecm_front_end_ppe_fse_enable_limit_handler()
|
||||
* Sysctl to enable/disable FSE programming through PPE.
|
||||
*/
|
||||
-int ecm_front_end_ppe_fse_enable_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
+int ecm_front_end_ppe_fse_enable_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -895,7 +895,7 @@ int ecm_front_end_ppe_fse_enable_handler
|
||||
* ecm_front_end_db_conn_limit_handler()
|
||||
* Database connection limit sysctl node handler.
|
||||
*/
|
||||
-int ecm_front_end_db_conn_limit_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
+int ecm_front_end_db_conn_limit_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
int current_value;
|
||||
@@ -930,7 +930,7 @@ int ecm_front_end_db_conn_limit_handler(
|
||||
* ecm_front_end_denied_ports_read()
|
||||
* Reads the denied ports from the denied ports array and prints.
|
||||
*/
|
||||
-static void ecm_front_end_denied_ports_read(void __user *buffer, size_t *lenp, loff_t *ppos, struct hlist_head *denied_ports)
|
||||
+static void ecm_front_end_denied_ports_read(void *buffer, size_t *lenp, loff_t *ppos, struct hlist_head *denied_ports)
|
||||
{
|
||||
char *read_buf;
|
||||
int i, len;
|
||||
@@ -966,7 +966,7 @@ static void ecm_front_end_denied_ports_r
|
||||
len = scnprintf(read_buf + bytes, 4, "\n");
|
||||
bytes += len;
|
||||
|
||||
- bytes = simple_read_from_buffer(buffer, *lenp, ppos, read_buf, bytes);
|
||||
+ bytes = memory_read_from_buffer(buffer, *lenp, ppos, read_buf, bytes);
|
||||
*lenp = bytes;
|
||||
kfree(read_buf);
|
||||
}
|
||||
@@ -993,7 +993,7 @@ static inline bool ecm_front_end_is_port
|
||||
* ecm_front_end_denied_ports_handler()
|
||||
* Proc handler function for denied ports read/write operation.
|
||||
*/
|
||||
-static int ecm_front_end_denied_ports_handler(int write, void __user *buffer, size_t *lenp, loff_t *ppos, struct hlist_head *denied_ports, bool is_udp)
|
||||
+static int ecm_front_end_denied_ports_handler(int write, void *buffer, size_t *lenp, loff_t *ppos, struct hlist_head *denied_ports, bool is_udp)
|
||||
{
|
||||
|
||||
char *buf;
|
||||
@@ -1018,10 +1018,9 @@ static int ecm_front_end_denied_ports_ha
|
||||
count = ECM_FRONT_END_DENIED_PORTS_HTABLE_SIZE * 8 * sizeof(char);
|
||||
}
|
||||
|
||||
- if (copy_from_user(buf, buffer, count)) {
|
||||
- kfree(pfree);
|
||||
- return -EFAULT;
|
||||
- }
|
||||
+ memcpy(buf, buffer, count);
|
||||
+ *lenp = count;
|
||||
+ *ppos += count;
|
||||
|
||||
token = strsep(&buf, " ");
|
||||
if (strlen(token) != 3) {
|
||||
@@ -1115,7 +1114,7 @@ static int ecm_front_end_denied_ports_ha
|
||||
* ecm_front_end_udp_denied_ports_handler()
|
||||
* Proc handler function for UDP denied ports read/write operation.
|
||||
*/
|
||||
-static int ecm_front_end_udp_denied_ports_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
+static int ecm_front_end_udp_denied_ports_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
/*
|
||||
* Usage:
|
||||
@@ -1135,7 +1134,7 @@ static int ecm_front_end_udp_denied_port
|
||||
* ecm_front_end_tcp_denied_ports_handler()
|
||||
* Proc handler function for TCP denied ports read/write operation.
|
||||
*/
|
||||
-static int ecm_front_end_tcp_denied_ports_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
+static int ecm_front_end_tcp_denied_ports_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
/*
|
||||
* Usage:
|
||||
Loading…
Reference in New Issue
Block a user