Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4395924ybv; Mon, 10 Feb 2020 18:39:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzqQceuXRU/qL34nVXTKIH2ii6VBTH4wNAXIsxMj5xXDiv01pI76GDJ5NsT4XWTMuX4aZ24 X-Received: by 2002:aca:c0c5:: with SMTP id q188mr1422898oif.169.1581388741623; Mon, 10 Feb 2020 18:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581388741; cv=none; d=google.com; s=arc-20160816; b=pU94PSAPdTBGskjHWFlN2cqo5jJDqtm+yWfQgL+9/iMQQWHAkEbA0fMZsTGbUhqE7m r7f91p0d6rgTFCwdtdKz06L3HCu9iM/X6Nx0NKfgUSI5f7MdV8FYMEa5hqL0w3Wn/HNj Rze9Ws29ut5kc/TGUl7PF/GqtXSsHtU1MeVLSBUZdvcELkaO+Mgvdx45vohGw69Nivlw B9fxe/7imjYO5IsxBhLJTtiKj+KhI6ynxBdWD2EEucXkXil7crngIgOoMV/kIRBj8PQU FOJR3IZQc//Ho7CKZsnHstiefzTgqR/hJcTLHNTPF81gtqHJ0cNU0Jka1R+chcNMT2ev PnCA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=QZyEZ/pOjni03p5CJTGQn4guDmrGEy4H+FIPKHmUfqQ=; b=WMYQxBgqwz8p1VMn96ubkym7LKRMP8ccqqR7ABBeTPVEp56/umynFkHw8HHqFxrpw9 SNBQXGI+mSoKST2TESqbGKzoHNLEVCxCbhKcpRZz6VKxyDQz0iWR5RGJXn6EugiLqtDj 4MSx3YHSuwEOHzG/VqiBD3KcrxWqsIc83l6nDUmKkFuXGa8AX4DniGWI01s0Q3nzOGLz G7PpOeDnn16OpGtyvrdTPmDgaPtaABslZFEqKrMMvEmM9dyIgQPaxmqJSwAXe5wn++SF uCaDv9wKf768LufC3/QNtqrsKqsBam6yX3pZEWVVWTzu47ZDSQrprzQg+AfQHcoZYYKP 8png== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j+wTX9ek; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23si1087070otq.41.2020.02.10.18.38.50; Mon, 10 Feb 2020 18:39:01 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=j+wTX9ek; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbgBKCg4 (ORCPT + 99 others); Mon, 10 Feb 2020 21:36:56 -0500 Received: from mail-vk1-f193.google.com ([209.85.221.193]:32815 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbgBKCgz (ORCPT ); Mon, 10 Feb 2020 21:36:55 -0500 Received: by mail-vk1-f193.google.com with SMTP id i78so2575067vke.0; Mon, 10 Feb 2020 18:36:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QZyEZ/pOjni03p5CJTGQn4guDmrGEy4H+FIPKHmUfqQ=; b=j+wTX9ekCsz4lQTnO0o6YxQi/RDcxchwLDOWZo4TPaHsdvF7K5p8X94r6dlDcmtcqI /sblqfvf0sqSKjK4oso+oLJOTuEb7h+rLHywG/UayM06GscdwWZaC5qY2IypSREHgcRZ 4PyRx/KHuc0d+GbFFdXPwmJdrJ374Jv1ehxoFOA5n4uAXUHtqQfEvPn82qd+Q8JtnZXR 8Lzp/PpQnT8AuutrReg28yEES2eALdZRm1PfksB15RAyr+4MmH+3bi7Uq8SqGGS+Nn0o S6J1mrajpCSZ11gT/tpZKfz2wKEvA7XjNfroVEFYbUebFq+R5g0fZtjt+PUf30gh35ni oLzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QZyEZ/pOjni03p5CJTGQn4guDmrGEy4H+FIPKHmUfqQ=; b=bhU+jfc3sG64trKs0nEa99sk/Cfv9gdOQ9r8EkGYQSwHqF0SZMsLqtIKvOonFUjeWb BDcByb6BWup7hPggqDg4Gc9mpeYyS9KyWYtVYAy5zmaxTzeXnqcGXo+AGCnjO5TQbZOi gaJWYervQV1J8mprsSiQgIt3sYTvzT8wQEUHiDGqQYBHEiogiocw11jtbTOyr1rm/fye xkJKNkV7YITmZQm/KWQC6FP2HI65Cg/lUmeFmRa9rM+lRiHydkZQR3TCzcZM6L25AVDt w4HrQzjAu+cjIBr2GNKk0LZx+yURwSN7tvudUr6YZPE35RQvuLs0J16dTtk0j28YBvzw ft0w== X-Gm-Message-State: APjAAAVNDp4pYEmC1HrBnykqoQd/fGlNgPaWQgIvBWRj48CR2FVeFNgm 6PbJcX6FUE8SGR4TKNrdW/05yOCaCvazwbGrfGM= X-Received: by 2002:a1f:b6d7:: with SMTP id g206mr3682850vkf.8.1581388614515; Mon, 10 Feb 2020 18:36:54 -0800 (PST) MIME-Version: 1.0 References: <20200210161852.842-1-masahiroy@kernel.org> In-Reply-To: <20200210161852.842-1-masahiroy@kernel.org> From: Justin Capella Date: Mon, 10 Feb 2020 18:36:42 -0800 Message-ID: Subject: Re: [PATCH] scripts/kallsyms: fix memory corruption caused by write over-run To: Masahiro Yamada Cc: Linux Kbuild mailing list , youling257 , Pavel Machek , LKML 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 Looks like len is already +1, maybe it shouldn't be? > len = strlen(name) + 1; > > - sym = malloc(sizeof(*sym) + len); > + sym = malloc(sizeof(*sym) + len + 1); Maybe strlcpy or if len wasn't incremented? > > - memcpy(sym_name(sym), name, len); > + strcpy(sym_name(sym), name); >