From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E9C9C43334 for ; Mon, 18 Jul 2022 15:33:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235472AbiGRPd5 (ORCPT ); Mon, 18 Jul 2022 11:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235376AbiGRPd4 (ORCPT ); Mon, 18 Jul 2022 11:33:56 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08E985FEE; Mon, 18 Jul 2022 08:33:54 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso5968696wma.2; Mon, 18 Jul 2022 08:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vBxJcVDI+MBiYNM9PJpNBxYIwPjkJMaPy5JiLonNMLo=; b=iYon2gh8luEPcsrVrG8BU368mG1Xk+kpfwLOv21BTASSf/FolHFJHb4XxIYH5umRYa zr0UthJuQaLVhROiBEvlQktyIE7eYmbgro+yEjRd+6CZJSHlknFMCgBjXRmCUWOHBm/P 9/DSNmN0/gHbMnAx7ETnBpEfMWD0QCnMSNxBCIty24/q4j0xaFUSh3yftS0/4g1n4h5d VubnTpp714okHPzwVlGSPQOygqV6ygMkaUNkO9GGnB9MeNOHEDk3GOzcCLsmQBZAfl2J X/DTwHmqA8CtjcT8u2HJD0mut8B97uGLsFVeMyhKlDub3iGCmBDp5epVGKipMnotXK/y DqlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vBxJcVDI+MBiYNM9PJpNBxYIwPjkJMaPy5JiLonNMLo=; b=HdxspePG3GAm2gxAkOQ0TwmDGJfOmgvIfFBSHTV25Y7QKrIiTDuhpH1agPQLHJfkfj moh30icJ3m2pC8HPpxG9DdaGqVcCXLk1v1Xu04ObTF1QiD+YH4Wt15zLCAfmcqa/ip8q XWfGEymabk9MGtyceIGwX8YRw0c4QkC3uB1X7o+GZroFKWhU0FHrSOwA5UXZpzCcWHm6 GIM6fJjCmv4etQ0c5hQj3zhMcN6VZCjkGV9Nl6YCYRuiKYFM0nQ2ehKT99VpTp9SIx/Z e4/YllupI4DFcLyr3wEfw3gndP5HOoRdpbka4lM5RmSWk5WPI+XWnnI9qQ1YeDAJwkTM Qtgg== X-Gm-Message-State: AJIora+fcYBHuU6WxdTJVwRR0DwVCNkI+1aturI5peefx5pQeF3E1jU3 nE+G61yt1kRkPuSgTWoDcqlTojBuw42ty3hF2qgtJnVO X-Google-Smtp-Source: AGRyM1syWxjt15tB51xzmEK68Mm/SO0RQGXRyezFoFVwKyOltT3WigrGsVUUL7GkjaYGwvm2AhrvEvj95kRwd2wE9E8= X-Received: by 2002:a05:600c:1c83:b0:3a3:1f70:25a5 with SMTP id k3-20020a05600c1c8300b003a31f7025a5mr2504212wms.54.1658158433376; Mon, 18 Jul 2022 08:33:53 -0700 (PDT) MIME-Version: 1.0 References: <20220715125013.247085-1-mlombard@redhat.com> <5a469c5a.8b85.1821171d9de.Coremail.chen45464546@163.com> <22bf39a6.8f5e.18211c0898a.Coremail.chen45464546@163.com> In-Reply-To: From: Alexander Duyck Date: Mon, 18 Jul 2022 08:33:42 -0700 Message-ID: Subject: Re: Re: [PATCH V3] mm: prevent page_frag_alloc() from corrupting the memory To: Maurizio Lombardi Cc: Chen Lin , Jakub Kicinski , Andrew Morton , linux-mm , LKML , Netdev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Jul 18, 2022 at 8:25 AM Maurizio Lombardi wro= te: > > po 18. 7. 2022 v 16:40 odes=C3=ADlatel Chen Lin na= psal: > > > > But the original intention of page frag interface is indeed to allocate= memory > > less than one page. It's not a good idea to complicate the definition = of > > "page fragment". > > I see your point, I just don't think it makes much sense to break > drivers here and there > when a practically identical 2-lines patch can fix the memory corruption = bug > without changing a single line of code in the drivers. > > By the way, I will wait for the maintainers to decide on the matter. > > Maurizio I'm good with this smaller approach. If it fails only under memory pressure I am good with that. The issue with the stricter checking is that it will add additional overhead that doesn't add much value to the code. Thanks, - Alex