Justice Shetty, 74, is out of danger and being treated in a private hospital, said state home minister Ramalinga Reddy.
The attacker has been identified as Tejas Sharma. He was in the crowd outside the Lokayukta's office on the ground floor of the Multi-Storey Building. He was allegedly allowed in without a proper check.

The man who attacked Justice P Vishwanatha Shetty was identified as Tejas Sharma.
"There was no bar for anybody. Anybody could access him with their grievances, there was no armed guard," said Brijesh Kalappa of the state's ruling Congress, describing the attacker as a "madman".
Comments
"There are multiple CCTV cameras...a metal detector and multiple people watching. How can we say there has been a security breach," Mr Kalappa added.Former Lokayukta Santosh Hegde, however, rejected the view. "There has definitely been a security breach," he said.