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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34EBDC2D0EC for ; Sun, 12 Apr 2020 21:11:48 +0000 (UTC) Received: from vger.kernel.org (unknown [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09E60206E5 for ; Sun, 12 Apr 2020 21:11:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09E60206E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbgDLVK5 (ORCPT ); Sun, 12 Apr 2020 17:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.18]:44814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbgDLVK5 (ORCPT ); Sun, 12 Apr 2020 17:10:57 -0400 Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 932FFC0A3BF5; Sun, 12 Apr 2020 14:10:57 -0700 (PDT) Received: from ip5f5bd698.dynamic.kabel-deutschland.de ([95.91.214.152] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jNjsU-0005Yo-KY; Sun, 12 Apr 2020 21:10:54 +0000 Date: Sun, 12 Apr 2020 23:10:53 +0200 From: Christian Brauner To: Eugene Syromiatnikov Cc: linux-kernel@vger.kernel.org, Christian Brauner , Andrew Morton , Ingo Molnar , Tejun Heo , Oleg Nesterov , Johannes Weiner , Li Zefan , Peter Zijlstra , cgroups@vger.kernel.org, "Dmitry V. Levin" Subject: Re: [PATCH] clone3: fix cgroup argument sanity check Message-ID: <20200412211053.fs54wfguvttav7j6@wittgenstein> References: <20200412202533.GA29554@asgard.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200412202533.GA29554@asgard.redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 12, 2020 at 10:25:33PM +0200, Eugene Syromiatnikov wrote: > Checking that cgroup field value of struct clone_args is less than 0 > is useless, as it is defined as unsigned 64-bit integer. Moreover, > it doesn't catch the situations where its higher bits are lost during > the assignment to the cgroup field of the cgroup field of the internal > struct kernel_clone_args (where it is declared as signed 32-bit > integer), so it is still possible to pass garbage there. A check > against INT_MAX solves both these issues. > > Fixes: ef2c41cf38a7559b ("clone3: allow spawning processes into cgroups") > Signed-off-by: Eugene Syromiatnikov Thanks, will queue for rc2 unless I hear objections. Acked-by: Christian Brauner