From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752399AbdIBKfF (ORCPT ); Sat, 2 Sep 2017 06:35:05 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33172 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbdIBKfD (ORCPT ); Sat, 2 Sep 2017 06:35:03 -0400 X-Google-Smtp-Source: ADKCNb47B+44Ufs1+9GxAl6C7r9x/0T/pcgTtc9EPmqUyzA/ntSbVCfGq6vd+WaVDYBOYZbsTTS9xA== Date: Sat, 2 Sep 2017 12:35:00 +0200 From: Ingo Molnar To: Kees Cook Cc: Mike Galbraith , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH][DEBUG] x86/refcount: split up refcount saturation handling Message-ID: <20170902103459.chfpuomyyytmre52@gmail.com> References: <20170831192728.GA135568@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170831192728.GA135568@beast> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kees Cook wrote: > In support of debugging the problems Mike Galbraith has seen with > x86-refcount vs gcc vs network refcounts... > > This minimizes the differences between unchecked-refcount and x86-refcount > by changing the refcount_dec() failure case to not saturate. The reporting > of negative values is reduced to pr_warn from WARN to avoid spamming dmesg > (which may impact race conditions). Ratelimiting is disabled just to be > sure no reports are being dropped. > > Signed-off-by: Kees Cook > --- > arch/x86/mm/extable.c | 51 ++++++++++++++++++++++++++++++++++----------------- > kernel/panic.c | 2 +- > 2 files changed, 35 insertions(+), 18 deletions(-) If this patch is still useful then please include it in your next refcount series. Better debuggability is always welcome. Thanks, Ingo