From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757687AbcH3Jlf (ORCPT ); Tue, 30 Aug 2016 05:41:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:52734 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757964AbcH3Jlc (ORCPT ); Tue, 30 Aug 2016 05:41:32 -0400 Date: Tue, 30 Aug 2016 11:41:28 +0200 (CEST) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: Christopher Arges cc: Petr Mladek , live-patching@vger.kernel.org, Josh Poimboeuf , Jessica Yu , Miroslav Benes , linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: add load/unload hooks to objects In-Reply-To: <20160829161627.GA32390@gmail.com> Message-ID: References: <1472237448-22270-1-git-send-email-chris.j.arges@canonical.com> <1472237448-22270-2-git-send-email-chris.j.arges@canonical.com> <20160829152330.GN4866@pathway.suse.cz> <20160829161627.GA32390@gmail.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Aug 2016, Christopher Arges wrote: > Another example is CVE-2016-2117. Here we need to unset NETIF_F_SG on a > particular device. If the device is already loaded we need a way to > fixup hw_features on an already allocated network device. Again this > could be done in the init code of the patch, but a nicer solution would > be to do this on a load/unload hook appropriately. I am afraid this is more complicated than what you describe. You can't just unset NETIF_F_SG and be done with it; look for example what might happen if you clear the flag while skb_segment() is running and gcc is refetching netdev_features_t (there is no READ_ONCE() for that). The same holds for __ip6_append_data(). I am not saying this can't be worked around, but it's way much more complicated than just clearing a bit in a callback. -- Jiri Kosina SUSE Labs