From: David S. Miller Date: Fri, 2 Oct 2020 22:27:08 +0000 (-0700) Subject: Merge branch 'Introduce-sendpage_ok-to-detect-misused-sendpage-in-network-related... X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e7d4005d48e248a5bd30db780a67164ccdc37f16;p=linux.git Merge branch 'Introduce-sendpage_ok-to-detect-misused-sendpage-in-network-related-drivers' Coly Li says: ==================== Introduce sendpage_ok() to detect misused sendpage in network related drivers As Sagi Grimberg suggested, the original fix is refind to a more common inline routine: static inline bool sendpage_ok(struct page *page) { return (!PageSlab(page) && page_count(page) >= 1); } If sendpage_ok() returns true, the checking page can be handled by the concrete zero-copy sendpage method in network layer. The v10 series has 7 patches, fixes a WARN_ONCE() usage from v9 series, - The 1st patch in this series introduces sendpage_ok() in header file include/linux/net.h. - The 2nd patch adds WARN_ONCE() for improper zero-copy send in kernel_sendpage(). - The 3rd patch fixes the page checking issue in nvme-over-tcp driver. - The 4th patch adds page_count check by using sendpage_ok() in do_tcp_sendpages() as Eric Dumazet suggested. - The 5th and 6th patches just replace existing open coded checks with the inline sendpage_ok() routine. ==================== Signed-off-by: David S. Miller --- e7d4005d48e248a5bd30db780a67164ccdc37f16