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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C77CCC31E50 for ; Sun, 16 Jun 2019 21:31:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C34320665 for ; Sun, 16 Jun 2019 21:31:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O0N1XJfE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="NaOJcl+y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C34320665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+/+qqTExgMCgq8ipzcFybYtGpKwuQ5VUo9030O4/U8g=; b=O0N1XJfED6d3hO n1ifsDp3tdDlujS9ejbvYJLAiaylgdOtsIYmPH+F0lyNUrVluqbUOJK/zFUpyK87zG6PnBeuWaGgt pvwa1yyaGio2yoTpIJ2HTy3UgdMYSKwhAEemSoimV7CksB+2Mt0+7QRcrZfm0ewf1GZl15MTKe5KO I7VtuBVYCjA7QO1Q8h5HIdhAED1bAUPUxyN34wwxZOYFU9LGnX2GbQgAZEfiHidNpEZB5iuav6GNk VQNcuys5m0H6OI7NCLt5TyVRZU0oxegDDjmxP/Slsw9WGa+9YHRUYLYwqrSPng18d1aq1BRFypd24 ueNb8GXPh3+et2lny2Dw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcckM-0005Qi-EV; Sun, 16 Jun 2019 21:31:30 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcckK-0005QP-4b for linux-arm-kernel@lists.infradead.org; Sun, 16 Jun 2019 21:31:29 +0000 Received: by mail-pf1-x42a.google.com with SMTP id m30so4511935pff.8 for ; Sun, 16 Jun 2019 14:31:27 -0700 (PDT) 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=7VduBeQKV5QqdjaRJMGgAlmp2IHtPHNsUVn3EFkQ16A=; b=NaOJcl+yzjhCeEuveWJCk+ztsn2feghCQVbaTu/DJt/zO+DaY4tFj/CMCQsela+8h+ EKmmF2vvjDrJU6JhpZFROJhfuBdfMvQrtx3BxSU/UtzB8jNzHBhvW5ji713pacfpK+ur T/RCfrXIOu2euKG9FHWvlH0SOhLRvANMeGHsY= 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=7VduBeQKV5QqdjaRJMGgAlmp2IHtPHNsUVn3EFkQ16A=; b=IoCZE/Lc4VRcAtXnEBS3pGtYXV6zQnLOJuM7sJ2BoeiAMR4gqalPs3CL5WhELT7zh2 KiDWIXOhRG5fQOQEmvAUKYEP5WZmliR5y0qUIoTeK3f52VvGcK1P7uHKFaAQVaNpRlmz 8rJgpLfTN+yzPmGNOmMo+lhI+7ecKE+1mRAFNiB6HkhJp/Cn7dMWXmFlYmeTYsBrpX3p 3eklRakHOZUmDvFaoCJtIW6OCd5/ThkF13Dp3rrvNbBUL7YmAItmwoY3kHpjK2ukJqSb cbwuyGYlIu9rXXc/0gsLASZZdPS11l3pQwDMYnpke1OiY28VAqm+S32PaQLF1kffHIxv pOoQ== X-Gm-Message-State: APjAAAXpjOrt+x44YMLo0/qgh7Jo3W8T57tOI/RXiCT+kLtOG1PkOIGV r6X5qXvXYOqkjDaQobBFTW8eWg== X-Google-Smtp-Source: APXvYqy5woxSa9sXUW5owSCTm3+vlDqFe+0XmxF8JtpZmxIUt7qyTuJKjIzBbbHvBsWgxujujdFMaA== X-Received: by 2002:a65:64d6:: with SMTP id t22mr43708172pgv.406.1560720686430; Sun, 16 Jun 2019 14:31:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f11sm4268923pjg.1.2019.06.16.14.31.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Jun 2019 14:31:25 -0700 (PDT) Date: Sun, 16 Jun 2019 14:31:24 -0700 From: Kees Cook To: Ard Biesheuvel Subject: Re: [RFC] Disable lockref on arm64 Message-ID: <201906161429.BCE1083@keescook> References: <20190612040933.GA18848@dc5-eodlnx05.marvell.com> <20190612093151.GA11554@brain-police> <20190614070914.GA21961@dc5-eodlnx05.marvell.com> <20190614095846.GC10506@fuggles.cambridge.arm.com> <20190614103850.GG10659@fuggles.cambridge.arm.com> <201906142026.1BC27EDB1E@keescook> <201906150654.FF4400F7C8@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190616_143128_208479_6CC542CD X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "catalin.marinas@arm.com" , Jan Glauber , Will Deacon , "linux-kernel@vger.kernel.org" , Jayachandran Chandrasekharan Nair , Linus Torvalds , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Jun 15, 2019 at 04:18:21PM +0200, Ard Biesheuvel wrote: > Yes, I am using the same saturation point as x86. In this example, I > am not entirely sure I understand why it matters, though: the atomics > guarantee that the write by CPU2 fails if CPU1 changed the value in > the mean time, regardless of which value it wrote. > > I think the concern is more related to the likelihood of another CPU > doing something nasty between the moment that the refcount overflows > and the moment that the handler pins it at INT_MIN/2, e.g., > > > CPU 1 CPU 2 > > inc() > > load INT_MAX > > about to overflow? > > yes > > > > set to 0 > > > > set to INT_MIN/2 Ah, gotcha, but the "set to 0" is really "set to INT_MAX+1" (not zero) if you're using the same saturation. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel