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=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 6CCF0C43463 for ; Fri, 18 Sep 2020 23:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31725206FC for ; Fri, 18 Sep 2020 23:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726249AbgIRXzn (ORCPT ); Fri, 18 Sep 2020 19:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbgIRXzm (ORCPT ); Fri, 18 Sep 2020 19:55:42 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823AFC0613CE for ; Fri, 18 Sep 2020 16:55:42 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJQDx-001LjX-0T; Fri, 18 Sep 2020 23:55:29 +0000 Date: Sat, 19 Sep 2020 00:55:28 +0100 From: Al Viro To: Andy Lutomirski Cc: syzbot , Aleksa Sarai , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , LKML , Ingo Molnar , Peter Zijlstra , syzkaller-bugs@googlegroups.com, Thomas Gleixner , X86 ML Subject: Re: WARNING in ex_handler_uaccess Message-ID: <20200918235528.GB3421308@ZenIV.linux.org.uk> References: <000000000000762dee05af9ccd01@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2020 at 04:31:33PM -0700, Andy Lutomirski wrote: > check_zeroed_user() looks buggy. It does: > > if (!user_access_begin(from, size)) > return -EFAULT; > > unsafe_get_user(val, (unsigned long __user *) from, err_fault); > > This is wrong if size < sizeof(unsigned long) -- you read outside the > area you verified using user_access_begin(). Read the code immediately prior to that. from will be word-aligned, and size will be extended accordingly. If the area acceptable for user_access_begin() ends *NOT* on a word boundary, you have a problem and I would strongly recommend to seek professional help. All reads in that thing are word-aligned and word-sized. So I very much doubt that your analysis is correct.