Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754325AbdIGGFC (ORCPT ); Thu, 7 Sep 2017 02:05:02 -0400 Received: from mout.gmx.net ([212.227.17.20]:64452 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753437AbdIGGE7 (ORCPT ); Thu, 7 Sep 2017 02:04:59 -0400 Subject: Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages To: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , Petr Mladek , Andrew Morton References: <1504729681-3504-1-git-send-email-deller@gmx.de> <20170907004522.GA3885@jagdpanzerIV.localdomain> From: Helge Deller Message-ID: <8b93f9ca-95f6-4e40-1cc8-d1a65833abff@gmx.de> Date: Thu, 7 Sep 2017 08:01:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170907004522.GA3885@jagdpanzerIV.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:NPPnyuT43WSgzf6RP4lxDEiPpiDbu68cJr+azouy4bhuVdQ6d0r LgrQKHRkZoFiKmRCogQ4nirShgzANszJ/5poYB7j5QifsZBBTVOW2OULLBLbL9CoUjoO25H D4SxE97WhjTEtxSCs3D6omL669lvnZha1uZwg45Yy5bToR4JjJewIKWDTf+hA9e5GMmFQEF McTf/m7WSTDuc+CmdObfw== X-UI-Out-Filterresults: notjunk:1;V01:K0:gPkYbSZKZ8Q=:JxX6BOZTBhIdP37/85es3x 9wtQG3psAhoqwrAALYue9IOCHSqJTgchQyxuZ8eyE2coPScm3jjM9cggFh5MF2WF8iFyugxas BNLGCR73a8kJWtT7AUDh6jLycQy74fgJYrHVEDlBNkhrzk8yi4vLLIzQ1h3DUS7XFQoarGrAz Dmd6kQsu83ML4H90uwlPLdmcgcVfghgYYWdQVTBVmBuugRhcNQdUSdHqroy0gWd+DEBI5HSKv alZeojx12wXOK9FzJxMK1fqfryxMLW/Bj+4Nnus5wZ2mBsc4Efink4fqjaDNoyqPL2+JP7syf oqSpGufKDNAaH92GHcZzcXX/Eqz/bBYuD5rvQVsWlyCfNOkim61iKy51Zv42QZ4fOXG6V4hw6 +9ckuhTifzfbdR3MT2VqyqBXyoYNmBxGAQOcJdlbzr1hbYNZgIhpz3cK+/hMkSwE6lznBMYsK PFyOS5apEhafcdt1Hkb2ByvH0tuiupAGolY2yYOSkS7gCQBlKbmkjeckO+dSwwy4USMmkwzMw 7EZRwA+nnGrChRnGw6p1pg+9RgfCy1jZybplXABuFaO8vbXLCeg/6/AgCnxIBNQOmMqhkRL/I HdvK4RqJ7uyWCE4rG5FThDq8XU5I/mN4JJSzTotzYjhOwpfZkxa9UXzV1eYdJxGjLKPPmsvRF b632hzrZsTxsP/LuqWhM52Ry/CTmxthBgFMjdVC0Y+hsNFcVDscKqOtj4+knTifGcVW6nPZXP yp/FhYgbAub896iQvDlXjz+I2xCXle9oAXROUPYX/n/ISz9U4PK6kfHyv8rKJsUZsw5smeL1q z+IBufMDkLN9/r9AUO4mLYarsnA0pZMYfziz5NF1KlltyZZxmc= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1513 Lines: 38 On 07.09.2017 02:45, Sergey Senozhatsky wrote: > On (09/06/17 22:27), Helge Deller wrote: >> This patch series fixes the wrong usages of the %pF and %pS printk format >> specifiers throughout the kernel code. >> >> Both specifiers have the same result on most architectures. But on ia64, ppc64 >> and parisc64 architectures the %pF specifier does an extra conversion because >> there function pointers are actually function descriptors. > > hm... > can we fix it in lib/vsprintf.c instead? There is nothing to fix in vsprintf, because it is already providing both %pF and %pS for the two different architecture-specific API call implementations. > a) the patch set has "there is no problem on platform A, but still > let's just change it" > > which is probably fine. but > > b) you tweak/fix the currently existing users, OK. but there, most > likely, will be new users that will require fixes in the future. Please read the documentation in Documentation/printk-formats.txt. It's really as simple that if you use function pointers you *need to* use %pF, and if you use raw addresses of functions, you *need to* use %pS. If you use the correct specifier the output will automatically be correct for all architectures. If you don't, then the output on ia64, ppc64 and parisc64 architectures will be wrong and may lead to kernel crashes in the worst case. My patch series simply fixes that code which has it wrong. It has no impact at all on users on x86, ARM, mips and other platforms. Helge