Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3059367imw; Wed, 6 Jul 2022 16:54:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sASgcrV1PNBPXSbHRa6Wo61ahVcRtqrJnnnOPAZAPu3ICaLut2Qw2XtTumwE7hWaAQLGvU X-Received: by 2002:a05:6a00:15c1:b0:525:2db4:2a2c with SMTP id o1-20020a056a0015c100b005252db42a2cmr48052000pfu.30.1657151698405; Wed, 06 Jul 2022 16:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657151698; cv=none; d=google.com; s=arc-20160816; b=nlrGe8wrPOtrVdqbnsArAdpzJoUqXsTn5jBaL+1LPhBdRACdqWuS6vLlytWKpkMatf 8URx2l4V5WLm9aw78fW4LfJQJEeW9/c5BA6Tyx3vE3/hWos4PrrFhpIJnmaI4H3N8llp afnicJu3Im3FIiE3ukSw2Wz/EJ/rgXrYkfdSjTnd2IsgPAb+jblgY0m80Ds5ObjtRcxy hLjoHmgZ40/6d1aD4jFn0SGnaeEpO59FPO6bO4anXL7Xt+ougs4foKneK40HI2VsasXV jod7C3EiNHeVfjFRyNmTFJXSb2Co9Qhry/YZIDsot3Jeu8YPDJygwS7v0bKjM31FQWbu A5pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+ziVL8l45N1j8hHSl9LgmfhnTA7yOdWor6E4r8/k7yg=; b=qU5SNEP0RP1k4qGOuCL9QSK52LgXLDpKE1Gt5X34b3L5HfGaPkmfDNW9P4rwQpIoIK mDI/Gr35+96BqZX8P8ZIPAk/ZxfxHfvacWnEPm3F/UbTjhTQEjoCDwMgLt0U4b2U3UM0 NccZy5pbTNPXO2oeK+IXo7+NB/9lRYRrdrmuY7JXEN7FQu4BlOyrbUUUmVeoigbrrklO X0zgBejIR4fz53yXCyWzk2/iMBoN5gJ9bRVMwjaoDUMB+pTRrtTja0EG1HuUq7lllc9z Z3R5s6STsvCDJEQuo8DZyYcS1G0J8mowzWOoncUFsNtZEUgkdIoMJ0J4T3mc4cVSizv2 iHsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="UH/OkfVs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a170902e80c00b0016be9faf06bsi13555211plg.480.2022.07.06.16.54.46; Wed, 06 Jul 2022 16:54:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="UH/OkfVs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233810AbiGFXdk (ORCPT + 99 others); Wed, 6 Jul 2022 19:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbiGFXdj (ORCPT ); Wed, 6 Jul 2022 19:33:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 047A42C135; Wed, 6 Jul 2022 16:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+ziVL8l45N1j8hHSl9LgmfhnTA7yOdWor6E4r8/k7yg=; b=UH/OkfVs7Cpj/LrUgT0DHqZLoi S7s1dgLIMpSKGh48el+4LoYQfgSeyCS9ZMSXx/0pvWGHVKnMhhXPuCmRFtItIy4LadtG9Z/+2Ybd+ dmeABV+cOZC2tgvQEFkUbrKC4OBqEgIhMyW7e/51PoY0Lm7pRK0frAfGfTB4xNuMVg0kfYQXuFnrh uo0gJMxkwfqXOyI5UlFWAcLrN8uy8lIn/Nsy+Zu1n5XIUUM7R5o+VX/TXotM0SUDJla/6ElxsdvKH /CqaunG0R0DfE5gkROjyLtb8vE0CWih8lrUYA8kdoA3XfjomaTg1D3Vkhi6KkvSGmjtPHnLcVdhAu SzQF3bEQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9EWU-00ClG8-VB; Wed, 06 Jul 2022 23:33:34 +0000 Date: Wed, 6 Jul 2022 16:33:34 -0700 From: Luis Chamberlain To: Aaron Tomlin Cc: Christophe Leroy , "linux-modules@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] module: Show the last unloaded module's taint flag(s) Message-ID: References: <20220627164052.2416485-1-atomlin@redhat.com> <20220627164052.2416485-2-atomlin@redhat.com> <4ddb64da-58f0-a4af-cf57-a870015a0077@csgroup.eu> <20220628074708.fg3ocx3vu7affkxl@ava.usersys.com> <20220703142218.65dacvxozppgct6y@ava.usersys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220703142218.65dacvxozppgct6y@ava.usersys.com> Sender: Luis Chamberlain X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 03, 2022 at 03:22:18PM +0100, Aaron Tomlin wrote: > On Tue 2022-06-28 08:47 +0100, Aaron Tomlin wrote: > > On Tue 2022-06-28 05:54 +0000, Christophe Leroy wrote: > > > > - /* Store the name of the last unloaded module for diagnostic purposes */ > > > > strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); > > > > + strcat(last_unloaded_module, module_flags(mod, buf, false)); > > > > > > You replace a bounded string copy by an unbounded strict contat. > > > > > > Should you use strlcat() instead ? > > > > Hi Christophe, > > > > Why? If I understand correctly, both the destination and source string are > > NULL-terminated (see module_flags()). So, strcat() should be sufficient. > > Hi Luis, > > Any thoughts on this? As far as I can tell, the destination string cannot > be overwritten; albeit, I can use the safer option if you prefer. Yeah I don't like this as-is, it makes it not so easy to follow, I'll reply in my review of your patch now. Luis