Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8F98C636D3 for ; Thu, 2 Feb 2023 19:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231486AbjBBTKF (ORCPT ); Thu, 2 Feb 2023 14:10:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231237AbjBBTKD (ORCPT ); Thu, 2 Feb 2023 14:10:03 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F28CD34C25 for ; Thu, 2 Feb 2023 11:10:01 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id ha3-20020a17090af3c300b00230222051a6so2765277pjb.2 for ; Thu, 02 Feb 2023 11:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Ei84xjALj/qnZ251dtHcjT7fuwkFwrmIuOWdIaj3IB4=; b=ifBa3W+FjfUT/jALuyk7vSXJgPyrderSzeCqeUprNB2WEcZ5Cgu0jv05ook+3UnGvo RtCgWWWwBDb7dOQWyuCGRnin3PpUqmpGnFqv5jTK2qZ2wwaTL2B9DzAqWakctSuEbd68 sv1+oh3wKsRHifknwXnc2pr4q1kxywhLR6pyU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ei84xjALj/qnZ251dtHcjT7fuwkFwrmIuOWdIaj3IB4=; b=tu84fxAscoCjLzLQl38NpjiAdlUZ4OSyYVT1/sG/udi5PwUZb4k8jhk/0KLwhjNmS8 Is0Pr+M5+4+ENiQjiEazTU1f3I9hWrcs7WCYbEKDxEmhu7tm9T9TLlYsiyNIm2ftBcrJ QpA1HB3owK469x96mLjjy87cU6VYPc73c31DRsj0gjF+j8/2OmfAl71wkClZ2y9OiKeB o9V4pes909LsKWkLZQyg+VWafinuoNkj4s9Q8Z4+cImcBcW9HDUz/QRFpfKoHRHJBpM8 iyE8WH7jQq7nE7jnsJaraNPj+y26dqrDWzbly5u1Lfor3eT/I8BnZDWQ/JkQpsml1oGU eLsg== X-Gm-Message-State: AO0yUKWE31vnJAx+HTMBFWOzjnAs7HU3f5P7GyqlVmE1dbBwSWknhHoF uQPVxSZ9sa08voBEaHRYUECt7w== X-Google-Smtp-Source: AK7set9p/VLscj8lYzuVH+QL97IgWbcWTtlAXemsvo5mM0a99DAyaG7vV23KHqvBlFv4YZ4XzS0krA== X-Received: by 2002:a17:902:ce8f:b0:196:2d55:5b96 with SMTP id f15-20020a170902ce8f00b001962d555b96mr8751901plg.24.1675365001490; Thu, 02 Feb 2023 11:10:01 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id s23-20020a170902b19700b00186b3c3e2dasm14950plr.155.2023.02.02.11.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 11:10:01 -0800 (PST) Message-ID: <63dc0a89.170a0220.49507.0091@mx.google.com> X-Google-Original-Message-ID: <202302021904.@keescook> Date: Thu, 2 Feb 2023 19:10:00 +0000 From: Kees Cook To: John Stultz , Sami Tolvanen , Ard Biesheuvel Cc: Yongqin Liu , Vlastimil Babka , Greg Kroah-Hartman , Rasmus Villemoes , Thomas Gleixner , Jason Gunthorpe , Nishanth Menon , Michael Kelley , Dan Williams , Won Chung , David Gow , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Guenter Roeck , Andy Shevchenko , Paolo Abeni , Geert Uytterhoeven , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev, Sumit Semwal Subject: Re: [PATCH 5/6] driver core: Add __alloc_size hint to devm allocators References: <20221101222520.never.109-kees@kernel.org> <20221101223321.1326815-5-keescook@chromium.org> <63dbf04a.630a0220.2608a.0149@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 02, 2023 at 10:56:29AM -0800, John Stultz wrote: > That said, making sense of the error message isn't completely trivial > either. I've been seeing a few cases recently of some of the new > compiler tooling (I pinged you earlier on a CFI one) causing errors > that developers aren't really sure how to address. I know sometimes > it's not easy to surface the errors with context to what was wrong, > but at the risk of intense bike shedding, is there some way to provide > something like "Likely array bounds error" instead of just "BRK > handler: Fatal exception"? Yeah, this is a result of the size trade-off that resulted in config CONFIG_UBSAN_TRAP -- there ends up being no message about what went wrong. I'd really like to have cleaner handling of this -- perhaps what was done for KCFI could be applied to UBSAN as well, though this is an area I don't know well myself. (i.e. encoding "this was a UBSAN trap" in the trap itself.) Sami or Ard, is this something that could be improved for arm64? -- Kees Cook