Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3224463pxa; Tue, 18 Aug 2020 09:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGg+BCXoVaJf8t5uIWEpBpGAaced5pnn+ADQPIvBJXmeaMtDcPrrRFYd//g1bzeToOPh5P X-Received: by 2002:a17:906:2c4a:: with SMTP id f10mr20874993ejh.352.1597768554163; Tue, 18 Aug 2020 09:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597768554; cv=none; d=google.com; s=arc-20160816; b=dfTtevB/GZOWzIkPQFTfUz3xegUPnPJlLfQvfI4oyRUcQgnp0xxNxaCasfKq5pf2aL VCe3MtHtzd5gtkVOMwiKfMFKmLx0wnAVfFR3OV1zQjzvfxcN86ysGd/piTZdJAC7BLX2 VMU8VmCaMvWFRoWdhvGCRnNocw41Zkmh/gJ8xfdi3YfjsK63glwRxgzMQvqVoEJmYErX 9dRkqqyrotchllA8beFVwpxHxP3F3lyMXG2OrEncJ2XkAjA0J72EXlbD7QorN8MPkgNO JkStuMIXiwpv8V1PK3Lz4zDxPTI04jUCbH0mk0SM+2IQwWuWUCp1kZvpJ3x1QcY71zpO KENw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:from:references:cc:to; bh=X314X9gbxoKYselJtpgDWoAc9h3Sthoimz1EXroPZ04=; b=RbR3gRvguDMQTX2zaL5wGHi7XNNgrScZJlkEI4hgBSFyzTXvUwfVF9A53eeFL9/FHU XpG+asztuk43VS91naHq0PzBCEEDPpgH7dmfCT4IQFBOFdOJSt/ktX5B6VFvDLX3MvfW o2W34ZkX1w05cuRzospdB8TWKtvoPFOOMFz2KPSij449x/A1K73tu/vQ0llg4rSm0cyp CoAiJQrYn02SX/GtECqfUUYqhnmzYC3RRz/pgF0u0jnqUIJ9F007fE1vmpoH0j26jVf2 CCX0hO8jBS6lZQuEbMxnXrzZyESfqGDeSX8hHhbg8RHZ4wYwKcIm9X5clkV7Mqk4VniJ ttMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc26si14137016ejb.333.2020.08.18.09.35.29; Tue, 18 Aug 2020 09:35:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728122AbgHRQdw (ORCPT + 99 others); Tue, 18 Aug 2020 12:33:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:58704 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbgHRQdt (ORCPT ); Tue, 18 Aug 2020 12:33:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B66ABAB89; Tue, 18 Aug 2020 16:34:12 +0000 (UTC) To: Christoph Hellwig Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Chaitanya Kulkarni , Hannes Reinecke , Jan Kara , Jens Axboe , Mikhail Skorzhinskii , Philipp Reisner , Sagi Grimberg , Vlastimil Babka , stable@vger.kernel.org References: <20200818131227.37020-1-colyli@suse.de> <20200818131227.37020-2-colyli@suse.de> <20200818162404.GA27196@lst.de> From: Coly Li Autocrypt: addr=colyli@suse.de; keydata= mQINBFYX6S8BEAC9VSamb2aiMTQREFXK4K/W7nGnAinca7MRuFUD4JqWMJ9FakNRd/E0v30F qvZ2YWpidPjaIxHwu3u9tmLKqS+2vnP0k7PRHXBYbtZEMpy3kCzseNfdrNqwJ54A430BHf2S GMVRVENiScsnh4SnaYjFVvB8SrlhTsgVEXEBBma5Ktgq9YSoy5miatWmZvHLFTQgFMabCz/P j5/xzykrF6yHo0rHZtwzQzF8rriOplAFCECp/t05+OeHHxjSqSI0P/G79Ll+AJYLRRm9til/ K6yz/1hX5xMToIkYrshDJDrUc8DjEpISQQPhG19PzaUf3vFpmnSVYprcWfJWsa2wZyyjRFkf J51S82WfclafNC6N7eRXedpRpG6udUAYOA1YdtlyQRZa84EJvMzW96iSL1Gf+ZGtRuM3k49H 1wiWOjlANiJYSIWyzJjxAd/7Xtiy/s3PRKL9u9y25ftMLFa1IljiDG+mdY7LyAGfvdtIkanr iBpX4gWXd7lNQFLDJMfShfu+CTMCdRzCAQ9hIHPmBeZDJxKq721CyBiGAhRxDN+TYiaG/UWT 7IB7LL4zJrIe/xQ8HhRO+2NvT89o0LxEFKBGg39yjTMIrjbl2ZxY488+56UV4FclubrG+t16 r2KrandM7P5RjR+cuHhkKseim50Qsw0B+Eu33Hjry7YCihmGswARAQABtBhDb2x5IExpIDxj b2x5bGlAc3VzZS5kZT6JAlYEEwEIAEACGyMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgBYh BOo+RS/0+Uhgjej60Mc5B5Nrffj8BQJcR84dBQkY++fuAAoJEMc5B5Nrffj8ixcP/3KAKg1X EcoW4u/0z+Ton5rCyb/NpAww8MuRjNW82UBUac7yCi1y3OW7NtLjuBLw5SaVG5AArb7IF3U0 qTOobqfl5XHsT0o5wFHZaKUrnHb6y7V3SplsJWfkP3JmOooJsQB3z3K96ZTkFelsNb0ZaBRu gV+LA4MomhQ+D3BCDR1it1OX/tpvm2uaDF6s/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KgKa/4cSZX2x/5+KkQx9wHwackw5gDCvAdZ+Q81nm6tRxEYBBiVDQZYqO73stgT ZyrkxykUbQIy8PI+g7XMDCMnPiDncQqgf96KR3cvw4wN8QrgA6xRo8xOc2C3X7jTMQUytCz9 0MyV1QARAQABiQI8BBgBCAAmAhsMFiEE6j5FL/T5SGCN6PrQxzkHk2t9+PwFAlxHziAFCRj7 5/EACgkQxzkHk2t9+PxgfA//cH5R1DvpJPwraTAl24SUcG9EWe+NXyqveApe05nk15zEuxxd e4zFEjo+xYZilSveLqYHrm/amvQhsQ6JLU+8N60DZHVcXbw1Eb8CEjM5oXdbcJpXh1/1BEwl 4phsQMkxOTns51bGDhTQkv4lsZKvNByB9NiiMkT43EOx14rjkhHw3rnqoI7ogu8OO7XWfKcL CbchjJ8t3c2XK1MUe056yPpNAT2XPNF2EEBPG2Y2F4vLgEbPv1EtpGUS1+JvmK3APxjXUl5z 6xrxCQDWM5AAtGfM/IswVjbZYSJYyH4BQKrShzMb0rWUjkpXvvjsjt8rEXpZEYJgX9jvCoxt oqjCKiVLpwje9WkEe9O9VxljmPvxAhVqJjX62S+TGp93iD+mvpCoHo3+CcvyRcilz+Ko8lfO hS9tYT0HDUiDLvpUyH1AR2xW9RGDevGfwGTpF0K6cLouqyZNdhlmNciX48tFUGjakRFsxRmX K0Jx4CEZubakJe+894sX6pvNFiI7qUUdB882i5GR3v9ijVPhaMr8oGuJ3kvwBIA8lvRBGVGn 9xvzkQ8Prpbqh30I4NMp8MjFdkwCN6znBKPHdjNTwE5PRZH0S9J0o67IEIvHfH0eAWAsgpTz +jwc7VKH7vkvgscUhq/v1/PEWCAqh9UHy7R/jiUxwzw/288OpgO+i+2l11Y= Subject: Re: [PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h Message-ID: <217ec0ec-3c5a-a8ed-27d9-c634f0b9a045@suse.de> Date: Wed, 19 Aug 2020 00:33:37 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200818162404.GA27196@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/19 00:24, Christoph Hellwig wrote: > I think we should go for something simple like this instead: This idea is fine to me. Should a warning message be through here? IMHO the driver still sends an improper page in, fix it in silence is too kind or over nice to the buggy driver(s). And maybe the fix in nvme-tcp driver and do_tcp_sendpages() are still necessary. I am not network expert, this is my opinion for reference. Coly Li > --- > From 4867e158ee86ebd801b4c267e8f8a4a762a71343 Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Tue, 18 Aug 2020 18:19:23 +0200 > Subject: net: bypass ->sendpage for slab pages > > Sending Slab or tail pages into ->sendpage will cause really strange > delayed oops. Prevent it right in the networking code instead of > requiring drivers to work around the fact. > > Signed-off-by: Christoph Hellwig > --- > net/socket.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/net/socket.c b/net/socket.c > index dbbe8ea7d395da..fbc82eb96d18ce 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -3638,7 +3638,12 @@ EXPORT_SYMBOL(kernel_getpeername); > int kernel_sendpage(struct socket *sock, struct page *page, int offset, > size_t size, int flags) > { > - if (sock->ops->sendpage) > + /* > + * sendpage does manipulates the refcount of the passed in page, which > + * does not work for Slab pages, or for tails of non-__GFP_COMP > + * high order pages. > + */ > + if (sock->ops->sendpage && !PageSlab(page) && page_count(page) > 0) > return sock->ops->sendpage(sock, page, offset, size, flags); > > return sock_no_sendpage(sock, page, offset, size, flags); >