[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fix harmless uninitialized read in svn_fs_fs__l2p_index_append

From: Orivej Desh <orivej_at_gmx.fr>
Date: Mon, 27 Jul 2020 03:13:47 +0000

* Daniel Shahaf <d.s_at_daniel.shahaf.name> [2020-07-27]
> Orivej Desh wrote on Sat, 25 Jul 2020 23:27 +0000:
> > Clang 10 memory sanitizer reports an uninitialized read of .offset in
> > if ((entry > 0 && proto_entry.offset == 0) || eof)
> > when read_l2p_entry_from_proto_index set eof and left the proto_entry unset.
>
> Orivej Desh wrote on Sat, 25 Jul 2020 23:27 +0000:
> > [[[
> > Fix harmless uninitialized read in svn_fs_fs__l2p_index_append
> >
> > * subversion/libsvn_fs_fs/index.c
> > (svn_fs_fs__l2p_index_append): Do not access proto_entry.offset when
> > it is unset due to reaching eof.
>
> Well written.
>
> > ]]]
> > +++ subversion/libsvn_fs_fs/index.c (working copy)
> > @@ -827,7 +827,7 @@ svn_fs_fs__l2p_index_append(svn_checksum_t **check
> > /* handle new revision */
> > - if ((entry > 0 && proto_entry.offset == 0) || eof)
> > + if (eof || (entry > 0 && proto_entry.offset == 0))
>
> Looks good to me, +1.
>
> Does libsvn_fs_x need the same change?

Indeed, I have fixed memory-sanitized "svnadmin create --fs-type fsx"
with the attached patch.

> Thanks for the patch,
>
> Daniel

Received on 2020-07-27 05:17:45 CEST

This is an archived mail posted to the Subversion Dev mailing list.