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 149254 Details for
Bug 230976
A timing window that causes double freeing file_lock entry
[?]
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]
flock patch
flock.patch (text/plain), 1.92 KB, created by
Tadashi Iwashita
on 2007-03-05 09:21:43 UTC
(
hide
)
Description:
flock patch
Filename:
MIME Type:
Creator:
Tadashi Iwashita
Created:
2007-03-05 09:21:43 UTC
Size:
1.92 KB
patch
obsolete
>--- locks.c 2007-03-04 16:02:51.000000000 +0900 >+++ locks.c.mod 2007-03-04 16:26:33.000000000 +0900 >@@ -657,8 +657,9 @@ > * at the head of the list, but that's secret knowledge known only to > * flock_lock_file and posix_lock_file. > */ >-static int flock_lock_file(struct file *filp, struct file_lock *new_fl) >+static int flock_lock_file(struct file *filp, struct file_lock *request) > { >+ struct file_lock *new_fl = NULL; > struct file_lock **before; > struct inode * inode = filp->f_dentry->d_inode; > int error = 0; >@@ -673,17 +674,19 @@ > continue; > if (filp != fl->fl_file) > continue; >- if (new_fl->fl_type == fl->fl_type) >+ if (request->fl_type == fl->fl_type) > goto out; > found = 1; > locks_delete_lock(before); > break; > } >- unlock_kernel(); >- >- if (new_fl->fl_type == F_UNLCK) >- return 0; >+ if (request->fl_type == F_UNLCK) >+ goto out; > >+ error = -ENOMEM; >+ new_fl = locks_alloc_lock(); >+ if (new_fl == NULL) >+ goto out; > /* > * If a higher-priority process was blocked on the old file lock, > * give it the opportunity to lock the file. >@@ -691,26 +694,28 @@ > if (found) > cond_resched(); > >- lock_kernel(); > for_each_lock(inode, before) { > struct file_lock *fl = *before; > if (IS_POSIX(fl)) > break; > if (IS_LEASE(fl)) > continue; >- if (!flock_locks_conflict(new_fl, fl)) >+ if (!flock_locks_conflict(request, fl)) > continue; > error = -EAGAIN; >- if (new_fl->fl_flags & FL_SLEEP) { >- locks_insert_block(fl, new_fl); >- } >+ if (request->fl_flags & FL_SLEEP) >+ locks_insert_block(fl, request); > goto out; > } >+ locks_copy_lock(new_fl, request); > locks_insert_lock(&inode->i_flock, new_fl); >+ new_fl = NULL; > error = 0; > > out: > unlock_kernel(); >+ if (new_fl) >+ locks_free_lock(new_fl); > return error; > } > >@@ -1399,9 +1404,7 @@ > error = flock_lock_file_wait(filp, lock); > > out_free: >- if (list_empty(&lock->fl_link)) { >- locks_free_lock(lock); >- } >+ locks_free_lock(lock); > > out_putf: > fput(filp);
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 230976
:
149251
|
149253
| 149254