Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3236365pxf; Mon, 15 Mar 2021 05:09:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLVsCE+BRJvKBF25xJMcbaFiHoubdWxSCubLE0FmYN9+6dY84y6U9ooMqZMXiLFC8eXZL8 X-Received: by 2002:a17:906:a413:: with SMTP id l19mr23304071ejz.421.1615810193485; Mon, 15 Mar 2021 05:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810193; cv=none; d=google.com; s=arc-20160816; b=ZDceVbWB5oRQafUbrzs316S+lyuT1rDEQsiyJNVjAKXBJjYoOTQV2/1LOjuVsjR4PX iWnkdnu4iA0qNAmX1athcfBw6uthwMQhOHRKyMcIBqxEtowgHqWmurQMcrlrFbypXu3C PPfN6lT53JWpfEQJqUc0BlcofZl2p/rbTtBTZYp37W/OQBWdCdcLQ5IphqTVfaWyCf2+ D1OoW6/zegNNOCR2cfHPQ9yFIMTvfaYWLNl3S3Dc6/If9m7I35L3k+HWA4lBrGkNMDMD 9tMy26ci4WToE5JCW6cq6qzX5t9rYXCnSD5XVmChKS7bI89F7PUXXw4IER66AUq6H4bY am0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=s+Nngxw33SqYPyz6Zv5oaaQuR0M1LDfJZXkXOYx+XJE=; b=FSp7XuEWwprDI6nz6wqUbo+QF0c90hGT4HjBvszPuI/mxR6Dwc1nmIVbyGG9p4u20P To0Eu2EHMDUeRf3XyNom+IB6BxRdSiShIGRVQ08Xtv2/5luf73U2rJPhlZ6Sppfonse0 hjrxAYj5RsrgNX0pWEG7kFXgq2Ab68CAbMngDIzq0yFRpzG8PEzxM0AykN90Qok+JHZw +8abz13WSY2eV9jjQnFy/9VnAWAfhqcH62Zt0V5cuHioXtnndYJ4Fuz976w6VDRiUCVe LRMvfLqeOMKjQvaOOWJLeqMvAyb/Qh5ugDMkv4UZNhmgQz4iOleWQPY+oRmR9KXazwEE uGdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FkblyqXq; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si10777739ejf.656.2021.03.15.05.09.31; Mon, 15 Mar 2021 05:09:53 -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=@redhat.com header.s=mimecast20190719 header.b=FkblyqXq; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbhCOMIh (ORCPT + 99 others); Mon, 15 Mar 2021 08:08:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24808 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230443AbhCOMIK (ORCPT ); Mon, 15 Mar 2021 08:08:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615810090; 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=s+Nngxw33SqYPyz6Zv5oaaQuR0M1LDfJZXkXOYx+XJE=; b=FkblyqXqxsrXWz1D+n0vI8i9jz2qt6/ptf94DbPGvO253UXkIeOhItuy818/WhVtF0Q1Zt nkZyjf2tDDliQcSbAhwaYAlsejp3a9gRi0Q0mPap9B7V4p1HWEZf9GD82bULbrWmx1Ere4 mWSaVktccEzQOvPrEbNzJ2fk3xEJELU= 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-124-YfkgaUQHPL2QwyjJoYzVEg-1; Mon, 15 Mar 2021 08:08:08 -0400 X-MC-Unique: YfkgaUQHPL2QwyjJoYzVEg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C243800C78; Mon, 15 Mar 2021 12:08:07 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.194.107]) by smtp.corp.redhat.com (Postfix) with SMTP id 49DCD5C8AA; Mon, 15 Mar 2021 12:08:05 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 15 Mar 2021 13:08:06 +0100 (CET) Date: Mon, 15 Mar 2021 13:08:03 +0100 From: Oleg Nesterov To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, gorcunov@openvz.org, security@kernel.org Subject: Re: [PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak Message-ID: <20210315120803.GA13620@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/14, Alexey Dobriyan wrote: > > prctl(PR_SET_MM, PR_SET_MM_AUXV, addr, 1); > > will copy 1 byte from userspace to (quite big) on-stack array > and then stash everything to mm->saved_auxv. I too don't understand, memcpy(mm->saved_auxv, user_auxv, len) will copy 1 byte... And why task_lock(current) ? What does it try to protect? Oleg.