public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* usb: f_fs: Fix CFI failure in ki_complete
@ 2022-12-12 13:24 Prashanth K
  2022-12-12 13:35 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Prashanth K @ 2022-12-12 13:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Gustavo A . R . Silva, Shuah Khan,
	John Keeping, Linyu Yuan, Pratham Pratap, Vincent Pelletier,
	Dan Carpenter, Udipto Goswami
  Cc: linux-usb, linux-kernel, # 5 . 15, Prashanth K

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@vger.kernel.org> # 5.15
Signed-off-by: Prashanth K <quic_prashk@quicinc.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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-12-23 14:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 13:24 usb: f_fs: Fix CFI failure in ki_complete Prashanth K
2022-12-12 13:35 ` Greg Kroah-Hartman
2022-12-14 13:08   ` Prashanth K
2022-12-14 14:56     ` Greg Kroah-Hartman
2022-12-14 17:35   ` David Laight
2022-12-22 12:51     ` Prashanth K
2022-12-23  9:04       ` Dan Carpenter
2022-12-23 14:41         ` Alexander Lobakin
2022-12-23 14:51       ` 'Greg Kroah-Hartman'
2022-12-12 13:37 ` John Keeping
2022-12-12 13:49 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox