We study the optimality of linear precoding for the two-receiver multiple-input multiple-output (MIMO) Gaussian broadcast channel (BC) with confidential messages. Secret dirty-paper coding (SDPC) is optimal under an input covariance constraint, but there is no computable secrecy capacity expression for the general MIMO case under an average power constraint. In principle, for this case, the secrecy capacity region could be found through an exhaustive search over the set of all possible matrix power constraints. Clearly, this search, coupled with the complexity of dirty-paper encoding and decoding, motivates the consideration of low complexity linear precoding as an alternative. We prove that for a two-user MIMO Gaussian BC under an input covariance constraint, linear precoding is optimal and achieves the same secrecy rate region as S-DPC if the input covariance constraint satisfies a specific condition, and we characterize the corresponding optimal linear precoders. We then use this result to derive a closed-form sub-optimal algorithm based on linear precoding for an average power constraint. Numerical results indicate that the secrecy rate region achieved by this algorithm is close to that obtained by the optimal S-DPC approach with a search over all suitable input covariance matrices.