Last Updated Sep 18, 2009 12:00 PM EDT
It seems pretty clear that there's some tension between your boss and your boss's boss, and that the latter is recruiting you to keep tabs on your boss for him. Assuming each of them has a decent standing and support in your company, and there's no clear-cut reason to align more fully with your boss's boss, this puts you in a difficult spot.
First of all, you should try to determine as best you can what the source of the tension is -- is it your direct boss's performance, or perhaps a personality conflict or political struggle? -- so you can try to defuse it when necessary. To the extent possible, try to minimize your public contact with your boss's boss so your direct boss doesn't become suspicious and turn against you. Of course, this isn't always possible, so you always want to have a ready answer for your boss when he or she asks about what the two of you were discussing, ideally restricting it to neutral details of how a given project is progressing. You want to be aware and prepared at all times to manage potential conflicts between your boss and his supervisor.
I recently had a client whose boss's boss told him that he was going to be getting a raise, but that he shouldn't tell his direct boss about it. Apparently, his boss's boss didn't have confidence in his direct boss's ability to reward the right people in his group, and so he stepped in to make his own evaluations. In this case, it wasn't in my client's best interests to align too strongly with his boss's boss since he had good ties to his boss's network and didn't want to jeopardize those. So my client worked to maintain both these connections by doing a good job for his direct boss, and also protecting the confidence of his boss's boss. It's been a challenging balancing act for him, but one that should pay off when one or both of his bosses eventually ascends further in the company.