From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751458AbdJSBof (ORCPT ); Wed, 18 Oct 2017 21:44:35 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37429 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbdJSBoe (ORCPT ); Wed, 18 Oct 2017 21:44:34 -0400 X-ME-Sender: Date: Thu, 19 Oct 2017 12:44:29 +1100 From: "Tobin C. Harding" To: "Jason A. Donenfeld" Cc: Sergey Senozhatsky , kernel-hardening@lists.openwall.com, "Theodore Ts'o" , Linus Torvalds , Kees Cook , Paolo Bonzini , Tycho Andersen , "Roberts, William C" , Tejun Heo , Jordan Glover , Greg KH , Petr Mladek , Joe Perches , Ian Campbell , Sergey Senozhatsky , Catalin Marinas , Will Deacon , Steven Rostedt , Chris Fries , Dave Weinstein , Daniel Micay , Djalal Harouni , LKML Subject: Re: [PATCH v5] printk: hash addresses printed with %p Message-ID: <20171019014429.GG31318@eros> References: <1508362242-12857-1-git-send-email-me@tobin.cc> <20171019013106.GE604@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailer: Mutt 1.5.24 (2015-08-30) User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 19, 2017 at 03:36:20AM +0200, Jason A. Donenfeld wrote: > On Thu, Oct 19, 2017 at 3:31 AM, Sergey Senozhatsky > wrote: > > On (10/19/17 03:03), Jason A. Donenfeld wrote: > > [..] > >> 1) Go back to the spinlock yourself. > > > > so we ruled out NMI deadlocks? > > Oh, right. No, I haven't thought through this enough to rule it out. > Indeed if that's an issue, the locks in the _once code will also be an > issue. > > So if locking is totally impossible, then a race-free way of doing > this is with a tri-state compare and exchange. Things are either: in > state 1: no key, state 2: getting key, state 3: have key. If state 1 > or 2, print the placeholder token. If state 3, do the hashing. Cool! That's the solution I've been looking for since day 1. You the man. thanks, Tobin.