Menu

#564 AD uses PROT_WRITE without PROT_READ

None
closed
nobody
None
1
2014-06-18
2014-05-22
No

Are there OSes or architectures where PROT_WRITE implies PROT_READ? I ran into this on FreeBSD/FreeNAS x86_64.

(We've got an abort() cropping up as well, but I couldn't get that to reproduce yet.)

diff --git a/libatalk/adouble/ad_open.c b/libatalk/adouble/ad_open.c
index ea221ff..aee7eaf 100644
--- a/libatalk/adouble/ad_open.c
+++ b/libatalk/adouble/ad_open.c
@@ -586,7 +586,7 @@ static int ad_convert_osx(const char path, struct adouble ad)

 origlen = ad_getentryoff(ad, ADEID_RFORK) + ad_getentrylen(ad, ADEID_RFORK);
  • map = mmap(NULL, origlen, PROT_WRITE, MAP_SHARED, ad_reso_fileno(ad), 0);
  • map = mmap(NULL, origlen, PROT_READ | PROT_WRITE, MAP_SHARED, ad_reso_fileno(ad), 0);
    if (map == MAP_FAILED) {
    LOG(log_error, logtype_ad, "mmap AppleDouble: %s\n", strerror(errno));
    EC_FAIL;

Discussion

  • Ralph Böhme

    Ralph Böhme - 2014-06-18
    • status: open --> closed
    • Group: -->
     

Log in to post a comment.