Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1812884ybj; Wed, 6 May 2020 05:56:11 -0700 (PDT) X-Google-Smtp-Source: APiQypLKguLffge0+KFyMZVQ60WzilWEUkNJ7Jdx/o/3XGqu/WHp/RiMJZzLg1TI7GXXJ6nBN26g X-Received: by 2002:a50:e841:: with SMTP id k1mr6994592edn.245.1588769770989; Wed, 06 May 2020 05:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588769770; cv=none; d=google.com; s=arc-20160816; b=hyRH7UncHOcgQOjHeiV/ZXNv0EUYPafI0RlwJKF45Kx8PUnhD0V2Jr7w2o/BQE4Qu5 UqgZckHzOSarwt6D/DCjOkAcp/wDsbEKbRonGAZuuHMpdyfLT6PQzVIBgQ6I6xm7/vKe tiLqteRSRh/aECDHb6rk/vq1ZRm9cVqwR7jH3zp+r5Qkz1NqPXk2mhmYqI415VkkPIv1 amjSWS8kioZ3AG2DwQ5qcz1L/WDw86p0mnFp1dTaU+gf1M00rC0fqM6fdQneAhDK6KwI CT/tVOVowviBs42JXRca5PpGIwA0kDwjxHE8uodI6nvm5oI+GfboWrhAWZZpJ/IjF4tl XUOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=HYMSKD4puOesGZerwur7PSxsdy+Bu9iPUqBLd5NWDVs=; b=hmGLR+lmV2N3LYWuhG8VS89LTZPJXCVYb5Ir/p1v5Rhu9NZi/loeIddfPGaBLRClpQ hUABTbKDtEVDwRThje00ipkBfiQQQRyc3AiNXxnQYxqWnA/x0W08hJwhXXgps6+/yZ8G ysARO+qKOVMWZ12zYl4XlEJAspBHS/lJPhwoCfkZaA5miBt9tIKROQ/SXFkp40weeMS2 C2wLoOAfvCGYRb7HIyvJXORd3xqKOK8J13zgpaB0UwFv+ZcgRQZ5I2oiBnyM4W0BEdIP MaPbE83PTvUtRiIrHBLe9O9Y3pMrV3HysCC9rAC9Gginon70p6F1C1tfJInAX6c/oHpI GwSw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si1077877ejc.135.2020.05.06.05.55.48; Wed, 06 May 2020 05:56:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728479AbgEFMvp (ORCPT + 99 others); Wed, 6 May 2020 08:51:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:34586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728131AbgEFMvp (ORCPT ); Wed, 6 May 2020 08:51:45 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5816020575; Wed, 6 May 2020 12:51:43 +0000 (UTC) Date: Wed, 6 May 2020 08:51:41 -0400 From: Steven Rostedt To: Srikar Dronamraju Cc: Oleg Nesterov , Guo Ren , Christian Borntraeger , "David S. Miller" , Linus Torvalds , "Eric W. Biederman" , Peter Zijlstra , Ingo Molnar , Jann Horn , Al Viro , Jens Axboe , Security Officers , Andrea Arcangeli , Ananth N Mavinakayanahalli , Naveen Rao , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] uprobes: ensure that uprobe->offset and ->ref_ctr_offset are properly aligned Message-ID: <20200506085141.723673f1@gandalf.local.home> In-Reply-To: <20200506052955.GA8259@linux.vnet.ibm.com> References: <20200428091149.GB19958@linux.vnet.ibm.com> <20200428123914.GA27920@redhat.com> <20200504164724.GA28697@redhat.com> <20200506052955.GA8259@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 May 2020 10:59:55 +0530 Srikar Dronamraju wrote: > * Oleg Nesterov [2020-05-04 18:47:25]: > > > uprobe_write_opcode() must not cross page boundary; prepare_uprobe() > > relies on arch_uprobe_analyze_insn() which should validate "vaddr" but > > some architectures (csky, s390, and sparc) don't do this. > > > > We can remove the BUG_ON() check in prepare_uprobe() and validate the > > offset early in __uprobe_register(). The new IS_ALIGNED() check matches > > the alignment check in arch_prepare_kprobe() on supported architectures, > > so I think that all insns must be aligned to UPROBE_SWBP_INSN_SIZE. > > > > Another problem is __update_ref_ctr() which was wrong from the very > > beginning, it can read/write outside of kmap'ed page unless "vaddr" is > > aligned to sizeof(short), __uprobe_register() should check this too. > > > > Cc: stable@vger.kernel.org > > Reported-by: Linus Torvalds > > Suggested-by: Linus Torvalds > > Signed-off-by: Oleg Nesterov > > Thanks Oleg. > > Looks good to me. > > Reviewed-by: Srikar Dronamraju > > --- > Thanks Oleg, Srikar and Sven. As this is in the kernel/events/ directory, I'm guessing it should be taken through the tip tree? -- Steve