From: "David Hildenbrand (Arm)" <david@kernel.org>
To: klourencodev@gmail.com, linux-mm@kvack.org
Cc: jack@suse.cz, rppt@kernel.org, akpm@linux-foundation.org,
vbabka@suse.cz, brauner@kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] mm/fadvise: validate offset in generic_fadvise
Date: Mon, 9 Feb 2026 09:06:06 +0100 [thread overview]
Message-ID: <64fa130c-a87a-4c73-a2af-ff52c9268588@kernel.org> (raw)
In-Reply-To: <20260208135738.18992-1-klourencodev@gmail.com>
On 2/8/26 14:57, klourencodev@gmail.com wrote:
> From: Kevin Lourenco <klourencodev@gmail.com>
>
> When converted to (u64) for page calculations, a negative offset can
> produce extremely large page indices. This may lead to issues in certain
> advice modes (excessive readahead or cache invalidation).
>
> Reject negative offsets with -EINVAL for consistent argument validation
> and to avoid silent misbehavior.
>
> POSIX and the man page do not clearly define behavior for negative
> offset/len. FreeBSD rejects negative offsets as well, so failing with
> -EINVAL is consistent with existing practice. The man page can be
> updated separately to document the Linux behavior.
>
> Signed-off-by: Kevin Lourenco <klourencodev@gmail.com>
> ---
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
next prev parent reply other threads:[~2026-02-09 8:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-22 14:18 [PATCH] " klourencodev
2025-12-22 17:52 ` Andrew Morton
2025-12-22 23:38 ` Kevin Lourenco
2025-12-23 9:45 ` David Hildenbrand (Red Hat)
2025-12-23 16:16 ` Kevin Lourenco
2026-01-06 19:46 ` David Hildenbrand (Red Hat)
2026-02-01 0:43 ` Andrew Morton
2026-02-04 20:41 ` Kevin Lourenco
2026-02-08 13:57 ` [PATCH v2] " klourencodev
2026-02-09 8:06 ` David Hildenbrand (Arm) [this message]
2026-02-09 10:56 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=64fa130c-a87a-4c73-a2af-ff52c9268588@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=klourencodev@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox