]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
SUNRPC: Tighten bounds checking in svc_rqst_replace_page
authorChuck Lever <chuck.lever@oracle.com>
Thu, 26 Feb 2026 14:47:34 +0000 (09:47 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
commit46ca8dd2441ffa49a7f31b9070f972f52c5779c3
tree0f1ff51e8d3b70e4e3037c6497ff8211fc25469e
parent2a83ffc5575013784ea41739daf9e10200e44e7c
SUNRPC: Tighten bounds checking in svc_rqst_replace_page

svc_rqst_replace_page() builds the Reply buffer by advancing
rq_next_page through the response page range. The bounds
check validates rq_next_page against the full rq_pages array,
but the valid range for rq_next_page is

  [rq_respages, rq_page_end].

Use those bounds instead.

This is correct today because rq_respages and rq_page_end
both point into rq_pages, and it prepares for a subsequent
change that separates the Reply page array from rq_pages.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/svc.c