* [PATCH] Fix messed hunks in generic_setlease
@ 2007-09-25 7:57 Pavel Emelyanov
2007-09-25 8:07 ` Andrew Morton
2007-09-25 10:38 ` Kamalesh Babulal
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Emelyanov @ 2007-09-25 7:57 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List, Kamalesh Babulal
I have noticed, that one hunk was lost and one duplicated
during merging the fix-potential-oops-in-generic_setlease(-xxx)
patches. One of the fixes is already in the hot-fixes, but the
second one is still lost.
The returned pointer was not the one allocated, but some temporary
used to scan through the inode's locks list. This caused and OOPS
during Kamalesh's testing.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/fs/locks.c b/fs/locks.c
index c0fe71a..c1198e3 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1423,7 +1418,7 @@ int generic_setlease(struct file *filp,
locks_copy_lock(new_fl, lease);
locks_insert_lock(before, new_fl);
- *flp = fl;
+ *flp = new_fl;
return 0;
out:
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix messed hunks in generic_setlease
2007-09-25 7:57 [PATCH] Fix messed hunks in generic_setlease Pavel Emelyanov
@ 2007-09-25 8:07 ` Andrew Morton
2007-09-25 8:30 ` Pavel Emelyanov
2007-09-25 10:38 ` Kamalesh Babulal
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2007-09-25 8:07 UTC (permalink / raw)
To: Pavel Emelyanov; +Cc: Linux Kernel Mailing List, Kamalesh Babulal
On Tue, 25 Sep 2007 11:57:45 +0400 Pavel Emelyanov <xemul@openvz.org> wrote:
> I have noticed, that one hunk was lost and one duplicated
> during merging the fix-potential-oops-in-generic_setlease(-xxx)
> patches. One of the fixes is already in the hot-fixes, but the
> second one is still lost.
>
> The returned pointer was not the one allocated, but some temporary
> used to scan through the inode's locks list. This caused and OOPS
> during Kamalesh's testing.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>
> ---
>
> diff --git a/fs/locks.c b/fs/locks.c
> index c0fe71a..c1198e3 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -1423,7 +1418,7 @@ int generic_setlease(struct file *filp,
> locks_copy_lock(new_fl, lease);
> locks_insert_lock(before, new_fl);
>
> - *flp = fl;
> + *flp = new_fl;
> return 0;
>
> out:
argh, what a mess - there are way too many trees playing with fs/locks.c.
umm, I think this is not a mismerge and that the original patch
(http://lkml.org/lkml/2007/9/20/141) had this bug in it.
And I've just sent that buggy patch to Linus. Do you agree?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix messed hunks in generic_setlease
2007-09-25 8:07 ` Andrew Morton
@ 2007-09-25 8:30 ` Pavel Emelyanov
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Emelyanov @ 2007-09-25 8:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List, Kamalesh Babulal
Andrew Morton wrote:
> On Tue, 25 Sep 2007 11:57:45 +0400 Pavel Emelyanov <xemul@openvz.org> wrote:
>
>> I have noticed, that one hunk was lost and one duplicated
>> during merging the fix-potential-oops-in-generic_setlease(-xxx)
>> patches. One of the fixes is already in the hot-fixes, but the
>> second one is still lost.
>>
>> The returned pointer was not the one allocated, but some temporary
>> used to scan through the inode's locks list. This caused and OOPS
>> during Kamalesh's testing.
>>
>> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>>
>> ---
>>
>> diff --git a/fs/locks.c b/fs/locks.c
>> index c0fe71a..c1198e3 100644
>> --- a/fs/locks.c
>> +++ b/fs/locks.c
>> @@ -1423,7 +1418,7 @@ int generic_setlease(struct file *filp,
>> locks_copy_lock(new_fl, lease);
>> locks_insert_lock(before, new_fl);
>>
>> - *flp = fl;
>> + *flp = new_fl;
>> return 0;
>>
>> out:
>
> argh, what a mess - there are way too many trees playing with fs/locks.c.
>
> umm, I think this is not a mismerge and that the original patch
> (http://lkml.org/lkml/2007/9/20/141) had this bug in it.
Indeed... :(
> And I've just sent that buggy patch to Linus. Do you agree?
Shame on me... Sorry :(
(going to the blackboard to write "I will check my patches twice before
sending them to Andrew" for 100 times)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix messed hunks in generic_setlease
2007-09-25 7:57 [PATCH] Fix messed hunks in generic_setlease Pavel Emelyanov
2007-09-25 8:07 ` Andrew Morton
@ 2007-09-25 10:38 ` Kamalesh Babulal
1 sibling, 0 replies; 4+ messages in thread
From: Kamalesh Babulal @ 2007-09-25 10:38 UTC (permalink / raw)
To: Pavel Emelyanov; +Cc: Andrew Morton, Linux Kernel Mailing List
Pavel Emelyanov wrote:
> I have noticed, that one hunk was lost and one duplicated
> during merging the fix-potential-oops-in-generic_setlease(-xxx)
> patches. One of the fixes is already in the hot-fixes, but the
> second one is still lost.
>
> The returned pointer was not the one allocated, but some temporary
> used to scan through the inode's locks list. This caused and OOPS
> during Kamalesh's testing.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>
> ---
>
> diff --git a/fs/locks.c b/fs/locks.c
> index c0fe71a..c1198e3 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -1423,7 +1418,7 @@ int generic_setlease(struct file *filp,
> locks_copy_lock(new_fl, lease);
> locks_insert_lock(before, new_fl);
>
> - *flp = fl;
> + *flp = new_fl;
> return 0;
>
> out:
>
Hi Pavel,
I tested your patch and NULL pointer dereference is not triggered.
--
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-25 10:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-25 7:57 [PATCH] Fix messed hunks in generic_setlease Pavel Emelyanov
2007-09-25 8:07 ` Andrew Morton
2007-09-25 8:30 ` Pavel Emelyanov
2007-09-25 10:38 ` Kamalesh Babulal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox