Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp495742ima; Fri, 15 Mar 2019 07:30:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlJAcun1CX9x+O24C0In79j7Iau22H6oG/+367MQdIanAAGqczpMo8fxhy4Gv8jmWKqX4b X-Received: by 2002:a63:cc01:: with SMTP id x1mr3660299pgf.221.1552660233413; Fri, 15 Mar 2019 07:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552660233; cv=none; d=google.com; s=arc-20160816; b=aA0HzYP8sDxruDRo6c120mA7v5Adpu1jn8frV5wlxeksAS33VlO+U4NP/KvDDsXdhx B+nqV8OvJg6d/WAPp3pAVvomyFm22u7rleWx+N4kQU/1BHaI1g1z6d9TrWdRpjG5Qt0e NRyboKY8G3Rzv4uUfHxnvs8Luk5Id4p7CYDEAelePXT9ePZ2mW5eTsIdy516+H6s8b/b scPAJaYW5X5+AVdAxyxvnvk5YubQ50ymIWidELHBO5UjdZDNR4YgS/sCLYDQ9Th+McgP 7PIok3m6WVz5rDMQAedvYr/PV3+/AE2hLygcwHaNx/b1Kp0CaED+iTaCkC3fsKGhf9rM 9nRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GhZ6JEqM6OGPlOqUafs+5RJ8MCNfu/6ROv/YnY68g88=; b=noaCqqxDKjc/aEAQQxoPTCJeZ9MoG1nrs6HvdziB1zFXwpzlydyMInGRHCtV6mgjQh 1kvbKZ/pQwM7QTNdR0zFOwBbQs3j/zNHi8Q02PcFRwAkeAgrRrh+dl/wj3PotkwS6xFK YVOphfzlRe++2YqGCCuith4X3+en416bCBKJlWp/HJQtX4dX9MMIfohGmDGdJk7zDGqa r9ZyBOihcFC8jlIhfz/Olq3Wvjaw88pcsIIr6835pVIhmheRUgaLnw/LCRYjowhrS02X 5jPwlBGN7SGjv++5G51/NbFjfEd6Snppw5x/NvFbEWmGL1Oh9l9KrRVUNwu6p3F2n+wR 8baQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=l3voeamv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si2050883pla.80.2019.03.15.07.30.18; Fri, 15 Mar 2019 07:30:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=l3voeamv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729278AbfCOO3g (ORCPT + 99 others); Fri, 15 Mar 2019 10:29:36 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33629 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729253AbfCOO3f (ORCPT ); Fri, 15 Mar 2019 10:29:35 -0400 Received: by mail-pf1-f195.google.com with SMTP id i19so6494348pfd.0 for ; Fri, 15 Mar 2019 07:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GhZ6JEqM6OGPlOqUafs+5RJ8MCNfu/6ROv/YnY68g88=; b=l3voeamv6jZGeOAGko8E4Eje0cjk9b7t/1+dPYeHM/aHRf3+aAu8dujyEp4/C08XTW D9ykaaQzm84JoVzJvzn416WhF9zux+sxDyWyxRNHMX7K1dZj3uV7JOjmSLqS8d9DDVaF gkLRUjB41GkDdsomUWXZVHoZ5KbFS9n6SZye6IIfqAUydQYR+ZI9f0t6t43NiKwwep8i KUWZ6qBBtMLGFACzx8LP2qUGkg7grxwl+fbqzDpHRcpmpPqJLuQCQb3FcjtyxHIxg61h Zb1CSDeRdFg3kKX6ZG8ZeUR87nu1Qu0PrmQqpT8siYDJrz+pohTI9CpiEfRwDWXgTDN1 tJhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GhZ6JEqM6OGPlOqUafs+5RJ8MCNfu/6ROv/YnY68g88=; b=f9GqF+UvrFZu0jclk/WNLbcv8NDEEaOLaznu6AkefpO86haBBYStCBkRsHHoj2FcyU QQ7fbMskcKmU6x7xdTAhrtG58Dt8VMVOlMmtvfppQ6ulJMqrmG6DEKTgo+9SEaObIJFM DQDhfKMCsXMaF7UE3fFp1rvqDkM1lktkLR+3jzUnOIthRfJr6fksEtJrc4knM5G5yQZL 7QtPtanaCDtMGQ5schse0i4AjJUkygaVTdEHMQ+h1P87G4ZDo9HR14XlQlP/JmGiaedl OlHa6FCmPo4dl1/CgkT4GXqehQNxvbRYbSUK/pbhTZGxBXkZYFmx8JI2V3zbdB2HlJsc 1mag== X-Gm-Message-State: APjAAAWbrcNNnFz+J4Zc4BlpYgdDe03TrTy50mjq1z7yp/eno/ifCvhu 9gLLeupPmCzrvDhLscTFd3uh+Fic5A8Seg== X-Received: by 2002:aa7:818e:: with SMTP id g14mr4305675pfi.245.1552660174267; Fri, 15 Mar 2019 07:29:34 -0700 (PDT) Received: from [192.168.1.121] (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id v1sm4036969pff.9.2019.03.15.07.29.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 07:29:33 -0700 (PDT) Subject: Re: [PATCH 15/18] blktrace: change strncpy+truncation to strlcpy To: Dominique Martinet Cc: Steven Rostedt , Ingo Molnar , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> <1531445162-19771-1-git-send-email-asmadeus@codewreck.org> <20190314213721.339979f0@oasis.local.home> <80ab6751-cd34-1da6-91c7-7558d3a17943@kernel.dk> <20190315063022.GA12910@nautica> From: Jens Axboe Message-ID: <85f295e5-d338-100b-16a6-45e28d292388@kernel.dk> Date: Fri, 15 Mar 2019 08:29:31 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190315063022.GA12910@nautica> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/15/19 12:30 AM, Dominique Martinet wrote: > Jens, Steven, > > Jens Axboe wrote on Thu, Mar 14, 2019: >> On 3/14/19 7:37 PM, Steven Rostedt wrote: >>> I noticed this old patch in my inbox. It looks like a legit cleanup. >>> Want to take it? >> >> Indeed, I've applied it. Thanks! > > Thanks. I am terribly sorry about this patch series to be honest, I did > not prepare it properly and sent too many generic patches at once but > more importantly some were unsafe (strlcpy expects the input string to > be validly formatted, because it basically does strlen() on it to check > how much hasn't been copied for its return value) > I was pointed out strscpy instead as a safer alternative. > > In this case `name` comes from bdevname() which is disk_name() in > block/partition-generic.c which is a snprintf, so we are guaranted > null truncation from there and it should be OK, but I wanted to check > and point it out. Dropped. -- Jens Axboe