Re: usb: f_fs: Fix CFI failure in ki_complete

From: 'Greg Kroah-Hartman'
Date: Fri Dec 23 2022 - 09:51:20 EST


On Thu, Dec 22, 2022 at 06:21:03PM +0530, Prashanth K wrote:
>
>
> On 14-12-22 11:05 pm, David Laight wrote:
> > From: Greg Kroah-Hartman
> > > Sent: 12 December 2022 13:35
> > >
> > > On Mon, Dec 12, 2022 at 06:54:24PM +0530, Prashanth K wrote:
> > > > 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.
> > >
> > > "might"? Does it or not? If it does, why hasn't this been reported
> > > before?
> >
> > Does the cast even help at all.
> Actually I also have these same questions
> - why we haven't seen any instances other than this one?
> - why its not seen on other indirect function calls?

Great, please work on figuring these out before you resubmit this again
as obviously we can't take this change without knowing the answers here.

good luck!

greg k-h