// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2017 Joe Lawrence <joe.lawrence@redhat.com>
*/
/* * livepatch-shadow-fix2.c - Shadow variables, livepatch demo * * Purpose * ------- * * Adds functionality to livepatch-shadow-mod's in-flight data * structures through a shadow variable. The livepatch patches a * routine that periodically inspects data structures, incrementing a * per-data-structure counter, creating the counter if needed. * * * Usage * ----- * * This module is not intended to be standalone. See the "Usage" * section of livepatch-shadow-mod.c.
*/
staticbool livepatch_fix2_dummy_check(struct dummy *d, unsignedlong jiffies)
{ int *shadow_count;
/* * Patch: handle in-flight dummy structures, if they do not * already have a SV_COUNTER shadow variable, then attach a * new one.
*/
shadow_count = klp_shadow_get_or_alloc(d, SV_COUNTER, sizeof(*shadow_count), GFP_NOWAIT,
NULL, NULL); if (shadow_count)
*shadow_count += 1;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.