Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rnbd-srv: Zero the rsp buffer before using it

Before using the data buffer to send back the response message, zero it
completely. This prevents any stray bytes to be picked up by the client
side when there the message is exchanged between different protocol
versions.

Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Grzegorz Prajsner <grzegorz.prajsner@ionos.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Md Haris Iqbal and committed by
Jens Axboe
69d26698 4ac9690d

+3
+3
drivers/block/rnbd/rnbd-srv.c
··· 551 551 { 552 552 struct block_device *bdev = file_bdev(sess_dev->bdev_file); 553 553 554 + memset(rsp, 0, sizeof(*rsp)); 555 + 554 556 rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP); 555 557 rsp->device_id = cpu_to_le32(sess_dev->device_id); 556 558 rsp->nsectors = cpu_to_le64(bdev_nr_sectors(bdev)); ··· 659 657 660 658 trace_process_msg_sess_info(srv_sess, sess_info_msg); 661 659 660 + memset(rsp, 0, sizeof(*rsp)); 662 661 rsp->hdr.type = cpu_to_le16(RNBD_MSG_SESS_INFO_RSP); 663 662 rsp->ver = srv_sess->ver; 664 663 }