Re: Patch to allow users to kill their own queries - Mailing list pgsql-hackers

From Greg Smith
Subject Re: Patch to allow users to kill their own queries
Date
Msg-id 4EEB5388.50504@2ndQuadrant.com
Whole thread Raw
In response to Re: Patch to allow users to kill their own queries  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Patch to allow users to kill their own queries
Re: Patch to allow users to kill their own queries
List pgsql-hackers
On 12/16/2011 08:42 AM, Robert Haas wrote:
> the proposed patch would potentially result - in the extremely 
> unlikely event of a
> super-fast PID wraparound - in someone cancelling a query they
> otherwise wouldn't have been able to cancel.
>    

So how might this get exploited?

-Attach a debugger and put a breakpoint between the check and the kill
-Fork processes to get close to your target
-Wait for a process you want to mess with to appear at the PID you're 
waiting for.  If you miss it, repeat fork bomb and try again.
-Resume the debugger to kill the other user's process

If I had enough access to launch this sort of attack, I think I'd find 
mayhem elsewhere more a more profitable effort.  Crazy queries, work_mem 
abuse, massive temp file generation, trying to get the OOM killer 
involved; seems like there's bigger holes than this already.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: JSON for PG 9.2
Next
From: Magnus Hagander
Date:
Subject: Re: Patch to allow users to kill their own queries