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,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=unavailable 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 886BEC433DF for ; Sat, 8 Aug 2020 00:20:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6059B20866 for ; Sat, 8 Aug 2020 00:20:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="raa038Ca" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726386AbgHHAUN (ORCPT ); Fri, 7 Aug 2020 20:20:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbgHHAUK (ORCPT ); Fri, 7 Aug 2020 20:20:10 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17310C061A29 for ; Fri, 7 Aug 2020 17:02:27 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id t7so2951096otp.0 for ; Fri, 07 Aug 2020 17:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5V4fSeXIIf10FVBMF3ZwZcNjvm3OCHIjH9V8C29Y8lQ=; b=raa038CaUF9eWBraNH4WEyPuTHJSK6iOiV7k6AYrMeNgIhzFx6ZewrZSuo5lrAVEdK 9bOtaWtNfF07d9UEYUqPA6aNkM20agULeekqUYoS5Qe3Z22dBLbZuaZdwc0zac2dFT8n N3xMKrgLDJwJrCyj4e9MYB3+ZJJ1gVbN1ypxreVVkfRzZh9Lwqwz7wDfTV0KYta5fshZ OdIZMeVdyM0/ehI67+Kizp9fRZugyLsg7B4FbHuK8BMDqZEVUpWK0PH5DX68JkBYxfMs aOpiQcc5HKPaKOyUagtLwMCbgtum4v9yvrQ01rY6uf9g56CM5kjZ1vx+55Z+jpg2jETd tMrg== 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=5V4fSeXIIf10FVBMF3ZwZcNjvm3OCHIjH9V8C29Y8lQ=; b=mtPgFmd9ZNqrfcjoFlCZfM1GLTRkaIPvEJOgu+rDOZ8Z2yiJvU5yjBQUfDjmt4q15+ vB4j5sBq/Ar5AfVyOkFmAMDeSrWoZa03NetR0gfpFIN8Hiv7QnMq47h/T8mHIpZI7Wtv BZCWYMEnp2YAFlebRlyYDNQ6PuQ6Qk6Gn55J0gMU3GznKzDCxUsRbBUEfNTmwifY6Slr bnfuWM7zUTKbe3F4/OMBGQBeLcGzlEAt0XLUnvBnS5bMZd1JvEWa4zdUmqgu/lXbUZ75 0saeKlX/hHOQUpVPq11HslBPJ6ImJe0elJZIFvoPInhZHJHeZ3VvG/62vmtE8u6bFgWF 2awg== X-Gm-Message-State: AOAM532CN8Nxe7guHLn4SMhEVj32Toj5qrNRynaqDaNKtw16FZHgW7sk jq9YgoZjkGoIdW7rhjiYeMB3IpiESOu/7WXiY6ercQ== X-Google-Smtp-Source: ABdhPJyt2wG3ZDTNWblVENQs5ccUnTXPuZbzbj0BnXWicp6XtJM28SQrhwmJ/s4VEOh4n6cv6N5dnVLVJsMlDVkrD+Y= X-Received: by 2002:a05:6830:237b:: with SMTP id r27mr13338417oth.352.1596844946630; Fri, 07 Aug 2020 17:02:26 -0700 (PDT) MIME-Version: 1.0 References: <20200709182642.1773477-1-keescook@chromium.org> <20200709182642.1773477-4-keescook@chromium.org> <202008071516.83432C389@keescook> In-Reply-To: <202008071516.83432C389@keescook> From: John Stultz Date: Fri, 7 Aug 2020 17:02:15 -0700 Message-ID: Subject: Re: [PATCH v7 3/9] net/scm: Regularize compat handling of scm_detach_fds() To: Kees Cook 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 , linux-fsdevel , linux-kselftest@vger.kernel.org, Amit Pundir , Bjorn Andersson Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Aug 7, 2020 at 3:18 PM Kees Cook wrote: > > 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 so much! Yes, I just updated to Linus' latest and the issue has disappeared! thanks again! -john