mirror of
https://github.com/LiBwrt-op/openwrt-6.x.git
synced 2025-12-17 01:06:35 +00:00
Use the copy_from_user() and copy_to_user() functions for accessing memory provided by the user in the ptm netdev iotls. In addition also check for root permission before executing ioctl. Suggested-by: Stanislav Fort from Aisle Research Reported-by: Stanislav Fort from Aisle Research Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
--- a/ifxmips_ptm_adsl.c
|
|
+++ b/ifxmips_ptm_adsl.c
|
|
@@ -178,9 +178,11 @@ static INLINE void mailbox_signal(unsign
|
|
*/
|
|
static INLINE void proc_file_create(void);
|
|
static INLINE void proc_file_delete(void);
|
|
+#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
|
|
static int proc_read_version(char *, char **, off_t, int, int *, void *);
|
|
static int proc_read_wanmib(char *, char **, off_t, int, int *, void *);
|
|
static int proc_write_wanmib(struct file *, const char *, unsigned long, void *);
|
|
+#endif
|
|
#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC
|
|
static int proc_read_genconf(char *, char **, off_t, int, int *, void *);
|
|
#endif
|
|
@@ -936,6 +938,7 @@ static INLINE void proc_file_delete(void
|
|
remove_proc_entry("driver/ifx_ptm", NULL);
|
|
}
|
|
|
|
+#if defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
|
|
static int proc_read_version(char *buf, char **start, off_t offset, int count, int *eof, void *data)
|
|
{
|
|
int len = 0;
|
|
@@ -1010,8 +1013,9 @@ static int proc_write_wanmib(struct file
|
|
|
|
return count;
|
|
}
|
|
+#endif
|
|
|
|
-#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC
|
|
+#if defined(ENABLE_FW_PROC) && ENABLE_FW_PROC && defined(ENABLE_DBG_PROC) && ENABLE_DBG_PROC
|
|
|
|
static int proc_read_genconf(char *page, char **start, off_t off, int count, int *eof, void *data)
|
|
{
|