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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0280C433EF for ; Sat, 16 Apr 2022 21:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233077AbiDPVQD (ORCPT ); Sat, 16 Apr 2022 17:16:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbiDPVQB (ORCPT ); Sat, 16 Apr 2022 17:16:01 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C181A2E6A9 for ; Sat, 16 Apr 2022 14:13:26 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id n18so9646038plg.5 for ; Sat, 16 Apr 2022 14:13:26 -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=BjuGjhP4kQ32yKxfj1klKnac9K0XU0XMV9i06nB2Ffw=; b=GyVgmPUPKlHwgjgMupQ3m8a1KtAcRlmYQtP+ay8ThpdC8/UZAH9YWi+a1xebtVu3z9 3HNwQs3a8FTwoxLtDQPx4+agyG51wueyE8SZx8anisVgHgvTqPEaUV+Qa6rdUVavZg29 CTLMxmd6i4Z7MvxuRnYfozyCe+Adzip55g/DU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BjuGjhP4kQ32yKxfj1klKnac9K0XU0XMV9i06nB2Ffw=; b=PpEm+RW15UCWPv4OQrOrkRSkponQ9FvZ6G1+iwMoSR+iPYO9resf8HMkXzSjQPvi0i VdhCYRiiqma8xcw9p0xmid8JrJhAX0icsGWwE+L7Ng76K2EfzLy4WZIkSVrGU8wRiokL pWRXCjZvHis/M0JuLd61lQeUcOi3wU2nET0NqKIQLpcNgLQbXUuPtEmar4EbPB9jsyts +jxxDa3qYVy3ZvckIiXhanmQsXcoGkRgGteXBpa9HeYfSdsgYysuQfVBQ93K0DYxqwuH ScBf9jqa11YJDa80DaCPKNj/w2+rm+GgxgYx2Nslp0kYbtMXu9IsZE4s+0feI3rdYCO7 2Hiw== X-Gm-Message-State: AOAM531hpIK62dddfYwEULCY3VGBNTMkXhr28Fn+B7AOzUqXGH2R0ktu RRak4CA60HstQPnnvyndCMUlb2uuQJeYUQ== X-Google-Smtp-Source: ABdhPJw1Iuz9CgyW1LYrs6aaku8ERT5AYV8PDxCcP+HhoQjHs7Ts0OOOvQ9hwQ3C8FVMgtJHM26JRA== X-Received: by 2002:a17:902:b582:b0:14c:a63d:3df6 with SMTP id a2-20020a170902b58200b0014ca63d3df6mr4610655pls.51.1650143606310; Sat, 16 Apr 2022 14:13:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f187-20020a6251c4000000b005058e59604csm6758560pfb.217.2022.04.16.14.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Apr 2022 14:13:25 -0700 (PDT) Date: Sat, 16 Apr 2022 14:13:25 -0700 From: Kees Cook To: Muhammad Usama Anjum Cc: Shuah Khan , Greg Kroah-Hartman , kernel@collabora.com, kernelci@groups.io, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] selftests/lkdtm: add config Message-ID: <202204161407.D6D3202FD@keescook> References: <20220217205620.2512094-1-usama.anjum@collabora.com> <20220217205620.2512094-2-usama.anjum@collabora.com> <202203091123.33E89F5@keescook> <76529762-1a36-142d-0aa9-beb5fa2bb27b@collabora.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 Mon, Apr 04, 2022 at 12:50:01PM +0500, Muhammad Usama Anjum wrote: > Hi Kees, > > Any thoughts? > > On 3/15/22 4:55 PM, Muhammad Usama Anjum wrote: > > On 3/10/22 10:22 PM, Muhammad Usama Anjum wrote: > >> On 3/10/22 12:23 AM, Kees Cook wrote: > >>> On Fri, Feb 18, 2022 at 01:56:20AM +0500, Muhammad Usama Anjum wrote: > >>>> Add config option which is needed for SLAB_LINEAR_OVERFLOW test. It > >>>> needs KASAN enabled. > >>> > >>> I'd prefer this use the SLAB_DEBUG options -- KASAN is very heavy. > >> I'll test it out and update in the next patch version. > >> I've tested by removing KASAN and adding the following config: > > CONFIG_SLAB=y > > CONFIG_DEBUG_SLAB=y I recommend slub instead: CONFIG_SLUB=y CONFIG_SLUB_DEBUG=y and one more, see below... > > > > The result of SLAB_LINEAR_OVERFLOW test doesn't remain deterministic in > > this config. The task never crashes and hence stack trace never appears. > > When executed several times we get "Slab corruption" logs and after some > > more tries whole kernel crashes. I've not used DEBUG_SLAB before and not > > sure if this is the expected behavior. If we aren't sure, we can keep > > KASAN turned on instead. I think you need to enable the actual kmem debugging with a boot param ("slub_debug=ZF"), or with CONFIG_SLUB_DEBUG_ON=y. -- Kees Cook