Received: by 10.223.176.5 with SMTP id f5csp3200605wra; Thu, 1 Feb 2018 12:24:19 -0800 (PST) X-Google-Smtp-Source: AH8x2252DYTI46Hqqp+BDQSWX3EW8tOPzIeujBBtvMf2RLlRulcVtsJrphXlDzgoL+gO8+0EtMhJ X-Received: by 2002:a17:902:9306:: with SMTP id bc6-v6mr32509094plb.29.1517516659861; Thu, 01 Feb 2018 12:24:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517516659; cv=none; d=google.com; s=arc-20160816; b=QKZT5vFHoLRzWcFFktJ9G/p1lM/VmBchLlJCEL6f90QggrBW0sNHrMmE3Ehyh9dN17 Qn3W56BKlKK0jGhaSnTR/SSD9a6Dm3F2kszJghYGySl0ShEOwQ4+WWazWuOQ0yvwUCTp 2OL1z8H6hCbMTw3Bmxf6Ag7q8DUjZBNGJBA6rMZgYuulM32WZDgF47/7PD15jOUGI1dk 458ZGQ28MqO1A2uQBu/8QtwVRt6gA4XMR2SrSzJAUyxGAyX8iysy4XwP7nhx+gtvZmwX 8tIYNF24TAZO0n/XRaAVygZdOeOsbfJL+i4T1ukaUUQfuJnB2zr2y+f7/d8ddw+VFQi6 340A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=kB03nunkgMIuxQZI+zKiqFu+oZs9BJvjfZ45uUhC8bo=; b=sR8O56xMd9knfzMOZka0lhjd8j6zxECGyI3L+nHdVDkeqctF/AnNYyrifkmJbk+BYF IRQSRAy8H/HoFFHtWKhkxDfVgRUogmApSnL1H+ZHk5toDk6YA7B2oQn1LkmQMM3a/f7R 14MrzeB96AF0ax8T9va0F8cKZ9bvO2NibGEeM4jGLsfNY5BNZmX56ifco8PAOTN+ZIu8 gchG7bBBScFaHR+rsdHqf0MTb9N9u3gcRAp9S/1s66/NY1y71/vwhDeVb1TaNjIv9uqQ CSmYQlgilk0qplsC23S00Eu9SGtVVDVtvCixTobuJDWpb5rPWfJfr5x1JccNpKDo3vhp 1XyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=VYBf+gSX; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=J/i4GQzG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2-v6si320832plt.293.2018.02.01.12.24.05; Thu, 01 Feb 2018 12:24:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=VYBf+gSX; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=J/i4GQzG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755026AbeBAUXN (ORCPT + 99 others); Thu, 1 Feb 2018 15:23:13 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37424 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754949AbeBAUWu (ORCPT ); Thu, 1 Feb 2018 15:22:50 -0500 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w11KKGOQ005867; Thu, 1 Feb 2018 12:22:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=kB03nunkgMIuxQZI+zKiqFu+oZs9BJvjfZ45uUhC8bo=; b=VYBf+gSXl3DT3SknHpe4LueY8H1JmRkKm73zvgw46xVO7AVXU+wLhEUWYlNrBfn8dR+E 7/xqq1MNSiH+lsy99p5E0ROIomhHQlOyzDescem/ieIwdWlxOdTDMwv0A6eHtXQQ5aEC lec0AdBglOpqOruwyq0YfaWiEnNomDBaFIQ= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2fv911gag6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 01 Feb 2018 12:22:43 -0800 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.33) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 1 Feb 2018 15:22:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=kB03nunkgMIuxQZI+zKiqFu+oZs9BJvjfZ45uUhC8bo=; b=J/i4GQzGFGnVI1rsIBQ8B5FRTt9BrCAMefujQ+kz+5VZ2IUcMtFgJKCjVmXDTBZ7PUVYWcCUfuPyhPLhhbt9YjevyBqle4fPAj4g+u91j4Pi27q+B+tXO34QZUKHZVI6iH2f0VaniqKehOp/cIZm2R95PWRIr29ACcAQQPk5M2o= Received: from castle.DHCP.thefacebook.com (2620:10d:c092:200::1:e1d4) by SN2PR15MB1087.namprd15.prod.outlook.com (2603:10b6:804:22::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Thu, 1 Feb 2018 20:22:15 +0000 Date: Thu, 1 Feb 2018 20:22:04 +0000 From: Roman Gushchin To: Eric Dumazet CC: "David S. Miller" , , , , , , Subject: Re: [PATCH net] net: memcontrol: charge allocated memory after mem_cgroup_sk_alloc() Message-ID: <20180201202158.GA11477@castle.DHCP.thefacebook.com> References: <20180125001911.15597-1-guro@fb.com> <20180125.120302.1117695034222616751.davem@davemloft.net> <20180131215401.GA8956@castle> <20180201.101655.1316424669256047119.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180201.101655.1316424669256047119.davem@davemloft.net> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [2620:10d:c092:200::1:e1d4] X-ClientProxiedBy: AM5PR06CA0002.eurprd06.prod.outlook.com (2603:10a6:206:2::15) To SN2PR15MB1087.namprd15.prod.outlook.com (2603:10b6:804:22::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0fb296d5-4bb0-426e-d45a-08d569b18031 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:SN2PR15MB1087; X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB1087;3:cCR6KGHrSW1x34kQLKhC2xpb1+re3rzl8ssukCcVxLItHrrSOhdWWNQnhkT3UAbJzCbweCv5RSFHLTGQJCvX7tAUkScGwgOwucKzBxhv2OpIgEH23JHq3S7ttYBp8kXFGHUWaq+e4nUK9l1KuwcHxF7j4/pq3IeerBtXlvvAS2jc+Y9T1YI9iJZQej3YuHxU+MbS4TqJsk8WVdIVOCD5PA/mwMmtge1ed2O5vvQCZcGQkGpCbF/rUvMY9ElDz77r;25:B5Sxrk+8u9rO3QdhNuz6/QbPEE+dKBQANmVBl7yTOlGvJtUr9S5kKAJ/8iEY8lZx0X4VDvWZbExEHW+vsYIgoDBdVuPdIfbp8SUrNCq4p55k7+5U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XsCA5+PAlqedhXUYaNtlzFvwb87tFIf6VPRdQjfthDVukSvPTGEq4kJ27Z+5qzpZCGFCZ1mXbDn/RHngdAz45NUqmbhhoC8SutAYK+UPTO5GPoEat7KiYksxIIEEPKUZP09r7R5ItfQuPpGLtOxu0q7z1vQrBdMSJ7D2luO2c58oLg3q/tf7knvMJlKblXhAM/DCMj/osz9eQoHOqynF0mxu4P+e1zSVqKZQ7lts0+aUxNNnDX8OUjxNo9+c4Ob4K+CIf0VxoFnb+mwfDCRXUh0ugZuS2UZLhSymhfO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231101)(11241501184)(2400082)(944501161)(6041288)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:SN2PR15MB1087;BCL:0;PCL:0;RULEID:;SRVR:SN2PR15MB1087; X-Forefront-PRVS: 0570F1F193 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39380400002)(376002)(366004)(396003)(39860400002)(346002)(189003)(199004)(8936002)(47776003)(25786009)(105586002)(33656002)(6666003)(5660300001)(6506007)(93886005)(6916009)(4326008)(2906002)(52396003)(7696005)(6246003)(386003)(186003)(76176011)(478600001)(106356001)(52116002)(58126008)(16526019)(2950100002)(97736004)(68736007)(23726003)(9686003)(53936002)(81156014)(7736002)(229853002)(6116002)(8676002)(305945005)(55016002)(16586007)(316002)(81166006)(83506002)(86362001)(1076002)(50466002)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR15MB1087;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR15MB1087;23:2g7aTdkpbrTF775CF/zb+5aK7pJY5t+l4zbkKQAww?= =?us-ascii?Q?1jcvG4kDVyYfwsozTFlfnQMLaFV0HjZ5rsvFsm+8WSt4YOg4FBGEJrjcNszm?= =?us-ascii?Q?SXMzzILaNr9RqxQ9a7HBjJmtvG2sg7CwygRUWY79QuIVEJfgY9c9+je/PTm+?= =?us-ascii?Q?MUj0ojBVxoD1YlWpW1c628b5FgYpBPggc8vc5Fk4h5q+Uh/egcYK7Q3fk8Nk?= =?us-ascii?Q?A+Z73aKZOP81Sl4NjET0Ws9RWHxAZFuZJimMwLX65GD4ptkwLHeXfKIoBxA7?= =?us-ascii?Q?PmnL3WEcs/+gCYAiAxGjaDcMK1AB7FAjbNJywZjJEL3ntogyYcLhjuApm1IQ?= =?us-ascii?Q?kom0wGpFHR79cM52AblR3uI8rSCPohzUL82uj0ie8qunDoYsVsAaZhUdlJK4?= =?us-ascii?Q?jpjRzzS1qwsVE+oM7jb/j9YahUKAyD7yRfKiXYqiWPucucZINaq1tOTixpf9?= =?us-ascii?Q?37ntSz1AuqOqL+Xg6921N37z2N80H2bL2m144d+VJluuT05qdctvFn+EaDL0?= =?us-ascii?Q?zwf5GW3mDHacIs0FXin9P65BCEv4hwXTBwbbhBVBx3+brX3O3pCRIlAgoklN?= =?us-ascii?Q?wW7Oh5+zQmF9cXxXvDZh14L03aLFJJC9DWS+1ILs5r+eKOGy7mJw6Hm5x/F8?= =?us-ascii?Q?KSrPSRigrbnWernFNlalWVgujj8876amSWrCaZP0XdiqTZzjwmAMMX6TEbx5?= =?us-ascii?Q?+ltySid/l8gS91KdJ991gGNd1cegai0fdWCmTULCenLipfkQcUqj1augLOtq?= =?us-ascii?Q?NX2K3SvZNZ2whgLTBIY33XQpLUZOk4c01D2CoYZutoyMLvvsmBXDZESdUFZG?= =?us-ascii?Q?BHeTJgwpSvfND1xWVh7NaVJDCc9MBBYhufvw5qRkmFzXyJs+jEzGQY24p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FcJBufcuR4zJUxL2PMGAo4IsY5gAdU/gsbN4+ImFosNL6hFL/wkjTSqZcVrE=;7:fhVd81F4K8ZuXTpLEUYCX13OJGk+t3v4pV+dtSsPBd3kAI3kfvoVCu8wdLp1LuUjMxrgVPFIipFQeBPQnBnXsMJf7BuTjeQRHpRP4D+XDI58QuABv9k+8ghu4CGXOAdhJHPyBMRshAorQnQbuoFqoBJ/UYZ8vGfWvp3wap2/hAXRdm+Yr5iFtjAzFaqjK9jAroAZ5DwFJkQC3T1lXVY5Q810p3ZxfLeNosxsueX/EVSdsFW3MMbMe6qFYKYqvEaB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB1087;20:O4N4GxQfXCr6GlpVitLR3lGiPSaeAgk8kSUS8JlkDQAbXY8oVa8Ngw+HlEpVmFNQsJGk+8axs/L/gWJWTFRb/UWkgwrvhkQGOeHYk7pJqzPaUaHKNyeUe12p0evGp6mpo4DP7ele2IZzPT+9omp78ycuxbs0NP38c+Q1BHhxcpo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2018 20:22:15.9762 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb296d5-4bb0-426e-d45a-08d569b18031 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR15MB1087 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-01_06:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 01, 2018 at 10:16:55AM -0500, David Miller wrote: > From: Roman Gushchin > Date: Wed, 31 Jan 2018 21:54:08 +0000 > > > So I really start thinking that reverting 9f1c2674b328 > > ("net: memcontrol: defer call to mem_cgroup_sk_alloc()") > > and fixing the original issue differently might be easier > > and a proper way to go. Does it makes sense? > > You'll need to work that out with Eric Dumazet who added the > change in question which you think we should revert. Eric, can you, please, provide some details about the use-after-free problem that you've fixed with commit 9f1c2674b328 ("net: memcontrol: defer call to mem_cgroup_sk_alloc()" ? Do you know how to reproduce it? Deferring mem_cgroup_sk_alloc() breaks socket memory accounting and makes it much more fragile in general. So, I wonder, if there are solutions for the use-after-free problem. Thank you! Roman