From: Sylvain Gault <sylvain.gault at gmail.com> I found something suspicious while hunting another bug a while ago. The conditions for that bug to occur seems quite hard to meet, but it's still code quality improvement. See the commit message for details. Sylvain Gault (1): efi: Suspicious size reduction in emalloc efi/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 1.8.5.3
celelibi at gmail.com
2014-Feb-13 02:20 UTC
[syslinux] [PATCH] efi: Suspicious size reduction in emalloc
From: Sylvain Gault <sylvain.gault at gmail.com> It could happen on 32 bits architecture that the memory size really allocated could be less than required. On 64 bits, allocate_pages may be called more times than needed. This closes bug #39. Signed-off-by: Sylvain Gault <sylvain.gault at gmail.com> --- efi/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/efi/main.c b/efi/main.c index 0e6b137..94878f9 100644 --- a/efi/main.c +++ b/efi/main.c @@ -691,10 +691,8 @@ EFI_STATUS emalloc(UINTN size, UINTN align, EFI_PHYSICAL_ADDRESS *addr) /* Low-memory is super-precious! */ if (end <= 1 << 20) continue; - if (start < 1 << 20) { - size -= (1 << 20) - start; + if (start < 1 << 20) start = (1 << 20); - } aligned = (start + align -1) & ~(align -1); -- 1.8.5.3
2014-02-13 3:20 UTC+01:00, celelibi at gmail.com <celelibi at gmail.com>:> From: Sylvain Gault <sylvain.gault at gmail.com> >It looks like git-send-email messed the headers when changing the sender.
Op 2014-02-13 om 04:04 schreef Sylvain Gault:> 2014-02-13 3:20 UTC+01:00, celelibi at gmail.com <celelibi at gmail.com>: > > From: Sylvain Gault <sylvain.gault at gmail.com> > > > > It looks like git-send-email messed the headers when changing the sender.And there was no actual patch ( no unified diff output ) in that e-mail. Please rerun providing '[PATCH] Potential bug in emalloc' Groeten Geert Stappers -- Leven en laten leven
Gene Cumm
2014-Feb-13 11:24 UTC
[syslinux] [PATCH] efi: Suspicious size reduction in emalloc
On Wed, Feb 12, 2014 at 9:20 PM, <celelibi at gmail.com> wrote:> From: Sylvain Gault <sylvain.gault at gmail.com> > > It could happen on 32 bits architecture that the memory size really allocated > could be less than required. On 64 bits, allocate_pages may be called > more times than needed. > > This closes bug #39. > > Signed-off-by: Sylvain Gault <sylvain.gault at gmail.com> > --- > efi/main.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/efi/main.c b/efi/main.c > index 0e6b137..94878f9 100644 > --- a/efi/main.c > +++ b/efi/main.c > @@ -691,10 +691,8 @@ EFI_STATUS emalloc(UINTN size, UINTN align, EFI_PHYSICAL_ADDRESS *addr) > /* Low-memory is super-precious! */ > if (end <= 1 << 20) > continue; > - if (start < 1 << 20) { > - size -= (1 << 20) - start; > + if (start < 1 << 20) > start = (1 << 20); > - } > > aligned = (start + align -1) & ~(align -1);Geert, it looks like the thread got broken apart -- -Gene
2014-02-13 4:04 UTC+01:00, Sylvain Gault <sylvain.gault at gmail.com>:> 2014-02-13 3:20 UTC+01:00, celelibi at gmail.com <celelibi at gmail.com>: >> From: Sylvain Gault <sylvain.gault at gmail.com> >> > > It looks like git-send-email messed the headers when changing the sender. >Actually this was correct. It's the git-send-email way to specify the author when it's different from the mail sender. And git-am will parse it correctly and generate the right "Author:". Celelibi