lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Nov 2008 22:55:20 +0200
From:	"Pekka Enberg" <penberg@...helsinki.fi>
To:	"Paul Menage" <menage@...gle.com>
Cc:	"Ying Han" <yinghan@...gle.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, akpm <akpm@...ux-foundation.org>,
	"David Rientjes" <rientjes@...gle.com>,
	"Rohit Seth" <rohitseth@...gle.com>
Subject: Re: [PATCH][V3]Make get_user_pages interruptible

Hi Paul,

On Fri, Nov 21, 2008 at 5:31 PM, Ying Han <yinghan@...gle.com> wrote:
>>                         */
>> -                       if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE)))
>> -                               return i ? i : -ENOMEM;
>> +                       if (unlikely(sigkill_pending(tsk)))
>> +                               return i ? i : -ERESTARTSYS;

On Mon, Nov 24, 2008 at 10:02 PM, Paul Menage <menage@...gle.com> wrote:
> You've changed the check from sigkill_pending(current) to sigkill_pending(tsk).
>
> I originally made that sigkill_pending(current) since we want to avoid
> tasks entering an unkillable state just because they're doing
> get_user_pages() on a system that's short of memory. Admittedly for
> the main case that we care about, mlock() (or an mmap() with
> MCL_FUTURE set) then tsk==current, but philosophically it seems to me
> to be more correct to do the check against current than tsk, since
> current is the thing that's actually allocating the memory. But maybe
> it would be better to check both?

Well, most callers seem to pass 'current' to get_user_pages() but for
the out-of-tree revoke patches, for example, you certainly want to
check sigkill_pending(current) as well; otherwise the revoke operation
is unkillable while in get_user_pages().

Not that revoke() is going to hit mainline any time soon but it does
serve as an argument for checking both.

                        Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ