In this paper, we consider the resource allocation problem of cooperative spectrum sharing among multiple primary users (PUs) and multiple secondary users (SUs), where the PUs lease their spectrum to the SUs in a time-division manner while the SUs in return help the data transmission of the PUs by relaying. The PU's strategy is to decide a proper fraction of spectrum leasing time to SUs for maximizing its payoff, while the SU's strategy is to decide the proper power for relaying PUs' traffic, and for transmitting its own data so as to satisfy its payoff. We formulate the problem as a coalitional game with transferable utility (TU), and propose an algorithm to show the game converges to the solution concept (the core). We also show that the grand coalition formed by grouping all PUs and SUs is stable. Finally, we demonstrate in simulations the benefits of our proposed approach comparing to other approaches of power control.