Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 634959 Details for
Bug 869942
Kernel crashes on reading an ACL containing 190 ACEs over NFSv4
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to really fix the NFSv4 ACL problem
nfs4proc.c.patch (text/plain), 3.02 KB, created by
Albert Flügel
on 2012-10-29 10:07:28 UTC
(
hide
)
Description:
Patch to really fix the NFSv4 ACL problem
Filename:
MIME Type:
Creator:
Albert Flügel
Created:
2012-10-29 10:07:28 UTC
Size:
3.02 KB
patch
obsolete
>--- rhel6-nfs4proc.c 2012-10-26 09:28:06.000000000 +0200 >+++ nfs4proc.c 2012-10-29 10:42:34.000000000 +0100 >@@ -3411,16 +3411,17 @@ > return ret; > } > >-static void nfs4_write_cached_acl(struct inode *inode, const char *buf, size_t acl_len) >+static void nfs4_write_cached_acl(struct inode *inode, struct page **pages, size_t pgbase, size_t acl_len) > { > struct nfs4_cached_acl *acl; >+ size_t buflen = sizeof(*acl) + acl_len; > >- if (buf && acl_len <= PAGE_SIZE) { >- acl = kmalloc(sizeof(*acl) + acl_len, GFP_KERNEL); >+ if (buflen <= PAGE_SIZE) { >+ acl = kmalloc(buflen, GFP_KERNEL); > if (acl == NULL) > goto out; > acl->cached = 1; >- memcpy(acl->data, buf, acl_len); >+ _copy_from_pages(acl->data, pages, pgbase, acl_len); > } else { > acl = kmalloc(sizeof(*acl), GFP_KERNEL); > if (acl == NULL) >@@ -3444,7 +3445,7 @@ > */ > static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen) > { >- struct page *pages[NFS4ACL_MAXPAGES] = {NULL, }; >+ struct page *pages[NFS4ACL_MAXPAGES + 1] = {NULL, }; > struct nfs_getaclargs args = { > .fh = NFS_FH(inode), > .acl_pages = pages, >@@ -3453,13 +3454,12 @@ > struct nfs_getaclres res = { > .acl_len = buflen, > }; >- void *resp_buf; > struct rpc_message msg = { > .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GETACL], > .rpc_argp = &args, > .rpc_resp = &res, > }; >- int ret = -ENOMEM, npages, i, acl_len = 0; >+ int ret = -ENOMEM, npages, i, acl_len; > > npages = (buflen + PAGE_SIZE - 1) >> PAGE_SHIFT; > /* As long as we're doing a round trip to the server anyway, >@@ -3467,24 +3467,24 @@ > if (npages == 0) > npages = 1; > >- for (i = 0; i < npages; i++) { >+ /* allocate an additional page, because the actually needed >+ * memory might be larger due to the res.data_offset added >+ * in the getacl NFS4 RPC call */ >+ for (i = 0; i <= npages; i++) { > pages[i] = alloc_page(GFP_KERNEL); > if (!pages[i]) > goto out_free; > } >- if (npages > 1) { >- /* for decoding across pages */ >- res.acl_scratch = alloc_page(GFP_KERNEL); >- if (!res.acl_scratch) >- goto out_free; >- } >+ /* for decoding across pages */ >+ res.acl_scratch = alloc_page(GFP_KERNEL); >+ if (!res.acl_scratch) >+ goto out_free; > args.acl_len = npages * PAGE_SIZE; > args.acl_pgbase = 0; > /* Let decode_getfacl know not to fail if the ACL data is larger than > * the page we send as a guess */ > if (buf == NULL) > res.acl_flags |= NFS4_ACL_LEN_REQUEST; >- resp_buf = page_address(pages[0]); > > dprintk("%s buf %p buflen %zu npages %d args.acl_len %zu\n", > __func__, buf, buflen, npages, args.acl_len); >@@ -3493,10 +3493,7 @@ > goto out_free; > > acl_len = res.acl_len - res.acl_data_offset; >- if (acl_len > args.acl_len) >- nfs4_write_cached_acl(inode, NULL, acl_len); >- else >- nfs4_write_cached_acl(inode, resp_buf + res.acl_data_offset, >+ nfs4_write_cached_acl(inode, pages, res.acl_data_offset, > acl_len); > if (buf) { > ret = -ERANGE; >@@ -3507,7 +3504,7 @@ > } > ret = acl_len; > out_free: >- for (i = 0; i < npages; i++) >+ for (i = 0; i <= npages; i++) > if (pages[i]) > __free_page(pages[i]); > if (res.acl_scratch)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 869942
:
633216
|
633217
|
633405
| 634959 |
680079