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

Re: [PATCH] tools/ocaml: Fix OoB read in stub_syslog()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrii Sultanov <andriy.sultanov@xxxxxxxxxx>
  • Date: Tue, 24 Nov 2026 08:58:45 +0000
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Feedback-ID"
  • Cc: Olivier Lambert <olivier.lambert@xxxxxxxxxx>, Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxxxx>
  • Delivery-date: Tue, 24 Nov 2026 08:59:09 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/16/26 22:26, Andrew Cooper wrote:

__syslog_facility_table[] maps Ocaml LOG_* facilities indices to local system
indices.  The final line is intended to initialise 6 entries in the table, but
only initalises one with the logical OR of 6 facilities, making the table 5
entries too short.

This is probably a copy&paste error from Ocaml, where | is right operator to
use for a list of this nature.

Fixes: ea8ddf27e5c8 ("ocaml: add logging bindings.")
Assisted-by: LLM
Reported-by: Olivier Lambert <olivier.lambert@xxxxxxxxxx>
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Andrii Sultanov <andriy.sultanov@xxxxxxxxxx>
CC: Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxxxx>

This is only an issue if you modify oxenstored.conf to use one of these
facilities.
---
  tools/ocaml/xenstored/syslog_stubs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/syslog_stubs.c 
b/tools/ocaml/xenstored/syslog_stubs.c
index 760e78ff73dc..16c7202d39ba 100644
--- a/tools/ocaml/xenstored/syslog_stubs.c
+++ b/tools/ocaml/xenstored/syslog_stubs.c
@@ -30,7 +30,7 @@ static int __syslog_facility_table[] = {
        LOG_AUTH, LOG_AUTHPRIV, LOG_CRON, LOG_DAEMON, LOG_FTP, LOG_KERN,
        LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3,
        LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7,
-       LOG_LPR | LOG_MAIL | LOG_NEWS | LOG_SYSLOG | LOG_USER | LOG_UUCP
+       LOG_LPR, LOG_MAIL, LOG_NEWS, LOG_SYSLOG, LOG_USER, LOG_UUCP,
  };
value stub_syslog(value facility, value level, value msg)

base-commit: 97bf370375113caf92fccf04e2877fc6b5ff887f
Acked-by: Andrii Sultanov <andriy.sultanov@xxxxxxxxxx>




 


Rackspace

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