virt_to_page() call should not be used on kernel text and data addresses. virt_to_page() is used by sg_init_one(). So change padbuf to be allocated within iscsi_segment.
Unified · Split
| @@ -177,7 +177,6 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn, · 176 unmodified lines | |||
| 177 | struct iscsi_segment *segment, int recv, | 177 | struct iscsi_segment *segment, int recv, |
| 178 | unsigned copied) | 178 | unsigned copied) |
| 179 | { | 179 | { |
| 180 | static unsigned char padbuf[ISCSI_PAD_LEN]; | ||
| 181 | struct scatterlist sg; | 180 | struct scatterlist sg; |
| 182 | unsigned int pad; | 181 | unsigned int pad; |
| 183 | 182 | ||
| @@ -233,7 +232,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn, · 49 unmodified lines | |||
| 233 | debug_tcp("consume %d pad bytes\n", pad); | 232 | debug_tcp("consume %d pad bytes\n", pad); |
| 234 | segment->total_size += pad; | 233 | segment->total_size += pad; |
| 235 | segment->size = pad; | 234 | segment->size = pad; |
| 236 | segment->data = padbuf; | 235 | segment->data = segment->padbuf; |
| 237 | return 0; | 236 | return 0; |
| 238 | } | 237 | } |
| 239 | } | 238 | } |
| @@ -39,6 +39,7 @@ struct iscsi_segment { · 38 unmodified lines | |||
| 39 | unsigned int total_copied; | 39 | unsigned int total_copied; |
| 40 | 40 | ||
| 41 | struct hash_desc *hash; | 41 | struct hash_desc *hash; |
| 42 | unsigned char padbuf[ISCSI_PAD_LEN]; | ||
| 42 | unsigned char recv_digest[ISCSI_DIGEST_SIZE]; | 43 | unsigned char recv_digest[ISCSI_DIGEST_SIZE]; |
| 43 | unsigned char digest[ISCSI_DIGEST_SIZE]; | 44 | unsigned char digest[ISCSI_DIGEST_SIZE]; |
| 44 | unsigned int digest_len; | 45 | unsigned int digest_len; |