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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAC79C433F5 for ; Mon, 13 Dec 2021 20:48:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 010B16B0071; Mon, 13 Dec 2021 15:48:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F03726B0073; Mon, 13 Dec 2021 15:48:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCAA56B0074; Mon, 13 Dec 2021 15:48:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0040.hostedemail.com [216.40.44.40]) by kanga.kvack.org (Postfix) with ESMTP id CC57C6B0071 for ; Mon, 13 Dec 2021 15:48:10 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7AD2489095 for ; Mon, 13 Dec 2021 20:48:00 +0000 (UTC) X-FDA: 78913957920.26.BBCDA62 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by imf01.hostedemail.com (Postfix) with ESMTP id ACD604000F for ; Mon, 13 Dec 2021 20:47:56 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id j11so15595948pgs.2 for ; Mon, 13 Dec 2021 12:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=eqk7jFNpc/SH/qINtrLZmX7rz6WzU7wy/i8GODHyph8=; b=gtoDoj7zftTSDacSWlLcucF0Y+x7ZVprYxu1SmOcS4rpu3wp6LiBOFaWaajY15N9aE x6p2zW31go3m7OPw9ne5sS3i5ffP6srY61uF9CMT9EYirXJf1k8Ap2LrIGvN4biZiyFY gVWE/FgpVDj2rj+kcO8IjQ/Hm2OdnBZaOk0pQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eqk7jFNpc/SH/qINtrLZmX7rz6WzU7wy/i8GODHyph8=; b=zMDRgrucSVlYhPvJBZJIp5qTbDdrqbHKID+Pv0JGNQwNaHzard5NizAJ1moQNsppbq pFY0YqPm7F36RTHILmUV7PnqcdJAkP9vgJEuOq6Ys0nwgPx95hVIvNt0fUpd1uB/73UM zR3LZ15uqdy3kjEJtbJ27iOOUZdMyvNzfhDQBP2cLC729p1orEjy+nCdalp3iG+BAjGA virD2HmAke5DVtjb+4r0nhX3mNUnODUzvNajXGGBiFq/a+BlyQfXWskWXtO8WvyI2k2a SNtPn+AX1UGOABKNfspfSVlfBOXHPD1I9j+PNCuqehMyXBeilHWgXgjo4xFUicJtTniH o2jg== X-Gm-Message-State: AOAM532XSAsAI5R91tZtnTk+VVagnN1fgiU9glbQ1xuXCb1lJ5Bjv9Fk Q2yubD2tPP9BSdZy4apNC7cpaA== X-Google-Smtp-Source: ABdhPJy3cTRWZARtl258fW/RQaHnimDEQQIDDVMQwTVVZe7Xv5B8uFrvjs0/l64nBo/NkYTztu75Ug== X-Received: by 2002:a05:6a00:124d:b0:4ad:574d:4d2f with SMTP id u13-20020a056a00124d00b004ad574d4d2fmr460593pfi.24.1639428479163; Mon, 13 Dec 2021 12:47:59 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id lb4sm31923pjb.18.2021.12.13.12.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 12:47:58 -0800 (PST) Date: Mon, 13 Dec 2021 12:47:58 -0800 From: Kees Cook To: Matthew Wilcox Cc: William Kucharski , "linux-mm@kvack.org" , Thomas Gleixner , "linux-hardening@vger.kernel.org" Subject: Re: [PATCH v3 0/3] Assorted improvements to usercopy Message-ID: <202112131246.4BBFBA69A@keescook> References: <20211213142703.3066590-1-willy@infradead.org> <196BFB9E-9A72-48B1-863E-021DE0B162A7@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: ACD604000F X-Stat-Signature: ca6c8zud964fbmjdzuzj4z9q8admiomh Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=gtoDoj7z; spf=pass (imf01.hostedemail.com: domain of keescook@chromium.org designates 209.85.215.178 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-HE-Tag: 1639428476-32145 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Dec 13, 2021 at 08:27:42PM +0000, Matthew Wilcox wrote: > On Mon, Dec 13, 2021 at 07:18:57PM +0000, William Kucharski wrote: > > I like these, but a quick question: > > > > Since the usercopy_abort() calls are all because the offset exceeds the page > > size, is there a reason why you don't specifically state that via the detail > > parameter rather than just supply a NULL pointer? > > Hmm ... I'd defer to Kees on this, because I'm not familiar with > usercopy_abort() usage, but the only places which use the detail > parameter today are slab/slub, which use it to pass the name of > the slab. I think the user is supposed to infer that we overran the > end of the page based on the offset & length values. I agree that leaving it NULL is best here. The "detail" is really about adding more information about which thing it was, which for slab makes sense, but most other stuff there isn't really anything to quickly distinguish one from another (i.e. vmap is all vmap). -- Kees Cook