Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11893918ybi; Fri, 26 Jul 2019 01:21:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzISHL7ljrFBYKu+Gjt4i0JAxgyEcPwpTN3a3NuqWg2IxuVG8zOIsEs2pS+RFdzfABl3Ot5 X-Received: by 2002:a63:6eca:: with SMTP id j193mr15028545pgc.74.1564129280287; Fri, 26 Jul 2019 01:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564129280; cv=none; d=google.com; s=arc-20160816; b=QyeUOs7pUrqrnzTXferZYhiaKjiQ8cl72iH6P8cnp5X0UlwbsrMZGwlcOKCzEo/AXu SUZbIOxnWC9Bw8lWBWxX2CX4qzcZjXTx83k6nJ2Y3cb6TKbeBOVcLUlKciPMezOGjD7f 8Kcz58ZrPRiwBEErGz8N69R6BOVZ100jCkJfxXzXWjUG1J6OkFiWHljd+q3v9t3PyD4z 59inZLOjJe7B3oZXffq7E+gszPEY60crWwi+egyr/JdpBo241ZTdQlGU+28EL9mA7C5a LTlJ62BkONL+Qv9MZ24efZvZyKzJbqQVjhtN9Z4J8jM0UHE7CQgBfwJF88tJ5YvDF6TQ N3Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=cv6ArQ9NZhLZAsMOKTlIqB/LTTH5DVyYg5LsOGfQjYU=; b=Lez0S3vL1E7S8GTQGcmkSRkCIPtiFo8Qv4w9AmkkOGbmv3ADwOSHcQ/AYr0fGQdjzf /gGQDrYyY0xH12jgZ9DtApuJ+EYuskK7RVjzqukp/08iIs1HksxhFPTHyJ5Fv3HT8lkH XEXuXFtdMK8Z9d42MmQWcLXOoTTj8ec8rAI2v4Gue2uiyVcrAnA3D4sWCyAowbvgtLc1 4Bgmt6qvrnH4CipiS6YpIrrpspbIXPND8RUzxn+wQGqQoGpYKYnG11YRGPrMBicZOEd9 W87F5yjJaMRhpU8DCD1hWgUyw6l+eldAz4EXhrvASrQ8J3v7C4vk7YhCJMBnkiDngQm8 y98g== ARC-Authentication-Results: i=1; mx.google.com; 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 b11si16825177plz.307.2019.07.26.01.21.05; Fri, 26 Jul 2019 01:21:20 -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; 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 S1726300AbfGZIUN (ORCPT + 99 others); Fri, 26 Jul 2019 04:20:13 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:37170 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfGZIUN (ORCPT ); Fri, 26 Jul 2019 04:20:13 -0400 Received: by mail-qt1-f195.google.com with SMTP id y26so51783260qto.4; Fri, 26 Jul 2019 01:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cv6ArQ9NZhLZAsMOKTlIqB/LTTH5DVyYg5LsOGfQjYU=; b=MVj+FRIRoI9zs4XhrIxoP8deVDubUIWYgWGfcuNcouRf5NScbPBPwTSJyMHJ2ro7SN kk20AvAu/Q+d82Rnxu9KrHAbpgF9yDmyNAzr0FN7+EaZGghcsZpwuC+0dhM2T5jd0zfH yxX6acsm37D6VPFHqqNfvjHHEYQguHanCKrxHdbdymfaphC2ny+WA034eQeDQxKC88Ka F5mB5VYFgV/mzWrtiomc30ia8dl3feW7Kc3AgJvS1dHlwNctxsEfc5O4IHYe7G2Mxmjf 6HuBu8kN6UW7UhL2WgtQBBPQE4FtozrmhhpvOW90gBGph94dLcG+Dcpb6ukplR21RFRr zfaQ== X-Gm-Message-State: APjAAAWd3B0/SfgNSflcrirMtULQcuszF+oIaPEUwBlMzJKyFEwoGC3t XpwAIVhaCoU7qsDRcmVq3ybG36z4qq1gpQxhKTs= X-Received: by 2002:a0c:e952:: with SMTP id n18mr63764893qvo.63.1564129212169; Fri, 26 Jul 2019 01:20:12 -0700 (PDT) MIME-Version: 1.0 References: <20190724144651.28272-1-christian@brauner.io> <20190724144651.28272-3-christian@brauner.io> In-Reply-To: <20190724144651.28272-3-christian@brauner.io> From: Arnd Bergmann Date: Fri, 26 Jul 2019 10:19:55 +0200 Message-ID: Subject: Re: [PATCH 2/5] pidfd: add pidfd_wait() To: Christian Brauner Cc: Linux Kernel Mailing List , Oleg Nesterov , "Eric W . Biederman" , Kees Cook , Joel Fernandes , Thomas Gleixner , Tejun Heo , David Howells , Jann Horn , Andy Lutomirski , Andrew Morton , Aleksa Sarai , Linus Torvalds , Al Viro , Android Kernel Team , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 4:47 PM Christian Brauner wrote: > + > +static int copy_rusage_to_user_any(struct rusage *kru, struct rusage __user *ru) > +{ > +#ifdef CONFIG_COMPAT > + if (in_compat_syscall()) > + return put_compat_rusage(kru, (struct compat_rusage __user *)ru); > +#endif > + return copy_to_user(ru, kru, sizeof(*kru)); > +} I think this code needs a check for COMPAT_USE_64BIT_TIME in order to handle x32 correctly. It would be nice to introduce it in a separate patch, and then use it to kill off compat_sys_getrusage() and compat_sys_wait4(), and possibly even compat_sys_waitid() in combination with your copy_siginfo_to_user_any(). That could be done as a cleanup patch afterwards, or as part of your series. Arnd