Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4871085imm; Wed, 30 May 2018 13:48:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJBRL49fokpLYnPTFaLHir2IIJ4AvA3A/steCypprcRnx0HYV29ArKzBDqm99iyqEh3h68i X-Received: by 2002:a62:fcb:: with SMTP id 72-v6mr4165555pfp.231.1527713299632; Wed, 30 May 2018 13:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527713299; cv=none; d=google.com; s=arc-20160816; b=OA/AYgHs7kf0pOhY1EeK9JRMQhGdATNWrv64JexuOGV6zjuWo7qH84wXIMLPMiP8zG YLRn/S8CgMXxQ4IlnFNBmEcXVXaiVq23z6cFoHmrpyK6P1o+3nNTmGryXlGMomHH7byv IhkABQSswzvQnH/Y+7PxOzkIAggRZBGsS5ZCmi9MU8vRHpoUqpf5e+7djru4F5xhjJ0M N90TvOEmofknfdbWfSU0trYBf9uKXKImG8qAv0GwfaQVNqu4LiuiFjc4wiPQ1aoMewjT cgJxubr/8c1ZKnI55/nQ2UfpKKK1JSfyPlxc3cfk9Fcaa1Gy3opuBf3f2z9Ib90Ot+hw E15w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=v7qPrZ+v70Fd3i7nMHAg5oOVuxQHpyuTwZAeV0Xs7+U=; b=e1hnwRczXBBWWmTNw0NoT9fFbGbmOl04qNBBUtEAFJ9nWqJBnyVWe9MjgzN7t3SHq2 PIGGLTs4Iy7nly1OUh+8OFRfle7nL/ZmpMgEz/bfGLCpqoU2YDpM5qfVTt3Do5WVqXU1 /RmOZgE/QU+Qm9e9R+puD6PEFlDt8i38Kyf1FcXHYKh+FvVNCV0Eki2sEe4yyiJZaqQ8 i/hBqzQUppqg4BFvqlzogmGLix8v+J0mhcJZ+u5DwmGm/yoo0K2Wm4lbdAyQUxQ/6OCO oOUT2g7eMOBZMJt5JhPESoY4i38nVs2oiJr4/w9PvJfTm2NC48N6EDcQrsUDELALq34c q2WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=F6P9ktXb; 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 b8-v6si35333436ple.469.2018.05.30.13.48.05; Wed, 30 May 2018 13:48:19 -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=fail header.i=@gmail.com header.s=20161025 header.b=F6P9ktXb; 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 S932370AbeE3UrS (ORCPT + 99 others); Wed, 30 May 2018 16:47:18 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:37775 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932233AbeE3UrP (ORCPT ); Wed, 30 May 2018 16:47:15 -0400 Received: by mail-vk0-f68.google.com with SMTP id m144-v6so11985551vke.4 for ; Wed, 30 May 2018 13:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=v7qPrZ+v70Fd3i7nMHAg5oOVuxQHpyuTwZAeV0Xs7+U=; b=F6P9ktXbJsL8kX4xBmuh6tL7l6UtRFksINVyaqxRyYlhzHzjG31kPcKt1YSNHg1BFh j3trtaXX0r7g78pSh3C/Vtwh2atuHcpY8Vkkh/ug1l5mGO/7d6IpXIeZ8PWCeTsZuGOw mg3MPO33MY2SGnyuAqg3vLt/mDASl2mEoYFgcjWd4Mg/sg8uqwAbtb8eL2Knrbdm3hJg OpX6TNs5shcrpsR0OH4CVS2TTQ4ltBdE5fUDLRkuqsmFmuCXLCvj7RgeS9vNKvli7tSj eC9X+qbHaj3YQXbANTkGQxjsbCkEo0B4R2KLqX/NZXgtLeh0SS1nf+fHPG4LH4fCptui oUhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=v7qPrZ+v70Fd3i7nMHAg5oOVuxQHpyuTwZAeV0Xs7+U=; b=l0JA+y41D5jSLKrLi3N4l+7thS8mjMYldVE3SUMOq+lmxNvnhA1+mAunVXeTzFTF97 bS7pqMg/tUQahILln5gDpzn4tWY3SHpxuJk0j78JgCQSkdv991b0ngEHGgV08BEKz41V wTmF87VefEf0tZDR9rgNhu0zRNhe9AMJ2FLYvxQpC8j4mQV47SFolMsCGAhwvnywrYja ZMpl0QAB8pHxnVdCbFqdurrOKugpYCl3xtBO+Q2iaLeaOfgFxSRrwk+NMBWRPS13F4c6 /Dj/VyU3GddsmFd+MaVnhSYc+0AI4zRXFZH5bpOEdL0KlKGybQGMINlbtR/czgHe05Cw Qdiw== X-Gm-Message-State: ALKqPwf3AEIdUKtWgOf68cYbNtGgdztp6ESqbewYJcmyZi3wFx/pU+0h +zAcuOpPct7eCryDgGzNRU9XF5sqwHYAIyTX0ZPnjA== X-Received: by 2002:a1f:644:: with SMTP id 65-v6mr2472280vkg.159.1527713234550; Wed, 30 May 2018 13:47:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:7a0a:0:0:0:0:0 with HTTP; Wed, 30 May 2018 13:47:13 -0700 (PDT) In-Reply-To: <20180530143415.ksc6fb4zo6m7xb25@holly.lan> References: <1527573427-16569-1-git-send-email-nick.desaulniers@gmail.com> <20180530143415.ksc6fb4zo6m7xb25@holly.lan> From: Geert Uytterhoeven Date: Wed, 30 May 2018 22:47:13 +0200 X-Google-Sender-Auth: 2s9rX8ykln7BGywLEMWnIxn6tQA Message-ID: Subject: Re: [PATCH] kdb: prefer strlcpy to strncpy To: Daniel Thompson Cc: Nick Desaulniers , Arnd Bergmann , Jason Wessel , Randy Dunlap , Baolin Wang , "Eric W. Biederman" , kgdb-bugreport@lists.sourceforge.net, Linux Kernel Mailing List , ebiggers@google.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org H Daniel, On Wed, May 30, 2018 at 4:34 PM, Daniel Thompson wrote: > On Tue, May 29, 2018 at 07:01:35PM -0700, Nick Desaulniers wrote: >> On Tue, May 29, 2018 at 12:57 AM, Arnd Bergmann wrote: >> > On Tue, May 29, 2018 at 7:57 AM, Nick Desaulniers >> > wrote: >> >> Fixes stringop-truncation and stringop-overflow warnings from gcc-8. >> Eric points out that this will leak kernel memory if size is less than >> sizeof src. > > Don't quite understand what this means (there's no allocation here, how > can there be a leak?) but the symbol completion certainly won't work if > we truncate the copy here. Not leak an is memory leak, but leak as in information leak of uninitialized data to userspace (if the buffer is ever copied to userspace). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds