[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen/hypfs: check the return value of snprintf to avoid leaking stack accidently




On 8/4/22 16:13, Jan Beulich wrote:
On 04.08.2022 15:10, Xenia Ragiadakou wrote:
On 8/4/22 16:01, Jan Beulich wrote:
On 04.08.2022 14:47, Xenia Ragiadakou wrote:
Changes in v2:
- add ASSERT_UNREACHABLE()

Hmm, this ...

--- a/xen/common/hypfs.c
+++ b/xen/common/hypfs.c
@@ -377,8 +377,10 @@ int hypfs_read_dyndir_id_entry(const struct 
hypfs_entry_dir *template,
       unsigned int e_namelen, e_len;
e_namelen = snprintf(name, sizeof(name), template->e.name, id);
-    if ( e_namelen >= sizeof(name) )
+    if ( e_namelen >= sizeof(name) ) {
+        ASSERT_UNREACHABLE();
           return -ENOBUFS;
+    }

... looks to be an incremental patch on top of v1, not v2 of that
patch?

So, here, IIUC, I have to create a patch series and add the assert in
the second (2/2) patch? What should be the version number of the series?

No, why? Simply fold this change into the earlier one, and call the
result v3.

Okkk, I just realized what I have done.

--
Xenia



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.