Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1764445ybh; Sun, 8 Mar 2020 12:21:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsN2yVJ/Jgx/7IhbCFeO+2CXk7IZ19HpJTXL/p6uY6T5nJJGJvTnQyQUEc2nDfZ+yLYScS1 X-Received: by 2002:a05:6808:30d:: with SMTP id i13mr4275028oie.119.1583695318544; Sun, 08 Mar 2020 12:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583695318; cv=none; d=google.com; s=arc-20160816; b=wdLCeoSVXCTqxktqN7UyikHQBkv0pOvOTlExohF6Ug5wZQgvBohKa0kAdMFD4OYIg4 hIEvrWO16HloS412nQ8E1LJhjUl7GPnCNi34qhwBUStHeMPZikoIZT/X83gjEnfpGjT0 n7G8ubXfjPUdMI23sio3n04XT3W1VqWCBgrE2EUzMFZiJstNyfIAw0Q2cLy4eCkalkpu Mtze8xan2JAoKLgFgdYDORF9yyniUQvrinKAjgDnKbZ2UB3n92vFbplOZtKXgZAoJIvj 5sMqMrEbYcvEY3wDdHCuMhNGf+OEQoToSIy5KgssgwSmlwVC4dms7tjDqTPv/gPFacHA whvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=5RsguPBlitqGfQTqGG5bwc880eR+W3otok7/25Yc35c=; b=Yt3Ey6nE21/+i0jqAVKnWul7n2Syw+yJlxAumfPe+z+6Gea8sybSJBrklHxCMB1dnK GHK78TzDx4Ydwr9JXLf9icBXHo9UTtj0bimNM66NL/Tz+nicGwVag+FPWPgsFR0YEQHV 8Z/1P6saP3IbQ4MMHgWebGBLsGRSq8JaeHiC2uPuvMy0FPJzwRPYReG3VPDFn0gfheuZ aYXpbLh8Yg429lGWWeXm5LPFOLjesBGcTNtEys4utKTkESWOSczV/pLRiIpkVfmDXU9X Ug+vOz5z2m3KAIj9CdIu5R8ngWlz/BVIBUjrC5/2wk7JDapfkYWwH6rPcWZJelhYJ/x2 goNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si2960346oia.33.2020.03.08.12.21.46; Sun, 08 Mar 2020 12:21:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbgCHTVK (ORCPT + 99 others); Sun, 8 Mar 2020 15:21:10 -0400 Received: from gentwo.org ([3.19.106.255]:43428 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbgCHTVK (ORCPT ); Sun, 8 Mar 2020 15:21:10 -0400 Received: by gentwo.org (Postfix, from userid 1002) id 5D6383F1C0; Sun, 8 Mar 2020 19:21:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 5A5433E998; Sun, 8 Mar 2020 19:21:09 +0000 (UTC) Date: Sun, 8 Mar 2020 19:21:09 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Kees Cook cc: Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , Daniel Micay , Vitaly Nikolenko , Silvio Cesare , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] slub: Relocate freelist pointer to middle of object In-Reply-To: <202003051624.AAAC9AECC@keescook> Message-ID: References: <202003051624.AAAC9AECC@keescook> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Mar 2020, Kees Cook wrote: > Instead of having the freelist pointer at the very beginning of an > allocation (offset 0) or at the very end of an allocation (effectively > offset -sizeof(void *) from the next allocation), move it away from > the edges of the allocation and into the middle. This provides some > protection against small-sized neighboring overflows (or underflows), > for which the freelist pointer is commonly the target. (Large or well > controlled overwrites are much more likely to attack live object contents, > instead of attempting freelist corruption.) Sounds good. You could even randomize the position to avoid attacks on via the freelist pointer. Acked-by: Christoph Lameter