[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Dec 2022 18:54:24 +0530
From: Prashanth K <quic_prashk@...cinc.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Gustavo A . R . Silva" <gustavoars@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
John Keeping <john@...anate.com>,
Linyu Yuan <quic_linyyuan@...cinc.com>,
Pratham Pratap <quic_ppratap@...cinc.com>,
Vincent Pelletier <plr.vincent@...il.com>,
"Dan Carpenter" <error27@...il.com>,
Udipto Goswami <quic_ugoswami@...cinc.com>
CC: <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
"# 5 . 15" <stable@...r.kernel.org>,
Prashanth K <quic_prashk@...cinc.com>
Subject: usb: f_fs: Fix CFI failure in ki_complete
Function pointer ki_complete() expects 'long' as its second
argument, but we pass integer from ffs_user_copy_worker. This
might cause a CFI failure, as ki_complete is an indirect call
with mismatched prototype. Fix this by typecasting the second
argument to long.
Cc: <stable@...r.kernel.org> # 5.15
Signed-off-by: Prashanth K <quic_prashk@...cinc.com>
---
drivers/usb/gadget/function/f_fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 73dc10a7..9c26561 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -835,7 +835,7 @@ static void ffs_user_copy_worker(struct work_struct *work)
kthread_unuse_mm(io_data->mm);
}
- io_data->kiocb->ki_complete(io_data->kiocb, ret);
+ io_data->kiocb->ki_complete(io_data->kiocb, (long)ret);
if (io_data->ffs->ffs_eventfd && !kiocb_has_eventfd)
eventfd_signal(io_data->ffs->ffs_eventfd, 1);
--
2.7.4
Powered by blists - more mailing lists