Commit 612f468
net/sched: cls_fw: Fix improper refcount update leads to use-after-free
commit 0323bce upstream.
In the event of a failure in tcf_change_indev(), fw_set_parms() will
immediately return an error after incrementing or decrementing
reference counter in tcf_bind_filter(). If attacker can control
reference counter to zero and make reference freed, leading to
use after free.
In order to prevent this, move the point of possible failure above the
point where the TC_FW_CLASSID is handled.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Reported-by: M A Ramdhan <[email protected]>
Signed-off-by: M A Ramdhan <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Reviewed-by: Pedro Tammela <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: SeongJae Park <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent a4b9782 commit 612f468
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | 224 | | |
230 | 225 | | |
231 | 226 | | |
| |||
244 | 239 | | |
245 | 240 | | |
246 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
0 commit comments