[OE-core] [oe-core][PATCH 1/1] mdadm: fix format-overflow

Martin Jansa martin.jansa at gmail.com
Fri Jun 22 21:12:35 UTC 2018


Too late I've noticed that it's the same size, but in different file,
surprisingly I haven't seen the failure in  Detail.c only in the super0.c.
Maybe it's different issue, but I don't know how to reproduce this one.

But of course, 4 bytes is terrible waste :).

On Fri, Jun 22, 2018 at 11:07 PM Khem Raj <raj.khem at gmail.com> wrote:

> On Fri, Jun 22, 2018 at 12:56 PM Martin Jansa <martin.jansa at gmail.com>
> wrote:
> >
> > See https://patchwork.openembedded.org/patch/151888/
> >
>
> yeah Martin is frugal with the extra space :)  using 16 probably provides
> some benefits of data being aligned hard to say
>
> > On Fri, Jun 22, 2018 at 9:24 PM Joe Slater <joe.slater at windriver.com>
> wrote:
> >>
> >> nb[] is not quite big enough.
> >>
> >> Signed-off-by: Joe Slater <joe.slater at windriver.com>
> >> ---
> >>  .../0002-mdadm-Specify-enough-length-when-write-to-buffer.patch     |
> 6 +++++-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git
> a/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
> b/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
> >> index cbce053..6bbe8f4 100644
> >> ---
> a/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
> >> +++
> b/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
> >> @@ -24,6 +24,10 @@ Change the length to 47.
> >>
> >>  Signed-off-by: Xiao Ni <xni at redhat.com>
> >>  Signed-off-by: Jes Sorensen <Jes.Sorensen at gmail.com>
> >> +
> >> +nb[] actually needs to be at least 12, but we will make it 16.
> >> +
> >> +Signed-off-by: Joe Slater <joe.slater at windriver.com>
> >>  ---
> >>  Upstream-Status: Backport
> >>   Detail.c | 2 +-
> >> @@ -53,7 +57,7 @@ index 938cfd9..f5b4507 100644
> >>                 mdp_disk_t *dp;
> >>                 char *dv;
> >>  -              char nb[5];
> >> -+              char nb[11];
> >> ++              char nb[16];
> >>                 int wonly, failfast;
> >>                 if (d>=0) dp = &sb->disks[d];
> >>                 else dp = &sb->this_disk;
> >> --
> >> 2.7.4
> >>
> >> --
> >> _______________________________________________
> >> Openembedded-core mailing list
> >> Openembedded-core at lists.openembedded.org
> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180622/50c57653/attachment-0002.html>


More information about the Openembedded-core mailing list