Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1299896ybz; Sat, 25 Apr 2020 15:50:47 -0700 (PDT) X-Google-Smtp-Source: APiQypLyjr1PM8U4vPRgf3gOAMLu+QuGjaThPb7rQucNZe5FcLNL08vsMRDgm98uqHGF8v+8rjNQ X-Received: by 2002:aa7:d783:: with SMTP id s3mr13523268edq.64.1587855047696; Sat, 25 Apr 2020 15:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587855047; cv=none; d=google.com; s=arc-20160816; b=iNDhU3IREJQGM7FC0TpfTxAQAyE1Tn2SC6c1FzH7os/v+BRlkhvwnOT/dvnPhWkwmx qyINoIyT5BClrcmQn6MF4cV6p2OlsBlxo7+CIqR2ExfzRSiH8m1jqGn1gpkiv0xHsZqD J4QtwAoflNCQiE44Nonnin0nDqoNMyZYPPPXIj22xjzDanspZTcihmicG+8oOI4nYjos lYpwJl1APn3L9+JtjTykXXglkCceTIhErkri9zycYK/BqKNtWN3a+Nl9ZE92crRWg5i+ LA6yl89mGoftc7WhaAnjdPS6ftvnAguspNHNva9hlP92Xp2XVNsGHgOTop+Ur766LLUW yVnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=INjGMVxgX7lD+RGHEgxoq3gDShE5KD3g4HVfvBFmby0=; b=IYJIfceNhnp+UOhV1iyg/09rhHxXqS0Gi+FYnI807wYbzQmUKixShMXv4AGBhCPoYC eFn0KnFibTGmjza/UWEBH+nYpwvhqVIf7R3nTS3DeMZn4w43uatumcTs8dhUWjl3GvEH xEh1WiFfvRgNmM/HWtP3t1eBkV1ejauhazdCZ3vyomofhk1AVf5sRvd0qt0i1vX4/esM 0Gx0th5GAbLzVRAKgvq9qNXoKvh4zIWOlR873Ym6NUhh94QmWPqiyJADGf1N1D045AVX Lt1reHVJBK3x0gm8GXQ2UV/g6uezW0ZwB24uemV2T+zGA4dhA0PhZV2cw6EU48Sukyq4 5bxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a19cRORN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj13si5295350edb.342.2020.04.25.15.50.24; Sat, 25 Apr 2020 15:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a19cRORN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbgDYWse (ORCPT + 99 others); Sat, 25 Apr 2020 18:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726232AbgDYWse (ORCPT ); Sat, 25 Apr 2020 18:48:34 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E70DBC09B04F for ; Sat, 25 Apr 2020 15:48:33 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id z6so5278365plk.10 for ; Sat, 25 Apr 2020 15:48:33 -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=INjGMVxgX7lD+RGHEgxoq3gDShE5KD3g4HVfvBFmby0=; b=a19cRORNjk+/VdnJXmNiPknF3uo2PtEDXd+Wn4E4Yw2n5jXzONbHkfcL7Io7V4/h1A hqComD/2KShYjSZxHRAydagOWbxq3YizLF44RZb5NMD2WtxFknT5vLn3qoKXRKx43h5E obdJgZwA4bH5Uox8RuOWkBB9t/5HwOcUSuKEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=INjGMVxgX7lD+RGHEgxoq3gDShE5KD3g4HVfvBFmby0=; b=sccpy0/5ZeEOWYcRgHpu5Jhzm/CC0Mk4HWGQCAyT8ifyD0gJZekhn4JPOf+uGhSh5F S/7SrBRIzXCahf0lSDsF/4ILwFTLT0K5t/MlCAZ+fyq0bdmzqtD1t5SLONRFd0Y60Rrm NwD5B5GBBWpRTEFEE66cjliRdC2aVYbot9zEv00LUfaayaKXp6JKcEyzfKu0iC13GA6f +sOj5IwMzqTaITzRISLnInDD6fRbqeo+sg33uXfVhkXSejU6k+/nvRM85qZD+EZgvDeB r5MH2p7QQowRcfa+IeGVfvoQ5GgDaBL6Gb+c3T/W7rAKwOPIz/lmUm/DgIYlZ1zdTUfs a4zw== X-Gm-Message-State: AGi0PuYO37muwYYTMpWtYIDcgr5+lggvsRlMgoMaet2RSBnbEHPaTrK0 ejmnkokKpop9CJlgitilerXnoQ== X-Received: by 2002:a17:902:598f:: with SMTP id p15mr15950225pli.264.1587854913322; Sat, 25 Apr 2020 15:48:33 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b15sm8864879pfd.139.2020.04.25.15.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 15:48:32 -0700 (PDT) Date: Sat, 25 Apr 2020 15:48:31 -0700 From: Kees Cook To: Changbin Du Cc: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slub: do not place freelist pointer to middle of object if redzone is on Message-ID: <202004251547.0F8E6856B@keescook> References: <20200425091338.24283-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200425091338.24283-1-changbin.du@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 25, 2020 at 05:13:38PM +0800, Changbin Du wrote: > The recent kernel fails to boot when slub redzone is turned on. This is > caused by commit 3202fa62fb ("slub: relocate freelist pointer to middle of > object") which relocates freelist pointer to middle of object. In this > case, get_track() gets a wrong address and then the redzone is overwritten. Hi! A fix for this is already in -next: https://www.ozlabs.org/~akpm/mmotm/broken-out/slub-avoid-redzone-when-choosing-freepointer-location.patch the above doesn't disable the mitigation when using redzones, so I prefer that to this suggested solution. -- Kees Cook