Commit fb1f16d
usb: gadget: f_fs: change ep->status safe in ffs_epfile_io()
If a task read/write data in blocking mode, it will wait the completion
in ffs_epfile_io(), if function unbind occurs, ffs_func_unbind() will
kfree ffs ep, once the task wake up, it still dereference the ffs ep to
obtain the request status.
Fix it by moving the request status to io_data which is stack-safe.
Cc: <stable@vger.kernel.org> # 5.15
Reported-by: Michael Wu <michael@allwinnertech.com>
Tested-by: Michael Wu <michael@allwinnertech.com>
Reviewed-by: John Keeping <john@metanate.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1654863478-26228-2-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 802dcaf commit fb1f16d
1 file changed
Lines changed: 19 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
| |||
227 | 225 | | |
228 | 226 | | |
229 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
| 711 | + | |
| 712 | + | |
710 | 713 | | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
716 | 720 | | |
717 | 721 | | |
718 | 722 | | |
| |||
1050 | 1054 | | |
1051 | 1055 | | |
1052 | 1056 | | |
1053 | | - | |
1054 | 1057 | | |
1055 | 1058 | | |
1056 | 1059 | | |
| |||
1066 | 1069 | | |
1067 | 1070 | | |
1068 | 1071 | | |
1069 | | - | |
| 1072 | + | |
| 1073 | + | |
1070 | 1074 | | |
1071 | 1075 | | |
1072 | 1076 | | |
| |||
1075 | 1079 | | |
1076 | 1080 | | |
1077 | 1081 | | |
1078 | | - | |
| 1082 | + | |
1079 | 1083 | | |
1080 | 1084 | | |
1081 | 1085 | | |
1082 | 1086 | | |
1083 | 1087 | | |
1084 | 1088 | | |
1085 | 1089 | | |
1086 | | - | |
1087 | | - | |
| 1090 | + | |
| 1091 | + | |
1088 | 1092 | | |
1089 | 1093 | | |
1090 | 1094 | | |
1091 | 1095 | | |
1092 | | - | |
1093 | | - | |
| 1096 | + | |
| 1097 | + | |
1094 | 1098 | | |
1095 | 1099 | | |
1096 | | - | |
| 1100 | + | |
1097 | 1101 | | |
1098 | 1102 | | |
1099 | 1103 | | |
| |||
0 commit comments