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 ED961C433F5 for ; Fri, 12 Nov 2021 09:08:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9862460555 for ; Fri, 12 Nov 2021 09:08:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9862460555 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 3DE486B0078; Fri, 12 Nov 2021 04:08:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 38E386B007B; Fri, 12 Nov 2021 04:08:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27D7D6B007D; Fri, 12 Nov 2021 04:08:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 1A1336B0078 for ; Fri, 12 Nov 2021 04:08:33 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D322A1808F91D for ; Fri, 12 Nov 2021 09:08:32 +0000 (UTC) X-FDA: 78799702464.11.8C8FDEE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 604CB900050F for ; Fri, 12 Nov 2021 09:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636708111; 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=ujeVOJaP3l3Agh5Fd01V+TO1YiXBRY47fAbGw6BqApM=; b=IP61uZCXgCyr6llBpq4ygb3rGQ0DSZV/WxxMa8d/i70dRbVlJdC0RdtmsJCI1KYEm8WDiN lfQ1zc8X1cEeTjAGuuureteiIv0GUHWTcjRLMtDLSwPcvsdMj6EudCf02JyGGXfVlLAr+J uZLP+Eq4Ok9Zh/73e+kv8EHd59yTXbI= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-383-ajmqF_nHOJ2cR1s8SFX2EQ-1; Fri, 12 Nov 2021 04:08:28 -0500 X-MC-Unique: ajmqF_nHOJ2cR1s8SFX2EQ-1 Received: by mail-lj1-f197.google.com with SMTP id y11-20020a2e978b000000b00218df7f76feso2894083lji.11 for ; Fri, 12 Nov 2021 01:08:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ujeVOJaP3l3Agh5Fd01V+TO1YiXBRY47fAbGw6BqApM=; b=q+7Aeglow82zDreWWex3UcacRF8aYPcjwfWSUcuO4dfCK+MqU2ra1vb7lsi8jRz8IE 70b5BT4MpAvmom8XROgiZmp7YmV56vgsluUSotV990o55iTuZOb2XqKZ0Wv0BO/9sPC1 EgMCnmu3NZH4UqwxkEhTzLqc+2ovL95qPfn8RUQCW/siG154Yc06r//YaBSNReyhl1yY F/LJto2g9oEhupJGr9DV/dY0hj6WVpT/1Hzj6Ze6yrIZc2/6V0AkD2NnD53NUXFlWMkZ Zy7h5ltyybSowbYZiK7m9zUMi+AF4vZXSHBV1hPifFA3a44cp9H1EEao1ckZAORT4KKm rAfA== X-Gm-Message-State: AOAM531ORi1BdQx7faGlfnqJ+2UP2HqFnj1vfw8zZ2bYOjRqw2L5837N MJ0XJzd8B44ikuggBz+07xSwR8bxhZUnZRVocXcMuBMRIMokIb/p2SFilfh1ycxixX3NxZtenLB HH6UkdHFkpr5ThwNCpkm3JlRgV0M= X-Received: by 2002:ac2:4341:: with SMTP id o1mr12750429lfl.297.1636708106668; Fri, 12 Nov 2021 01:08:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCc2uOBlvYGYG6DZyxhxuF39PB33M8nb2w4etD6lIMHAvP93dNADJAYeJYTDPnFUoiH+M+IkY/35BQGVeyOL4= X-Received: by 2002:ac2:4341:: with SMTP id o1mr12750368lfl.297.1636708106001; Fri, 12 Nov 2021 01:08:26 -0800 (PST) MIME-Version: 1.0 References: <20211111191800.21281-1-david@redhat.com> <20211112070113.GA19016@MiWiFi-R3L-srv> <21bdcecd-127c-f70e-0c7d-cb1b97caecb0@redhat.com> <20211112090116.GC19016@MiWiFi-R3L-srv> In-Reply-To: <20211112090116.GC19016@MiWiFi-R3L-srv> From: David Hildenbrand Date: Fri, 12 Nov 2021 10:08:14 +0100 Message-ID: Subject: Re: [PATCH v1] proc/vmcore: fix clearing user buffer by properly using clear_user() To: Baoquan He Cc: Linux Kernel Mailing List , Dave Young , Vivek Goyal , Andrew Morton , Philipp Rudo , kexec@lists.infradead.org, Linux MM , linux-fsdevel X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 604CB900050F X-Stat-Signature: e6heqsamrjb9i667fabtt7dia64hac1b Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IP61uZCX; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf28.hostedemail.com: domain of dhildenb@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=dhildenb@redhat.com X-HE-Tag: 1636708112-143567 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: > > "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!