Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH 0/5] accel/qaic: Improve bounds checking in encode/decode
@ 2023-06-21  7:21 Dan Carpenter
  2023-06-21  7:21 ` [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message() Dan Carpenter
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Dan Carpenter @ 2023-06-21  7:21 UTC (permalink / raw)
  To: Jeffrey Hugo
  Cc: Carl Vanderlip, Pranjal Ramajor Asha Kanojiya, Oded Gabbay,
	linux-arm-msm, dri-devel, kernel-janitors

(I think this is the first cover letter I have ever written).

These patches are based on review and not from testing.

I found it quite complicated to track the buffer sizes.  What happens
is the qaic_manage() gets a buffer user_msg->data[] which has
user_msg->len bytes.  The qaic_manage() calls qaic_manage_msg_xfer()
which encodes the user's message.

Then we get a response and we decode the response back into
user_msg->data[], but we don't check that it is overflowed.  We instead
copy seem to check against msg_hdr_len (which would prevent a read
overflow).  At the end user_msg->len gets set to the number of bytes
that we copied to the buffer.

I'm coming to this code brand new, it's the first time I have seen it.
So I don't really understand.  There is an element of trust in
msg_hdr_len but then at other times we check it for integer overflows
which indicates deep distrust.

What I'm saying is that there may be more issues in this code.  But also
that I don't really understand it so please review carefully.

The patch that I'm least sure of is 4/5:

[PATCH 4/5] accel/qaic: move and expand integer overflow checks for
 map_user_pages()

regards,
dan carpenter

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

end of thread, other threads:[~2023-07-08  5:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21  7:21 [PATCH 0/5] accel/qaic: Improve bounds checking in encode/decode Dan Carpenter
2023-06-21  7:21 ` [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message() Dan Carpenter
2023-06-22 11:24   ` Pranjal Ramajor Asha Kanojiya
2023-06-22 11:43     ` Dan Carpenter
2023-06-22 11:54       ` Dan Carpenter
2023-07-04  6:27   ` Pranjal Ramajor Asha Kanojiya
2023-07-04  6:34     ` Pranjal Ramajor Asha Kanojiya
2023-07-04  8:48       ` Dan Carpenter
2023-07-04  8:38     ` Dan Carpenter
2023-07-04  9:48       ` Pranjal Ramajor Asha Kanojiya
2023-07-04  9:58         ` Dan Carpenter
2023-07-07 18:29           ` Jeffrey Hugo
2023-06-21  7:21 ` [PATCH 2/5] accel/qaic: tighten bounds checking in decode_message() Dan Carpenter
2023-07-04  6:30   ` Pranjal Ramajor Asha Kanojiya
2023-07-07 18:43   ` Jeffrey Hugo
2023-06-21  7:22 ` [PATCH 3/5] accel/qaic: Add consistent integer overflow checks Dan Carpenter
2023-07-07 18:51   ` Jeffrey Hugo
2023-07-08  5:06     ` Pranjal Ramajor Asha Kanojiya
2023-06-21  7:22 ` [PATCH 4/5] accel/qaic: move and expand integer overflow checks for map_user_pages() Dan Carpenter
2023-07-07 19:16   ` Jeffrey Hugo
2023-06-21  7:22 ` [PATCH 5/5] accel/qaic: Fix a leak in map_user_pages() Dan Carpenter
2023-07-07 19:24   ` Jeffrey Hugo
2023-07-08  4:44   ` Pranjal Ramajor Asha Kanojiya
2023-06-22  2:53 ` [PATCH 0/5] accel/qaic: Improve bounds checking in encode/decode Jeffrey Hugo
2023-06-22 10:22   ` Dan Carpenter

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