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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41AEBC433F5 for ; Fri, 12 Nov 2021 13:24:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BF3EC61075 for ; Fri, 12 Nov 2021 13:24:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF3EC61075 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0E7CB6B0074; Fri, 12 Nov 2021 08:24:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0982F6B0078; Fri, 12 Nov 2021 08:24:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC8056B007B; Fri, 12 Nov 2021 08:24:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id D7CF26B0074 for ; Fri, 12 Nov 2021 08:24:02 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8D5B2181BF8B9 for ; Fri, 12 Nov 2021 13:24:02 +0000 (UTC) X-FDA: 78800346156.19.E759FC6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id DC18060019AA for ; Fri, 12 Nov 2021 13:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636723441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V0x70aOSjj4juyUQjyZjwm3PmchvbNbWWsusOMomWSY=; b=Nj7buJAoAj74NVBm3cieF3pmF3zA2AA/oDuNVCGf2DJo3/VlLn2WlUgRUIhAPrPXgyzamQ /42miFyAqVihWqsHYnCQl8R751ig25lKQl1S94vDWQDl6GySMoUDhkoOGofVMzHgTtHbn/ Xvoi5BC8C49SAnkgmiw3NevsPnY1z1U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-317-yDqGPiWaOQqk18Zf6QR59A-1; Fri, 12 Nov 2021 08:23:58 -0500 X-MC-Unique: yDqGPiWaOQqk18Zf6QR59A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F0BCA9F92F; Fri, 12 Nov 2021 13:23:56 +0000 (UTC) Received: from localhost (ovpn-12-197.pek2.redhat.com [10.72.12.197]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC7A267840; Fri, 12 Nov 2021 13:23:28 +0000 (UTC) Date: Fri, 12 Nov 2021 21:23:26 +0800 From: Baoquan He To: David Hildenbrand Cc: Linux Kernel Mailing List , Dave Young , Vivek Goyal , Andrew Morton , Philipp Rudo , kexec@lists.infradead.org, Linux MM , linux-fsdevel Subject: Re: [PATCH v1] proc/vmcore: fix clearing user buffer by properly using clear_user() Message-ID: <20211112132326.GA16071@MiWiFi-R3L-srv> References: <20211111191800.21281-1-david@redhat.com> <20211112070113.GA19016@MiWiFi-R3L-srv> <21bdcecd-127c-f70e-0c7d-cb1b97caecb0@redhat.com> <20211112090116.GC19016@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Nj7buJAo; spf=none (imf14.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DC18060019AA X-Stat-Signature: rxj11dwfwzyknyjnxedrwc13hroth4uf X-HE-Tag: 1636723442-970249 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/12/21 at 10:08am, David Hildenbrand wrote: > > > "that allows supervisor mode programs to optionally set user-space > > > memory mappings so that access to those mappings from supervisor mode > > > will cause a trap. This makes it harder for malicious programs to > > > "trick" the kernel into using instructions or data from a user-space > > > program" > > > > OK, probably. I thought it's triggered in access_ok(), and tried to > > figure out why. But seems we should do something to check this in > > access_ok(), otherwise the logic of clear_user/_clear_user is not so > > reasonable. Anyway, I have learned it, thanks a lot for digging it out. > > > > By the way, I can't open above wiki article, found below commit from > > hpa. Maybe we can add some into log to tell this, not strong opinin, > > leave it to you. > > Yes, now that we know the root cause I'll add some more details to the > patch description and resend -- thanks Baoquan! Thanks for sending v2.