Merge pull request #831 from micmac1/fs-vpx-CVE-2023-5217
[feed/telephony.git] / libs / dahdi-linux / patches / 142-Remove-checks-for-HAVE_UNLOCKED_IOCTL-for-kernel-5.9.patch
1 From 6d4c748e0470efac90e7dc4538ff3c5da51f0169 Mon Sep 17 00:00:00 2001
2 From: Shaun Ruffell <sruffell@sruffell.net>
3 Date: Mon, 16 Nov 2020 22:01:22 -0600
4 Subject: [PATCH 10/12] Remove checks for HAVE_UNLOCKED_IOCTL for kernel >= 5.9
5
6 In upstream commit (4e24566a134ea1674 "fs: remove the HAVE_UNLOCKED_IOCTL and
7 HAVE_COMPAT_IOCTL defines") [1] the kernel removed these defines.
8
9 All supported kernels include support for the unlocked_ioctl now, so
10 DAHDI can also remove these checks.
11
12 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e24566a134ea167441a1ffa3d439a27c
13
14 Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
15 ---
16 drivers/dahdi/dahdi-base.c | 44 ---------------------------------
17 drivers/dahdi/dahdi_transcode.c | 11 ---------
18 2 files changed, 55 deletions(-)
19
20 --- a/drivers/dahdi/dahdi-base.c
21 +++ b/drivers/dahdi/dahdi-base.c
22 @@ -53,10 +53,6 @@
23 #include <linux/ktime.h>
24 #include <linux/slab.h>
25
26 -#if defined(HAVE_UNLOCKED_IOCTL) && defined(CONFIG_BKL)
27 -#include <linux/smp_lock.h>
28 -#endif
29 -
30 #include <linux/ppp_defs.h>
31
32 #include <asm/atomic.h>
33 @@ -4069,14 +4065,6 @@ dahdi_timer_unlocked_ioctl(struct file *
34 return 0;
35 }
36
37 -#ifndef HAVE_UNLOCKED_IOCTL
38 -static int dahdi_timer_ioctl(struct inode *inode, struct file *file,
39 - unsigned int cmd, unsigned long data)
40 -{
41 - return dahdi_timer_unlocked_ioctl(file, cmd, data);
42 -}
43 -#endif
44 -
45 static int dahdi_ioctl_getgains(struct file *file, unsigned long data)
46 {
47 int res = 0;
48 @@ -7011,14 +6999,6 @@ exit:
49 return ret;
50 }
51
52 -#ifndef HAVE_UNLOCKED_IOCTL
53 -static int dahdi_ioctl(struct inode *inode, struct file *file,
54 - unsigned int cmd, unsigned long data)
55 -{
56 - return dahdi_unlocked_ioctl(file, cmd, data);
57 -}
58 -#endif
59 -
60 /**
61 * _get_next_channo - Return the next taken channel number from the span list.
62 * @span: The span with which to start the search.
63 @@ -10272,11 +10252,7 @@ static const struct file_operations dahd
64 .owner = THIS_MODULE,
65 .open = dahdi_open,
66 .release = dahdi_release,
67 -#ifdef HAVE_UNLOCKED_IOCTL
68 .unlocked_ioctl = dahdi_unlocked_ioctl,
69 -#else
70 - .ioctl = dahdi_ioctl,
71 -#endif
72 .poll = dahdi_poll,
73 .read = dahdi_no_read,
74 .write = dahdi_no_write,
75 @@ -10285,11 +10261,7 @@ static const struct file_operations dahd
76 static const struct file_operations dahdi_timer_fops = {
77 .owner = THIS_MODULE,
78 .release = dahdi_timer_release,
79 -#ifdef HAVE_UNLOCKED_IOCTL
80 .unlocked_ioctl = dahdi_timer_unlocked_ioctl,
81 -#else
82 - .ioctl = dahdi_timer_ioctl,
83 -#endif
84 .poll = dahdi_timer_poll,
85 .read = dahdi_no_read,
86 .write = dahdi_no_write,
87 @@ -10352,21 +10324,9 @@ nodev_unlocked_ioctl(struct file *file,
88 return nodev_common("ioctl");
89 }
90
91 -#ifndef HAVE_UNLOCKED_IOCTL
92 -static int nodev_ioctl(struct inode *inode, struct file *file,
93 - unsigned int cmd, unsigned long data)
94 -{
95 - return nodev_unlocked_ioctl(file, cmd, data);
96 -}
97 -#endif
98 -
99 static const struct file_operations nodev_fops = {
100 .owner = THIS_MODULE,
101 -#ifdef HAVE_UNLOCKED_IOCTL
102 .unlocked_ioctl = nodev_unlocked_ioctl,
103 -#else
104 - .ioctl = nodev_ioctl,
105 -#endif
106 .read = nodev_chan_read,
107 .write = nodev_chan_write,
108 .poll = nodev_chan_poll,
109 @@ -10376,11 +10336,7 @@ static const struct file_operations dahd
110 .owner = THIS_MODULE,
111 .open = dahdi_open,
112 .release = dahdi_release,
113 -#ifdef HAVE_UNLOCKED_IOCTL
114 .unlocked_ioctl = dahdi_unlocked_ioctl,
115 -#else
116 - .ioctl = dahdi_ioctl,
117 -#endif
118 .read = dahdi_chan_read,
119 .write = dahdi_chan_write,
120 .poll = dahdi_chan_poll,
121 --- a/drivers/dahdi/dahdi_transcode.c
122 +++ b/drivers/dahdi/dahdi_transcode.c
123 @@ -397,13 +397,6 @@ static long dahdi_tc_unlocked_ioctl(stru
124 };
125 }
126
127 -#ifndef HAVE_UNLOCKED_IOCTL
128 -static int dahdi_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
129 -{
130 - return (int)dahdi_tc_unlocked_ioctl(file, cmd, data);
131 -}
132 -#endif
133 -
134 static unsigned int dahdi_tc_poll(struct file *file, struct poll_table_struct *wait_table)
135 {
136 int ret;
137 @@ -427,11 +420,7 @@ static struct file_operations __dahdi_tr
138 .owner = THIS_MODULE,
139 .open = dahdi_tc_open,
140 .release = dahdi_tc_release,
141 -#ifdef HAVE_UNLOCKED_IOCTL
142 .unlocked_ioctl = dahdi_tc_unlocked_ioctl,
143 -#else
144 - .ioctl = dahdi_tc_ioctl,
145 -#endif
146 .read = dahdi_tc_read,
147 .write = dahdi_tc_write,
148 .poll = dahdi_tc_poll,