aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-10-21 19:27:58 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:33 -0500
commitd37322a43ebac79eef417149f5696390cf8872db (patch)
tree71538cfff1bc2bd82e744ece265e7e6c45c07c6f /include/scsi
parent7221d7e59d1c675828b6de50b757cd8282011a5d (diff)
[SCSI] libfc: Fix frags in frame exceeding SKB_MAX_FRAGS in fc_fcp_send_data
In case of sequence offload, in fc_fcp_send_data(), the skb_fill_page_info() called may end up adding more frags to the skb_shinfo(fp_skb(fp))->frags[], exceeding SKB_MAX_FRAGS, this eventually corrupts the memory. I am adding the FR_FRAME_SG_LEN back, but as SKB_MAX_FRAGS -1, leaving 1 for our fcoe_eof_crc page. And send will be broken into multiple large sends if the frame already contains more frags than skb handle. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/fc_frame.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index c35d2383cc26..148126dcf9e9 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -37,6 +37,9 @@
37#define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ 37#define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */
38#define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ 38#define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */
39 39
40/* Max number of skb frags allowed, reserving one for fcoe_crc_eof page */
41#define FC_FRAME_SG_LEN (MAX_SKB_FRAGS - 1)
42
40#define fp_skb(fp) (&((fp)->skb)) 43#define fp_skb(fp) (&((fp)->skb))
41#define fr_hdr(fp) ((fp)->skb.data) 44#define fr_hdr(fp) ((fp)->skb.data)
42#define fr_len(fp) ((fp)->skb.len) 45#define fr_len(fp) ((fp)->skb.len)