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

Fixed two things in v2:  Include the <linux/overflow.h> file.  Change
the >= in encode and decode to >.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [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
  0 siblings, 1 reply; 14+ 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] 14+ messages in thread

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11  6:05 [PATCH 0/5 v2] accel/qaic: Improve bounds checking in encode/decode Dan Carpenter
2023-07-11  6:06 ` [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message() Dan Carpenter
2023-07-11  6:07   ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
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

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