From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751602AbcG3I0p (ORCPT ); Sat, 30 Jul 2016 04:26:45 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33640 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbcG3I0f (ORCPT ); Sat, 30 Jul 2016 04:26:35 -0400 Subject: Re: [PATCH 1/1] UBSAN: use uppercase K to format a kernel pointer To: Joe Perches , Andrey Ryabinin References: <20160729111053.21306-1-nicolas.iooss_linux@m4x.org> <1469821991.3998.86.camel@perches.com> Cc: Andrew Morton , linux-kernel@vger.kernel.org From: Nicolas Iooss Message-ID: <2ccb1bd7-6a2a-d7d1-e768-82e25f156c71@m4x.org> Date: Sat, 30 Jul 2016 10:26:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1469821991.3998.86.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/29/2016 09:53 PM, Joe Perches wrote: > On Fri, 2016-07-29 at 13:10 +0200, Nicolas Iooss wrote: >> handle_object_size_mismatch() used %pk to format a kernel pointer in >> pr_err(). This seems to be a misspelling for %pK. > > Thanks Thanks for your feedbacks. I agree %pK does not make much sense in the context it is used. I will modify this patch to use %p instead. >> diff --git a/lib/ubsan.c b/lib/ubsan.c > [] >> @@ -308,7 +308,7 @@ static void handle_object_size_mismatch(struct >> type_mismatch_data *data, >> return; >> >> ubsan_prologue(&data->location, &flags); >> - pr_err("%s address %pk with insufficient space\n", >> + pr_err("%s address %pK with insufficient space\n", >> type_check_kinds[data->type_check_kind], >> (void *) ptr); >> pr_err("for an object of type %s\n", data->type->type_name); > > Maybe change this to a single output line: > > pr_err("%s address %pK with insufficient space for an object of type %s\n", > type_check_kinds[data->type_check_kind], (void *)ptr, > data->type->type_name); As both handle_missaligned_access() and handle_object_size_mismatch() use two pr_err() calls to display their error messages, it seems the split has been made on purpose (maybe to avoid logging long lines). I won't merge the calls in my patch as this appears to be more an ergonomic subject for people really using this code. -- Nicolas