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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 BA081C433DF for ; Fri, 7 Aug 2020 22:18:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9433E2224D for ; Fri, 7 Aug 2020 22:18:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Wn/aVUaE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgHGWS2 (ORCPT ); Fri, 7 Aug 2020 18:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbgHGWS2 (ORCPT ); Fri, 7 Aug 2020 18:18:28 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F199C061756 for ; Fri, 7 Aug 2020 15:18:28 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id f10so1833822plj.8 for ; Fri, 07 Aug 2020 15:18:28 -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=ihUSU6TqQbA0JXbd19oZy506xASqHLLOMJEBd8n0p2U=; b=Wn/aVUaEpIsbJFU2rZwOaBv1mXyaL5z/lsmczIB5oCGwxqrmJk4Q9cz35ynOWmkGX9 YO3gSWKXo0dBwU4Tny4oneJye9E+joTqkH+fW2jqJqHfVhkiKRo0DJfvkxHj6keeAQ6m +DhiIN6tSaI5j1+Bj8tLd/vDswmMKxo/tRIXo= 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=ihUSU6TqQbA0JXbd19oZy506xASqHLLOMJEBd8n0p2U=; b=uVw2cNRNaUYFb72QGxqyKEPvIuQ2LGZO73GBMGJEofhsZvkKVty3PSDPG37n+lP10d bt4S3VwMgSuxZNYxWNJXDYIg4qbW/VFnQgH/cMHu0YNacHGt9rXnfs3CfOK8p+khc8y7 U3O5Xxyg/Hlh43l8SgRqzh7tP9n0L5Mnigs+o+54ritTRiVDNe6GjkKz/iyJ6yQFY46u 4u1gpzPC0KOXpuaCjotgapNKi/iL/vxVYtBnBoR71PFanlBLZzLncHRJoGovEUxXNvis yS1ViXUpU5SUq8qRNBQ//31wFwingentPZr/Mb+wgbu1G6hQRMxEKgGvXjObTKRYnnrZ pcGQ== X-Gm-Message-State: AOAM531I9WhD/k+MWOJWxcGgip0hi/HDHqFxCAsxU23gJkUbYEK6Uoy1 sbbAZxT3ZU6JOmVtPA75Ck8yAQ== X-Google-Smtp-Source: ABdhPJw13RGqkJjIaNqKZmvnuvXy1e+fEZ64kkiFX1oChLJZSE2IdRQiu9+MQd4tH+0QJtO8sJzmFg== X-Received: by 2002:a17:90a:d98f:: with SMTP id d15mr15634958pjv.212.1596838707622; Fri, 07 Aug 2020 15:18:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a16sm14432615pfr.45.2020.08.07.15.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2020 15:18:26 -0700 (PDT) Date: Fri, 7 Aug 2020 15:18:25 -0700 From: Kees Cook To: John Stultz Cc: Linux Kernel Mailing List , Christian Brauner , Sargun Dhillon , Christian Brauner , Tycho Andersen , David Laight , Christoph Hellwig , "David S. Miller" , Jakub Kicinski , Alexander Viro , Aleksa Sarai , Matt Denton , Jann Horn , Chris Palmer , Robert Sesek , Giuseppe Scrivano , Greg Kroah-Hartman , Andy Lutomirski , Will Drewry , Shuah Khan , netdev , containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, Amit Pundir , Bjorn Andersson Subject: Re: [PATCH v7 3/9] net/scm: Regularize compat handling of scm_detach_fds() Message-ID: <202008071516.83432C389@keescook> References: <20200709182642.1773477-1-keescook@chromium.org> <20200709182642.1773477-4-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Fri, Aug 07, 2020 at 01:29:24PM -0700, John Stultz wrote: > On Thu, Jul 9, 2020 at 11:28 AM Kees Cook wrote: > > > > Duplicate the cleanups from commit 2618d530dd8b ("net/scm: cleanup > > scm_detach_fds") into the compat code. > > > > Replace open-coded __receive_sock() with a call to the helper. > > > > Move the check added in commit 1f466e1f15cf ("net: cleanly handle kernel > > vs user buffers for ->msg_control") to before the compat call, even > > though it should be impossible for an in-kernel call to also be compat. > > > > Correct the int "flags" argument to unsigned int to match fd_install() > > and similar APIs. > > > > Regularize any remaining differences, including a whitespace issue, > > a checkpatch warning, and add the check from commit 6900317f5eff ("net, > > scm: fix PaX detected msg_controllen overflow in scm_detach_fds") which > > fixed an overflow unique to 64-bit. To avoid confusion when comparing > > the compat handler to the native handler, just include the same check > > in the compat handler. > > > > Acked-by: Christian Brauner > > Signed-off-by: Kees Cook > > --- > > Hey Kees, > So during the merge window (while chasing a few other regressions), > I noticed occasionally my Dragonboard 845c running AOSP having trouble > with the web browser crashing or other apps hanging, and I've bisected > the issue down to this change. > > Unfortunately it doesn't revert cleanly so I can't validate reverting > it sorts things against linus/HEAD. Anyway, I wanted to check and see > if you had any other reports of similar or any ideas what might be > going wrong? Hi; Yes, sorry for the trouble. I had a typo in a refactor of SCM_RIGHTS. I suspect it'll be fixed by this: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1fa2c0a0c814fbae0eb3e79a510765225570d043 Can you verify Linus's latest tree works for you? If not, there might be something else hiding in the corners... Thanks! -- Kees Cook