Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp925650ybl; Tue, 28 Jan 2020 15:03:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzoaM6c7oDUC4exZ5KIs/kKojV2nkziH4pSquNfZMmAn1pUfpMhlRmM158TEJk0aeYoAQvD X-Received: by 2002:a54:480c:: with SMTP id j12mr4460836oij.130.1580252590570; Tue, 28 Jan 2020 15:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580252590; cv=none; d=google.com; s=arc-20160816; b=TwuFGlhS3OpKCSKrkUwxRyaVQa6+stcsz0022OJz8pbpxlw2MsD9v+Ap7OIISnaA4b NyNjnCaPEbnvv7Wj2w7K4mPhkBgYTgnTjs4bcBEynhVLojFgdSFRk6Lwabhw1dVpmdcf hlE93KaeopLUdtk4MJ3jtUvIgk2UjOwf2wi/Q5+8RDEhP1dCDQyQZHxp+7Z1ZVlbnW2d S1oh/KS+8uiDxjZnqV11yETXU7BkHaj+ricCSpreUzH75zuJZqAsz4mbmAcx5//1Qn1q 2a7pmxbQ7L/ECcaCnIUXRUCXopDS3BRKsJThIRHloabUwRYzJTgPMTQHxbS0/Hbx7Se2 eFkg== 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=+dg91h5BizLIOhJtrfPoQX1PBXFzRkzG/EccKIP5g+k=; b=GAugFGCzwfliuAyAcluhkYdGej2GMB4TvQ1slWgZpnRe5PWuGiMu1z5BhLFMWcW86A oMX8Gw4oWRnUsWTvYbieQf6fN9ANr7rER/Yj6iiyx4i+p8L8YEjsdaIpPwguPvv13OiD xiAm9bLT4Wtw1hLBtsNlYtJJmTAPuQ5xFCutEHUxxxuhDWEVpeyO5W8nGUZDitQvUfcZ fPt7mgp+47uJuOKcWZ+3KLbwqcYQRkIyx5w6sa620OKbLZGG5JFePPY9cd3JFLMA8F1F XikLn2SZa6CCHhPxK4jmiWzQ9fMwo843qdPGjBdA2GzV4tg5xfax0lJUZBYtoBMi5CBv 8jmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SLEtsTXM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si116616oih.217.2020.01.28.15.02.47; Tue, 28 Jan 2020 15:03:10 -0800 (PST) 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; dkim=pass header.i=@chromium.org header.s=google header.b=SLEtsTXM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726444AbgA1XB5 (ORCPT + 99 others); Tue, 28 Jan 2020 18:01:57 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43660 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbgA1XB4 (ORCPT ); Tue, 28 Jan 2020 18:01:56 -0500 Received: by mail-pf1-f196.google.com with SMTP id s1so6822378pfh.10 for ; Tue, 28 Jan 2020 15:01:56 -0800 (PST) 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=+dg91h5BizLIOhJtrfPoQX1PBXFzRkzG/EccKIP5g+k=; b=SLEtsTXM5HHL6KRx3hcUWmwHu6WOPgN0CNP8fHNTI+FAT+8rXdOFNHQ4Yag2eY0oom MxIjkObrnioymch5q5MyrzGbWNjwhgMUswCx/M+MVBVQAe23jccXfrAxinTI930p2387 D9bys2Kwzdd099/FcXPhmwL9QuGCzxCyDD8ZA= 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=+dg91h5BizLIOhJtrfPoQX1PBXFzRkzG/EccKIP5g+k=; b=ESuosxL5QXsi0oYSk6khrjAN68979UeIXlOY0fDgN2nK/lAl4LHrlZ5ol7XGLuTzsP o0Rr62fMTghojYbRcn5F/h8QEnAXHcYUMDQhuDJHGy5lQUVZspkuCuSsxeMQ00B6GjmO GOLaFqREWxiuhHshbknjqDydy5Bwi+raSX+Fo1nXi9WBT4S8EgBpiWWgvjUQbNBq6Y4T EkMgIiYTJ6JHrGIPhwBIfukC1vSHeV46JzlpHKYSe4R1CSHctPPAsVvBhwo+o3SAWnja +D6+uUX8VUFS9XMq3byxrb9IULG732DImOPhJIJvMcNvIxBBfwBobNqWzRfNb1Ht49Ba fgig== X-Gm-Message-State: APjAAAW+A3nlRStvP9Iw1pQZceaW+cxcs/lFIbDFywZ6AFUQAXsD5OBt 1qabupeHoC1ZNRMe6TWw8JPhaw== X-Received: by 2002:aa7:82d5:: with SMTP id f21mr6360681pfn.245.1580252515843; Tue, 28 Jan 2020 15:01:55 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k21sm136324pgt.22.2020.01.28.15.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 15:01:54 -0800 (PST) Date: Tue, 28 Jan 2020 15:01:53 -0800 From: Kees Cook To: Christian Borntraeger Cc: Jiri Slaby , Julian Wiedmann , Ursula Braun , Alexander Viro , linux-kernel@vger.kernel.org, David Windsor , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-xfs@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Christoph Hellwig , Christoph Lameter , "David S. Miller" , Laura Abbott , Mark Rutland , "Martin K. Petersen" , Paolo Bonzini , Christoffer Dall , Dave Kleikamp , Jan Kara , Luis de Bethencourt , Marc Zyngier , Rik van Riel , Matthew Garrett , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, kernel-hardening@lists.openwall.com, Vlastimil Babka , Michal Kubecek Subject: Re: [kernel-hardening] [PATCH 09/38] usercopy: Mark kmalloc caches as usercopy caches Message-ID: <202001281457.FA11CC313A@keescook> References: <1515636190-24061-1-git-send-email-keescook@chromium.org> <1515636190-24061-10-git-send-email-keescook@chromium.org> <9519edb7-456a-a2fa-659e-3e5a1ff89466@suse.cz> <201911121313.1097D6EE@keescook> <201911141327.4DE6510@keescook> <202001271519.AA6ADEACF0@keescook> <5861936c-1fe1-4c44-d012-26efa0c8b6e7@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5861936c-1fe1-4c44-d012-26efa0c8b6e7@de.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 28, 2020 at 08:58:31AM +0100, Christian Borntraeger wrote: > > > On 28.01.20 00:19, Kees Cook wrote: > > On Thu, Jan 23, 2020 at 09:14:20AM +0100, Jiri Slaby wrote: > >> On 14. 11. 19, 22:27, Kees Cook wrote: > >>> On Tue, Nov 12, 2019 at 01:21:54PM -0800, Kees Cook wrote: > >>>> How is iucv the only network protocol that has run into this? Do others > >>>> use a bounce buffer? > >>> > >>> Another solution would be to use a dedicated kmem cache (instead of the > >>> shared kmalloc dma one)? > >> > >> Has there been any conclusion to this thread yet? For the time being, we > >> disabled HARDENED_USERCOPY on s390... > >> > >> https://lore.kernel.org/kernel-hardening/9519edb7-456a-a2fa-659e-3e5a1ff89466@suse.cz/ > > > > I haven't heard anything new. What did people think of a separate kmem > > cache? > > > > Adding Julian and Ursula. A separate kmem cache for iucv might be indeed > a solution for the user hardening issue. It should be very clean -- any existing kmallocs already have to be "special" in the sense that they're marked with the DMA flag. So converting these to a separate cache should be mostly mechanical. > On the other hand not marking the DMA caches still seems questionable. My understanding is that exposing DMA memory to userspace copies can lead to unexpected results, especially for misbehaving hardware, so I'm not convinced this is a generically bad hardening choice. -Kees > > For reference > https://bugzilla.suse.com/show_bug.cgi?id=1156053 > the kernel hardening now triggers a warning. > -- Kees Cook