From nobody Sat Jun 13 13:30:07 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 817633CB2CC for ; Tue, 2 Jun 2026 11:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780398403; cv=none; b=hhlbokxfOQd88jiXhukZcNWJhlQiG775gXxJeePjjdWqVyShxAJDzoAUW0+FwIL9FY+GpCO5yB0JPTfaXmtiBCnBSkGO7zGslz1NEepc+N0r/oM/FDh5jUXS014VxBvOePIJ9bLDdSSoB2ALR7NVC7/tS5X+wAcAThYThObJ1Rw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780398403; c=relaxed/simple; bh=WzBnS0mkIJKatCmrutYt1kamqedj1lTYH+KB3ZNL16g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ShXmmyG3YhgN2DWYb+6RVmJKKkrKhb4exhThV6gvJco6GLaJJzquhSZLXONQqS2gr4ocXDUSOv5xAxpa8vyNPRKMgFEMy9XprwktyO58Q3TyOogydHWzGxPE8WKCVe+ArAvfeNG4xez2J3RqbCEqz9Neud1hKwccl4qJMW2++98= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YbXPzbLq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YbXPzbLq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 499261F00893; Tue, 2 Jun 2026 11:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780398398; bh=/qu2IPDA2PF27oFfKuoclvpV/15L0SmXzGjwgc+d/YI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YbXPzbLqpsZzF8BOiz9XEsDfv6n4Bf1OMs6c6X4a27qhvD921Npd1UHFkdlX4eJhF mWQ7wVgbUMakNMG7Eo/RjDdPbwJmJZc4jPmm1hcwZEYVBLmQIjdbtclIs/Qkr+HH+q 6e52Ftzv7kdrfrlE/SU+OAccwZjTkLw+/nZG0+BQDAkgCzjK3H6LEvw9H4leqhsDuj mopU11kaN5RAtQRs1WrJPZ6YJ4UzXnlQsvAoem+rThKzzTadQtqJJ2mW3wx/XGPqCZ Bd7rDshuzOWYFCnTS3m9U0e0V5bAiTXLP/UC//8Oj9Do8SKfA7mvaCIo698dlHJcE8 uFw23qGiVda/w== From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 1/3] drivers/char/mem: eliminate unnecessary use of success_hook Date: Tue, 2 Jun 2026 12:06:25 +0100 Message-ID: <010579cca6787cf7bb057ab1f7228978b10601c8.1780397980.git.ljs@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" /dev/zero, uniquely, marks memory mapped there as anonymous. This is currently achieved using the mmap_action->success_hook. However this hook circumvents the abstraction of VMA initialisation so it's preferable to do things a different way. To achieve this, this patch firstly defaults the VMA descriptor's vm_ops field to the dummy VMA operations, which is what file-backed VMAs default this field to. That way, we can detect whether a driver sets this field to NULL in order to mark it anonymous. We then introduce vma_desc_set_anonymous() to do this explicitly, and invoke it in mmap_zero_prepare(). This way, any driver which does not explicitly set desc->vm_ops, retains the dummy vm_ops as they would previously. We also update set_vma_user_defined_fields() to make clear that we are either setting vma->vm_ops to what is provided by the driver (or defaulting to dummy_vm_ops if not set), or setting the VMA anonymous. This lays the groundwork for removing the success hook. Signed-off-by: Lorenzo Stoakes Acked-by: David Hildenbrand (Arm) Acked-by: Greg Kroah-Hartman Reviewed-by: Oscar Salvador (SUSE) --- drivers/char/mem.c | 17 +++++------------ include/linux/mm.h | 5 +++++ mm/util.c | 1 + mm/vma.c | 3 +++ tools/testing/vma/include/dup.h | 1 + 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 5fd421e48c04..a4297eb39887 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -504,17 +504,6 @@ static ssize_t read_zero(struct file *file, char __use= r *buf, return cleared; } =20 -static int mmap_zero_private_success(const struct vm_area_struct *vma) -{ - /* - * This is a highly unique situation where we mark a MAP_PRIVATE mapping - * of /dev/zero anonymous, despite it not being. - */ - vma_set_anonymous((struct vm_area_struct *)vma); - - return 0; -} - static int mmap_zero_prepare(struct vm_area_desc *desc) { #ifndef CONFIG_MMU @@ -523,7 +512,11 @@ static int mmap_zero_prepare(struct vm_area_desc *desc) if (vma_desc_test(desc, VMA_SHARED_BIT)) return shmem_zero_setup_desc(desc); =20 - desc->action.success_hook =3D mmap_zero_private_success; + /* + * This is a highly unique situation where we mark a MAP_PRIVATE mapping + * of /dev/zero anonymous, despite it not being. + */ + vma_desc_set_anonymous(desc); return 0; } =20 diff --git a/include/linux/mm.h b/include/linux/mm.h index 11f440e9d7cd..0f2612a70fb1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1489,6 +1489,11 @@ static inline void vma_set_anonymous(struct vm_area_= struct *vma) vma->vm_ops =3D NULL; } =20 +static inline void vma_desc_set_anonymous(struct vm_area_desc *desc) +{ + desc->vm_ops =3D NULL; +} + static inline bool vma_is_anonymous(struct vm_area_struct *vma) { return !vma->vm_ops; diff --git a/mm/util.c b/mm/util.c index 3cc949a0b7ed..2b2a9df689d7 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1192,6 +1192,7 @@ void compat_set_desc_from_vma(struct vm_area_desc *de= sc, desc->vm_file =3D vma->vm_file; desc->vma_flags =3D vma->flags; desc->page_prot =3D vma->vm_page_prot; + desc->vm_ops =3D vma->vm_ops; =20 /* Default. */ desc->action.type =3D MMAP_NOTHING; diff --git a/mm/vma.c b/mm/vma.c index d90791b00a7b..9eea2850818a 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2697,6 +2697,8 @@ static void set_vma_user_defined_fields(struct vm_are= a_struct *vma, { if (map->vm_ops) vma->vm_ops =3D map->vm_ops; + else /* Only /dev/zero should do this. */ + vma_set_anonymous(vma); vma->vm_private_data =3D map->vm_private_data; } =20 @@ -2744,6 +2746,7 @@ static unsigned long __mmap_region(struct file *file,= unsigned long addr, .action =3D { .type =3D MMAP_NOTHING, /* Default to no further action. */ }, + .vm_ops =3D &vma_dummy_vm_ops, }; bool allocated_new =3D false; int error; diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/du= p.h index 9e0dfd3a85b0..306171d061e7 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -1303,6 +1303,7 @@ static inline void compat_set_desc_from_vma(struct vm= _area_desc *desc, desc->vm_file =3D vma->vm_file; desc->vma_flags =3D vma->flags; desc->page_prot =3D vma->vm_page_prot; + desc->vm_ops =3D vma->vm_ops; =20 /* Default. */ desc->action.type =3D MMAP_NOTHING; --=20 2.54.0 From nobody Sat Jun 13 13:30:07 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FECD3CA4AD for ; Tue, 2 Jun 2026 11:06:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780398404; cv=none; b=Fbih+JNHD4pojdqJS5j1npajViRgHa5EtvdTKLJqwEs72oY9Z6pTER6+k17hXhT1S3BO55+LKLNutBlHsp/B9R/mqlkximGnW0TfO20zXS+8Zk7eu0H+noVfRzMQq5+hXhgncYrjjxrdeqVyYIYqVY7UuWLKnWmqWqXS6wRaFfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780398404; c=relaxed/simple; bh=kbHB3+BMAKK8oJPmnzxNvRSEyA7swdoLOD3WYdkW3RY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JLIppcZV/7i+wPPq6pCds3yaKAQk6FJSnMOAhlcIQ99+6tyfNcAPG5eb7umCUvKuNBb5vcAqiLF5HpURLCnTOwtYgY0V2WG2vPd842XKhGh2IglIVDNPdTtfEkIVrVNr1o7m71d7G2+ZJl3nM0LdeWXC1LRjAhVLSOgdQomFYmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bJutkObC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bJutkObC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24CDD1F00898; Tue, 2 Jun 2026 11:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780398401; bh=RDbr0381BRy8zwWOC6o0iLlxNMOQ3y9mZNJBCj9lknk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bJutkObCCB7dbwzH+nmbp+9/fDeqAqs1G+pqV/651Br86DAHsBVDaO2fRhjPGNqII EJY/iPr0YV8u7ko9Btc8J2X5LMkomEPSt6m+Y4HuF5tJ7WFmpDveHVQtc9xegh10Rn TYe3Ly0RTOPhUXWm1gjp/LEz0gIitCxhuXqYdeyIj4SsaMeRiOtx733jk5KzpK7Gi6 FVuaN2c+t45aNzgtfM763kE1AfG3XzAkb9Ndi2oyvAKb46u5r9dpjOR9WQJZWE4YUf jsG5z0nOCH3JWX6F/QefKZxU5WwKDMUEK115a+qLsLJhgFNmzwtCpMwb+PZEOivPN9 bTRKg1p3dOMQw== From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 2/3] mm/vma: remove mmap_action->success_hook Date: Tue, 2 Jun 2026 12:06:26 +0100 Message-ID: X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This hook was introduced to work around code that seemed to absolutely require access to a VMA pointer upon mmap(). However, providing this hook leaves a backdoor to drivers getting access to the very thing mmap_prepare eliminates - a pointer to the VMA. Let's solve this contradiction by removing it. The key intended user was hugetlb, however it seems that the best course now is to avoid allowing all drivers the ability to work around mmap_prepare, and find a different solution there. Signed-off-by: Lorenzo Stoakes Acked-by: David Hildenbrand (Arm) Reviewed-by: Oscar Salvador --- include/linux/mm_types.h | 10 ---------- mm/util.c | 2 -- tools/testing/vma/include/dup.h | 10 ---------- 3 files changed, 22 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index a308e2c23b82..945c0a5386d6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -843,16 +843,6 @@ struct mmap_action { }; enum mmap_action_type type; =20 - /* - * If specified, this hook is invoked after the selected action has been - * successfully completed. Note that the VMA write lock still held. - * - * The absolute minimum ought to be done here. - * - * Returns 0 on success, or an error code. - */ - int (*success_hook)(const struct vm_area_struct *vma); - /* * If specified, this hook is invoked when an error occurred when * attempting the selected action. diff --git a/mm/util.c b/mm/util.c index 2b2a9df689d7..4e172990afcd 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1397,8 +1397,6 @@ static int mmap_action_finish(struct vm_area_struct *= vma, =20 if (!err) err =3D call_vma_mapped(vma); - if (!err && action->success_hook) - err =3D action->success_hook(vma); =20 /* do_munmap() might take rmap lock, so release if held. */ maybe_rmap_unlock_action(vma, action); diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/du= p.h index 306171d061e7..fddfd1b57c09 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -482,16 +482,6 @@ struct mmap_action { }; enum mmap_action_type type; =20 - /* - * If specified, this hook is invoked after the selected action has been - * successfully completed. Note that the VMA write lock still held. - * - * The absolute minimum ought to be done here. - * - * Returns 0 on success, or an error code. - */ - int (*success_hook)(const struct vm_area_struct *vma); - /* * If specified, this hook is invoked when an error occurred when * attempting the selection action. --=20 2.54.0 From nobody Sat Jun 13 13:30:07 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C98B3CB910 for ; Tue, 2 Jun 2026 11:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780398408; cv=none; b=u3USg/gbvUPjQjUGP9m6/QWOp2kCYNeRFiRHFvLH2aG9G2nHeAXUNswgmNWbFmxlHfyAu8NdX2+7u09n2qgOqyViY61oLWRwDM6zotiRkj2kSAnZO4umwdcxsmmO1qLjlahCVSKK4TuzbPXdBTAF6mFHvFVQWAsWCWHh12NWlnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780398408; c=relaxed/simple; bh=9O291112WAAQUPsFkYR0KJ9Vl329c9w1d5VtkhiDDVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PNouohiilwhwOwVpMxGnalcZi4Re++cKeU8MiTUpZ1OdyVvIdDnfJwvQ/ewmIeNLH7hNzDp92uhVhSxj4LJj9DPCPYrCCDG9ZKR+RYKuRpCE5wWS/v4jKqlhsTcGOZazN1UIc3NOE8rhEMr79fQiDhaJxPX52goZIYf0UTyd6Qc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f+coS9bU; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f+coS9bU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3ED21F00893; Tue, 2 Jun 2026 11:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780398404; bh=F0B4o40L/vdj2UPhP5HubCeeLQUl0X/X8R3+9RCeRZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=f+coS9bU/z238epRHKz7qsUSfNlbI1vN65w1piUAjQpmEbE1+knhgPdMYy7EuCGUu RVI5RamVpaOq5bbv8hFl4Gnxyu0uSH2rIMp6z6/LLB9WNaftYjNaVtO06cNrXKfc+u Kyzps1uzP4+Jvo7jKrpeZVzYXAeAQ3ueR08qqHTc/Bzlwy00x0vHtK543+hwiiGtbv t7EaBmMUX+AOmFYJR6R1r0T145Q2/5bkp2lIP1imPi1IYg0CNAtd7JiIZEy1nssUbk fc5o6j3s/3OSdF1n1Zfti14oi8XVQmzhHVMlU1cwzSNRbX0M3OBenmXIrQZ0h6Jwx0 RuH7ioPtk6/3A== From: Lorenzo Stoakes To: Andrew Morton Cc: Arnd Bergmann , Greg Kroah-Hartman , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 3/3] mm/vma: eliminate mmap_action->error_hook, introduce error_override Date: Tue, 2 Jun 2026 12:06:27 +0100 Message-ID: <55d13f7d016b827c459946d46a56105635be111c.1780397980.git.ljs@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rather than providing a hook, simplify things by providing the ability to override mmap action errors. This allows us to more carefully validate the value provided and thus ensure only a valid error code is specified, and simplifies the interface. This way, we eliminate all hooks but mmap_prepare and allow only mmap actions to be specified (which core mm controls). This significantly improves robustness and eliminates any unnecessary code duplication in driver mmap hooks. We also update the /dev/mem logic (the only user) to use mmap_action->error_override instead. Signed-off-by: Lorenzo Stoakes Acked-by: David Hildenbrand (Arm) Reviewed-by: Oscar Salvador (SUSE) --- drivers/char/mem.c | 8 +------- include/linux/mm_types.h | 9 +++------ mm/util.c | 29 +++++++++++++++++++++-------- tools/testing/vma/include/dup.h | 9 +++------ 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index a4297eb39887..63253d1de5d7 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -322,11 +322,6 @@ static const struct vm_operations_struct mmap_mem_ops = =3D { #endif }; =20 -static int mmap_filter_error(int err) -{ - return -EAGAIN; -} - static int mmap_mem_prepare(struct vm_area_desc *desc) { struct file *file =3D desc->file; @@ -362,8 +357,7 @@ static int mmap_mem_prepare(struct vm_area_desc *desc) =20 /* Remap-pfn-range will mark the range with the I/O flag. */ mmap_action_remap_full(desc, desc->pgoff); - /* We filter remap errors to -EAGAIN. */ - desc->action.error_hook =3D mmap_filter_error; + desc->action.error_override =3D -EAGAIN; =20 return 0; } diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 945c0a5386d6..5ef78617ce93 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -844,13 +844,10 @@ struct mmap_action { enum mmap_action_type type; =20 /* - * If specified, this hook is invoked when an error occurred when - * attempting the selected action. - * - * The hook can return an error code in order to filter the error, but - * it is not valid to clear the error here. + * If non-zero, replace errors that arise from mmap actions with this + * value instead. Only valid error codes may be specified. */ - int (*error_hook)(int err); + int error_override; =20 /* * This should be set in rare instances where the operation required diff --git a/mm/util.c b/mm/util.c index 4e172990afcd..af2c2103f0d9 100644 --- a/mm/util.c +++ b/mm/util.c @@ -1414,16 +1414,22 @@ static int mmap_action_finish(struct vm_area_struct= *vma, */ len =3D vma_pages(vma) << PAGE_SHIFT; do_munmap(current->mm, vma->vm_start, len, NULL); - if (action->error_hook) { - /* We may want to filter the error. */ - err =3D action->error_hook(err); - /* The caller should not clear the error. */ - VM_WARN_ON_ONCE(!err); - } - return err; + + return action->error_override ?: err; } =20 #ifdef CONFIG_MMU + +static int check_mmap_action(struct mmap_action *action) +{ + const unsigned long override =3D action->error_override; + + if (WARN_ON_ONCE(override && !IS_ERR_VALUE(override))) + return -EINVAL; + + return 0; +} + /** * mmap_action_prepare - Perform preparatory setup for an VMA descriptor * action which need to be performed. @@ -1433,7 +1439,14 @@ static int mmap_action_finish(struct vm_area_struct = *vma, */ int mmap_action_prepare(struct vm_area_desc *desc) { - switch (desc->action.type) { + struct mmap_action *action =3D &desc->action; + int err; + + err =3D check_mmap_action(action); + if (err) + return err; + + switch (action->type) { case MMAP_NOTHING: return 0; case MMAP_REMAP_PFN: diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/du= p.h index fddfd1b57c09..bf26b3f48d3a 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -483,13 +483,10 @@ struct mmap_action { enum mmap_action_type type; =20 /* - * If specified, this hook is invoked when an error occurred when - * attempting the selection action. - * - * The hook can return an error code in order to filter the error, but - * it is not valid to clear the error here. + * If non-zero, replace errors that arise from mmap actions with this + * value instead. Only valid error codes may be specified. */ - int (*error_hook)(int err); + int error_override; =20 /* * This should be set in rare instances where the operation required --=20 2.54.0