Skip to content

Commit b132cf4

Browse files
Yan, ZhengAlex Elder
authored andcommitted
rbd: Clear ceph_msg->bio_iter for retransmitted message
The bug can cause NULL pointer dereference in write_partial_msg_pages Signed-off-by: Zheng Yan <[email protected]> Reviewed-by: Alex Elder <[email protected]> (cherry picked from commit 4364352)
1 parent 88ed6ea commit b132cf4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/ceph/messenger.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,10 @@ static void prepare_write_message(struct ceph_connection *con)
563563
m->hdr.seq = cpu_to_le64(++con->out_seq);
564564
m->needs_out_seq = false;
565565
}
566+
#ifdef CONFIG_BLOCK
567+
else
568+
m->bio_iter = NULL;
569+
#endif
566570

567571
dout("prepare_write_message %p seq %lld type %d len %d+%d+%d %d pgs\n",
568572
m, con->out_seq, le16_to_cpu(m->hdr.type),

0 commit comments

Comments
 (0)