Commit 6170922
ring-buffer: Prevent off-by-one array access in ring_buffer_desc_page()
As pointed out by Smatch, the ring-buffer descriptor array page_va is
counted by nr_page_va, but the accessor ring_buffer_desc_page() allows
access off by one.
Currently, this does not cause problems, as the page ID always comes
from a trusted source. Nonetheless, ensure robustness and fix the
accessor. While at it, make the page_id unsigned.
Link: https://patch.msgid.link/20260410124527.3563970-1-vdonnefort@google.com
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent 1111e9b commit 6170922
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2238 | 2238 | | |
2239 | 2239 | | |
2240 | 2240 | | |
2241 | | - | |
| 2241 | + | |
2242 | 2242 | | |
2243 | | - | |
| 2243 | + | |
2244 | 2244 | | |
2245 | 2245 | | |
2246 | 2246 | | |
| |||
0 commit comments