From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 139CE8F60 for ; Thu, 2 Feb 2023 19:10:01 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id nm12-20020a17090b19cc00b0022c2155cc0bso2747692pjb.4 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=hLFHiAK7bh64CPycssoJEHWcSFtclPKB0Yyo6MGHh06iPEOoGr8pCmqQ0JWUrjgBLk kgjfGuNtm3cAp6Wd0OJ7lfbjZPd9/swDYDI7K6xDtyjRJzaGWgur+sVz+usM0Vdd90DJ 65vraeydPrqDWo0netMnY7NsuK+kkPHexzQBXOiHHgBpQrk7omP39mwjpk6ibVSw1k83 X8V15KPrEpZc4JxgJCiKxmJ32SRff2WVC7T3srxU0ixdibdIS7gkVpJ935JZwYczqwQT 2uze+Ai0ov/Sy8r2+y7OeAcPv0DyI5Y55l4mAPpKvFYwkt6npTID1Qq38cdpBDx0Fbds wVWQ== X-Gm-Message-State: AO0yUKVEwwhuYmKA+fIpGTk9EmDVrgo6htb/Gk6T3jmIJqyuDQesysIP ZIg25QdSDxT+pvcWWrs7UUPbLA== 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> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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