Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1357015ybl; Wed, 14 Aug 2019 15:36:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoPow3ETTkhark89WrXiV+etwVms7weTorz1Vaj76U5FomEHJDcbgZVRcGE4pyXe9oy3Eb X-Received: by 2002:a17:902:728a:: with SMTP id d10mr1571910pll.282.1565822198159; Wed, 14 Aug 2019 15:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565822198; cv=none; d=google.com; s=arc-20160816; b=W9WS73Qj1bT+D5bcwuPuqL+uMwDX7Nqcpzxv2G2rj61I0luOcFLb1IwNuOAfwiOQQM CriHGHWE3wQXg307bqp/TJ2Pq5UJtgdisurJtKQ1kzSZqMEVTnLGgYNjucBLTkFYCS+j nA6w+/oLdBg4KKItk4D90uG506CwOfQbgnE9tEs7oOwokQo/sRvGZDTZ/wJF8jN5kmXS 1DI8Fzf98f28fPj41vlxWC8Lj5CxcxZWOj0I2pbb4vRjet0hqwrstKq6d/YGbdJh3dBi 1sH5GxUlf1S+oHK88nEs3zG4jdnH9lcKe7s0wf/AfM4CSJtNm638JF5GHhbi31eIRvKR GZDA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kQNyDHb8zca3q/Z2umntxExZzSaW7rY9ZgrbV3o+crY=; b=Rkbb4pQZoDlUsmmFhLiU+FU+dRh1uyTFV8uj8+BfMluERKZbOrwUvR6UrakcatMsi5 jEMi9BFpnoJSbLgTZUYyDguUSSnuN1RghLtaVzUhBY8IR1t5mAAom/UxlF0rCPahOu/n Chg5Upk9mGvSsSTGpCXO9EHeJEb/JLmjMZrc7PJj6mTiYmpglhSxA0xwDAb6lOboyzqi I9/S/J5EI1YBOg/dpXustj5GD88lRnzsO1qrHlEoFal68xdXZSLu9ZGQSK/BPeGtaxDA ObYFqDyKz3MG0ikWsFKhy02Z5Km3DrzHS3Yl3Q3eAn5bCEBSkcl/LmIaMOuFQkwBaASf rnlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="S/1z63Ov"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si590256pgj.239.2019.08.14.15.36.22; Wed, 14 Aug 2019 15:36:38 -0700 (PDT) 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=@kernel.org header.s=default header.b="S/1z63Ov"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729921AbfHNWSI (ORCPT + 99 others); Wed, 14 Aug 2019 18:18:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:59726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbfHNWSI (ORCPT ); Wed, 14 Aug 2019 18:18:08 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4107D20665; Wed, 14 Aug 2019 22:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565821086; bh=k8sF9ByxTFJt+xPpPS1ClUhI3arOUct3oMxaqPHO3MI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S/1z63Ov8CQ7Ns/DVtHuelIHzOPS4/tww77AgTZI+v2U7sLvnbEEPlv9WPhG4y32H Ky5oGomVEEFvzPSSqxC0WdbhxRINJl5SXaHNr/fe/MyCpOGumxN+7Nu+yIVU/PM4I1 D0rTreqznnzPWBSf5XSM5YiCaXthUF0BkjISpeJc= Date: Wed, 14 Aug 2019 15:18:05 -0700 From: Andrew Morton To: Ivan Khoronzhuk Cc: bjorn.topel@intel.com, linux-mm@kvack.org, xdp-newbies@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, magnus.karlsson@intel.com Subject: Re: [PATCH v2 bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits Message-Id: <20190814151805.bbff7b08f3a4119750b3e9fd@linux-foundation.org> In-Reply-To: <20190814150934.GD4142@khorivan> References: <20190812113429.2488-1-ivan.khoronzhuk@linaro.org> <20190812124326.32146-1-ivan.khoronzhuk@linaro.org> <20190812141924.32136e040904d0c5a819dcb1@linux-foundation.org> <20190814150934.GD4142@khorivan> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Aug 2019 18:09:36 +0300 Ivan Khoronzhuk wrote: > On Mon, Aug 12, 2019 at 02:19:24PM -0700, Andrew Morton wrote: > > Hi, Andrew > > >On Mon, 12 Aug 2019 15:43:26 +0300 Ivan Khoronzhuk wrote: > > > >> The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING > >> and XDP_UMEM_PGOFF_COMPLETION_RING offsets. The offsets seems like are > >> established already and are part of configuration interface. > >> > >> But for 32-bit systems, while AF_XDP socket configuration, the values > >> are to large to pass maximum allowed file size verification. > >> The offsets can be tuned ofc, but instead of changing existent > >> interface - extend max allowed file size for sockets. > > > > > >What are the implications of this? That all code in the kernel which > >handles mapped sockets needs to be audited (and tested) for correctly > >handling mappings larger than 4G on 32-bit machines? Has that been > > That's to allow only offset to be passed, mapping length is less than 4Gb. > I have verified all list of mmap for sockets and all of them contain dummy > cb sock_no_mmap() except the following: > > xsk_mmap() > tcp_mmap() > packet_mmap() > > xsk_mmap() - it's what this fix is needed for. > tcp_mmap() - doesn't have obvious issues with pgoff - no any references on it. > packet_mmap() - return -EINVAL if it's even set. Great, thanks. > > >done? Are we confident that we aren't introducing user-visible buggy > >behaviour into unsuspecting legacy code? > > > >Also... what are the user-visible runtime effects of this change? > >Please send along a paragraph which explains this, for the changelog. > >Does this patch fix some user-visible problem? If so, should be code > >be backported into -stable kernels? > It should go to linux-next, no one has been using it till this patch > with 32 bits as w/o this fix af_xdp sockets can't be used at all. > It unblocks af_xdp socket usage for 32bit systems. > > > That's example of potential next commit message: > Subject: mm: mmap: increase sockets maximum memory size pgoff for 32bits > > The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING > and XDP_UMEM_PGOFF_COMPLETION_RING offsets. These offsets are established > already and are part of the configuration interface. > > But for 32-bit systems, using AF_XDP socket configuration, these values > are too large to pass the maximum allowed file size verification. The > offsets can be tuned off, but instead of changing the existing interface, > let's extend the max allowed file size for sockets. > > No one has been using it till this patch with 32 bits as w/o this fix > af_xdp sockets can't be used at all, so it unblocks af_xdp socket usage > for 32bit systems. > > All list of mmap cbs for sockets were verified on side effects and > all of them contain dummy cb - sock_no_mmap() at this moment, except the > following: > > xsk_mmap() - it's what this fix is needed for. > tcp_mmap() - doesn't have obvious issues with pgoff - no any references on it. > packet_mmap() - return -EINVAL if it's even set. > > ... > > Is it ok to be replicated in PATCH v2 or this explanation is enough here > to use v1? I have replaced the changlog in my tree with the above, thanks.