[libvirt PATCH] util: virGetSubIDs: do not limit file size

Ján Tomko via Devel posted 1 patch 2 days, 22 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/72a804fa351ba466d889683d24cc440a89f69b3b.1778584318.git.jtomko@redhat.com
There is a newer version of this series
src/util/virutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt PATCH] util: virGetSubIDs: do not limit file size
Posted by Ján Tomko via Devel 2 days, 22 hours ago
From: Ján Tomko <jtomko@redhat.com>

https://redhat.atlassian.net/browse/RHEL-174491

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/virutil.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virutil.c b/src/util/virutil.c
index 187b8202dd..2cc7edac50 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -1223,7 +1223,7 @@ virGetSubIDs(virSubID **retval, const char *file)
 
     *retval = NULL;
 
-    if (virFileReadAll(file, BUFSIZ, &buf) < 0)
+    if (virFileReadAll(file, SIZE_MAX, &buf) < 0)
         return -1;
 
     lines = g_strsplit(buf, "\n", 0);
-- 
2.54.0

Re: [libvirt PATCH] util: virGetSubIDs: do not limit file size
Posted by Peter Krempa via Devel 2 days, 22 hours ago
On Tue, May 12, 2026 at 13:11:58 +0200, Ján Tomko via Devel wrote:
> From: Ján Tomko <jtomko@redhat.com>
> 
> https://redhat.atlassian.net/browse/RHEL-174491

^^^^ is not publicly accessible.

This patch thus lacks *any* form of explanation or justification.

> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  src/util/virutil.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/virutil.c b/src/util/virutil.c
> index 187b8202dd..2cc7edac50 100644
> --- a/src/util/virutil.c
> +++ b/src/util/virutil.c
> @@ -1223,7 +1223,7 @@ virGetSubIDs(virSubID **retval, const char *file)
>  
>      *retval = NULL;
>  
> -    if (virFileReadAll(file, BUFSIZ, &buf) < 0)
> +    if (virFileReadAll(file, SIZE_MAX, &buf) < 0)

Also this will likely require a comment stating *why* we allow unlimited
reads. Maybe you can cite the discussion from the upstream issue filed
for this which does provide some.