Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4393455ioa; Wed, 27 Apr 2022 02:53:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyAoJsi4GsRM1Jdt16LpPBuLHNpYPIqHh0pWwOiPdM/I/cK+isvWSccS9RpJKZmSUjDG9+ X-Received: by 2002:a17:90b:4f85:b0:1d9:91df:ad17 with SMTP id qe5-20020a17090b4f8500b001d991dfad17mr13215928pjb.129.1651053202412; Wed, 27 Apr 2022 02:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651053202; cv=none; d=google.com; s=arc-20160816; b=rPEMCbx56ro/6mNBzLDAt2QN/x5sC94ZI841QTL80U9rGpmdDR22twXy8WdKsu82Xx kb//IaGr7p2ij/NtYN8AqhRhRHr4ZMUu7egQUogRxf8DBfIgEk/vBIm/5HY6JnJf2FaL yNthEXSZJaZvuPk6AkaklaTI8/rEFq1f/1qWxDIVMwF4WBDK1yVxsX74w2d0O/gia7LA 4ZY8JvCBGOtI5XS/7yXdctn0Zd6uDhk0+vhBp0CtKKK0GeOJr+dLbY/or4zsQzohrIhd cGAbPVgOn/GIqsLQ8qmWuI9ELwVOh7tM47elOghElESrpTtV3ieYcUClkuHTpluxWGjS Ragw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=SXEzXXHS0sThjX6HVBy0JVDgoPY4IQBVYQvk7kEkDnI=; b=aUma7csMQC/ZMjS6Q2YtY18l8SkOIaRkHs1/hSfKEzZl3mf1vsfn7ksTWzhit9d86+ kw0JrOSYMjXDBluIJpw5YZ0vy2fGDJcxehjaJ0buikP3VIL8kzvdf0/lB8RHxu781j2G UKhsERbvAoGwb2b9SGLr11tTlTv4ONlUGc/mlIwWE0mnimgn6b5HjeFjWAeXKwxyge11 jtIPnZGuA5rQXlyvPrmzZHiWMG9XIjeWiQEk4B1b4u1Oi16PJYsK2+whmH4SwcHhFXqN Tl25bDw0dFv1xMKtSlGnr7WQ7qOPAa7QF/Q9mz3l1hb050TL2g1vb7FZRqxBMaRxDHg8 BJDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=CgiytSfr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t16-20020a170902b21000b0015868facd3esi1147521plr.138.2022.04.27.02.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:53:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=CgiytSfr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EA5992A3D45; Wed, 27 Apr 2022 02:23:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355148AbiDZUvY (ORCPT + 99 others); Tue, 26 Apr 2022 16:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355103AbiDZUvW (ORCPT ); Tue, 26 Apr 2022 16:51:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9DFE4D251 for ; Tue, 26 Apr 2022 13:48:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3E3F461446 for ; Tue, 26 Apr 2022 20:48:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60EF2C385A0; Tue, 26 Apr 2022 20:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651006092; bh=rpvSC2xGOQbxtEJiuPwyZqO4h6SMbmUX1MZN0z6pcbc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CgiytSfrTg2IwS09rq9QP0ZKU3f4BRurD7D9QqwTQzGtHGcWDO4sIcJ/TFZLuOlfh pzTdV+op3HjsvlCA4UMN+i3bC1xaQwWNAxGUwyVLWANZEXkhd3F7JqE5HGkC9juScp UGc3MJLIsDmXT1qPTdo0mUatALVHUbiO9ZDtL9/o= Date: Tue, 26 Apr 2022 13:48:11 -0700 From: Andrew Morton To: "Fabio M. De Francesco" Cc: Ira Weiny , Catalin Marinas , "Matthew Wilcox (Oracle)" , Peter Collingbourne , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/highmem: VM_BUG_ON() if offset + len > PAGE_SIZE Message-Id: <20220426134811.63a398ea5d2212dfececfd83@linux-foundation.org> In-Reply-To: <1790890.atdPhlSkOF@leap> References: <20220426193020.8710-1-fmdefrancesco@gmail.com> <20220426123412.51fb58780a8fe2b32c7814ce@linux-foundation.org> <1790890.atdPhlSkOF@leap> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Apr 2022 22:19:57 +0200 "Fabio M. De Francesco" wrote: > On marted=EC 26 aprile 2022 21:34:12 CEST Andrew Morton wrote: > > On Tue, 26 Apr 2022 21:30:20 +0200 "Fabio M. De Francesco"=20 > wrote: > >=20 > > > Add VM_BUG_ON() bounds checking to make sure that, if "offset + len> > > > PAGE_SIZE", memset() does not corrupt data in adjacent pages. > > >=20 > >=20 > > hm, why? To match all the other functions in there? > >=20 > > I suppose that's logical. Or we could just delete all the other > > VM_BUG_ON()s. Have any of them proven to be at all useful? > >=20 > I am not so sure about it being so useful. I just noted that memzero_page= ()=20 > is the only function of that family that is implemented with no=20 > VM_BUG_ON(). I have no actual proofs of usefulness :(=20 >=20 > This is why yesterday I sent an "RFC Patch" (please see =20 > https://lore.kernel.org/lkml/20220424104806.25396-1-fmdefrancesco@gmail.c= om/ >=20 > Soon after sending it I thought that VM_WARN_ON_ONCE() could have been=20 > better suited, but Ira Weiny wrote to use VM_BUG_ON() for consistency. >=20 > Now I could either delete all other VM_BUG_ON() or replace them with=20 > VM_WARN_ON_ONCE() (or some other macro).=20 >=20 > Ah, a third solution might be to leave highmem.h as it is now :) >=20 > What do you prefer? Merge this patch as-is, I guess. Going through and removing unuseful VM_BUG_ON()s is a separable activity.