public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Fix invalid acl_entry_t on 32-bit Cygwin
Date: Fri, 10 Jul 2020 08:30:39 +0000 (GMT)	[thread overview]
Message-ID: <20200710083039.D5DE138708C5@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=acfc63b0cf0df472a8e17df1bf5a2c8284e28833

commit acfc63b0cf0df472a8e17df1bf5a2c8284e28833
Author: David Allsopp <david.allsopp@metastack.com>
Date:   Thu Jul 9 20:17:03 2020 +0100

    Fix invalid acl_entry_t on 32-bit Cygwin
    
    If the acl_t struct was at or above 0x80000000 then the pointer was
    sign-extended to 0xffff_ffff_8000_0000 and so the index was lost.
    
    Signed-off-by: David Allsopp <david.allsopp@metastack.com>

Diff:
---
 winsup/cygwin/release/3.1.7  | 4 ++++
 winsup/cygwin/sec_posixacl.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/release/3.1.7 b/winsup/cygwin/release/3.1.7
new file mode 100644
index 000000000..6ce316fc4
--- /dev/null
+++ b/winsup/cygwin/release/3.1.7
@@ -0,0 +1,4 @@
+Bug Fixes:
+----------
+
+- Fix acl_get_* functions in 32-bit Cygwin (pointer sign extension)
diff --git a/winsup/cygwin/sec_posixacl.h b/winsup/cygwin/sec_posixacl.h
index a3790a52b..0f9e7bde3 100644
--- a/winsup/cygwin/sec_posixacl.h
+++ b/winsup/cygwin/sec_posixacl.h
@@ -34,7 +34,7 @@ struct __acl_t
 inline acl_entry_t
 __to_entry (acl_t acl, uint16_t idx)
 {
-  return ((uint64_t) idx << 48) | (uint64_t) acl;
+  return ((uint64_t) idx << 48) | (uint64_t) ((uintptr_t) acl);
 }
 #define __to_permset(a,i)	((acl_permset_t)__to_entry((a),(i)))


                 reply	other threads:[~2020-07-10  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200710083039.D5DE138708C5@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).