Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2796926rwb; Fri, 9 Dec 2022 06:29:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Jd1s44m07q4+a7ktIDvybXcw9LJnfHgpjYmhz/ECgC1LMfQ2HvSx8XRR+sTm13CuDeeGk X-Received: by 2002:a05:6a21:3382:b0:aa:5c1b:d734 with SMTP id yy2-20020a056a21338200b000aa5c1bd734mr10379216pzb.44.1670596192275; Fri, 09 Dec 2022 06:29:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670596192; cv=none; d=google.com; s=arc-20160816; b=F1PUqIubeD5PhJUv3gosGzqQ5OTLTFe8oy9Hbx2EOhM3CwuKuzg/JhBADDbePHUWLU 52kp0/+4izQEO+x9A0hVlwqjsE4Zt1VPtsL9+CMy90d1qqdhzaHjmggjU2coabv8ShbQ fXRG14X2FRRdXyWBmf+6Ygfmp49p7mL/HmguUeabPOHMNv/NlAS/UE35D4CZ8sRvdsHS mBIfiMoKSNYDjQY7OcLxG8I5ZZ30sMi8PgDcPq/dAVEeTLYzab4U9n+R9bigpjGYLdJn Iy48kVmhuTB1ZXvuKKR2D2rrSLOxqFMfMhFUkn43XxiAV1T78WyKrNNPyo0+Gp5keC4l dKsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Nzwv4m3Hgg/uWdoPi0O3B5YBmF8eSTJJtprw/dS4JvI=; b=SEr39pDe+LTlBx2aOn3mTAyk7PCVp0cleJzcrW/ucN1fwMA7sFO0WvJSn3uvuMb3ud 4p3jjLtArhlQhgZgAV2J0kXJdkJSn7h3IAgN2puKMnYY+kXjmQsZ8Om9y+OWrHWmQmqJ 8oUxIDLj7iCA4OOt4UBb8XpAMbMM9IrixSUTWDzoE9YmyHhwvD5qbDHyDGJlQvVxJVeg M09PpEviCiqmq0V2S1NXZZdTN5HuOi+P91eksXREtr6uiG/5L0P4hf9PikN94FOp5MQe FTvK4KK9+ICpDGNQ6c/BcL2igHWt/DLVuqBc8V9GcbNhnqP9DYAIbA7CiHppZKwo0O00 la6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=S9KPDqoE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a63a551000000b0046ff3634a6asi1716558pgu.215.2022.12.09.06.29.40; Fri, 09 Dec 2022 06:29:52 -0800 (PST) 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=@suse.com header.s=susede1 header.b=S9KPDqoE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbiLIOUd (ORCPT + 75 others); Fri, 9 Dec 2022 09:20:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiLIOUQ (ORCPT ); Fri, 9 Dec 2022 09:20:16 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 603EA1903E; Fri, 9 Dec 2022 06:20:16 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 519BF229E8; Fri, 9 Dec 2022 14:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1670595614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nzwv4m3Hgg/uWdoPi0O3B5YBmF8eSTJJtprw/dS4JvI=; b=S9KPDqoEIBpJEb0CYzWi/31c4xU81n60FczF8mVTo/65TE9V/WYhYGIo+p3iAOaE8yb7LI 9EFZT/TtHuRtVToHzZ+MvaH+6zE8eDtFeaD+Z0MZ3VH09k+EsrWz6c7g/1dgokCsdBWqI6 X4Kk0boP5CGTvvybOrWwYtg3WoIsVrI= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2DABF2C141; Fri, 9 Dec 2022 14:20:14 +0000 (UTC) Date: Fri, 9 Dec 2022 15:20:13 +0100 From: Petr Mladek To: Song Liu Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz, x86@kernel.org, joe.lawrence@redhat.com, linuxppc-dev@lists.ozlabs.org, Josh Poimboeuf Subject: Re: [PATCH v6] livepatch: Clear relocation targets on a module removal Message-ID: References: <20220901171252.2148348-1-song@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Fri 2022-12-09 14:54:10, Petr Mladek wrote: > On Mon 2022-11-28 17:57:06, Song Liu wrote: > > On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > > > > --- a/kernel/livepatch/core.c > > > > +++ b/kernel/livepatch/core.c > I see that you removed also: > > if (strcmp(objname ? objname : "vmlinux", sec_objname)) > return 0; > > This is another bug in your "simplification". This actually is not a bug. It was replaced by the strcmp() check below. > > > > + > > > > + if (strcmp(objname, sec_objname)) > > > > + continue; But this works only because the function is not called for "vmlinux". It can't be unloaded. Well, this optimization is not worth it. IMHO, it is better when the API is able to handle "vmlinux" object a safe way. We always try to make the livepatch API as error-proof as possible. It is the main idea of livepatching. It should fix bugs without breaking the running system. Best Regards, Petr