Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8563101ybn; Tue, 1 Oct 2019 09:51:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOjxmpOTP5kNSR76+K8gOaH9Be8GgSWQZL2BGd1/dEV791EvR2wc0dXKybdaeBMlGj+GPN X-Received: by 2002:a17:906:1c5b:: with SMTP id l27mr25280737ejg.27.1569948714107; Tue, 01 Oct 2019 09:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569948714; cv=none; d=google.com; s=arc-20160816; b=0xPSktMjCSNfSEwrkPYWufnY42xZ09Y2dnZF2iy0PaV/GT51RsPT0ywhLFoR4iiWGF UQhSNKZU9C70FDbgPn/JCBzSbWDMAPz0pWHPax+UeEbkX5ljbd7ydQIBD26NbWOZvd2d qu2ZQz1yAnQQxPtTxRfw1NriNMBGh9kNH9zw4uiBvgHa5rAlaRlRMAdWDxmYIX4oH3z0 T8+L0hZ1ODGj9jhEHOfmGJHersoX8hcYQRH0rMRDd+pi39nrBjEDFKZz2ndhfymeJwTN N28PSml6WTNA/5d6yXEz3V1b+c1eCoDTs0fWBgk5x+R9BiUtbjn83rPc5TtWKEooHAoW YptA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=i0vYOnNzNl23wM5oAHQgXQknCy7kFcbZ26kS9YCoHBU=; b=FEp+cdl97/LsGR0+mXCcmQd9ZeaX9qqqLJUQE+uM3Qxmpeh/2oUh/HtyglnIsGUGao i0zzFAm0NWN0YD82qM3tZQwlWRN0AmDcgW5g3xnarAWstxC8f887xKFqG9QRyhHxuKHc zLzq4VKVeu0uynMY3rE4enS76eLlO7l8lABI3HT02dOgUsq2dC9KcAK+sh5eDu33+8N2 mPxDiNQmg4faUjFrZiS5eKzAJ+CX6IppS9fhZIiZE1xNDN84WbfL6shLH9MODzQ5LvMu uxwO8oSerEboaBF+aIDSYixUNu7oA1kLOtnMmr3tdjZ1Xlij244QIz9EhLUuKILK/erC 0Hhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=n5fjg1bq; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si10288575ejm.122.2019.10.01.09.51.29; Tue, 01 Oct 2019 09:51:54 -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=@chromium.org header.s=google header.b=n5fjg1bq; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389928AbfJAQ2x (ORCPT + 99 others); Tue, 1 Oct 2019 12:28:53 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44190 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbfJAQ2v (ORCPT ); Tue, 1 Oct 2019 12:28:51 -0400 Received: by mail-pg1-f196.google.com with SMTP id i14so9973256pgt.11 for ; Tue, 01 Oct 2019 09:28:50 -0700 (PDT) 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=i0vYOnNzNl23wM5oAHQgXQknCy7kFcbZ26kS9YCoHBU=; b=n5fjg1bqcekd+hNTKhsmR269yN2JoDYT7RNHZANM0CG3KvJR4l0sKewNwj5Cl+7/R4 lAyx5LnFBIt1px6L05UmEZPA9i2zOAJkpjn/cjD7aaFAwAdjVxTREahP7BB/PM3xPtIp zjjyDFWC3J3WfPK3n+0rHoaP3GdV6ByAiWF14= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=i0vYOnNzNl23wM5oAHQgXQknCy7kFcbZ26kS9YCoHBU=; b=i8aIXOt+MCZHZQlgM5K7yxh7wzXUIuvy1ammLSBvPJviflGm4YFKWaQKv88xEWc+k6 yjKSzuZIfXQ1yuK3aA9xVjybhHzN4A5RL0l4jv6eRnaLo0a2g1JqN+KW6Ir/eI1YHOQW JR5qcyIBZqvUk2ieJRveIQaXt2E9BWdSPg/rS36MHDeC6/+AnQkqHu7wDW80ZRQfQPOv Lz4gvCIoGpRehRM8UtZ0ZW+j3HqsZ5IhCFa/D4VfMKyB0DKgB8G/0y3N0UqsOjJqFGUZ OkQLqV7sms6Rj8xVZYhiPgTMqxeSMWzp3tUedYfYPkXbZnMjQf+mFMuQJM2EQsIy8Rjw xpNg== X-Gm-Message-State: APjAAAW2uyMm2dE21Vb4K9yTtEliD57mJP00HNCO6SYidZLAsI8lgW0+ qgSxB736S0JgJGijdWAedSr46Q== X-Received: by 2002:a63:cb:: with SMTP id 194mr30303545pga.172.1569947330613; Tue, 01 Oct 2019 09:28:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i6sm26975081pfq.20.2019.10.01.09.28.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2019 09:28:49 -0700 (PDT) Date: Tue, 1 Oct 2019 09:28:42 -0700 From: Kees Cook To: Christian Brauner Cc: Aleksa Sarai , Ingo Molnar , Peter Zijlstra , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Rasmus Villemoes , Al Viro , Linus Torvalds , libc-alpha@sourceware.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/4] lib: introduce copy_struct_from_user() helper Message-ID: <201910010928.243849D@keescook> References: <20191001011055.19283-1-cyphar@cyphar.com> <20191001011055.19283-2-cyphar@cyphar.com> <201909301856.01255535BD@keescook> <20191001023126.qhzeiwmtoo4agy7t@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001023126.qhzeiwmtoo4agy7t@wittgenstein> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 04:31:27AM +0200, Christian Brauner wrote: > On Mon, Sep 30, 2019 at 06:58:39PM -0700, Kees Cook wrote: > > On Tue, Oct 01, 2019 at 11:10:52AM +1000, Aleksa Sarai wrote: > > > +static __always_inline > > > +int copy_struct_from_user(void *dst, size_t ksize, > > > + const void __user *src, size_t usize) > > > > And of course I forgot to realize both this and check_zeroed_user() > > should also have the __must_check attribute. Sorry for forgetting that > > earlier! > > Just said to Aleksa that I'll just fix this up when I apply so he > doesn't have to resend. You ok with this, Kees? Yup; that's totally fine. Thanks! -- Kees Cook