From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbcCHUmf (ORCPT ); Tue, 8 Mar 2016 15:42:35 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34447 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751691AbcCHUlH (ORCPT ); Tue, 8 Mar 2016 15:41:07 -0500 From: Rasmus Villemoes To: Kees Cook , Andrew Morton Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [RFC 0/7] eliminate snprintf with overlapping src and dst Date: Tue, 8 Mar 2016 21:40:47 +0100 Message-Id: <1457469654-17059-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Doing snprintf(buf, len, "%s...", buf, ...) for appending to a buffer currently works, but it is somewhat fragile, and any other overlap between source and destination buffers would be a definite bug. This is an attempt at eliminating the relatively few occurences of this pattern in the kernel. I could use another set of eyes on all of these. The drm/amdkfd patch is unfortunately rather large, but I couldn't find a better way to do this. Rasmus Villemoes (7): drm/amdkfd: avoid fragile and inefficient snprintf use Input: joystick - avoid fragile snprintf use leds: avoid fragile sprintf use drivers/media/pci/zoran: avoid fragile snprintf use wlcore: avoid fragile snprintf use [media] ati_remote: avoid fragile snprintf use USB: usbatm: avoid fragile and inefficient snprintf use drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 168 +++++++++++++++--------------- drivers/input/joystick/analog.c | 8 +- drivers/leds/led-class-flash.c | 3 +- drivers/media/pci/zoran/videocodec.c | 5 +- drivers/media/rc/ati_remote.c | 11 +- drivers/net/wireless/ti/wlcore/boot.c | 12 ++- drivers/usb/atm/usbatm.c | 11 +- 7 files changed, 110 insertions(+), 108 deletions(-) -- 2.1.4