Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9842532ybi; Wed, 24 Jul 2019 10:54:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBMp/apLzIfdimtf+lRnmlPO3LHtUo3TIQUghlDTFLxY2Qqx3Nhp3yIrHNN9GFapGdk9NF X-Received: by 2002:a65:5a44:: with SMTP id z4mr82705204pgs.41.1563990897341; Wed, 24 Jul 2019 10:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563990897; cv=none; d=google.com; s=arc-20160816; b=pZ3xN7G83dyirOwm3b3N7dpEvp2bBcMKl4goTivIw4B/1vElbEj8/ch6Dx7Rip8DUJ V96woigz00XTz1ISUDvL4yPEj+84d/oC43yPFeTVN9Jf2siAtEHR50d+bKOioBRFKafL QdsWOJeJq8fg8NcJcasnzb34q/D4sfG9jZySmBlbyPFbY0tshXTS1c6/JE18e0THbVys b4xitcydhQP7yJ1lnAQZBzjK7lFEN56v+KAOIeVbOR5sTR7Fq1lBik6gq6zSx/bflmau 8WdDeTcWpblWo+kWlow7HV4rR7q5WM93XqU8MszZhR/PkuZBSBGmQKizxB7HDLkq89/w vU3w== 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:dkim-signature; bh=HHWcMU5Vdp2RzMeARQZwXgD9/0N7iPyalNjDDuAMZL0=; b=aIhszvAf46+fma7e8O1dAvkrmZN7Q7/VxcH28U1vSifh0f+CEvU2KepFvUMCyheveQ GQeTGzRgyrzlvsTtuucFK5OGHGXpgK8EkicRvqyDbSp8UV/vbbd8scyFAcy87MaqnR4C EiSu38TNYQ5OA31eppBQECvqlLI66Vtrbg4FCLZXmJiv2qiSLUFogRlEs7vybGuOcbJE sH6+oLGDQgYiabDfFf5YTsdiftxLfb4sfVEG7JwNLVOPSMndQZP5FLmTi3fLhIojsWHE d+40bL+/YIPdz8nGpX+5sPj8mMy+EsjmTmNa/C3eTlsbl9Gid6GRh00a1KEfv3/2pAMB yRKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=SbHSIb4u; 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 t190si13642952pgd.465.2019.07.24.10.54.43; Wed, 24 Jul 2019 10:54:57 -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=@linux-foundation.org header.s=google header.b=SbHSIb4u; 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 S2387657AbfGXRhz (ORCPT + 99 others); Wed, 24 Jul 2019 13:37:55 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34185 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfGXRhz (ORCPT ); Wed, 24 Jul 2019 13:37:55 -0400 Received: by mail-lj1-f194.google.com with SMTP id p17so45322933ljg.1 for ; Wed, 24 Jul 2019 10:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HHWcMU5Vdp2RzMeARQZwXgD9/0N7iPyalNjDDuAMZL0=; b=SbHSIb4uHTOyzVxpD/Qq/cOAkqA69PjiJ0SQszdK9GQ98snpnSWwFTpob3Yq1Z1yLR aae8Jprm9a/rPT6zRqYrIcAnPFR6xdNtyvTjIWZQmV8Q5oF4DIzZO1qadBBHOiNU57pC IAfGdcRk+5unMEIhEVPbzA5TfmURWmXgvrIAE= 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=HHWcMU5Vdp2RzMeARQZwXgD9/0N7iPyalNjDDuAMZL0=; b=qCpRShjV1VoSs8EYBlGgAi7JfvrvrfziqfusUAZ0m2PGR2gr8ZvNeH6uqbCilNh0ze Gcq6ls/day/6qY2Xc7eHcH3a1jravZlsISwb31MFK5vpU7ONy+I9DdMoMeUosBVtFK2M wc1EAbrN2Wd9hRDvBegr7+QYrsd3vkZUI0cvDNSqUhPusgdld0s29BdnAbb9QIL2+QwE HCLSjPD34r3jIHfM+TIcXkQGxdL/HD9TJXR4V90WJOJ5+ApLxhNOJ1b00RRi8ey9uO0B UvsxRIqp9tDb/mBzz2K9pDWWIEltV+MYO+T4LmS7IhVZFlI8sr2yGRSoYZ7KaCwULrHF R5OA== X-Gm-Message-State: APjAAAV/FUSz/hP4nUdJ46xS0yHo75GbJwl9witP8KA+ToL3vVsSDzUh Rt5zcybNxrlJ8wJlhCk3uiLTY+M7ntw= X-Received: by 2002:a2e:9155:: with SMTP id q21mr42725990ljg.198.1563989871636; Wed, 24 Jul 2019 10:37:51 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id v2sm7113999lfi.3.2019.07.24.10.37.50 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 10:37:50 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id v24so45389481ljg.13 for ; Wed, 24 Jul 2019 10:37:50 -0700 (PDT) X-Received: by 2002:a2e:9192:: with SMTP id f18mr13840192ljg.52.1563989869832; Wed, 24 Jul 2019 10:37:49 -0700 (PDT) MIME-Version: 1.0 References: <20190724144651.28272-1-christian@brauner.io> <20190724144651.28272-2-christian@brauner.io> In-Reply-To: <20190724144651.28272-2-christian@brauner.io> From: Linus Torvalds Date: Wed, 24 Jul 2019 10:37:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 1/5] exit: kill struct waitid_info To: Christian Brauner Cc: Linux List Kernel Mailing , Oleg Nesterov , Arnd Bergmann , "Eric W. Biederman" , Kees Cook , Joel Fernandes , Thomas Gleixner , Tejun Heo , David Howells , Jann Horn , Andrew Lutomirski , Andrew Morton , Aleksa Sarai , Al Viro , Android Kernel Team 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 7:47 AM Christian Brauner wrote: > > The code here uses a struct waitid_info to catch basic information about > process exit including the pid, uid, status, and signal that caused the > process to exit. This information is then stuffed into a struct siginfo > for the waitid() syscall. That seems like an odd thing to do. We can > just pass down a siginfo_t struct directly which let's us cleanup and > simplify the whole code quite a bit. Ack. Except I'd like the commit message to explain where this comes from instead of that "That seems like an odd thing to do". The _original_ reason for "struct waitid_info" was that "siginfo_t" is huge because of all the insane padding that various architectures do. So it was introduced by commit 67d7ddded322 ("waitid(2): leave copyout of siginfo to syscall itself") very much to avoid stack usage issues. And I quote: collect the information needed for siginfo into a small structure (waitid_info) simply because "sigset_t" was big. But that size came from the explicit "pad it out to 128 bytes for future expansion that will never happen", and the kernel using the same exact sigset_t that was exposed to user space. Then in commit 4ce5f9c9e754 ("signal: Use a smaller struct siginfo in the kernel") we got rid of the insane padding for in-kernel use, exactly because it causes issues like this. End result: that "struct waitid_info" no longer makes sense. It's not appreciably smaller than kernel_siginfo_t is today, but it made sense at the time. Linus